/* Quiet by default: new UI must follow ../DESIGN_SYSTEM.md. */
/* Self-hosted Assistant variable fonts; attribution and license in fonts/assistant. */
@font-face {
  font-family: "Assistant";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static-cache/584ca27bcae8348a5abeb6d8/fonts/assistant/assistant-hebrew-v24.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Assistant";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static-cache/584ca27bcae8348a5abeb6d8/fonts/assistant/assistant-latin-v24.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;
}

:root {
  /* Keep device dark mode and Chrome automatic darkening from changing this palette. */
  color-scheme: only light;
  --paper: #f3f6f3;
  --paper-deep: #e6ece8;
  --panel: #ffffff;
  --panel-muted: #f8faf9;
  --input: #ffffff;
  --inverse: #14222b;
  --on-inverse: #ffffff;
  --ink: #14222b;
  --ink-soft: #53626b;
  --line: #cfd9d4;
  --route: #1f6feb;
  --route-soft: #dceaff;
  --effort: #b63a55;
  --effort-soft: #f4dce2;
  --recovery: #93c9b4;
  --sun: #f2c14e;
  --surface-capture: #14222b;
  --surface-review: #f8faf9;
  --surface-decision: #fff7df;
  --surface-resolved: #eef7f3;
  --focus-ring: rgba(31, 111, 235, .34);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 20px;
  --control-radius: 8px;
  --tap-min: 44px;
  --text-small: .875rem;
  --text-body: 1rem;
  --shadow: 0 18px 60px rgba(20, 34, 43, 0.08);
  --radius: 18px;
  --display: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--body);
  font-size: var(--text-body);
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 34, 43, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 24px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { max-width: 100%; min-width: 0; font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--route) 34%, transparent);
  outline-offset: 2px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; }
.hidden { display: none !important; }

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 24px;
  text-align: center;
  background: var(--inverse);
  color: var(--on-inverse);
}
.boot-screen p { font-family: var(--utility); font-size: var(--text-body); letter-spacing: .12em; text-transform: uppercase; }
.boot-mark { display: flex; align-items: end; justify-content: center; gap: 6px; height: 42px; }
.boot-mark span { display: block; width: 7px; background: var(--route); animation: boot 1s ease-in-out infinite alternate; }
.boot-mark span:nth-child(1) { height: 20px; }
.boot-mark span:nth-child(2) { height: 40px; animation-delay: .2s; background: var(--effort); }
.boot-mark span:nth-child(3) { height: 28px; animation-delay: .4s; background: var(--sun); }
@keyframes boot { to { transform: translateY(-8px); opacity: .5; } }

.wordmark {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .06em;
}
.wordmark i { color: var(--effort); font-family: var(--utility); font-style: normal; font-weight: 400; }
.wordmark-light { color: white; font-size: 22px; }

.eyebrow, .section-kicker, .step-label {
  margin-bottom: 7px;
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
  background: var(--paper);
}
.auth-intro {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-height: 100vh;
  padding: clamp(40px, 7vw, 110px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(145deg, transparent 48%, rgba(31, 111, 235, .45) 49%, transparent 50%),
    linear-gradient(155deg, #14222b 0%, #203641 70%, #14222b 100%);
}
.auth-intro::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -110px;
  right: -160px;
  border: 48px solid rgba(147, 201, 180, .18);
  border-radius: 50%;
}
.auth-intro .wordmark { position: absolute; top: clamp(32px, 5vw, 72px); left: clamp(40px, 7vw, 110px); }
.auth-intro .eyebrow { color: var(--recovery); }
.auth-intro h1 { max-width: 650px; margin-bottom: 25px; font-size: clamp(46px, 6.2vw, 86px); line-height: .92; white-space: pre-line; }
.auth-copy { max-width: 590px; color: #cbd8d4; font-size: 17px; line-height: 1.65; }

.setup-card {
  align-self: center;
  width: min(760px, 100%);
  margin: 48px auto;
  padding: clamp(26px, 5vw, 68px);
}
.form-heading { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.form-heading h2 { margin-bottom: 0; font-size: 38px; }
.form-heading p { max-width: 560px; margin: 10px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.google-signin-button {
  min-height: 78px;
  margin-top: 30px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--route);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.google-signin-button:hover { border-color: var(--route); transform: translateY(-2px); box-shadow: 0 22px 60px rgba(20, 34, 43, .12); }
.google-signin-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.google-signin-button > span:nth-child(2) { min-width: 0; }
.google-signin-button strong, .google-signin-button small { display: block; }
.google-signin-button strong { font-family: var(--display); font-size: 21px; }
.google-signin-button small { margin-top: 3px; color: var(--ink-soft); font-size: var(--text-small); }
.google-signin-button > span:last-child { color: var(--route); font-size: 22px; }
.google-mark { width: 42px; height: 42px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 50%; color: #4285f4; font-family: var(--body); font-size: 19px; font-weight: 850; }
.auth-security-note { margin: 18px 0 0; padding-inline-start: 17px; border-inline-start: 2px solid var(--recovery); color: var(--ink-soft); font-size: var(--text-small); line-height: 1.6; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin-top: 30px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .08em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.local-setup-form fieldset { margin-top: 20px; }
fieldset { margin: 28px 0; padding: 0 0 28px; border: 0; border-bottom: 1px solid var(--line); }
legend { margin-bottom: 18px; font-family: var(--display); font-weight: 700; font-size: 19px; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 600; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--input);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus { border-color: var(--route); background: var(--panel); box-shadow: 0 0 0 3px rgba(31,111,235,.1); outline: 0; }
input[type="date"], input[type="time"] {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value { min-inline-size: 0; text-align: start; }
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit { min-inline-size: 0; padding: 0; }
.field-grid { display: grid; gap: 13px; margin-bottom: 13px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid.five { grid-template-columns: 1.15fr repeat(4, minmax(76px, .85fr)); }
.field-grid.six { grid-template-columns: 1.1fr repeat(5, minmax(68px, .76fr)); }

.primary-button, .quiet-button, .icon-button, .avatar-button, .text-button {
  border: 0;
  cursor: pointer;
  transition: transform .2s, background .2s, color .2s, opacity .2s;
}
.primary-button {
  min-height: 45px;
  padding: 12px 20px;
  border-radius: 7px;
  background: var(--inverse);
  color: var(--on-inverse);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 5px 5px 0 var(--route);
}
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--route); }
.primary-button:disabled, .quiet-button:disabled { cursor: wait; opacity: .58; }
.full { width: 100%; }
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--effort); font-size: var(--text-small); }
.garmin-import-note {
  position: relative;
  margin: 4px 0 28px;
  padding: 18px 18px 18px 64px;
  border: 1px solid #bcd4c9;
  background: #e9f3ef;
}
.garmin-import-note > span {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 28px;
  height: 28px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--inverse);
  color: var(--recovery);
  font-size: 18px;
}
.garmin-import-note strong { display: block; margin-bottom: 5px; font-family: var(--display); font-size: 18px; }
.garmin-import-note p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.6; }

.app-shell { min-height: 100vh; }
.side-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 230px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(243, 246, 243, .94);
  backdrop-filter: blur(12px);
}
.side-rail .wordmark { padding: 8px 8px 35px; }
.desktop-nav { display: grid; gap: 5px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 17px;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  font-weight: 650;
  cursor: pointer;
}
.nav-item span { font-family: var(--utility); font-size: var(--text-small); color: #91a098; }
.nav-item.active { color: var(--ink); background: white; }
.nav-item.active::before { content: ""; position: absolute; left: -26px; width: 4px; height: 24px; background: var(--route); }
.rail-status { margin-top: auto; display: flex; gap: 11px; align-items: center; padding: 16px 10px; border-top: 1px solid var(--line); }
.rail-status strong, .rail-status small { display: block; }
.rail-status strong { font-size: var(--text-small); }
.rail-status small { margin-top: 2px; color: var(--ink-soft); font-size: var(--text-small); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #98a49f; box-shadow: 0 0 0 4px rgba(152,164,159,.16); }
.status-dot.live { background: #35a975; box-shadow: 0 0 0 4px rgba(53,169,117,.16); }
.status-dot.error { background: var(--effort); box-shadow: 0 0 0 4px rgba(182,58,85,.14); }

.content-shell { margin-left: 230px; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 98px;
  padding: 22px clamp(24px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(207,217,212,.8);
  background: rgba(243,246,243,.88);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: 28px; }
.topbar .eyebrow { margin-bottom: 2px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.quiet-button {
  min-height: 39px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.7);
  font-size: var(--text-small);
  font-weight: 700;
}
.quiet-button:hover { background: white; border-color: #afbeb6; }
.sync-icon { color: var(--route); font-size: 16px; }
.syncing .sync-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar-button { width: 39px; height: 39px; border-radius: 50%; background: var(--effort); color: white; font-family: var(--display); font-weight: 800; }

main { padding: 30px clamp(20px, 5vw, 72px) 90px; }
.view { display: none; max-width: 1450px; margin: 0 auto; animation: view-in .45s cubic-bezier(.22,.76,.36,1) both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.fuel-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  min-height: 350px;
  overflow: hidden;
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: var(--shadow);
}
.fuel-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: 43%;
  bottom: -330px;
  border: 35px solid rgba(31,111,235,.42);
  border-radius: 50%;
  pointer-events: none;
}
.fuel-number-block { padding: clamp(34px, 5vw, 70px); }
.fuel-number-block .section-kicker, .macro-panel .section-kicker { color: var(--recovery); }
.hero-number { display: flex; align-items: end; gap: 18px; margin: 14px 0 35px; }
.hero-number strong { font-family: var(--display); font-size: clamp(86px, 10vw, 144px); line-height: .78; letter-spacing: -.055em; }
.hero-number span { padding-bottom: 3px; color: #aebfba; font-family: var(--utility); font-size: var(--text-small); line-height: 1.5; text-transform: uppercase; }
.calorie-equation { display: flex; flex-wrap: wrap; gap: 14px; color: #b6c6c1; font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.calorie-equation b { color: white; font-size: var(--text-small); }
.calorie-equation i { color: var(--route); font-style: normal; }
.fuel-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: rgba(255,255,255,.1); }
.fuel-meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--route), var(--recovery)); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.macro-panel { padding: clamp(32px, 4vw, 55px); background: var(--panel); color: var(--ink); }
.macro-panel .section-kicker { color: var(--ink-soft); }
.macro-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.macro-row span { font-size: var(--text-small); font-weight: 700; }
.macro-row b { font-family: var(--utility); font-size: var(--text-small); font-weight: 600; }
.macro-row b { direction: ltr; unicode-bidi: isolate; }
.macro-row i { font-style: normal; }
.macro-row div { grid-column: 1 / -1; height: 4px; background: var(--paper-deep); }
.macro-row em { display: block; width: 0; height: 100%; background: var(--route); transition: width .6s ease; }
.macro-row:nth-child(3) em { background: var(--effort); }
.macro-row:nth-child(2) em { background: var(--sun); }
.text-button { margin-top: 30px; padding: 0; background: transparent; font-size: var(--text-small); font-weight: 800; }
.text-button span { display: inline-block; margin-left: 5px; color: var(--route); transition: transform .2s; }
.text-button:hover span { transform: translateX(4px); }

.daily-update-card {
  display: grid;
  grid-template-columns: minmax(260px, .36fr) minmax(0, 1fr);
  gap: 12px 30px;
  align-items: center;
  margin-top: 22px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow-soft, 0 10px 32px rgba(20,34,43,.06));
}
.daily-update-heading .section-kicker { margin-bottom: 5px; color: var(--route); }
.daily-update-heading h2 { margin: 0; font-size: clamp(25px, 2.2vw, 32px); line-height: 1; letter-spacing: -.025em; }
#daily-update-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: stretch; }
#daily-update-text {
  min-height: 60px;
  max-height: 132px;
  resize: vertical;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--input);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
#daily-update-text:focus { border-color: var(--route); outline: 0; box-shadow: 0 0 0 4px var(--focus-ring); }
.daily-update-actions { display: flex; align-items: center; gap: 10px; }
.daily-update-actions .primary-button { min-width: 148px; min-height: 60px; padding-inline: 24px; border-radius: 999px; white-space: nowrap; box-shadow: 0 9px 22px color-mix(in srgb, var(--route) 18%, transparent); }
.daily-update-record {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in srgb, var(--route) 42%, var(--line));
  border-radius: 50%;
  background: var(--route-soft);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--route) 12%, transparent);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.daily-update-record:hover { transform: translateY(-2px); border-color: var(--route); }
.daily-update-record:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.transcription-icon { width: 25px; height: 25px; fill: none; stroke: var(--route); stroke-width: 2; stroke-linecap: round; }
.voice-stop-icon { display: none; width: 24px; height: 24px; fill: var(--effort); }
.recording .transcription-icon { display: none; }
.recording .voice-stop-icon { display: block; }
.daily-update-record.recording { border-color: var(--effort); background: var(--effort-soft); animation: record-pulse 1.1s ease-in-out infinite; }
.daily-update-record.transcribing { border-color: var(--sun); opacity: .72; }
.daily-update-record.transcribing .transcription-icon { stroke: var(--sun); animation: record-pulse 1.1s ease-in-out infinite; }
.daily-update-status { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--ink-soft); font-size: var(--text-small); }
.daily-update-summary { grid-column: 2; display: flex; flex-wrap: wrap; gap: 7px; }
.daily-update-summary span { padding: 7px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); font-size: var(--text-small); font-weight: 650; }

.coach-strip {
  margin: -8px 0 24px;
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--route);
  background: var(--panel-muted);
}
.coach-strip.caution { border-inline-start-color: var(--effort); }
.coach-strip.fuel { border-inline-start-color: var(--sun); }
.coach-strip summary { min-height: 58px; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.coach-strip summary::-webkit-details-marker { display: none; }
.coach-strip summary strong { font-family: var(--body); font-size: 15px; line-height: 1.4; }
.coach-strip > p { margin: 0; padding: 0 16px 16px; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.summary-cue { color: var(--route); font-size: 22px; transition: transform .2s; }
.coach-strip[open] .summary-cue { transform: rotate(45deg); }
.coach-mark { width: 40px; height: 40px; display: grid; place-content: center; border-radius: 50%; background: var(--route-soft); color: var(--route); font-size: 20px; }

.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 20px; }
.field-sheet { min-width: 0; padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line); background: var(--panel); box-shadow: 0 8px 28px rgba(20,34,43,.035); }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-heading h2 { margin-bottom: 0; font-size: 27px; }
.sheet-label { padding: 6px 8px; background: var(--inverse); color: var(--on-inverse); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .08em; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; background: var(--route-soft); color: var(--route); }

.fuel-line { position: relative; display: grid; gap: 0; }
.fuel-line::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 79px; width: 2px; background: repeating-linear-gradient(to bottom, var(--route) 0 7px, transparent 7px 13px); }
.fuel-stop { position: relative; width: 100%; min-height: 112px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 36px; padding: 5px 0 24px; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.fuel-stop:hover, .fuel-stop:focus-visible { background: color-mix(in srgb, var(--route-soft) 52%, transparent); }
.fuel-stop:last-child { min-height: 80px; padding-bottom: 0; }
.route-node { position: absolute; left: 72px; top: 11px; z-index: 2; width: 16px; height: 16px; border: 4px solid white; border-radius: 50%; background: var(--route); box-shadow: 0 0 0 1px var(--route); }
.session-stop .route-node { background: var(--effort); box-shadow: 0 0 0 1px var(--effort); }
.tomorrow-stop .route-node { background: var(--sun); box-shadow: 0 0 0 1px #d6a62e; }
.stop-time { padding-top: 11px; font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; }
.fuel-stop-copy { min-width: 0; padding-inline-start: 10px; }
.fuel-stop h3 { margin: 4px 0 4px; font-size: 20px; }
.stop-summary { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: var(--text-small); }
.fuel-stop small { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }
.mini-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-metrics span { padding: 6px 8px; background: var(--paper-deep); color: var(--ink); font-family: var(--utility); font-size: var(--text-small); }
.row-cue { display: inline-block; margin-inline-start: 4px; color: var(--route); font-family: var(--body); font-size: .9em; }
.context-panel { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-inline-start: 4px solid var(--route); background: var(--route-soft); }
.context-panel strong { display: block; margin-bottom: 5px; font-size: 15px; }
.context-panel p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.context-panel > .primary-button, .context-panel > .text-button { width: fit-content; margin-top: 12px; display: inline-flex; align-items: center; text-decoration: none; }
.fuel-line > .context-panel { z-index: 3; margin: -12px 0 20px; margin-inline-start: 100px; }
.workout-insight-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.workout-insight-label, .workout-adjusted { font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workout-insight-label { color: var(--route); }
.workout-adjusted { padding: 5px 8px; border-radius: 999px; background: var(--effort-soft); color: var(--effort); }
.context-panel .workout-insight > strong { margin-bottom: 8px; font-family: var(--display); font-size: 24px; line-height: 1.1; }
.workout-insight-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.workout-insight-facts span { min-width: 92px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--route) 16%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--panel) 72%, transparent); }
.workout-insight-facts small, .workout-insight-facts b { display: block; }
.workout-insight-facts small { margin-bottom: 2px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .06em; text-transform: uppercase; }
.workout-insight-facts b { color: var(--ink); font-family: var(--number); font-size: 14px; font-variant-numeric: tabular-nums; }

.weight-readout { display: flex; align-items: end; gap: 12px; }
.weight-readout strong { font-family: var(--display); font-size: 64px; line-height: .9; letter-spacing: -.045em; }
.weight-readout span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); line-height: 1.45; text-transform: uppercase; }
.mini-chart { width: 100%; height: 130px; margin: 20px 0 8px; overflow: visible; }
.trajectory-line { display: flex; justify-content: space-between; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.trajectory-line b { color: var(--ink); }
.trajectory-progress { height: 5px; margin: 12px 0; background: var(--paper-deep); }
.trajectory-progress span { display: block; height: 100%; background: var(--effort); }
.weight-status { margin: 14px 0 0; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }

.fuel-guidance { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.fuel-guidance article { min-height: 106px; padding: 21px; border-right: 1px solid var(--line); }
.fuel-guidance article:last-child { border-right: 0; }
.fuel-guidance span { display: block; margin-bottom: 8px; color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; text-transform: uppercase; }
.fuel-guidance p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }

.page-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin: 10px 0 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-title h2 { margin: 0; max-width: 760px; font-size: clamp(36px, 5vw, 62px); line-height: .96; }
.page-title > p { max-width: 380px; margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.6; }
.compact-page-title { margin: 0 0 var(--space-4); padding-bottom: var(--space-3); }
.compact-page-title h2 { font-size: clamp(30px, 4vw, 44px); }

.tomorrow-plan { margin-top: 20px; border-top: 5px solid var(--sun); }
.completed-meal-timing { margin-top: 20px; padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; border: 1px solid color-mix(in srgb, var(--recovery) 42%, var(--line)); border-inline-start: 4px solid var(--recovery); border-radius: var(--radius-small); background: var(--surface-resolved); box-shadow: var(--shadow-soft); }
.completed-timing-copy > span { color: var(--recovery); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.completed-timing-copy > strong { display: block; margin: 6px 0 3px; font-family: var(--display); font-size: 22px; line-height: 1.1; }
.completed-timing-copy > p { max-width: 760px; margin: 8px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
.completed-session-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.completed-session-facts span { padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--recovery) 22%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--recovery) 7%, var(--panel)); color: var(--ink); font-family: var(--number); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.completed-session-action { min-width: 170px; padding: 13px 15px; border-radius: 15px; background: var(--route); color: var(--on-inverse); box-shadow: 0 8px 22px color-mix(in srgb, var(--route) 18%, transparent); }
.completed-session-action small, .completed-session-action strong { display: block; }
.completed-session-action small { margin-bottom: 4px; font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }
.completed-session-action strong { font-family: var(--display); font-size: 17px; }
.tomorrow-plan-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.tomorrow-plan-head h2 { margin: 0 0 6px; font-size: 32px; }
.tomorrow-plan-head > div > p:last-child { margin: 0; color: var(--ink-soft); font-size: var(--text-body); }
.run-time-control { width: min(220px, 100%); min-width: 0; overflow: hidden; }
.run-time-control input { display: block; inline-size: 100%; min-width: 0; max-width: 100%; direction: ltr; text-align: center; font-family: var(--body); font-size: 20px; font-weight: 750; background: var(--surface-decision); border-color: color-mix(in srgb, var(--sun) 72%, var(--line)); }
.run-time-control input::-webkit-date-and-time-value { min-width: 0; text-align: center; }
.tomorrow-meal-timeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border: 1px solid var(--line); }
.plan-step { position: relative; min-height: 180px; padding: 20px; border-right: 1px solid var(--line); background: var(--panel); }
.plan-step:last-child { border-right: 0; }
.meal-timing { display: grid; justify-items: start; gap: 7px; margin-bottom: 20px; }
.timing-window { color: var(--ink-soft); font-family: var(--number); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.timing-window small { margin-inline-end: 6px; font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.timing-best { display: inline-flex; align-items: baseline; gap: 8px; padding: 7px 11px; border-radius: 999px; background: var(--route); color: var(--on-inverse); box-shadow: 0 7px 18px color-mix(in srgb, var(--route) 20%, transparent); }
.timing-best small { font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.timing-best b { font-family: var(--number); font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; }
.meal-timing.actual { margin: 0; justify-items: end; }
.meal-timing.actual .timing-best { background: var(--recovery); box-shadow: 0 7px 18px color-mix(in srgb, var(--recovery) 22%, transparent); }
.plan-step strong { display: block; margin: 7px 0 8px; font-family: var(--display); font-size: 20px; line-height: 1.05; }
.plan-step p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
.plan-step p b { color: var(--ink); }
.plan-step p small { display: block; margin-top: 4px; font-family: var(--utility); font-size: var(--text-body); text-transform: uppercase; }
.plan-step p em { display: block; margin-top: 8px; color: var(--ink-soft); font-style: normal; }
.plan-step.rest-plan { grid-column: 1 / -1; min-height: 100px; display: flex; gap: 20px; align-items: center; }
.plan-step.rest-plan .meal-timing { min-width: 132px; margin: 0; }
.macro-target-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 13px; }
.macro-target-chips span { min-width: 0; padding: 9px 7px; border-radius: 10px; background: var(--panel-muted); color: var(--ink-soft); font-size: var(--text-small); text-align: center; }
.macro-target-chips b { display: block; margin-bottom: 3px; color: var(--ink); font-family: var(--number); font-size: 15px; font-variant-numeric: tabular-nums; }
.learning-note { margin: 16px 0 0; padding-inline-start: 15px; border-inline-start: 3px solid var(--recovery); color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }

.food-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr); gap: 20px; align-items: start; }
.composer-heading { margin-bottom: 18px; }
.entry-mode-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 22px; }
.entry-mode-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 4px; border: 1px solid var(--line); background: var(--paper-deep); }
.entry-mode-switch button { min-height: 42px; border: 0; background: transparent; color: var(--ink-soft); font-size: var(--text-small); font-weight: 700; cursor: pointer; }
.entry-mode-switch button span { color: var(--route); }
.entry-mode-switch button.active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(20,34,43,.08); }
.barcode-scan-button { min-width: 88px; min-height: 50px; padding: 8px 13px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid color-mix(in srgb, var(--route) 42%, var(--line)); border-radius: 999px; background: var(--route-soft); color: var(--route); font-size: var(--text-small); font-weight: 800; cursor: pointer; }
.barcode-scan-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.smart-picks { margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--panel-muted); }
.smart-picks-heading { margin-bottom: 14px; }
.smart-picks-heading strong { display: block; font-family: var(--display); font-size: 22px; }
.smart-picks-heading small { display: block; max-width: 580px; margin-top: 4px; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }
.meal-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.meal-tabs button { min-height: var(--tap-min); padding: 7px; border: 0; border-bottom: 2px solid transparent; background: var(--paper-deep); color: var(--ink-soft); font-size: var(--text-small); cursor: pointer; }
.meal-tabs button span { margin-inline-end: 4px; color: var(--route); }
.meal-tabs button.active { border-bottom-color: var(--route); background: var(--panel); color: var(--ink); font-weight: 750; }
.shortcut-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.catalog-search { position: relative; margin: -5px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.catalog-search input { min-height: 54px; padding-inline-start: 42px; background: white; font-size: var(--text-body); }
.catalog-search label { position: relative; }
.catalog-search-icon { position: absolute; bottom: 11px; inset-inline-start: 14px; color: var(--route); font-family: var(--display); font-size: 25px; line-height: 1; pointer-events: none; }
.catalog-source-line { min-height: 10px; display: flex; justify-content: flex-end; gap: 18px; margin-top: 7px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .035em; text-transform: uppercase; }
.catalog-source-line small { color: var(--route); font: inherit; }
.catalog-results { position: absolute; inset: calc(100% - 12px) 0 auto; z-index: 8; max-height: 335px; overflow: auto; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); }
.catalog-result { width: 100%; padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 5px 18px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: start; cursor: pointer; }
.catalog-result:last-child { border-bottom: 0; }
.catalog-result:hover, .catalog-result:focus-visible { background: var(--route-soft); }
.catalog-result strong { font-size: var(--text-small); }
.catalog-result > span { font-family: var(--display); font-size: 19px; }
.catalog-result small { color: var(--ink-soft); font-size: var(--text-small); }
.catalog-result em { grid-column: 2; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-style: normal; text-transform: uppercase; }
.barcode-open { overflow: hidden; }
.barcode-dialog { width: min(520px, calc(100vw - 24px)); max-width: none; padding: 0; border: 1px solid var(--chrome-line); border-radius: 24px; background: var(--chrome); color: var(--on-inverse); box-shadow: 0 30px 100px rgba(5, 12, 17, .42); overflow: hidden; }
.barcode-dialog::backdrop { background: rgba(5, 12, 17, .72); backdrop-filter: blur(8px); }
.barcode-panel { padding: 22px; }
.barcode-panel > header { min-height: 54px; display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.barcode-panel > header .section-kicker { margin-bottom: 3px; color: var(--recovery); }
.barcode-panel > header h2 { margin: 0; color: var(--on-inverse); font-size: 29px; }
.barcode-close { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--chrome-line); border-radius: 50%; background: var(--glass-on-dark); color: var(--on-inverse); font-size: 26px; line-height: 1; cursor: pointer; }
.barcode-camera { position: relative; min-height: 330px; margin-top: 17px; display: grid; place-items: center; border: 1px solid var(--chrome-line); border-radius: 17px; background: #050c11; overflow: hidden; }
.barcode-camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.barcode-reticle { position: relative; z-index: 2; width: min(82%, 360px); height: 128px; border: 1px solid rgba(255,255,255,.58); border-inline: 0; }
.barcode-reticle::before, .barcode-reticle::after { content: ""; position: absolute; top: -1px; bottom: -1px; width: 18px; border-block: 3px solid var(--sun); }
.barcode-reticle::before { left: 0; border-left: 3px solid var(--sun); }
.barcode-reticle::after { right: 0; border-right: 3px solid var(--sun); }
.barcode-reticle i { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: var(--route); box-shadow: 0 0 18px var(--route); animation: barcode-sweep 1.8s ease-in-out infinite alternate; }
@keyframes barcode-sweep { from { transform: translateY(-42px); } to { transform: translateY(42px); } }
.barcode-camera p { position: absolute; z-index: 3; right: 16px; bottom: 14px; left: 16px; margin: 0; color: white; font-size: var(--text-body); font-weight: 700; text-align: center; text-shadow: 0 2px 8px #000; }
.barcode-manual { margin-top: 14px; border: 1px solid var(--chrome-line); border-radius: 14px; background: var(--glass-on-dark); overflow: hidden; }
.barcode-manual > summary { min-height: 48px; padding: 13px 15px; color: color-mix(in srgb, var(--on-inverse) 72%, transparent); font-size: var(--text-small); font-weight: 750; cursor: pointer; list-style-position: inside; }
.barcode-manual form { padding: 0 12px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.barcode-manual input { border-color: var(--chrome-line); background: #13232c; color: white; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.barcode-manual .primary-button { min-width: 94px; }
.shortcut-button { min-width: 0; min-height: 64px; padding: 11px 12px; display: grid; gap: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: start; cursor: pointer; }
.shortcut-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.shortcut-button small { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.shortcut-button:hover { border-color: var(--route); color: var(--route); transform: translateY(-1px); }
.usuals-empty { grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px dashed #b9cee9; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; text-align: center; }
.food-composer form { display: grid; gap: 14px; }
.compact-grid label { font-size: var(--text-small); }
.form-action-row { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.learning-inline { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-weight: 500; }
.check-label input { min-height: 0; width: auto; }
.ai-entry-panel { padding: var(--space-4); background: var(--surface-capture); color: white; }
.ai-entry-panel label { color: #c4d0d6; }
.meal-description-label { font-family: var(--display); font-size: 17px; color: white !important; }
.meal-flow { margin: 0 0 2px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); list-style: none; }
.meal-flow li { min-width: 0; padding-top: 9px; display: flex; align-items: center; gap: 7px; border-top: 2px solid #46565f; color: #819098; }
.meal-flow li span { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-content: center; border: 1px solid currentColor; border-radius: 50%; font-family: var(--utility); font-size: var(--text-small); }
.meal-flow li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--utility); font-size: var(--text-small); letter-spacing: .06em; text-transform: uppercase; }
.meal-flow li.complete { border-color: var(--recovery); color: var(--recovery); }
.meal-flow li.complete span { background: var(--recovery); color: var(--ink); }
.meal-flow li.current { border-color: var(--sun); color: white; }
.meal-flow li.current span { border-color: var(--sun); color: var(--sun); }
.voice-composer { position: relative; }
.voice-composer textarea { width: 100%; min-height: 140px; resize: vertical; padding: 17px; padding-inline-end: 82px; border: 1px solid #46565f; border-radius: var(--control-radius); background: #1d2d36; color: white; font: var(--text-body)/1.55 var(--body); }
.voice-composer textarea::placeholder { color: #87969e; }
.voice-composer textarea:focus { outline: 3px solid rgba(31,111,235,.35); border-color: var(--route); }
.voice-button { position: absolute; top: 12px; right: auto; inset-inline-end: 12px; width: 57px; height: 57px; display: grid; place-content: center; border: 1px solid #51616a; border-radius: 50%; background: #263740; color: white; cursor: pointer; }
.voice-button .transcription-icon { width: 24px; height: 24px; }
.voice-button.recording { border-color: var(--effort); background: #3b2330; animation: record-pulse 1.1s ease-in-out infinite; }
.voice-button.recording .voice-stop-icon { fill: white; }
.voice-button.transcribing { border-color: var(--sun); opacity: .8; }
.voice-button.transcribing .transcription-icon { stroke: var(--sun); animation: record-pulse 1.1s ease-in-out infinite; }
@keyframes record-pulse { 50% { box-shadow: 0 0 0 8px rgba(182,58,85,.18); } }
.ai-action-row { display: grid; grid-template-columns: minmax(130px, .42fr) 1fr; gap: 12px; align-items: end; }
.ai-action-row .primary-button { box-shadow: 5px 5px 0 var(--sun); }
.voice-status { min-height: 14px; margin: -4px 0 0; color: #91c3ad; font-size: var(--text-small); }
.ai-meal-preview { margin-top: 3px; padding: 16px; background: white; color: var(--ink); }
.ai-preview-head { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.ai-preview-head span { color: var(--route); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.ai-preview-head h3 { margin: 4px 0 0; font-size: 20px; }
.ai-preview-head p { margin: 3px 0 0; color: var(--ink-soft); font-size: var(--text-body); }
.ai-preview-head-actions { display: grid; justify-items: end; gap: 5px; }
.ai-preview-head-actions > strong { font-family: var(--display); font-size: 28px; }
.ai-preview-head-actions > strong small { font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.ai-preview-head-actions > button { padding: 0; border: 0; background: transparent; color: var(--effort); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
.ai-food-lines { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.meal-review-item { border: 1px solid var(--line); border-left: 4px solid var(--recovery); background: var(--surface-review); }
.meal-review-item.needs-decision { border-left-color: var(--sun); }
.meal-review-item > header { padding: 17px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px; }
.meal-item-index { width: 38px; height: 38px; display: grid; place-content: center; border-radius: 50%; background: var(--inverse); color: var(--on-inverse); font-family: var(--utility); font-size: var(--text-small); }
.meal-review-item header div > small { display: block; overflow: hidden; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.meal-review-item header div > strong { display: block; margin-top: 4px; font-size: 17px; line-height: 1.3; }
.meal-review-item header p { margin: 5px 0 0; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-body); line-height: 1.45; }
.meal-review-item-actions { display: grid; justify-items: end; gap: 5px; }
.meal-review-item-actions > b { color: var(--ink); font-family: var(--display); font-size: 20px; white-space: nowrap; }
.meal-review-item-actions > b small { font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.meal-review-item-actions > button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--ink-soft); cursor: pointer; }
.meal-decision { margin: 0; padding: 17px; border: 0; border-top: 1px solid #eadcae; background: var(--surface-decision); }
.meal-decision legend { width: 100%; padding: 0 0 12px; font-family: var(--body); font-size: 15px; font-weight: 750; }
.food-choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
.food-choice, .portion-choice-list button, .portion-presets button { min-height: 58px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); color: var(--ink); cursor: pointer; }
.food-choice { display: grid; gap: 3px; text-align: start; }
.food-choice span { font-size: 14px; font-weight: 750; line-height: 1.3; }
.food-choice small { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.food-choice:hover, .food-choice:focus-visible, .portion-choice-list button:hover, .portion-choice-list button:focus-visible, .portion-presets button:hover, .portion-presets button.active { border-color: var(--route); color: var(--route); }
.food-choice.selected { border-color: var(--route); background: var(--route-soft); box-shadow: inset 3px 0 0 var(--route); }
.portion-choice-list { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.portion-choice-list button { flex: 1 1 150px; font-size: var(--text-small); font-weight: 700; }
.ai-unmatched { margin: 12px 0 0; color: var(--effort); font-size: var(--text-small); line-height: 1.45; }
.ai-engine-note { margin: 12px 0 0; border: 1px solid var(--line); border-inline-start: 3px solid var(--recovery); border-radius: var(--control-radius); background: var(--surface-resolved); }
.ai-engine-note summary { width: fit-content; padding: 10px 12px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
.ai-engine-note p { margin: 0; padding: 0 12px 11px; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.ai-total-row { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; }
.ai-total-row > span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.ai-total-row .primary-button { box-shadow: 4px 4px 0 var(--route); }
.ai-estimate-note { margin: 14px 0 0; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.4; }
.portion-presets { display: grid; gap: 7px; padding: 12px; background: #f2f7ff; border: 1px solid #c9d7e9; }
.portion-presets > span { color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; }
.portion-presets > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.portion-presets button { min-height: 64px; display: grid; gap: 3px; }
.portion-presets button strong { font-size: var(--text-small); }
.portion-presets button small { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.piece-portion, .spoon-portion { display: grid; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel-muted); }
.portion-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 12px; background: var(--paper-deep); }
.portion-mode-switch button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font-size: var(--text-small); font-weight: 800; cursor: pointer; }
.portion-mode-switch button.active { background: var(--panel); color: var(--route); box-shadow: var(--shadow-soft); }
.piece-portion-fields, .spoon-portion-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.piece-portion-fields label, .spoon-portion-fields label { display: grid; gap: 6px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; }
.piece-portion-fields input, .piece-portion-fields select, .spoon-portion-fields input, .spoon-portion-fields select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--input); color: var(--ink); font: inherit; }
.piece-portion > small, .spoon-portion > small { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.catalog-result.recent-result { background: var(--route-soft); }
.catalog-result .recent-badge { color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.meal-bucket-list { display: grid; gap: 12px; }
.meal-bucket { border: 1px solid var(--line); background: #fafcfb; }
.meal-bucket.has-food { background: var(--panel); }
.meal-bucket.just-added { border-color: var(--route); box-shadow: 0 0 0 4px var(--focus-ring); }
.meal-bucket > header { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.meal-bucket > header > div { display: flex; align-items: center; gap: 8px; }
.meal-bucket > header > div:first-child > span { width: 24px; height: 24px; display: grid; place-content: center; border-radius: 50%; background: var(--inverse); color: var(--sun); }
.meal-bucket > header h3 { margin: 0; font-size: 18px; }
.meal-bucket > header b { font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.meal-bucket > header .meal-bucket-head-actions { gap: 10px; }
.meal-add-button { min-height: 32px; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--route) 38%, var(--line)); border-radius: 999px; background: var(--panel); color: var(--route); font-size: var(--text-small); font-weight: 800; cursor: pointer; }
.meal-add-button:hover { border-color: var(--route); background: var(--route-soft); }
.meal-clear-button { min-height: 32px; padding: 5px 8px; border: 0; background: transparent; color: var(--effort); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
.meal-bucket > div { padding: 0 13px; }
.meal-bucket:not(.has-food) > header { border-bottom: 0; background: transparent; }
.meal-bucket:not(.has-food) > div { display: none; }
.food-log-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.food-log-item:first-child { border-top: 0; }
.food-log-item h3 { margin: 0 0 4px; font-family: var(--body); font-size: var(--text-small); }
.food-log-item p { margin: 0; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-body); text-transform: uppercase; }
.food-log-item strong { font-family: var(--display); font-size: 22px; }
.delete-button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--ink-soft); cursor: pointer; }
.bucket-empty { margin: 0; padding: 18px 4px; color: #8b9891; font-size: var(--text-small); text-align: center; }
.empty-state { padding: 42px 12px; text-align: center; color: var(--ink-soft); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: var(--display); font-size: 21px; }
.empty-state p { font-size: var(--text-body); line-height: 1.55; }

.training-layout { display: grid; grid-template-columns: minmax(340px, .72fr) minmax(0, 1.28fr); gap: 20px; }
.workout-list, .activity-list { display: grid; }
.workout-item { display: grid; grid-template-columns: 53px 1fr auto; gap: 15px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line); }
.workout-item:first-child { border-top: 0; }
.workout-date { text-align: center; border-right: 1px solid var(--line); }
.workout-date b { display: block; font-family: var(--display); font-size: 26px; line-height: 1; }
.workout-date span { font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.workout-copy h3 { margin: 0 0 4px; font-size: 18px; }
.workout-copy p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); }
.workout-kind { padding: 5px 7px; background: var(--route-soft); color: var(--route); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.workout-kind.quality { background: var(--effort-soft); color: var(--effort); }
.workout-kind.rest { background: var(--paper-deep); color: var(--ink-soft); }
.activity-item { display: grid; grid-template-columns: minmax(130px, 1fr) repeat(4, minmax(62px, .42fr)); gap: 12px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-name h3 { margin: 0 0 3px; font-size: 16px; }
.activity-name span, .activity-stat span { display: block; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.activity-stat b { font-size: var(--text-small); }

.progress-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; }
.weight-entry-sheet form { display: grid; gap: 14px; }
.weight-chart { width: 100%; min-height: 330px; overflow: visible; }
.chart-key { display: flex; gap: 16px; font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.chart-key span::before { content: ""; display: inline-block; width: 14px; height: 2px; margin: 0 6px 3px 0; background: var(--effort); }
.chart-key .target-key::before { background: var(--route); border-top: 1px dashed white; }
.trajectory-explanation { margin: 4px 0 10px; padding: 15px 17px; border-inline-start: 3px solid var(--route); background: color-mix(in srgb, var(--route) 6%, var(--panel)); }
.trajectory-explanation strong { display: block; margin-bottom: 5px; font-family: var(--display); font-size: 20px; line-height: 1.15; }
.trajectory-explanation p { max-width: 760px; margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.progress-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.progress-stat { padding: 18px 12px; border-right: 1px solid var(--line); }
.progress-stat:last-child { border-right: 0; }
.progress-stat span { display: block; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.progress-stat strong { display: block; margin-top: 6px; font-family: var(--display); font-size: 23px; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 20px; }
.settings-layout form { display: grid; gap: 14px; }
.auto-calorie-field {
  position: relative;
  min-height: 96px;
  padding: 14px 16px;
  padding-inline-end: 52px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid #bcd4c9;
  border-left: 4px solid var(--recovery);
  background: #e9f3ef;
}
.auto-calorie-field > span { color: var(--ink-soft); font-size: var(--text-small); font-weight: 700; }
.auto-calorie-field strong { display: flex; align-items: baseline; gap: 7px; font-family: var(--display); }
.auto-calorie-field strong b { font-size: 32px; line-height: 1; }
.auto-calorie-field strong i { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-style: normal; text-transform: uppercase; }
.auto-calorie-details { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; z-index: 4; }
.auto-calorie-details summary { width: 30px; height: 30px; display: grid; place-content: center; border: 1px solid #9abaaa; border-radius: 50%; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; cursor: pointer; list-style: none; }
.auto-calorie-details summary::-webkit-details-marker { display: none; }
.auto-calorie-details[open] { inset-inline-start: 10px; padding: 10px; border: 1px solid #bcd4c9; background: white; box-shadow: var(--shadow); }
.auto-calorie-details[open] summary { margin-inline-start: auto; }
.auto-calorie-details p { margin: 8px 2px 2px; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.integration-stack { display: grid; gap: 14px; }
.settings-preferences {
  padding: 20px 22px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.settings-preferences > .section-kicker { margin: 0 0 7px; }
.settings-preference-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
}
.settings-preference-row > strong { font-size: var(--text-small); font-weight: 650; }
.settings-choice {
  padding: 3px;
  display: inline-flex;
  gap: 2px;
  border-radius: 999px;
  background: var(--panel-muted);
}
.settings-choice button {
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 750;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.settings-choice button:hover { color: var(--ink); }
.settings-choice button.active { background: var(--panel); color: var(--ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 9%, transparent); }
.settings-choice button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.account-card { padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; border: 1px solid var(--line); background: var(--panel); }
.account-card .section-kicker { grid-column: 1 / -1; margin: 0; }
.account-card strong, .account-card small { display: block; }
.account-card strong { font-family: var(--display); font-size: 19px; }
.account-card small { margin-top: 3px; color: var(--ink-soft); font-size: var(--text-small); overflow-wrap: anywhere; }
.integration-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.garmin-actions { grid-column: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; justify-self: start; }
.garmin-actions .primary-button { display: inline-flex; align-items: center; text-decoration: none; }
.garmin-source-statuses { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.garmin-source-statuses span { padding: 6px 9px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 750; letter-spacing: .03em; }
.text-button.danger { color: var(--effort); }
.integration-logo { width: 42px; height: 42px; display: grid; place-content: center; border-radius: 10px; background: var(--inverse); color: var(--on-inverse); font-family: var(--display); font-weight: 800; }
.integration-card h3 { margin: 0 0 6px; font-size: 20px; }
.integration-card p:not(.section-kicker) { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.garmin-connect-logo { display: flex; align-items: center; min-height: 96px; direction: ltr; }
.garmin-connect-logo img { display: block; width: min(96px, 100%); height: auto; }
.connection-catalog { padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.connection-catalog .section-heading { margin-bottom: 14px; }
.connection-catalog .section-heading h2 { font-size: 23px; }
.connection-list { display: grid; gap: 8px; }
.connection-list button { width: 100%; min-height: 58px; padding: 9px 11px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 11px; border: 1px solid var(--line); background: var(--panel-muted); color: var(--ink); text-align: start; cursor: pointer; }
.connection-list button:hover, .connection-list button[aria-expanded="true"] { border-color: var(--route); background: var(--route-soft); }
.connection-list button strong { align-self: end; font-size: 14px; }
.connection-list button small { grid-column: 2; align-self: start; color: var(--ink-soft); font-size: var(--text-small); }
.connection-list button > span:last-child { grid-column: 3; grid-row: 1 / 3; color: var(--route); font-size: 20px; }
.connection-mark { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-content: center; border-radius: 9px; background: var(--inverse); color: var(--on-inverse); font-family: var(--display); font-weight: 850; text-align: center; line-height: .6; }
.fitbit-mark { background: #00b0b9; font-size: var(--text-small); letter-spacing: 1px; }
.whoop-mark { background: #20232a; color: #42f5b3; }
.polar-mark { background: #df1742; }
.oura-mark { background: #b99a72; }
.suunto-mark { background: #e1261c; }
.status-pill { padding: 6px 8px; border-radius: 20px; background: var(--paper-deep); color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }

.mobile-nav { display: none; }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border-left: 4px solid var(--route); background: var(--inverse); color: var(--on-inverse); box-shadow: var(--shadow); font-size: var(--text-small); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: var(--effort); }

@media (max-width: 1120px) {
  .side-rail { width: 190px; padding-inline: 20px; }
  .content-shell { margin-left: 190px; }
  .nav-item.active::before { left: -20px; }
  .fuel-hero { grid-template-columns: 1.1fr .9fr; }
  .dashboard-grid, .food-layout, .settings-layout { grid-template-columns: 1fr; }
  .training-layout { grid-template-columns: 1fr; }
  .weight-sheet { min-height: 400px; }
  .tomorrow-meal-timeline { grid-template-columns: repeat(2, 1fr); }
  .plan-step:nth-child(2) { border-right: 0; }
  .plan-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  body { background-size: 100% 20px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-intro { position: relative; height: auto; min-height: 520px; padding: 118px 24px 52px; }
  .auth-intro .wordmark { top: 28px; left: 24px; }
  .auth-intro h1 { font-size: 54px; }
  .setup-card { margin: 0; padding: 36px 22px 60px; }
  .google-signin-button { min-height: 82px; margin-top: 24px; padding: 14px; }
  .google-signin-button strong { font-size: 20px; }
  .google-signin-button small, .auth-security-note { font-size: var(--text-small); }
  .field-grid.two, .field-grid.three, .field-grid.five, .field-grid.six { grid-template-columns: 1fr 1fr; }
  .field-grid.three label:last-child, .field-grid.five label:first-child, .field-grid.six label:first-child { grid-column: 1 / -1; }
  .side-rail { display: none; }
  .content-shell { margin-left: 0; }
  .topbar { min-height: 77px; padding: 14px 18px; }
  .topbar h1 { font-size: 23px; }
  .quiet-button span:last-child { display: none; }
  .quiet-button { min-width: 39px; justify-content: center; }
  main { padding: 20px 16px 128px; }
  .fuel-hero { grid-template-columns: 1fr; }
  .fuel-number-block { min-height: 315px; padding: 36px 26px 48px; }
  .hero-number strong { font-size: 98px; }
  .hero-number span { font-size: var(--text-small); line-height: 1.35; }
  .calorie-equation { gap: 12px; font-size: var(--text-small); line-height: 1.45; }
  .calorie-equation b { font-size: 17px; }
  .macro-panel { padding: 30px 26px; }
  .macro-row { padding: 21px 0; }
  .macro-row span { font-size: 17px; }
  .macro-row b { font-size: 16px; }
  .text-button { min-height: 44px; font-size: 16px; }
  .coach-strip { margin: 0 0 24px; }
  .coach-strip summary strong { font-size: 17px; }
  .coach-strip > p { font-size: var(--text-body); }
  .dashboard-grid, .fuel-guidance, .food-layout, .training-layout, .progress-layout, .settings-layout { grid-template-columns: 1fr; }
  .fuel-guidance article { border-right: 0; border-bottom: 1px solid var(--line); }
  .fuel-guidance article:last-child { border-bottom: 0; }
  .field-sheet { padding: 22px 18px; }
  .fuel-line::before { left: 65px; }
  .fuel-stop { grid-template-columns: 50px 1fr; gap: 30px; }
  .route-node { left: 58px; }
  .stop-time { font-size: var(--text-small); }
  .fuel-stop h3 { font-size: 23px; line-height: 1.15; }
  .stop-summary { margin-top: 7px; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
  .mini-metrics { gap: 8px; margin-top: 10px; }
  .mini-metrics span { padding: 7px 9px; font-family: var(--body); font-size: var(--text-small); font-weight: 650; }
  .context-panel strong { font-size: 17px; }
  .context-panel p { font-size: var(--text-body); }
  .fuel-line > .context-panel { margin-inline-start: 80px; }
  .weight-status, .learning-note { font-size: var(--text-small); }
  .page-title { align-items: start; flex-direction: column; }
  .page-title { margin-bottom: 18px; padding-bottom: 16px; }
  .page-title h2 { font-size: 36px; }
  .page-title > p { max-width: none; }
  .food-composer { display: flex; flex-direction: column; }
  .composer-heading { order: 1; }
  .entry-mode-row { order: 2; }
  .entry-panel { order: 3; }
  .smart-picks { order: 4; margin: 18px 0 0; }
  .entry-mode-switch button { font-size: 14px; }
  .meal-description-label { font-family: var(--body); font-size: 17px; font-weight: 750; }
  .voice-composer textarea { min-height: 160px; font-size: 17px; }
  .ai-entry-panel label, .food-composer label { font-size: 14px; }
  .meal-flow li b { font-size: var(--text-small); }
  .voice-status { font-size: var(--text-small); }
  .food-log-item h3 { font-size: 16px; }
  .food-log-item p { font-size: var(--text-body); }
  .tomorrow-plan-head { align-items: stretch; flex-direction: column; gap: 18px; }
  .tomorrow-plan-head h2 { font-size: 27px; line-height: 1.1; }
  .run-time-control { width: 100%; min-width: 0; }
  .run-time-control input { width: 100%; font-size: 19px; }
  .tomorrow-meal-timeline { grid-template-columns: 1fr; }
  .plan-step { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-step:last-child { border-bottom: 0; }
  .meal-timing { margin-bottom: 16px; }
  .plan-step strong { font-size: 23px; }
  .plan-step p { font-size: var(--text-body); line-height: 1.55; }
  .form-action-row { align-items: stretch; flex-direction: column; }
  .empty-state strong { font-size: 23px; }
  .empty-state p { font-size: var(--text-body); }
  .workout-copy p { font-size: var(--text-body); line-height: 1.45; }
  .workout-kind { font-size: var(--text-small); }
  .activity-item { grid-template-columns: 1fr 1fr 1fr; }
  .activity-name { grid-column: 1 / -1; }
  .activity-stat:last-child { display: none; }
  .activity-name span, .activity-stat span { font-size: var(--text-small); }
  .activity-stat b { font-size: 15px; }
  .weight-chart { min-height: 240px; }
  .progress-stat-row { grid-template-columns: 1fr 1fr; }
  .progress-stat:nth-child(2) { border-right: 0; }
  .progress-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .progress-stat span { font-size: var(--text-small); }
  .integration-card p:not(.section-kicker) { font-size: var(--text-body); }
  .garmin-actions { grid-column: 1 / -1; width: 100%; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 82px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 2px);
    border-top: 1px solid var(--line);
    background: var(--paper);
  }
  .mobile-nav button { min-height: 70px; padding: 9px 2px 7px; display: grid; place-items: center; align-content: center; gap: 4px; border: 0; background: transparent; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
  .mobile-nav-icon { width: 28px; height: 28px; display: grid; place-content: center; }
  .mobile-nav-icon svg { width: 28px; height: 28px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; shape-rendering: geometricPrecision; }
  .mobile-nav-icon svg * { vector-effect: non-scaling-stroke; }
  .mobile-nav button.active .mobile-nav-icon { filter: none; }
  .mobile-nav button.active { color: var(--route); }
  .toast { right: 14px; bottom: 102px; left: 14px; max-width: none; }
}

@media (max-width: 440px) {
  .field-grid.two, .field-grid.three, .field-grid.five, .field-grid.six { grid-template-columns: 1fr; }
  .field-grid.three label:last-child, .field-grid.five label:first-child, .field-grid.six label:first-child { grid-column: auto; }
  .hero-number { align-items: start; flex-direction: column; gap: 8px; }
  .hero-number strong { font-size: 88px; }
  .hero-number span { display: flex; gap: 4px; }
  .calorie-equation { gap: 9px; }
  .section-heading h2 { font-size: 27px; }
  .workout-item { grid-template-columns: 47px 1fr; }
  .workout-kind { grid-column: 2; justify-self: start; }
  .shortcut-row { grid-template-columns: 1fr; }
  .meal-flow li b { font-size: var(--text-small); }
  .food-choice-list { grid-template-columns: 1fr; }
  .meal-review-item > header { grid-template-columns: auto minmax(0, 1fr); }
  .meal-review-item-actions { grid-column: 2; grid-auto-flow: column; align-items: center; justify-content: space-between; }
  .ai-action-row { grid-template-columns: 1fr; }
  .ai-total-row { align-items: stretch; flex-direction: column; }
  .ai-total-row .primary-button { width: 100%; }
}

.profile-details-settings { margin: 0 0 18px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); }
.profile-details-settings legend { margin-bottom: 10px; color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.stable-weight-setting { margin: 10px 0 16px; display: grid; gap: 6px; }
.stable-weight-setting > span { color: var(--ink); font-size: var(--text-small); font-weight: 760; }
.stable-weight-setting input { max-width: 180px; }
.stable-weight-setting small { color: var(--ink-soft); font-size: var(--text-small); }
.treatment-settings-body { padding-top: 4px; }
.check-setting { min-height: 46px; margin-bottom: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-muted); color: var(--ink); font-size: var(--text-small); font-weight: 760; }
.check-setting input { width: 18px; height: 18px; accent-color: var(--route); }
.treatment-settings-body > p { margin: 10px 1px 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
.treatment-settings select:disabled { opacity: .5; }

/* Three-step onboarding and persistent update rail -------------------------- */
.setup-route {
  margin: 0 0 25px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}
.setup-route li {
  position: relative;
  min-width: 0;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 2px solid var(--line);
  color: var(--ink-soft);
}
.setup-route li::after { content: ""; position: absolute; top: -2px; inset-inline: 0; height: 2px; background: transparent; }
.setup-route li.active::after { background: var(--sun); }
.setup-route li.done::after { background: var(--recovery); }
.setup-route li span { width: 26px; height: 26px; display: grid; place-content: center; border: 1px solid currentColor; border-radius: 50%; font-family: var(--utility); font-size: var(--text-small); }
.setup-route li b { overflow: hidden; font-family: var(--utility); font-size: var(--text-small); letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.setup-route li.active { color: var(--ink); }
.setup-route li.active span { border-color: var(--sun); color: var(--sun); }
.setup-route li.done { color: var(--recovery); }
.returning-account {
  margin: 0 0 25px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border: 1px solid var(--chrome-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  color: var(--ink-soft);
  font-size: var(--text-small);
}
.returning-account a { color: var(--route); font-weight: 850; text-decoration: none; }
.returning-account a:hover { text-decoration: underline; }
.returning-account a:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.setup-next-button { margin-top: 22px; }
.setup-next-button:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.setup-back-button { min-height: 42px; margin: 16px auto 0; display: block; border: 0; background: transparent; color: var(--ink-soft); font-size: var(--text-small); font-weight: 700; cursor: pointer; }
.setup-back-button:hover { color: var(--route); }

.setup-weight-plan {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--effort);
  border-radius: var(--radius-small);
  background: var(--panel-muted);
}
.setup-weight-plan > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.setup-weight-plan h3 { margin: 0; font-size: 18px; }
.setup-weight-plan p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.setup-weight-plan .field-grid { margin-top: 15px; }
.weight-pace-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.weight-pace-options label { min-height: 58px; padding: 9px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); text-align: center; cursor: pointer; }
.weight-pace-options label:has(input:checked) { border-color: var(--route); background: var(--route-soft); color: var(--ink); }
.weight-pace-options input, .weekly-weigh-in input[type="radio"], .weekly-weigh-setting input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.weight-pace-options b, .weight-pace-options small { display: block; }
.weight-pace-options b { color: var(--ink); font-size: var(--text-small); }
.weight-pace-options small { margin-top: 3px; font-size: var(--text-small); }
.target-date-control { margin-top: 10px; }
.weekly-weigh-in { margin-top: 13px; padding-top: 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) 116px; align-items: end; gap: 10px; border-top: 1px solid var(--line); }
.weekly-weigh-in > span { align-self: center; color: var(--ink); font-size: var(--text-small); font-weight: 750; }
.weekly-weigh-in > div { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.weekly-weigh-in > div label, .weekly-weigh-setting .settings-choice label { min-height: 42px; padding: 9px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); cursor: pointer; }
.weekly-weigh-in > div label:has(input:checked), .weekly-weigh-setting .settings-choice label:has(input:checked) { border-color: var(--route); background: var(--route-soft); color: var(--route); }
.weekly-weigh-in b, .weekly-weigh-setting b { font-size: var(--text-small); }
.weight-guidance { margin-top: 12px !important; }

.device-setup-screen { min-height: 100vh; padding: 24px; display: grid; place-content: center; background: radial-gradient(circle at 76% 18%, color-mix(in srgb, var(--route) 22%, transparent), transparent 25rem), var(--chrome); }
.device-setup-card { width: min(590px, calc(100vw - 32px)); padding: clamp(24px, 5vw, 48px); border: 1px solid var(--chrome-line); border-radius: 28px; background: var(--panel); box-shadow: 0 35px 100px rgba(0,0,0,.32); }
.device-choice { margin: 22px 0 16px; padding: 14px; display: grid; grid-template-columns: 66px minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--route); border-radius: 18px; background: var(--route-soft); }
.device-choice img { width: 66px; border-radius: 15px; }
.device-choice b, .device-choice small { display: block; }
.device-choice b { color: var(--ink); font-size: 15px; }
.device-choice small { margin-top: 3px; color: var(--ink-soft); font-size: var(--text-small); }
.device-choice i { color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-style: normal; text-transform: uppercase; }
.device-connect-button { display: grid; place-content: center; text-decoration: none; }

.automatic-sync-status { color: var(--recovery); font-size: var(--text-small); font-weight: 750; }
.garmin-actions { width: 100%; justify-content: space-between; }
.garmin-actions .danger { margin: 0; margin-inline-start: auto; min-height: 42px; padding: 0 16px; border-color: color-mix(in srgb, var(--effort) 38%, var(--line)); color: var(--effort); }

.weekly-weigh-setting { padding: 14px; display: grid; grid-template-columns: auto minmax(220px, 1fr) 130px; align-items: end; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel-muted); }
.weekly-weigh-setting > span { align-self: center; color: var(--ink); font-size: var(--text-small); font-weight: 750; }
.weekly-weigh-setting .settings-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.weigh-in-schedule { margin: -6px 0 18px; padding: 12px; display: grid; gap: 4px; border-inline-start: 3px solid var(--sun); background: var(--surface-decision); }
.weigh-in-schedule > span { color: var(--ink-soft); font-size: var(--text-small); }
.weigh-in-schedule strong { font-size: 14px; }

.update-dock {
  position: fixed;
  z-index: 32;
  right: 22px;
  bottom: 22px;
  width: min(620px, calc(100vw - 260px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: 0 20px 60px color-mix(in srgb, var(--chrome) 25%, transparent);
  backdrop-filter: blur(24px) saturate(1.25);
}
#daily-update-form { display: grid; grid-template-columns: minmax(0, 1fr) 46px 42px; gap: 6px; align-items: end; }
#daily-update-text { min-height: 46px; max-height: 104px; padding: 12px 14px; resize: none; border: 0; border-radius: 17px; background: transparent; font-size: 14px; }
#daily-update-text:focus { background: var(--input); box-shadow: inset 0 0 0 1px var(--route); }
.update-dock .daily-update-record { width: 46px; height: 46px; flex-basis: 46px; box-shadow: none; }
.update-dock-submit { width: 42px; height: 46px; border: 0; border-radius: 16px; background: var(--route); color: white; font-size: 21px; font-weight: 800; cursor: pointer; }
.update-dock-submit:hover { background: color-mix(in srgb, var(--route) 84%, var(--ink)); }
.update-dock .daily-update-status { grid-column: 1 / -1; padding-inline: 12px; font-size: var(--text-small); }
html[dir="rtl"] .update-dock { right: auto; left: 22px; }

@media (max-width: 780px) {
  .auth-intro { min-height: 235px; padding: 92px 24px 28px; justify-content: flex-end; }
  .auth-intro h1 { max-width: 430px; margin: 0; font-size: 40px; line-height: .95; }
  .auth-intro .eyebrow, .auth-copy { display: none; }
  .setup-card { padding: 24px 18px 48px; }
  .setup-route { margin-bottom: 18px; }
  .form-heading { padding-bottom: 15px; }
  .form-heading h2 { font-size: 31px; }
  .form-heading p { margin-top: 6px; font-size: var(--text-body); }
  .setup-goal-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 15px; }
  .setup-goal-picker label { min-height: 76px; padding: 11px 9px 10px 43px; }
  .setup-goal-picker label > span { inset-inline-start: 10px; width: 25px; height: 25px; }
  .setup-goal-picker label > b { font-size: var(--text-small); }
  .setup-goal-picker label > small { font-size: var(--text-small); }
  html[dir="rtl"] .setup-goal-picker label { padding: 11px 43px 10px 9px; }
  .setup-weight-plan { padding: 14px; }
  .setup-weight-plan > div:first-child { display: block; }
  .setup-weight-plan > div:first-child p { margin-top: 4px; }
  .weekly-weigh-in { grid-template-columns: 1fr 110px; }
  .weekly-weigh-in > span { grid-column: 1 / -1; }
  .device-setup-screen { padding: 16px; }
  .device-setup-card { padding: 24px 18px; }
  .device-choice { grid-template-columns: 58px minmax(0, 1fr); }
  .device-choice img { width: 58px; }
  .device-choice i { display: none; }
  .weekly-weigh-setting { grid-template-columns: 1fr 110px; }
  .weekly-weigh-setting > span { grid-column: 1 / -1; }

  main { padding-bottom: 198px; }
  .update-dock { right: 12px; bottom: calc(env(safe-area-inset-bottom) + 88px); left: 12px; width: auto; border-radius: 20px; }
  html[dir="rtl"] .update-dock { right: 12px; left: 12px; }
  #daily-update-form { grid-template-columns: minmax(0, 1fr) 44px 40px; }
  #daily-update-text { min-height: 44px; padding: 11px 12px; font-size: 15px; }
  .update-dock .daily-update-record { width: 44px; height: 44px; }
  .update-dock-submit { width: 40px; height: 44px; }

  .fuel-number-block { min-height: 220px; padding: 27px 22px 43px; }
  .fuel-number-block::before { width: 245px; left: -5px; }
  .fuel-number-block::after { top: 15%; left: 202px; }
  .hero-number { margin: 17px 0 25px; }
  .hero-number strong { font-size: clamp(74px, 23vw, 96px); }
  .calorie-equation { font-size: var(--text-small); }
  .calorie-equation b { font-size: var(--text-small); }
  .fuel-meter { right: 22px; left: 22px; bottom: 20px; }
  .macro-panel { padding: 15px 22px 18px; }
  .macro-row { padding: 10px 0; }
  .macro-row span { font-size: var(--text-small); }
  .macro-row b { font-size: var(--text-small); }
  .text-button { min-height: 36px; margin-top: 10px; font-size: var(--text-small); }
  .toast { bottom: 174px; }
}

@media (max-width: 440px) {
  .setup-goal-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weight-pace-options { gap: 5px; }
  .weight-pace-options label { padding-inline: 4px; }
}

@media (min-width: 781px) and (max-height: 820px) {
  .auth-intro { padding-block: 42px; }
  .auth-intro h1 { font-size: clamp(46px, 4.7vw, 64px); margin-bottom: 16px; }
  .auth-copy { font-size: 14px; line-height: 1.5; }
}

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .wordmark, html[dir="rtl"] .hero-number strong, html[dir="rtl"] .calorie-equation, html[dir="rtl"] .weight-readout strong { direction: ltr; }
html[dir="rtl"] .side-rail { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .content-shell { margin-left: 0; margin-right: 230px; }
html[dir="rtl"] .nav-item { text-align: right; }
html[dir="rtl"] .nav-item.active::before { left: auto; right: -26px; }
html[dir="rtl"] .coach-strip { border-left-width: 1px; border-right: 6px solid var(--route); }
html[dir="rtl"] .coach-strip.caution { border-right-color: var(--effort); }
html[dir="rtl"] .coach-strip.fuel { border-right-color: var(--sun); }
html[dir="rtl"] .fuel-line::before { left: auto; right: 79px; }
html[dir="rtl"] .route-node { left: auto; right: 72px; }
html[dir="rtl"] .auth-intro .wordmark { left: auto; right: clamp(40px, 7vw, 110px); }
html[dir="rtl"] .google-signin-button { border-left-width: 1px; border-right: 5px solid var(--route); }
html[dir="rtl"] .google-signin-button > span:last-child { transform: rotate(180deg); }
html[dir="rtl"] .primary-button { box-shadow: -5px 5px 0 var(--route); }
html[dir="rtl"] .primary-button:hover { box-shadow: -7px 7px 0 var(--route); }
html[dir="rtl"] .auto-calorie-field { border-right: 4px solid var(--recovery); border-left-width: 1px; }
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="number"], html[dir="rtl"] input[type="date"] { direction: ltr; text-align: right; }
html[dir="rtl"] .garmin-import-note { padding: 18px 64px 18px 18px; }
html[dir="rtl"] .garmin-import-note > span { left: auto; right: 18px; }
html[dir="rtl"] .plan-step { border-right: 0; border-left: 1px solid var(--line); }
html[dir="rtl"] .plan-step:last-child { border-left: 0; }
html[dir="rtl"] .voice-composer textarea { padding: 17px 17px 17px 82px; }
html[dir="rtl"] .meal-review-item { border-right: 4px solid var(--recovery); border-left-width: 1px; }
html[dir="rtl"] .meal-review-item.needs-decision { border-right-color: var(--sun); }
html[dir="rtl"] .food-choice.selected { box-shadow: inset -3px 0 0 var(--route); }
html[dir="rtl"] .toast { right: auto; left: 24px; border-left: 0; border-right: 4px solid var(--route); }
html[dir="rtl"] .toast.error { border-right-color: var(--effort); }
html[dir="rtl"] .row-cue { transform: rotate(180deg); }

@media (max-width: 1120px) {
  html[dir="rtl"] .content-shell { margin-right: 190px; }
  html[dir="rtl"] .nav-item.active::before { right: -20px; }
  html[dir="rtl"] .plan-step:nth-child(2) { border-left: 0; }
}

@media (max-width: 780px) {
  html[dir="rtl"] .content-shell { margin-right: 0; }
  html[dir="rtl"] .fuel-line::before { right: 65px; }
  html[dir="rtl"] .route-node { right: 58px; }
  html[dir="rtl"] .toast { right: 14px; left: 14px; }
  html[dir="rtl"] .plan-step { border-left: 0; }
  html[dir="rtl"] .auth-intro .wordmark { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Premium race-control redesign ------------------------------------------------ */
:root {
  --paper: #eef2f0;
  --paper-deep: #e2e8e5;
  --panel: #fbfdfc;
  --panel-muted: #f3f6f5;
  --input: #f8fbf9;
  --inverse: #07151f;
  --inverse-soft: #102630;
  --on-inverse: #f8fbfa;
  --ink: #0d1d25;
  --ink-soft: #667570;
  --line: rgba(13, 29, 37, .12);
  --line-strong: rgba(13, 29, 37, .2);
  --route: #2f78ff;
  --route-soft: #e0eaff;
  /* The darker route, for inline links and labels on a route-soft fill (FS-078). */
  --route-ink: #1f5fd0;
  /* Motion, shared by every animated surface so the app has one voice (FS-078). */
  --motion-fast: 160ms;
  --motion-page: 240ms;
  --motion-sheet-in: 260ms;
  --motion-sheet-out: 180ms;
  --motion-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --motion-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --effort: #e55567;
  --effort-soft: #fde6e9;
  --recovery: #58bd9b;
  --sun: #efb943;
  /* The same three tones lifted for use on the dark card, where the mid-weight
     versions above go muddy against --inverse (FS-078). */
  --effort-light: #ff8e9c;
  --recovery-light: #7fe0bf;
  /* The amber pair. --sun-ink was already referenced by two rules further down
     this file and had never been defined, so those were resolving to nothing. */
  --sun-ink: #8a6a15;
  --sun-soft: #f7ecd5;
  --recovery-soft: #dff0e9;
  --chrome: #071016;
  --chrome-soft: #0d1d26;
  --chrome-line: rgba(230, 241, 238, .12);
  --glass-on-dark: rgba(18, 40, 51, .72);
  --glass-light: rgba(251, 253, 252, .78);
  --surface-capture: #0a1821;
  --surface-review: #f4f7f6;
  --surface-decision: #fff8df;
  --surface-resolved: #e8f6f1;
  --focus-ring: rgba(47, 120, 255, .34);
  --shadow: 0 28px 80px rgba(7, 21, 31, .13);
  --shadow-soft: 0 14px 36px rgba(7, 21, 31, .07);
  --radius: 24px;
  --radius-small: 14px;
  --control-radius: 12px;
  --display: "Avenir Next", Avenir, "SF Pro Display", "Segoe UI", sans-serif;
  --number: "DIN Alternate", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", Avenir, "SF Pro Text", "Segoe UI", sans-serif;
}

html[lang="he"] {
  --display: "Assistant", "Arial", sans-serif;
  --body: "Assistant", "Arial", sans-serif;
  --utility: "Assistant", "Arial", sans-serif;
  font-variant-numeric: tabular-nums;
}
html[lang="he"] :is(h1, h2, h3) { letter-spacing: -.015em; }

html { background: var(--paper); }
body {
  background:
    radial-gradient(circle at 88% 4%, color-mix(in srgb, var(--route) 8%, transparent), transparent 25rem),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 35%, transparent), transparent 42rem),
    var(--paper);
  background-size: auto;
}
h1, h2, h3 { letter-spacing: -.04em; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.boot-screen {
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--route) 16%, transparent), transparent 16rem),
    var(--chrome);
}
.boot-mark { position: relative; align-items: center; width: 70px; height: 70px; margin: auto; }
.boot-mark::before, .boot-mark::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--chrome-line); border-radius: 50%; }
.boot-mark::after { inset: 9px; border-color: color-mix(in srgb, var(--route) 58%, transparent); }
.boot-mark span { z-index: 1; width: 4px; border-radius: 5px; }
.boot-screen p { color: color-mix(in srgb, var(--on-inverse) 62%, transparent); letter-spacing: .18em; }

.wordmark { position: relative; gap: var(--space-2); font-size: 20px; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.wordmark img { display: block; flex: 0 0 36px; width: 36px; height: 36px; border-radius: var(--control-radius); }
.wordmark i { color: var(--sun); }
.wordmark-light { font-size: 20px; }
html[dir="rtl"] .auth-intro .wordmark { right: clamp(40px, 7vw, 104px); left: auto; }

.auth-screen { background: var(--paper); }
.auth-intro {
  padding: clamp(40px, 7vw, 104px);
  background:
    radial-gradient(circle at 76% 18%, color-mix(in srgb, var(--route) 24%, transparent), transparent 20rem),
    linear-gradient(148deg, var(--chrome) 0%, var(--inverse-soft) 100%);
}
.auth-intro::before {
  width: clamp(350px, 42vw, 620px);
  height: clamp(350px, 42vw, 620px);
  top: clamp(-160px, -8vw, -70px);
  right: clamp(-260px, -13vw, -120px);
  border: 1px solid var(--chrome-line);
  box-shadow: inset 0 0 0 34px color-mix(in srgb, var(--recovery) 4%, transparent), inset 0 0 0 35px var(--chrome-line), inset 0 0 0 78px color-mix(in srgb, var(--route) 3%, transparent), inset 0 0 0 79px var(--chrome-line);
}
.auth-intro::after { content: ""; position: absolute; width: 8px; height: 8px; top: 25%; right: 17%; border-radius: 50%; background: var(--sun); box-shadow: 0 0 26px color-mix(in srgb, var(--sun) 70%, transparent); }
.auth-intro h1 { position: relative; z-index: 1; max-width: 680px; margin-bottom: 0; font-size: clamp(48px, 6vw, 82px); font-weight: 650; line-height: .96; letter-spacing: -.065em; }
.setup-card { width: min(700px, 100%); padding: clamp(32px, 6vw, 80px); }
.form-heading { padding-bottom: 22px; }
.form-heading h2 { font-size: 40px; font-weight: 650; }
fieldset { margin-block: 32px; }
label { gap: 9px; font-size: var(--text-small); letter-spacing: .01em; }
input, select {
  min-height: 52px;
  padding: 13px 15px;
  border-color: var(--line);
  border-radius: var(--control-radius);
  background: var(--input);
}
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: var(--route); box-shadow: 0 0 0 4px var(--focus-ring); }

.primary-button {
  min-height: 50px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--route);
  font-family: var(--body);
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--route) 28%, transparent);
}
.primary-button:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--route) 88%, var(--ink)); box-shadow: 0 15px 32px color-mix(in srgb, var(--route) 34%, transparent); }
html[dir="rtl"] .primary-button, html[dir="rtl"] .primary-button:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--route) 28%, transparent); }
.google-signin-button {
  border-color: var(--line);
  border-inline-start: 4px solid var(--route);
  border-radius: var(--radius-small);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.google-signin-button:hover { border-color: var(--route); box-shadow: var(--shadow); }

.side-rail {
  width: 216px;
  padding: 27px 18px 22px;
  border: 0;
  border-inline-end: 1px solid var(--chrome-line);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--route) 12%, transparent), transparent 17rem),
    var(--chrome);
  color: var(--on-inverse);
  backdrop-filter: none;
}
.side-rail::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--route), var(--recovery), var(--sun)); }
.side-rail .wordmark { padding: 10px 10px 40px; color: var(--on-inverse); }
.desktop-nav { gap: 8px; }
.nav-item {
  min-height: 50px;
  gap: 13px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  color: color-mix(in srgb, var(--on-inverse) 54%, transparent);
  font-size: var(--text-small);
  font-weight: 650;
}
.nav-item:hover { color: var(--on-inverse); background: color-mix(in srgb, var(--on-inverse) 5%, transparent); }
.nav-item.active { border-color: var(--chrome-line); background: color-mix(in srgb, var(--on-inverse) 8%, transparent); color: var(--on-inverse); box-shadow: inset 0 1px color-mix(in srgb, var(--on-inverse) 7%, transparent); }
.nav-item.active::before { left: -18px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--route); box-shadow: 0 0 18px var(--route); }
.nav-icon { width: 25px; height: 25px; display: grid; place-content: center; color: inherit; }
.nav-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { color: var(--route); }
.rail-status { padding: 18px 11px 4px; border-color: var(--chrome-line); }
.rail-status strong { color: var(--on-inverse); }
.rail-status small { color: color-mix(in srgb, var(--on-inverse) 44%, transparent); }

.content-shell { margin-left: 216px; }
.topbar {
  min-height: 88px;
  padding: 18px clamp(24px, 4.5vw, 68px);
  border-color: var(--line);
  background: var(--glass-light);
  backdrop-filter: blur(24px) saturate(1.25);
}
.topbar h1 { font-size: 29px; font-weight: 650; letter-spacing: -.045em; }
.topbar .eyebrow { margin-bottom: 3px; color: var(--ink-soft); font-size: var(--text-small); letter-spacing: .16em; }
.top-actions { gap: 8px; }
.quiet-button {
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--ink) 5%, transparent);
}
.quiet-button { min-height: 42px; padding: 10px 15px; border-radius: 999px; }
.quiet-button:hover { border-color: var(--line-strong); background: var(--panel); transform: translateY(-1px); }
.avatar-button { width: 42px; height: 42px; background: linear-gradient(145deg, var(--effort), color-mix(in srgb, var(--effort) 72%, var(--route))); box-shadow: 0 8px 20px color-mix(in srgb, var(--effort) 24%, transparent); }

main { padding: 34px clamp(20px, 4.5vw, 68px) 100px; }
.view { max-width: 1420px; animation-duration: .55s; }
.fuel-hero {
  min-height: 390px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  border: 1px solid var(--chrome-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--route) 14%, transparent), transparent 26rem),
    linear-gradient(132deg, var(--chrome) 0%, var(--inverse-soft) 100%);
  box-shadow: 0 30px 80px color-mix(in srgb, var(--chrome) 24%, transparent);
}
.fuel-hero::after { width: 360px; height: 360px; left: auto; right: 29%; bottom: -255px; border: 1px solid color-mix(in srgb, var(--route) 38%, transparent); box-shadow: 0 0 0 28px color-mix(in srgb, var(--route) 4%, transparent), 0 0 0 29px var(--chrome-line), 0 0 0 70px color-mix(in srgb, var(--recovery) 3%, transparent), 0 0 0 71px var(--chrome-line); }
.fuel-number-block { position: relative; min-width: 0; padding: clamp(46px, 5vw, 74px); overflow: hidden; }
.fuel-number-block::before {
  content: "";
  position: absolute;
  width: clamp(300px, 33vw, 470px);
  aspect-ratio: 1;
  top: 50%;
  left: clamp(10px, 4vw, 62px);
  border: 1px solid var(--chrome-line);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 26px color-mix(in srgb, var(--route) 3%, transparent), inset 0 0 0 27px var(--chrome-line), inset 0 0 80px color-mix(in srgb, var(--route) 6%, transparent);
}
.fuel-number-block::after { content: ""; position: absolute; top: 18%; left: clamp(240px, 29vw, 430px); width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 24px var(--sun); }
.fuel-number-block > * { position: relative; z-index: 1; }
.hero-number { gap: 20px; margin: 24px 0 42px; }
.hero-number strong { font-family: var(--number); font-size: clamp(100px, 11.5vw, 168px); font-weight: 700; line-height: .72; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.hero-number span { padding-bottom: 1px; color: color-mix(in srgb, var(--on-inverse) 56%, transparent); font-size: var(--text-small); letter-spacing: .1em; }
.calorie-equation { gap: 15px; color: color-mix(in srgb, var(--on-inverse) 52%, transparent); font-size: var(--text-small); letter-spacing: .06em; }
.calorie-equation b { color: var(--on-inverse); font-size: var(--text-small); }
.calorie-equation i { color: var(--route); }
.fuel-meter { right: 34px; left: 34px; bottom: 28px; height: 3px; overflow: visible; border-radius: 99px; background: var(--chrome-line); }
.fuel-meter span { position: relative; border-radius: inherit; background: linear-gradient(90deg, var(--route), var(--recovery)); box-shadow: 0 0 20px color-mix(in srgb, var(--route) 44%, transparent); }
.fuel-meter span::after { content: ""; position: absolute; top: 50%; right: -4px; width: 9px; height: 9px; border: 2px solid var(--on-inverse); border-radius: 50%; background: var(--route); transform: translateY(-50%); }
.macro-panel {
  position: relative;
  z-index: 1;
  padding: clamp(38px, 4vw, 58px);
  border-inline-start: 1px solid var(--chrome-line);
  background: var(--glass-on-dark);
  color: var(--on-inverse);
  backdrop-filter: blur(18px);
}
.macro-row { padding: 22px 0; border-color: var(--chrome-line); }
.macro-row span { font-size: 14px; font-weight: 600; }
.macro-row b { color: color-mix(in srgb, var(--on-inverse) 75%, transparent); font-size: var(--text-small); }
.macro-row div { height: 3px; border-radius: 99px; background: var(--chrome-line); }
.macro-row em { border-radius: inherit; box-shadow: 0 0 12px color-mix(in srgb, var(--route) 36%, transparent); }
.text-button { min-height: 42px; margin-top: 26px; padding: 0 18px; border: 1px solid var(--chrome-line); border-radius: 999px; color: var(--on-inverse); }
.text-button:hover { background: color-mix(in srgb, var(--on-inverse) 7%, transparent); }

.dashboard-grid { gap: 22px; margin-top: 22px; }
.field-sheet, .settings-preferences, .account-card, .integration-card, .connection-catalog {
  border-color: var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow-soft);
}
.field-sheet { padding: clamp(24px, 3vw, 36px); }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { font-size: 28px; font-weight: 650; }
.icon-button { width: 38px; height: 38px; background: var(--route-soft); }
.icon-button:hover { transform: translate(2px, -2px); }
.coach-strip { margin: -6px 0 28px; border-color: var(--line); border-inline-start-width: 3px; border-radius: var(--radius-small); background: var(--panel-muted); overflow: hidden; }
.coach-strip summary { min-height: 64px; padding: 11px 15px; }
.coach-mark { background: var(--route-soft); }
.fuel-line::before { width: 1px; background: repeating-linear-gradient(to bottom, var(--route) 0 5px, transparent 5px 12px); }
.fuel-stop { min-height: 118px; transition: background .25s, transform .25s; }
.fuel-stop:hover, .fuel-stop:focus-visible { background: color-mix(in srgb, var(--route-soft) 45%, transparent); transform: translateX(3px); }
.route-node { border-color: var(--panel); box-shadow: 0 0 0 1px var(--route), 0 0 16px color-mix(in srgb, var(--route) 30%, transparent); }
.fuel-stop h3 { font-size: 21px; font-weight: 650; }
.stop-summary { color: var(--ink-soft); }
.mini-metrics span { border-radius: 999px; background: var(--paper-deep); }
.context-panel { border: 0; border-inline-start: 3px solid var(--route); border-radius: var(--radius-small); background: var(--route-soft); }
.weight-readout strong { font-family: var(--number); font-size: 72px; font-variant-numeric: tabular-nums; }
.mini-chart { margin-top: 26px; }
.trajectory-progress { border-radius: 99px; overflow: hidden; }

.tomorrow-plan { position: relative; margin-top: 22px; border-top: 0; overflow: hidden; }
.tomorrow-plan::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--sun), color-mix(in srgb, var(--sun) 16%, transparent)); }
.tomorrow-plan-head h2 { font-size: 31px; font-weight: 650; }
.run-time-control input { border-color: color-mix(in srgb, var(--sun) 50%, var(--line)); border-radius: var(--radius-small); background: var(--surface-decision); }
.tomorrow-meal-timeline { border-color: var(--line); border-radius: var(--radius-small); overflow: hidden; }
.plan-step { border-color: var(--line); }
.timing-best { border-radius: 999px; }

.page-title { border-color: var(--line); }
.compact-page-title h2 { font-size: clamp(34px, 4vw, 48px); font-weight: 650; }
.food-layout, .training-layout, .progress-layout, .settings-layout { gap: 22px; }
.entry-mode-switch { padding: 5px; border: 0; border-radius: 999px; background: var(--paper-deep); }
.entry-mode-switch button { border-radius: 999px; }
.entry-mode-switch button.active { background: var(--panel); box-shadow: 0 5px 16px color-mix(in srgb, var(--ink) 8%, transparent); }
.entry-panel {
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-muted);
  color: var(--ink);
}
.ai-entry-panel { background: var(--panel-muted); color: var(--ink); }
.ai-entry-panel label { color: var(--ink-soft); }
.meal-description-label { color: var(--ink) !important; }
.meal-flow li { border-color: var(--line); color: var(--ink-soft); }
.meal-flow li.current { color: var(--ink); }
.voice-composer textarea { border-color: var(--line); background: var(--input); color: var(--ink); }
.voice-composer textarea::placeholder { color: var(--ink-soft); }
.voice-button { border-color: var(--line); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-soft); }
.voice-status { color: var(--recovery); }
.ai-meal-preview { border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); color: var(--ink); }
.manual-entry-panel .catalog-search input, .manual-entry-panel .catalog-results, .manual-entry-panel .catalog-result { background: var(--input); }
.ai-action-row .primary-button { box-shadow: 0 10px 24px color-mix(in srgb, var(--sun) 20%, transparent); }
.smart-picks, .portion-presets { border-color: var(--line); border-radius: var(--radius-small); background: var(--panel-muted); }
.meal-tabs { gap: 6px; }
.meal-tabs button { border-radius: 10px; }
.shortcut-button, .meal-bucket, .meal-review-item, .food-choice, .portion-choice-list button, .portion-presets button { border-radius: var(--control-radius); }
.shortcut-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.catalog-results { border-radius: var(--radius-small); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.meal-bucket > header { border-radius: var(--control-radius) var(--control-radius) 0 0; }
.workout-kind, .status-pill { border-radius: 999px; }
.workout-item, .activity-item { padding-block: 19px; }
.auto-calorie-field { min-height: 102px; border: 1px solid color-mix(in srgb, var(--recovery) 40%, var(--line)); border-inline-start: 4px solid var(--recovery); border-radius: var(--radius-small); background: var(--surface-resolved); }
.auto-calorie-details[open] { border-color: var(--line); border-radius: var(--control-radius); background: var(--panel); }
.settings-preferences, .account-card, .integration-card, .connection-catalog { padding: 24px; }
.connection-list button { border-color: var(--line); border-radius: var(--control-radius); background: var(--panel-muted); }
.toast { right: 22px; bottom: 22px; padding: 15px 18px; border: 1px solid var(--chrome-line); border-inline-start: 3px solid var(--route); border-radius: var(--radius-small); background: var(--chrome); box-shadow: var(--shadow); }

html[dir="rtl"] .side-rail { border-left: 1px solid var(--chrome-line); }
html[dir="rtl"] .content-shell { margin-right: 216px; }
html[dir="rtl"] .nav-item.active::before { right: -18px; border-radius: 4px 0 0 4px; }
html[dir="rtl"] .fuel-stop:hover, html[dir="rtl"] .fuel-stop:focus-visible { transform: translateX(-3px); }
html[dir="rtl"] .coach-strip { border-left-width: 1px; border-right-width: 3px; }
html[dir="rtl"] .auto-calorie-field { border-right-width: 4px; }

@media (max-width: 1120px) {
  .side-rail { width: 184px; padding-inline: 14px; }
  .content-shell { margin-left: 184px; }
  .nav-item.active::before { left: -14px; }
  html[dir="rtl"] .content-shell { margin-right: 184px; }
  html[dir="rtl"] .nav-item.active::before { right: -14px; }
  .fuel-hero { grid-template-columns: 1.05fr .95fr; }
  .daily-update-card { grid-template-columns: 1fr; }
  .daily-update-heading { display: flex; align-items: baseline; gap: 12px; }
  .daily-update-heading .section-kicker { margin: 0; }
  .daily-update-summary { grid-column: 1; }
}

@media (max-width: 780px) {
  body { background: var(--paper); }
  .auth-intro { min-height: 480px; padding: 112px 24px 48px; }
  .auth-intro .wordmark { right: auto; left: 24px; }
  html[dir="rtl"] .auth-intro .wordmark { right: 24px; left: auto; }
  .auth-intro h1 { font-size: 52px; }
  .setup-card { padding: 40px 22px 64px; }
  .content-shell, html[dir="rtl"] .content-shell { margin: 0; }
  .topbar { min-height: 76px; padding: 13px 17px; }
  .topbar h1 { font-size: 23px; }
  main { padding: 18px 14px 118px; }
  .fuel-hero { min-height: 0; grid-template-columns: 1fr; border-radius: 24px; }
  .fuel-hero::after { right: -130px; bottom: -250px; }
  .fuel-number-block { min-height: 322px; padding: 42px 25px 54px; }
  .fuel-number-block::before { width: 315px; left: -18px; }
  .fuel-number-block::after { left: 252px; }
  .hero-number { align-items: flex-end; flex-direction: row; gap: 13px; margin: 25px 0 38px; }
  .hero-number strong { font-size: clamp(92px, 27vw, 116px); }
  .hero-number span { display: block; padding-bottom: 0; font-size: var(--text-small); }
  .calorie-equation { gap: 10px; font-size: var(--text-small); }
  .calorie-equation b { font-size: var(--text-small); }
  .fuel-meter { right: 25px; left: 25px; bottom: 30px; }
  .macro-panel { padding: 27px 25px 31px; border-inline-start: 0; border-top: 1px solid var(--chrome-line); }
  .macro-row { padding: 18px 0; }
  .macro-row span { font-size: 15px; }
  .macro-row b { font-size: var(--text-small); }
  .text-button { margin-top: 23px; font-size: 14px; }
  .dashboard-grid { margin-top: 16px; }
  .daily-update-card { grid-template-columns: 1fr; gap: 15px; margin-top: 16px; padding: 19px 17px; border-radius: 20px; }
  .daily-update-heading h2 { font-size: 26px; }
  #daily-update-form { grid-template-columns: 1fr; }
  #daily-update-text { min-height: 94px; font-size: 16px; }
  .daily-update-heading { display: block; }
  .daily-update-heading .section-kicker { margin-bottom: 5px; }
  .daily-update-actions { display: grid; grid-template-columns: 60px 1fr; }
  .daily-update-summary { grid-column: 1; }
  .daily-update-status { font-size: var(--text-small); }
  .field-sheet { padding: 23px 18px; border-radius: 20px; }
  .section-heading { margin-bottom: 23px; }
  .section-heading h2 { font-size: 26px; }
  .coach-strip summary strong { font-size: 15px; }
  .fuel-stop:hover, .fuel-stop:focus-visible, html[dir="rtl"] .fuel-stop:hover, html[dir="rtl"] .fuel-stop:focus-visible { transform: none; }
  .tomorrow-plan { margin-top: 16px; }
  .entry-mode-switch { margin-bottom: 18px; }
  .entry-panel { padding: 18px; }
  .compact-page-title h2 { font-size: 36px; }
  .mobile-nav {
    inset: auto 12px calc(env(safe-area-inset-bottom) + 10px);
    min-height: 72px;
    padding: 5px 4px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow: 0 18px 48px color-mix(in srgb, var(--chrome) 22%, transparent);
    backdrop-filter: blur(24px) saturate(1.3);
  }
  .mobile-nav button { min-height: 60px; gap: 2px; border-radius: 17px; font-size: var(--text-small); }
  .mobile-nav button.active { background: var(--route-soft); color: var(--route); }
  .mobile-nav-icon, .mobile-nav-icon svg { width: 25px; height: 25px; }
  .toast { right: 14px; bottom: 102px; left: 14px; }
}

@media (max-width: 440px) {
  .hero-number strong { font-size: 88px; }
  .hero-number span { font-size: var(--text-small); }
  .fuel-number-block::before { width: 290px; }
  .fuel-number-block::after { left: 224px; }
  .calorie-equation { justify-content: space-between; gap: 5px; }
  .calorie-equation i { margin-inline: 1px; }
  .settings-preference-row { padding-block: 12px; grid-template-columns: 1fr; gap: 8px; }
  .settings-choice { width: 100%; }
  .settings-choice button { flex: 1; }
  .entry-mode-row { grid-template-columns: minmax(0, 1fr) 78px; }
  .entry-mode-switch button { padding-inline: 7px; font-size: var(--text-small); }
  .barcode-scan-button { min-width: 0; padding-inline: 8px; }
  .barcode-panel { padding: 17px; }
  .barcode-camera { min-height: 360px; }
}

/* Action-first recommendations ------------------------------------------------- */
.preference-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-muted);
  overflow: hidden;
}
.care-mode-setting {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-muted);
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease;
}
.care-mode-setting.enabled { border-color: color-mix(in srgb, var(--recovery) 70%, var(--line)); background: var(--surface-resolved); }
.care-mode-control {
  min-height: 68px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.care-mode-control > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.care-mode-control:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
.care-mode-icon { width: 34px; height: 34px; padding: 7px; border-radius: 50%; fill: none; stroke: var(--ink-soft); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; background: var(--paper-deep); }
.care-mode-setting.enabled .care-mode-icon { stroke: var(--ink); background: var(--recovery); }
.care-mode-control b, .care-mode-control small { display: block; }
.care-mode-control b { margin-bottom: 3px; color: var(--ink); font-size: var(--text-small); }
.care-mode-control small { color: var(--ink-soft); font-size: var(--text-small); }
.care-mode-switch { width: 42px; height: 24px; padding: 3px; border-radius: 999px; background: var(--paper-deep); transition: background .2s ease; }
.care-mode-switch em { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); box-shadow: 0 2px 7px color-mix(in srgb, var(--ink) 18%, transparent); transition: transform .2s ease; }
.care-mode-setting.enabled .care-mode-switch { background: var(--recovery); }
.care-mode-setting.enabled .care-mode-switch em { transform: translateX(18px); }
html[dir="rtl"] .care-mode-setting.enabled .care-mode-switch em { transform: translateX(-18px); }
.care-mode-detail { display: none; padding: 0 15px 13px 65px; }
.care-mode-setting.enabled .care-mode-detail { display: block; }
.care-mode-detail summary { width: fit-content; color: var(--route); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
.care-mode-detail p { margin: 8px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
html[dir="rtl"] .care-mode-detail { padding-right: 65px; padding-left: 15px; }
.secondary-goal-settings { border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel-muted); overflow: hidden; }
.secondary-goal-heading { min-height: 68px; padding: 14px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.secondary-goal-heading span { display: block; color: var(--ink); font-size: var(--text-small); font-weight: 780; }
.secondary-goal-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.4; }
.secondary-goal-heading b { padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--route) 35%, var(--line)); border-radius: 999px; background: var(--route-soft); color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; white-space: nowrap; text-transform: uppercase; }
.secondary-goal-body { padding: 15px; border-top: 1px solid var(--line); }
.secondary-goal-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 15px; }
.secondary-goal-options label { min-height: 42px; padding: 9px 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); color: var(--ink-soft); font-size: var(--text-small); font-weight: 700; cursor: pointer; }
.secondary-goal-options label:has(input:checked) { border-color: var(--route); background: var(--route-soft); color: var(--ink); }
.secondary-goal-options label:has(input:disabled) { display: none; }
.secondary-goal-options input { appearance: auto; width: 16px; min-width: 16px; height: 16px; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; box-shadow: none; accent-color: var(--route); }
.secondary-goal-body > p { margin: 10px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.preference-settings > summary {
  min-height: 58px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.preference-settings > summary::-webkit-details-marker,
.progressive-detail > summary::-webkit-details-marker { display: none; }
.preference-settings > summary span { color: var(--ink); font-size: var(--text-small); font-weight: 750; }
.preference-settings > summary b { color: var(--ink-soft); font-size: var(--text-small); font-weight: 650; }
.preference-settings > summary i { color: var(--route); font-size: 20px; font-style: normal; transition: transform .2s ease; }
.preference-settings[open] > summary i { transform: rotate(90deg); }
.preference-settings > .field-grid { margin: 0; padding: 15px; border-top: 1px solid var(--line); }
.preference-settings > p { margin: -3px 15px 15px; color: var(--ink-soft); font-size: var(--text-body); }

.meal-source,
.meal-options {
  margin: 6px 0 0 !important;
  color: var(--ink-soft);
  font-size: var(--text-small) !important;
  line-height: 1.4 !important;
}
.meal-source { color: var(--recovery); font-weight: 750; }
.meal-options span { color: var(--route); font-weight: 800; }
.progressive-detail { margin-top: 9px; }
.progressive-detail > summary {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--route);
  font-size: var(--text-small);
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.progressive-detail > summary::after { content: "+"; font-family: var(--utility); transition: transform .2s ease; }
.progressive-detail[open] > summary::after { transform: rotate(45deg); }
.progressive-detail > p { margin: 7px 0 0 !important; color: var(--ink-soft); font-size: var(--text-body) !important; line-height: 1.5 !important; }
.smart-picks .progressive-detail > small { display: block; max-width: 580px; margin-top: 5px; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }
.context-panel .progressive-detail > p { max-width: 720px; }
.plan-step > div { min-width: 0; }
.plan-step .progressive-detail { margin-top: 7px; }
.plan-step .progressive-detail > summary { min-height: 26px; font-size: var(--text-small); }
.plan-step.rest-plan { align-items: flex-start; }

@media (max-width: 780px) {
  .preference-settings > summary { min-height: 64px; }
  .meal-source, .meal-options { font-size: var(--text-small) !important; }
  .progressive-detail > summary { min-height: 38px; font-size: var(--text-small); }
  .progressive-detail > p { font-size: var(--text-body) !important; }
  .completed-meal-timing { grid-template-columns: 1fr; }
  .meal-timing.actual { justify-items: start; }
}

/* Goal-led product framing ---------------------------------------------------- */
.goal-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.setup-goal-picker { margin-top: 24px; }
.goal-picker label {
  --goal-color: var(--route);
  position: relative;
  min-height: 94px;
  padding: 15px 15px 14px 54px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel-muted);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.goal-picker label:nth-child(1) { --goal-color: var(--effort); }
.goal-picker label:nth-child(2) { --goal-color: var(--sun); }
.goal-picker label:nth-child(3) { --goal-color: var(--route); }
.goal-picker label:nth-child(4) { --goal-color: var(--recovery); }
.goal-picker label:hover { border-color: var(--goal-color); transform: translateY(-1px); }
.goal-picker label:has(input:checked) {
  border-color: var(--goal-color);
  background: color-mix(in srgb, var(--goal-color) 11%, var(--panel));
  box-shadow: inset 3px 0 0 var(--goal-color);
}
.goal-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.goal-picker label > span {
  position: absolute;
  inset-inline-start: 15px;
  top: 50%;
  width: 27px;
  height: 27px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in srgb, var(--goal-color) 48%, var(--line));
  border-radius: 50%;
  color: var(--goal-color);
  font-family: var(--utility);
  font-size: 14px;
  font-weight: 800;
  transform: translateY(-50%);
}
.goal-picker label > b { font-size: 14px; line-height: 1.2; }
.goal-picker label > small { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.35; }
.goal-settings { margin: 0 0 22px; padding: 0 0 22px; }
.goal-settings legend { margin-bottom: 12px; font-size: 14px; }
.goal-picker-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.goal-picker-settings label { min-height: 72px; padding: 12px 10px 12px 42px; }
.goal-picker-settings label > span { inset-inline-start: 10px; width: 23px; height: 23px; font-size: var(--text-small); }
.goal-picker-settings label > b { font-size: var(--text-small); }
.goal-context {
  margin: 0;
  color: var(--recovery);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

html[dir="rtl"] .goal-picker label { padding: 15px 54px 14px 15px; }
html[dir="rtl"] .goal-picker-settings label { padding: 12px 42px 12px 10px; }

@media (max-width: 1120px) {
  .goal-picker-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .goal-picker { grid-template-columns: 1fr; }
  .goal-picker label { min-height: 78px; }
}

/* Final mobile composition: keep the daily instrument panel within one view. */
@media (max-width: 780px) {
  .auth-intro { min-height: 235px; padding: 92px 24px 28px; justify-content: flex-end; }
  .auth-intro h1 { margin: 0; font-size: 40px; line-height: .95; }
  .auth-intro .eyebrow, .auth-copy { display: none; }
  .setup-card { padding: 24px 18px 48px; }
  .setup-goal-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 15px; }
  .setup-goal-picker label { min-height: 76px; padding: 11px 9px 10px 43px; }
  html[dir="rtl"] .setup-goal-picker label { padding: 11px 43px 10px 9px; }

  main { padding-bottom: 198px; }
  .update-dock { right: 12px; bottom: calc(env(safe-area-inset-bottom) + 88px); left: 12px; width: auto; }
  html[dir="rtl"] .update-dock { right: 12px; left: 12px; }
  #daily-update-form { grid-template-columns: minmax(0, 1fr) 44px 40px; }
  #daily-update-text { min-height: 44px; max-height: 104px; padding: 11px 12px; font-size: 15px; }
  .update-dock .daily-update-record { width: 44px; height: 44px; }
  .update-dock-submit { width: 40px; height: 44px; }

  .fuel-number-block { min-height: 220px; padding: 27px 22px 43px; }
  .fuel-number-block::before { width: 245px; left: -5px; }
  .fuel-number-block::after { top: 15%; left: 202px; }
  .hero-number { align-items: flex-end; flex-direction: row; gap: 11px; margin: 17px 0 25px; }
  .hero-number strong { font-size: clamp(74px, 23vw, 96px); }
  .hero-number span { display: block; font-size: var(--text-small); }
  .calorie-equation { gap: 8px; font-size: var(--text-small); }
  .calorie-equation b { font-size: var(--text-small); }
  .fuel-meter { right: 22px; left: 22px; bottom: 20px; }
  .macro-panel { padding: 15px 22px 18px; }
  .macro-row { padding: 10px 0; }
  .macro-row span { font-size: var(--text-small); }
  .macro-row b { font-size: var(--text-small); }
  .text-button { min-height: 36px; margin-top: 10px; font-size: var(--text-small); }
  .toast { bottom: 174px; }
}

@media (max-width: 440px) {
  .setup-goal-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Premium update composer --------------------------------------------------- */
.update-scrim {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: block;
  border: 0;
  background: rgba(3,12,18,.42);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(2px);
  transition: opacity .24s ease;
}
.update-scrim.is-open { opacity: 1; pointer-events: auto; }
.update-dock {
  width: min(510px, calc(100vw - 260px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel) 96%, var(--route-soft));
  box-shadow: 0 30px 90px color-mix(in srgb, var(--chrome) 30%, transparent), inset 0 1px color-mix(in srgb, white 72%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(.985);
  transform-origin: bottom right;
  transition: opacity .24s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.update-dock.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.update-dock::before {
  content: "";
  position: absolute;
  inset: 0 22% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, #4ea1ff 30%, #d9b66c 70%, transparent);
}
.update-dock-header {
  padding: 18px 18px 13px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.update-dock-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in srgb, var(--route) 34%, var(--line));
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--route-soft) 82%, white), color-mix(in srgb, var(--panel) 88%, var(--route)));
  box-shadow: inset 0 1px color-mix(in srgb, white 80%, transparent), 0 8px 22px color-mix(in srgb, var(--route) 12%, transparent);
}
.update-dock-mark svg { width: 25px; height: 25px; fill: none; stroke: var(--route); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.update-dock-kicker { display: block; margin-bottom: 2px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.update-dock-header h2 { margin: 0; font-size: 23px; font-weight: 680; letter-spacing: -.04em; }
.update-dock-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-muted);
  color: var(--ink-soft);
  cursor: pointer;
}
.update-dock-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.update-dock #daily-update-form { padding: 0 18px 18px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.update-input-label { color: var(--ink-soft); font-size: var(--text-body); font-weight: 680; }
.update-dock #daily-update-text {
  width: 100%;
  min-height: 98px;
  max-height: 180px;
  padding: 15px 16px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel-muted);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 3%, transparent);
}
.update-dock #daily-update-text:focus { border-color: color-mix(in srgb, var(--route) 68%, var(--line)); background: var(--input); box-shadow: 0 0 0 4px var(--focus-ring); }
.update-dock-actions { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 9px; }
.update-dock .daily-update-record,
.update-dock-submit {
  width: auto;
  height: 50px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 15px;
  font-size: var(--text-small);
  font-weight: 760;
  letter-spacing: -.01em;
  cursor: pointer;
}
.update-dock .daily-update-record {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: inset 0 1px color-mix(in srgb, white 70%, transparent), 0 7px 18px color-mix(in srgb, var(--ink) 6%, transparent);
}
.update-dock .daily-update-record .transcription-icon { width: 21px; height: 21px; stroke: var(--route); }
.update-dock .daily-update-record.recording { border-color: color-mix(in srgb, var(--effort) 65%, var(--line)); background: var(--effort-soft); }
.update-dock .daily-update-record.transcribing { border-color: color-mix(in srgb, #d9b66c 62%, var(--line)); background: color-mix(in srgb, #d9b66c 12%, var(--panel)); }
.update-dock-submit {
  border: 1px solid color-mix(in srgb, #4ea1ff 45%, var(--chrome));
  background: linear-gradient(145deg, #123443, #07151f);
  color: #f5fbfc;
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 10px 24px rgba(7,21,31,.22);
}
.update-dock-submit svg { width: 19px; height: 19px; fill: none; stroke: #d9b66c; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.update-dock-submit:hover { background: linear-gradient(145deg, #174457, #091b27); }
.update-dock-submit:hover svg { transform: translateX(2px); }
.update-dock .daily-update-status { min-height: 14px; padding-inline: 2px; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.4; }
.top-menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--ink);
  box-shadow: inset 0 1px color-mix(in srgb, white 72%, transparent), var(--shadow-soft);
  cursor: pointer;
}
.top-menu-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.top-menu-button:hover { border-color: var(--line-strong); background: var(--panel); }
.top-update-button {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 780;
  cursor: pointer;
}
.top-update-button svg { width: 19px; height: 19px; fill: none; stroke: var(--route); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-update-button:hover { border-color: var(--line-strong); background: var(--panel); }

@media (max-width: 780px) {
  main { padding-bottom: 118px; }
  .top-update-button { display: none; }
  .mobile-nav {
    inset: auto 0 0;
    min-height: calc(72px + env(safe-area-inset-bottom));
    padding: 4px 10px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 64px;
    gap: 0;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
    border-radius: 22px 22px 0 0;
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    box-shadow: 0 24px 68px color-mix(in srgb, var(--chrome) 30%, transparent), inset 0 1px color-mix(in srgb, white 70%, transparent);
    backdrop-filter: blur(28px) saturate(1.4);
  }
  .mobile-nav .update-cta {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    min-height: 60px;
    padding: 0;
    display: grid;
    place-items: center;
    align-content: end;
    gap: 1px;
    overflow: visible;
    border: 0;
    border-radius: 17px;
    background: transparent;
    color: #f4fafb;
    text-align: center;
    box-shadow: none;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .update-cta-orb { position: absolute; top: -10px; left: 50%; width: 54px; height: 54px; display: grid; place-content: center; border: 1px solid rgba(217,182,108,.45); border-radius: 18px; background: radial-gradient(circle at 28% 18%, rgba(78,161,255,.24), transparent 35%), linear-gradient(145deg, #143847, #06131c 72%); box-shadow: inset 0 1px rgba(255,255,255,.16), 0 10px 22px rgba(7,21,31,.28), 0 0 0 4px color-mix(in srgb, var(--panel) 94%, transparent); transform: translateX(-50%); }
  .update-cta-wave { width: 25px; height: 25px; fill: none; stroke: #79b8ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .update-hold-ring { position: absolute; inset: 1px; width: 56px; height: 56px; overflow: visible; transform: rotate(-90deg); }
  .update-hold-ring circle { fill: none; stroke: #d9b66c; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 151; stroke-dashoffset: 151; opacity: 0; }
  .update-cta.is-pressing .update-hold-ring circle { opacity: 1; animation: update-hold-progress 520ms linear forwards; }
  .update-cta.is-listening .update-cta-wave { stroke: #d9b66c; animation: record-pulse 1.1s ease-in-out infinite; }
  .update-cta-copy { min-width: 0; margin-top: 0; display: block; }
  .update-cta-copy strong, .update-cta-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .update-cta-copy strong { color: var(--ink); font-family: var(--body); font-size: var(--text-small); font-weight: 780; letter-spacing: 0; }
  .update-cta-copy small { display: none; }
  .mobile-nav > [data-view] { grid-row: 1; min-height: 60px; padding: 4px 1px 2px; gap: 1px; border-radius: 15px; font-size: var(--text-small); }
  .mobile-nav > [data-view].active { background: color-mix(in srgb, var(--route-soft) 78%, transparent); }
  .mobile-nav-icon, .mobile-nav-icon svg { width: 23px; height: 23px; }

  .update-scrim {
    position: fixed;
    inset: 0;
    z-index: 31;
    display: block;
    border: 0;
    background: rgba(3,12,18,.46);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity .24s ease;
  }
  .update-scrim.is-open { opacity: 1; pointer-events: auto; }
  .update-dock {
    z-index: 33;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom) + 96px);
    left: 10px;
    width: auto;
    max-height: calc(100vh - env(safe-area-inset-bottom) - 118px);
    border-radius: 27px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(22px) scale(.985);
    transform-origin: bottom center;
    transition: opacity .24s ease, transform .32s cubic-bezier(.2,.8,.2,1);
  }
  html[dir="rtl"] .update-dock { right: 10px; left: 10px; }
  .update-dock.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
  .update-dock-close { display: grid; }
  .update-dock-header { padding: 18px 17px 13px; }
  .update-dock #daily-update-form { padding: 0 17px 17px; }
  .update-dock #daily-update-text { min-height: 112px; max-height: 170px; resize: none; font-size: 16px; }
  .update-dock-actions { grid-template-columns: 1fr 1fr; }
  .update-dock .daily-update-record, .update-dock-submit { width: auto; height: 52px; min-height: 52px; }
  .toast { bottom: 108px; }
  body.update-composer-open { overflow: hidden; }
}

@keyframes update-hold-progress { to { stroke-dashoffset: 0; } }

@media (max-width: 390px) {
  .update-cta-copy strong { font-size: var(--text-small); }
  .mobile-nav > [data-view] { font-size: var(--text-small); }
  .update-dock-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .update-cta.is-pressing .update-hold-ring circle { animation: none; stroke-dashoffset: 0; }
  .update-dock, .update-scrim { transition: none; }
}

/* Adaptive coach interview --------------------------------------------------- */
.auth-screen { grid-template-columns: minmax(390px, .92fr) minmax(560px, 1.08fr); }
.coach-intro {
  isolation: isolate;
  justify-content: flex-end;
  padding: clamp(36px, 6vw, 92px);
  background: var(--chrome);
}
.coach-intro::before, .coach-intro::after { content: none; }
.coach-portrait { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; filter: saturate(.88) contrast(1.03); }
.coach-portrait-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(6,18,27,.16) 0%, rgba(6,18,27,.04) 33%, rgba(6,18,27,.62) 70%, rgba(6,18,27,.94) 100%); }
.coach-intro .wordmark { z-index: 2; top: clamp(28px, 4vw, 58px); left: clamp(28px, 5vw, 76px); text-shadow: 0 2px 20px rgba(0,0,0,.25); }
html[dir="rtl"] .coach-intro .wordmark { right: clamp(28px, 5vw, 76px); left: auto; }
.coach-intro-copy { position: relative; z-index: 1; max-width: 600px; text-shadow: 0 2px 24px rgba(0,0,0,.28); }
.coach-outcome-kicker {
  margin: 0 0 13px;
  color: var(--recovery);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.coach-intro h1 { max-width: 580px; margin: 0; white-space: pre-line; font-size: clamp(48px, 5.6vw, 78px); line-height: .91; }
.coach-feature-rail { position: relative; max-width: 510px; margin-top: 30px; border-top: 1px solid rgba(255,255,255,.3); }
.coach-feature-rail::before { position: absolute; top: -1px; left: 0; width: 34%; height: 1px; content: ''; background: var(--sun); box-shadow: 0 0 16px color-mix(in srgb, var(--sun) 45%, transparent); }
.coach-feature { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 13px; padding: 18px 0 17px; border-bottom: 1px solid rgba(255,255,255,.2); }
.coach-feature-mark { width: 9px; height: 9px; margin-top: 4px; border: 2px solid var(--sun); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,191,59,.1); }
.coach-feature:nth-child(2) .coach-feature-mark { border-color: var(--recovery); box-shadow: 0 0 0 4px rgba(78,196,159,.1); }
.coach-feature strong { display: block; color: #fff; font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.coach-feature p { max-width: 440px; margin: 6px 0 0; color: rgba(255,255,255,.76); font-size: var(--text-body); line-height: 1.5; }

.setup-card { width: min(760px, 100%); padding: clamp(30px, 5vw, 68px); }
.coach-question-block { position: relative; }
.setup-story-kicker { display: block; margin-bottom: 13px; color: var(--sun-ink); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.coach-question { display: flex; align-items: flex-start; gap: 14px; }
.coach-question h2 { flex: 1; max-width: 610px; margin: 0; font-size: clamp(31px, 3.5vw, 46px); font-weight: 650; line-height: 1.03; letter-spacing: -.045em; }
.coach-question-turn { display: none; }
.coach-question-hint { max-width: 540px; margin: 17px 0 0; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.55; }
.coach-question-block.follow-up { margin: 10px 0 14px; padding: 15px 17px 16px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--route) 52%, var(--line)); border-inline-start: 4px solid var(--route); border-radius: 12px; background: color-mix(in srgb, var(--route-soft) 58%, var(--panel)); }
.coach-question-block.follow-up .setup-story-kicker { display: none; }
.coach-question-block.follow-up .coach-question-turn { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.coach-question-block.follow-up .coach-question h2 { max-width: none; font-size: clamp(21px, 2.2vw, 27px); line-height: 1.16; letter-spacing: -.025em; }
.coach-question-block.follow-up .coach-question-hint { margin-top: 8px; font-size: var(--text-small); }
.coach-question-block.follow-up.question-updated::after { position: absolute; inset: 0; content: ''; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--route); animation: question-arrival 1.1s ease-out both; }
.coach-answer-history { margin: 18px 0 14px; padding: 12px 14px; border-inline-start: 3px solid var(--recovery); background: var(--surface-resolved); }
.coach-answer-history span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.coach-answer-history p { max-height: 48px; margin: 5px 0 0; overflow: hidden; color: var(--ink); font-size: var(--text-body); line-height: 1.45; }
.coach-answer-form { margin-top: 18px; }
.coach-answer-composer { position: relative; border-radius: 22px; box-shadow: 0 18px 50px rgba(13,29,37,.14); }
.coach-answer-composer textarea { width: 100%; min-height: 154px; padding: 19px 20px 66px; resize: vertical; border: 1px solid #49616b; border-radius: 22px; background: #203844; color: #f6faf9; font: 16px/1.55 var(--body); caret-color: var(--route); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.coach-answer-composer textarea::placeholder { color: #52676e; }
.coach-answer-composer textarea:focus { border-color: var(--route); outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.coach-speak-button { position: absolute; right: 13px; bottom: 13px; min-height: 42px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #58717b; border-radius: 999px; background: #112c39; color: white; box-shadow: 0 8px 18px rgba(7,22,30,.2); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
html[dir="rtl"] .coach-speak-button { right: auto; left: 13px; }
.coach-speak-button svg { width: 20px; height: 20px; fill: none; stroke: var(--route); stroke-width: 1.8; stroke-linecap: round; }
.coach-speak-button.listening { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, transparent); }
.coach-speak-button.listening svg { stroke: var(--sun); animation: record-pulse 1.1s ease-in-out infinite; }
.coach-answer-submit { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; text-align: start; }
.coach-answer-submit > span:last-child { font-size: 20px; }
html[dir="rtl"] .coach-answer-submit > span:last-child { transform: rotate(180deg); }
.coach-answer-status { margin: 10px 3px 0; color: var(--ink-soft); font-size: var(--text-small); }
.coach-answer-status:empty { display: none; }

.goal-map { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.goal-map header { display: block; }
.goal-map-kicker { display: block; margin-bottom: 5px; color: var(--recovery); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.goal-map h2 { margin: 0; font-size: 28px; }
.goal-map-summary { max-width: 640px; margin: 12px 0 20px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.goal-map-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.goal-map-fact { min-width: 0; min-height: 72px; padding: 11px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); }
.goal-map-fact span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.goal-map-fact strong { overflow: hidden; color: var(--ink); font-size: var(--text-small); line-height: 1.35; text-overflow: ellipsis; }
.goal-map-fact.target { border-color: color-mix(in srgb, var(--sun) 70%, var(--line)); background: var(--surface-decision); }
.goal-map-fact.goal { border-inline-start: 3px solid var(--route); background: color-mix(in srgb, var(--route-soft) 56%, var(--panel)); }
.goal-map-fact.event { border-color: color-mix(in srgb, var(--recovery) 65%, var(--line)); }
.goal-map-fact.wide { grid-column: 1 / -1; min-height: 60px; }
.race-verification { margin-top: 10px; padding: 12px 13px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); }
.race-verification-icon { width: 28px; height: 28px; display: grid; place-content: center; border-radius: 50%; font-family: var(--utility); font-size: var(--text-small); font-weight: 900; }
.race-verification.verified .race-verification-icon { background: color-mix(in srgb, var(--recovery) 18%, var(--panel)); color: var(--recovery); }
.race-verification.unverified .race-verification-icon { background: color-mix(in srgb, var(--sun) 17%, var(--panel)); color: var(--sun-ink); }
.race-verification span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.race-verification strong { color: var(--ink); font-size: var(--text-small); }
.race-verification small { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.4; }
.race-verification a { color: var(--route); font-size: var(--text-small); font-weight: 800; text-decoration: none; }
.goal-map-actions { margin-top: 20px; padding-top: 16px; display: flex; align-items: center; gap: 13px; border-top: 1px solid var(--line); }
.goal-map-actions .primary-button { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.setup-correction-button { min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--route); font-size: var(--text-small); font-weight: 750; cursor: pointer; }

@keyframes question-arrival { 0% { opacity: .9; transform: scale(.985); } 100% { opacity: 0; transform: scale(1); } }

@media (max-width: 900px) {
  .auth-screen { display: block; }
  .coach-intro { position: relative; height: clamp(260px, 38vh, 360px); min-height: 260px; padding: 78px 22px 12px; }
  .coach-portrait { object-position: 50% 34%; }
  .coach-portrait-shade { background: linear-gradient(180deg, rgba(6,18,27,.18), rgba(6,18,27,.02) 42%, rgba(6,18,27,.9) 100%); }
  .coach-intro .wordmark { top: 24px; left: 22px; }
  html[dir="rtl"] .coach-intro .wordmark { right: 22px; left: auto; }
  .coach-intro h1 { font-size: clamp(35px, 9.5vw, 50px); line-height: .92; }
  .coach-outcome-kicker { margin-bottom: 8px; }
  .coach-feature-rail { margin-top: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coach-feature { padding: 11px 0 8px; }
  .coach-feature + .coach-feature { padding-inline-start: 14px; }
  .coach-feature p { display: none; }
  .setup-card { margin: 0 auto; padding: 22px 18px 44px; }
}

@media (max-width: 520px) {
  .coach-question h2 { font-size: 30px; }
  .coach-answer-composer textarea { min-height: 170px; padding: 16px 16px 64px; font-size: 16px; }
  .goal-map-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal-map-fact.wide { grid-column: 1 / -1; }
  .race-verification { grid-template-columns: 28px minmax(0, 1fr); }
  .race-verification a { grid-column: 2; }
  .goal-map-actions { align-items: stretch; flex-direction: column; }
  .goal-map-actions .primary-button, .setup-correction-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .coach-speak-button.listening svg { animation: none; }
  .coach-question-block.follow-up.question-updated::after { animation: none; opacity: 0; }
}

/* Mobile goal controls and motion ------------------------------------------ */
@media (max-width: 780px) {
  html.app-screen-active,
  html.app-screen-active body {
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  html.app-screen-active .app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  html.app-screen-active .content-shell {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
  }
  /* Reserve the navigation's actual height outside the scroll viewport.
     The final post actions must remain reachable even with larger safe areas. */
  html.app-screen-active .content-shell > main {
    padding-bottom: var(--space-4);
  }
  html.app-screen-active .mobile-nav {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
  }
  html { scroll-behavior: auto; }
  .view { animation: none; }
  .topbar {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .mobile-nav {
    position: fixed;
    background: var(--panel);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--chrome) 18%, transparent);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  html.standalone-mode .topbar {
    padding-top: max(13px, min(env(safe-area-inset-top, 0px), 54px));
  }
  html.standalone-mode .mobile-nav {
    min-height: calc(60px + max(24px, env(safe-area-inset-bottom)));
    padding: 4px 10px max(24px, env(safe-area-inset-bottom));
    grid-template-rows: 56px;
  }
  html.standalone-mode .mobile-nav .update-cta,
  html.standalone-mode .mobile-nav > [data-view] {
    min-height: 56px;
  }
  html.standalone-mode .update-cta-orb {
    top: -6px;
  }
  .goal-settings { margin-bottom: 12px; padding-bottom: 12px; }
  .goal-settings legend { margin-bottom: 4px; }
  .goal-selection-help {
    margin: 0 0 12px;
    color: var(--ink-soft);
    font-size: var(--text-small);
    line-height: 1.45;
  }
  .goal-picker-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .goal-picker-settings label,
  html[dir="rtl"] .goal-picker-settings label {
    min-height: 64px;
    padding-block: 10px;
  }
  .secondary-goal-heading { min-height: 60px; padding: 12px; }
  .secondary-goal-heading p { max-width: 230px; }
  .secondary-goal-body { padding: 12px; }
  .secondary-goal-options { gap: 7px; margin-bottom: 12px; }
  .secondary-goal-options label { min-height: 48px; }
}

@media (max-width: 360px) {
  .secondary-goal-options { grid-template-columns: 1fr; }
}

/* Weekly budget ledger ----------------------------------------------------- */
.budget-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--inverse);
  box-shadow: var(--shadow);
}
.weekly-budget-main {
  min-width: 0;
  padding: clamp(24px, 4vw, 46px) clamp(20px, 4vw, 48px) 0;
  color: var(--on-inverse);
  background:
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--route) 18%, transparent), transparent 18rem),
    linear-gradient(138deg, var(--inverse), color-mix(in srgb, var(--inverse) 86%, var(--route)));
}
.budget-hero-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-3);
}
.budget-hero-heading p {
  margin-bottom: var(--space-1);
  color: color-mix(in srgb, var(--on-inverse) 55%, transparent);
  font-family: var(--utility);
  font-size: var(--text-body);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.budget-hero-heading h2 { margin: 0; font-size: clamp(22px, 2.5vw, 34px); }
.budget-log-button {
  min-height: var(--tap-min);
  padding: 0 var(--space-3);
  border: 1px solid color-mix(in srgb, var(--on-inverse) 22%, transparent);
  border-radius: 999px;
  color: var(--on-inverse);
  background: transparent;
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
}
.budget-log-button span { margin-inline-start: var(--space-1); color: var(--sun); font-size: 18px; }
.budget-log-button:hover { background: color-mix(in srgb, var(--on-inverse) 8%, transparent); }
.weekly-budget-readout {
  min-width: 0;
  margin-top: clamp(26px, 4vw, 44px);
  display: flex;
  align-items: end;
  gap: var(--space-3);
}
.weekly-budget-readout strong {
  font-family: var(--number, var(--display));
  font-size: clamp(76px, 9vw, 132px);
  font-weight: 700;
  line-height: .72;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.weekly-budget-readout span {
  padding-bottom: 2px;
  color: color-mix(in srgb, var(--on-inverse) 58%, transparent);
  font-family: var(--utility);
  font-size: var(--text-small);
  line-height: 1.45;
  text-transform: uppercase;
  white-space: pre-line;
}
.weekly-budget-equation {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: color-mix(in srgb, var(--on-inverse) 58%, transparent);
  font-family: var(--utility);
  font-size: var(--text-small);
  text-transform: uppercase;
}
.weekly-budget-equation b { color: var(--on-inverse); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.weekly-budget-equation i { color: var(--route); font-style: normal; }
.weekly-budget-meter {
  height: 4px;
  margin-top: var(--space-3);
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-inverse) 12%, transparent);
}
.weekly-budget-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--route), var(--recovery));
  transition: width .55s ease;
}
.today-budget {
  min-width: 0;
  padding: clamp(24px, 3vw, 38px) clamp(20px, 3vw, 32px);
  color: var(--ink);
  background: var(--panel);
}
.today-budget > header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.today-budget > header h2 { margin: 0; font-size: 25px; }
.today-budget > header span {
  color: var(--route);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 800;
  text-align: end;
  text-transform: uppercase;
}
.today-budget > header span.over { color: var(--effort); }
.today-budget-readout { margin-top: 32px; display: flex; align-items: end; gap: var(--space-2); }
.today-budget-readout strong { font-family: var(--number, var(--display)); font-size: clamp(48px, 5.2vw, 72px); line-height: .76; letter-spacing: -.055em; }
.today-budget-readout span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.today-budget-equation { margin-top: var(--space-3); display: flex; gap: var(--space-3); color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.today-budget-equation b { color: var(--ink); font-size: var(--text-small); }
.daily-budget-meter { height: 4px; margin-top: var(--space-3); overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.daily-budget-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--route); transition: width .55s ease; }
.daily-macro-list { margin-top: var(--space-4); padding-top: var(--space-2); border-top: 1px solid var(--line); }
.daily-macro { padding: 8px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.daily-macro span { font-size: var(--text-small); font-weight: 750; }
.daily-macro b { font-family: var(--utility); font-size: var(--text-small); font-weight: 650; direction: ltr; unicode-bidi: isolate; }
.daily-macro i { font-style: normal; }
.daily-macro div { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.daily-macro em { display: block; width: 0; height: 100%; background: var(--route); transition: width .5s ease; }
.daily-macro:nth-child(2) em { background: var(--sun); }
.daily-macro:nth-child(3) em { background: var(--recovery); }
.budget-balance-grid { margin-top: 22px; display: grid; grid-template-columns: 1.45fr .75fr; gap: 22px; }
.budget-balance-grid .section-heading { align-items: center; margin-bottom: var(--space-4); }
.budget-balance-grid .section-heading > span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.weekly-macro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.weekly-macro { min-width: 0; padding: 4px var(--space-4); border-inline-start: 1px solid var(--line); }
.weekly-macro:first-child { padding-inline-start: 0; border-inline-start: 0; }
.weekly-macro:last-child { padding-inline-end: 0; }
.weekly-macro > span, .weekly-macro > b { display: block; }
.weekly-macro > span { margin-bottom: var(--space-1); font-size: var(--text-small); font-weight: 750; }
.weekly-macro > b { overflow: hidden; font-family: var(--utility); font-size: var(--text-small); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.weekly-macro i { font-style: normal; }
.weekly-macro > div { height: 5px; margin-top: var(--space-3); overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.weekly-macro em { display: block; width: 0; height: 100%; background: var(--route); transition: width .55s ease; }
.weekly-macro.carbs em { background: var(--sun); }
.weekly-macro.fat em { background: var(--recovery); }
.processing-sheet .section-heading details { position: relative; }
.processing-sheet .section-heading summary { width: 32px; height: 32px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-soft); cursor: pointer; list-style: none; }
.processing-sheet .section-heading summary::-webkit-details-marker { display: none; }
.processing-sheet .section-heading details p { position: absolute; z-index: 4; top: 38px; right: 0; width: min(260px, 70vw); margin: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--panel); box-shadow: var(--shadow); color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
html[dir="rtl"] .processing-sheet .section-heading details p { right: auto; left: 0; }
.processing-readout { display: flex; align-items: end; gap: var(--space-2); }
.processing-readout strong { font-family: var(--number, var(--display)); font-size: 48px; line-height: .8; }
.processing-readout span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.processing-meter { position: relative; height: 6px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.processing-meter span { display: block; width: 0; height: 100%; background: var(--sun); transition: width .55s ease; }
.processing-meter i { position: absolute; inset: 0 0 0 auto; width: 2px; background: var(--ink); opacity: .5; }
.processing-split { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.processing-split b { color: var(--ink); }
.field-grid.seven { grid-template-columns: 1.05fr 1.15fr repeat(5, minmax(64px, .7fr)); }

@media (max-width: 1120px) {
  .budget-hero { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); }
  .weekly-budget-readout strong { font-size: clamp(72px, 9vw, 104px); }
  .budget-balance-grid { grid-template-columns: 1fr; }
  .field-grid.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field-grid.seven label:first-child, .field-grid.seven label:nth-child(2) { grid-column: span 2; }
}

@media (max-width: 780px) {
  .budget-hero { grid-template-columns: 1fr; border-radius: 24px; }
  .weekly-budget-main { padding: 20px 18px 0; }
  .weekly-budget-readout { margin-top: 28px; }
  .weekly-budget-readout strong { font-size: clamp(68px, 20vw, 92px); }
  .weekly-budget-equation { flex-wrap: wrap; }
  .today-budget { padding: 20px 18px 22px; }
  .today-budget-readout { margin-top: var(--space-4); }
  .daily-macro-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
  .daily-macro { align-content: start; grid-template-columns: 1fr; }
  .daily-macro b { font-size: var(--text-small); }
  .daily-macro div { grid-column: 1; }
  .budget-balance-grid { margin-top: 16px; gap: 16px; }
  .weekly-macro { padding-inline: var(--space-2); }
  .weekly-macro > b { font-size: var(--text-small); }
  .field-grid.seven { grid-template-columns: 1fr 1fr; }
  .field-grid.seven label:first-child, .field-grid.seven label:nth-child(2) { grid-column: auto; }
}

@media (max-width: 440px) {
  .budget-hero-heading h2 { font-size: 22px; }
  .budget-log-button { padding-inline: var(--space-2); }
  .weekly-budget-readout span { font-size: var(--text-small); }
  .weekly-macro-grid { grid-template-columns: 1fr; gap: 13px; }
  .weekly-macro { padding: 0 0 13px; border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .weekly-macro:last-child { padding-bottom: 0; border-bottom: 0; }
  .field-grid.seven { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-budget-meter span, .daily-budget-meter span, .daily-macro em, .weekly-macro em, .processing-meter span { transition: none; }
}

/* Home: today first ------------------------------------------------------- */
.budget-hero.today-first {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  background: var(--inverse);
}
.today-budget-primary {
  min-width: 0;
  padding: clamp(28px, 4vw, 48px);
  color: var(--on-inverse);
  background:
    radial-gradient(circle at 76% 20%, color-mix(in srgb, var(--route) 20%, transparent), transparent 19rem),
    linear-gradient(138deg, var(--inverse), color-mix(in srgb, var(--inverse) 84%, var(--route)));
}
.today-budget-primary .today-budget-readout { margin-top: clamp(30px, 4vw, 46px); }
.today-budget-primary .today-budget-readout strong {
  color: var(--on-inverse);
  font-size: clamp(88px, 10vw, 142px);
  font-variant-numeric: tabular-nums;
}
.today-budget-primary .today-budget-readout span,
.today-budget-primary .today-budget-equation { color: color-mix(in srgb, var(--on-inverse) 58%, transparent); }
.today-budget-primary .today-budget-equation { align-items: center; }
.today-budget-primary .today-budget-equation b { color: var(--on-inverse); }
.today-budget-status {
  margin-inline-start: auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--recovery) 13%, transparent);
  color: var(--recovery);
  font-weight: 800;
  text-transform: none;
}
.today-budget-status.over { background: color-mix(in srgb, var(--sun) 13%, transparent); color: var(--sun); }
.today-budget-primary .daily-budget-meter { background: color-mix(in srgb, var(--on-inverse) 12%, transparent); }
.today-budget-primary .daily-budget-meter span { background: linear-gradient(90deg, var(--route), var(--recovery)); }
.daily-energy-split {
  margin-top: 16px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--on-inverse) 10%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--on-inverse) 5%, transparent);
}
.daily-energy-split header { min-width: 0; }
.daily-energy-split header > span,
.daily-energy-split header > strong { display: block; }
.daily-energy-split header > span,
.daily-energy-split > div small {
  color: color-mix(in srgb, var(--on-inverse) 56%, transparent);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.daily-energy-split header > strong {
  margin-top: 3px;
  color: var(--on-inverse);
  font-family: var(--number);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.daily-energy-split header small,
.daily-energy-split > div em {
  color: color-mix(in srgb, var(--on-inverse) 56%, transparent);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-style: normal;
}
.daily-energy-split > div { display: grid; grid-template-columns: repeat(2, auto); gap: 18px; }
.daily-energy-split > div > span { min-width: 70px; }
.daily-energy-split > div small,
.daily-energy-split > div b { display: block; }
.daily-energy-split > div b {
  margin-top: 3px;
  color: var(--on-inverse);
  font-family: var(--number);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.daily-energy-split > div i { font-style: normal; }
.today-budget-primary .daily-macro-list {
  margin-top: 24px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  border-top-color: color-mix(in srgb, var(--on-inverse) 12%, transparent);
}
.today-budget-primary .daily-macro { grid-template-columns: 1fr; padding: 0; }
.today-budget-primary .daily-macro span { color: var(--on-inverse); }
.today-budget-primary .daily-macro b { color: color-mix(in srgb, var(--on-inverse) 68%, transparent); }
.today-budget-primary .daily-macro div { grid-column: 1; background: color-mix(in srgb, var(--on-inverse) 12%, transparent); }

.weekly-budget-reference {
  min-width: 0;
  padding: clamp(28px, 3vw, 38px) clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
  color: var(--ink);
}
.weekly-budget-reference header p {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: var(--text-body);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.weekly-budget-reference header h2 { margin: 0; font-size: 25px; }
.budget-period-status { margin: var(--space-2) 0 0; color: var(--ink-soft); font-size: var(--text-small); }
.weekly-budget-reference .weekly-budget-readout { margin-top: 34px; gap: 9px; }
.weekly-budget-reference .weekly-budget-readout strong { color: var(--ink); font-size: clamp(46px, 4.4vw, 62px); }
.weekly-budget-reference .weekly-budget-readout span { color: var(--ink-soft); font-size: var(--text-small); }
.weekly-budget-reference .weekly-budget-equation { margin-top: 17px; gap: 10px; color: var(--ink-soft); }
.weekly-budget-reference .weekly-budget-equation b { color: var(--ink); font-size: var(--text-small); }
.weekly-budget-reference .weekly-budget-meter { margin-top: 16px; background: var(--paper-deep); }
.horizon-sheet { margin-top: 22px; }
.calorie-history { min-width: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.calorie-history-current { margin-block-end: var(--space-3); padding-block-end: var(--space-3); border-block-end: 1px solid var(--line); }
.calorie-history-current-label, .calorie-history-current-period { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.5; }
.calorie-history-current-amount { display: flex; align-items: baseline; gap: var(--space-1); color: var(--ink); }
.calorie-history-current-amount strong { font-family: var(--utility); font-size: 32px; line-height: 1.5; font-weight: 700; font-variant-numeric: tabular-nums; }
.calorie-history-current-amount > span { font-size: var(--text-small); color: var(--ink-soft); }
.calorie-history-current-period { margin: 0; }
.calorie-history-basis { margin: 0 0 var(--space-2); color: var(--ink-soft); font-size: var(--text-small); }
.calorie-history-scroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.calorie-history-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: var(--space-1); min-width: 100%; margin: 0; padding: 0; list-style: none; }
.calorie-history-days > li { min-width: 54px; }
.calorie-history-day { --history-accent: var(--line); display: grid; justify-items: center; gap: var(--space-2); width: 100%; min-height: var(--tap-min); margin: 0; padding: var(--space-2) 0; border: 1px solid transparent; border-radius: var(--control-radius); background: color-mix(in srgb, var(--history-accent) 10%, var(--panel)); color: var(--ink); font-family: var(--body); cursor: pointer; }
.calorie-history-day:hover, .calorie-history-day[aria-expanded="true"] { border-color: var(--history-accent); background: color-mix(in srgb, var(--history-accent) 22%, var(--panel)); }
.calorie-history .is-green { --history-accent: var(--recovery); }
.calorie-history .is-amber { --history-accent: var(--sun); }
.calorie-history .is-red { --history-accent: var(--effort); }
.calorie-history-date { display: grid; gap: var(--space-1); font-size: var(--text-small); line-height: 1.4; font-weight: 500; }
.calorie-history-date > span { color: var(--ink-soft); }
.calorie-history-date time { font-family: var(--utility); }
.calorie-history-delta { font-family: var(--utility); font-size: var(--text-body); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calorie-history-state { display: inline-block; min-width: calc(var(--space-4) + var(--space-1)); border-radius: var(--control-radius); background: color-mix(in srgb, var(--history-accent) 28%, var(--panel)); color: var(--ink); font-size: var(--text-body); line-height: 1.5; }
.calorie-history-controls { display: flex; align-items: center; gap: var(--space-1); min-height: var(--tap-min); margin-block-start: var(--space-1); font-size: var(--text-small); color: var(--ink-soft); }
.calorie-history-controls [data-history-status] { flex: 1; font-size: var(--text-body); }
.calorie-history-controls button, .calorie-history-close { display: grid; place-items: center; min-width: var(--tap-min); min-height: var(--tap-min); border: 0; border-radius: var(--control-radius); background: var(--panel-muted); color: var(--ink); cursor: pointer; }
.calorie-history-controls button:hover:enabled, .calorie-history-close:hover { background: color-mix(in srgb, var(--route) 8%, var(--panel)); }
.calorie-history-controls button:disabled { opacity: .3; cursor: default; }
.calorie-history-controls button[hidden], .calorie-history-detail[hidden] { display: none; }
.calorie-history-controls svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html[dir="rtl"] .calorie-history-controls svg { transform: scaleX(-1); }
.calorie-history-scroll:focus-visible, .calorie-history-day:focus-visible, .calorie-history-controls button:focus-visible, .calorie-history-close:focus-visible { outline: 2px solid var(--route); outline-offset: 2px; }
.calorie-history-day:focus-visible { outline-offset: -2px; }
.calorie-history-detail { margin-block-start: var(--space-2); padding-block-start: var(--space-2); border-block-start: 1px solid var(--line); font-size: var(--text-body); color: var(--ink); line-height: 1.5; }
.calorie-history-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.calorie-history-close { font-size: 26px; }
.calorie-history-classification { margin: 0 0 var(--space-3); color: var(--ink-soft); font-size: var(--text-small); }
.calorie-history-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; }
.calorie-history-metrics dt { font-size: var(--text-small); color: var(--ink-soft); }
.calorie-history-metrics dd { margin: var(--space-1) 0 0; font-family: var(--utility); font-size: var(--text-body); font-weight: 650; }
.calorie-history-note { margin: var(--space-3) 0 0; color: var(--ink-soft); font-size: var(--text-body); }
.horizon-heading { margin-bottom: 18px; }
.horizon-heading .section-kicker { display: block; margin-bottom: 5px; color: var(--route); }
.horizon-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 16px; }
.horizon-grid .coach-strip {
  min-height: 230px;
  margin: 0;
  padding: 24px 26px;
  align-content: center;
  border-inline-start-width: 4px;
}
.horizon-grid .coach-strip > strong { max-width: 720px; font-size: clamp(23px, 2.4vw, 31px); line-height: 1.14; }
.horizon-grid .coach-strip > p { max-width: 760px; font-size: var(--text-body); line-height: 1.55; }
.horizon-grid .coach-meal { max-width: 720px; }
.next-training-card {
  min-width: 0;
  min-height: 230px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 4px solid var(--route);
  border-radius: var(--radius-small);
  background: var(--panel-muted);
}
.next-training-card.quality { border-top-color: var(--effort); }
.next-training-card.long { border-top-color: var(--sun); }
.next-training-card.easy { border-top-color: var(--recovery); }
.next-training-card > header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.next-training-card > header span,
.next-training-card > header strong {
  font-family: var(--utility);
  font-size: var(--text-small);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.next-training-card > header span { color: var(--ink-soft); }
.next-training-card > header strong { color: var(--route); text-align: end; }
.next-training-main { margin-top: 25px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 14px; }
.next-training-mark { width: 44px; height: 44px; display: grid; place-content: center; border-radius: 14px; background: var(--route-soft); color: var(--route); }
.next-training-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.next-training-card h3 { margin: 0; font-size: 22px; line-height: 1.15; }
.next-training-card p { margin: 6px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.next-training-details { margin-top: 17px; border-top: 1px solid var(--line); }
.next-training-details summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; color: var(--route); font-size: var(--text-small); font-weight: 800; cursor: pointer; list-style: none; }
.next-training-details summary::-webkit-details-marker { display: none; }
.next-training-details summary::after { content: "+"; font-size: 19px; font-weight: 500; }
.next-training-details[open] summary::after { content: "−"; }
.next-training-details > div { display: grid; gap: 7px; padding: 0 0 14px; }
.next-training-details > div p { margin: 0; padding-inline-start: 11px; border-inline-start: 2px solid var(--route-soft); color: var(--ink); font-size: var(--text-body); }
.next-training-link {
  width: fit-content;
  min-height: 40px;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--route);
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
}
.next-training-link::after { content: " →"; }
html[dir="rtl"] .next-training-link::after { content: " ←"; }

.food-insights-grid { margin-top: 22px; display: grid; grid-template-columns: 1.45fr .75fr; gap: 22px; }
.food-insights-grid .section-heading { align-items: center; margin-bottom: var(--space-4); }
.food-insights-grid .section-heading > span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.processing-explanation { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.processing-explanation summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--route);
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.processing-explanation summary::-webkit-details-marker { display: none; }
.processing-explanation summary::after { content: "›"; font-size: 18px; transition: transform .2s ease; }
.processing-explanation[open] summary::after { transform: rotate(90deg); }
html[dir="rtl"] .processing-explanation summary::after { transform: rotate(180deg); }
html[dir="rtl"] .processing-explanation[open] summary::after { transform: rotate(90deg); }
.processing-explanation p { margin: 2px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }

@media (max-width: 980px) {
  .budget-hero.today-first { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
  .horizon-grid, .food-insights-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .budget-hero.today-first { grid-template-columns: 1fr; }
  .today-budget-primary { padding: 22px 18px 24px; }
  .today-budget-primary .today-budget-readout { margin-top: 30px; }
  .today-budget-primary .today-budget-readout strong { font-size: clamp(78px, 24vw, 102px); }
  .today-budget-primary .today-budget-equation { flex-wrap: wrap; }
  .today-budget-status { margin-inline-start: 0; }
  .today-budget-primary .daily-macro-list { gap: 11px; }
  .weekly-budget-reference { padding: 21px 18px 23px; }
  .weekly-budget-reference .weekly-budget-readout { margin-top: 20px; }
  .weekly-budget-reference .weekly-budget-readout strong { font-size: 48px; }
  .horizon-sheet { margin-top: 16px; }
  .horizon-grid .coach-strip, .next-training-card { min-height: 0; }
  .horizon-grid .coach-strip { padding: 20px 18px; }
  .horizon-grid .coach-strip > strong { font-size: 24px; }
  .next-training-card { padding: 19px 18px; }
  .next-training-link { margin-top: 22px; }
  .food-insights-grid { margin-top: 16px; gap: 16px; }
}

@media (max-width: 440px) {
  .today-budget-primary .budget-hero-heading h2 { font-size: 25px; }
  .today-budget-primary .budget-log-button { min-height: 42px; font-size: var(--text-small); }
  .today-budget-primary .daily-macro-list { gap: 8px; }
  .today-budget-primary .daily-macro span { font-size: var(--text-small); }
  .today-budget-primary .daily-macro b { font-size: var(--text-small); }
  .daily-energy-split { padding-inline: 11px; gap: 10px; }
  .daily-energy-split > div { gap: 10px; }
  .daily-energy-split > div > span { min-width: 61px; }
}

/* Schedule photo importer ------------------------------------------------- */
.schedule-import-sheet {
  position: relative;
  margin-bottom: 22px;
  overflow: hidden;
  border-top: 4px solid var(--route);
}
.schedule-import-sheet::after {
  position: absolute;
  width: 190px;
  height: 190px;
  inset: -96px -68px auto auto;
  border: 1px solid color-mix(in srgb, var(--route) 18%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
html[dir="rtl"] .schedule-import-sheet::after { right: auto; left: -68px; }
.schedule-import-lead {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr);
  align-items: center;
  gap: clamp(24px, 4vw, 52px);
}
.schedule-import-lead h2 { margin: 5px 0 8px; font-size: clamp(28px, 3vw, 39px); }
.schedule-import-lead p { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.schedule-capture-strip {
  position: relative;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--route) 24%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--route-soft) 58%, var(--panel));
}
.schedule-capture-strip::before {
  position: absolute;
  inset: 50% 16px auto;
  border-top: 1px dashed color-mix(in srgb, var(--route) 32%, transparent);
  content: "";
  pointer-events: none;
}
.schedule-capture-button,
.schedule-week-field {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.schedule-capture-button {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 12px;
  align-items: end;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.schedule-capture-button:hover { border-color: var(--route); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.schedule-capture-button:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.schedule-capture-icon {
  position: relative;
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-content: center;
  align-self: center;
  border-radius: 50%;
  background: var(--chrome);
  color: var(--sun);
}
.schedule-capture-icon::before {
  width: 19px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
  content: "";
}
.schedule-capture-icon::after {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: 20px 0 0 20px;
  border: 2px solid var(--chrome);
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.schedule-capture-button strong { align-self: end; font-size: 15px; }
.schedule-capture-button small { align-self: start; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
.schedule-week-field { padding: 11px 10px; display: grid; align-content: center; gap: 6px; }
.schedule-week-field > span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.schedule-week-field input { width: 100%; min-width: 0; min-height: 37px; padding: 6px; border-radius: 8px; font-family: var(--number); font-size: var(--text-body); }
.schedule-import-status { min-height: 18px; margin: 14px 0 0; color: var(--recovery); font-family: var(--utility); font-size: var(--text-small); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.schedule-review { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.schedule-review > header { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.schedule-review > header h3 { margin: 4px 0 0; font-size: 24px; }
.schedule-review > header > span { padding: 6px 9px; border-radius: 999px; background: var(--route-soft); color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; text-transform: uppercase; }
.schedule-warning-list { margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--sun) 45%, var(--line)); border-inline-start: 4px solid var(--sun); border-radius: var(--control-radius); background: var(--surface-decision); }
.schedule-warning-list p { margin: 4px 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.schedule-session-list { margin-top: 16px; display: grid; gap: 9px; counter-reset: detected-session; }
.schedule-session-card {
  position: relative;
  padding: 14px;
  display: grid;
  grid-template-columns: 28px minmax(150px, 1.5fr) 130px 95px 105px 110px 82px 88px 88px;
  align-items: end;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--panel-muted);
  counter-increment: detected-session;
}
.schedule-session-card::before {
  align-self: center;
  color: var(--route);
  font-family: var(--number);
  font-size: 14px;
  content: counter(detected-session, decimal-leading-zero);
}
.schedule-session-card label { min-width: 0; }
.schedule-session-card label > span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; text-transform: uppercase; }
.schedule-session-card input,
.schedule-session-card select { width: 100%; min-width: 0; min-height: 42px; padding: 8px; border-radius: 8px; font-size: var(--text-body); }
.schedule-session-card .schedule-name input { font-size: var(--text-body); font-weight: 700; }
.schedule-session-confidence { position: absolute; top: 7px; right: 8px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); text-transform: uppercase; }
html[dir="rtl"] .schedule-session-confidence { right: auto; left: 8px; }
.schedule-review-actions { margin-top: 17px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.schedule-review-actions .primary-button { min-width: 165px; }
.training-session-actions { display: flex; justify-content: flex-end; gap: 5px; }
.training-session-actions button { min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: var(--text-small); font-weight: 800; cursor: pointer; }
.training-session-actions button:first-child { border-color: color-mix(in srgb, var(--recovery) 54%, var(--line)); color: color-mix(in srgb, var(--recovery) 76%, var(--ink)); }
.training-session-actions button:hover { border-color: var(--route); color: var(--route); }

@media (max-width: 1500px) {
  .schedule-session-card { grid-template-columns: 28px minmax(170px, 1fr) repeat(3, minmax(100px, .55fr)); }
  .schedule-session-card label:nth-of-type(n+5) { grid-column: span 1; }
}

@media (max-width: 780px) {
  .schedule-import-sheet { padding-inline: 16px; }
  .schedule-import-lead { grid-template-columns: 1fr; gap: 20px; }
  .schedule-capture-strip { grid-template-columns: minmax(0, 1fr) 118px; }
  .schedule-session-card { grid-template-columns: 24px repeat(2, minmax(0, 1fr)); }
  .schedule-session-card::before { grid-row: 1 / 4; align-self: start; padding-top: 26px; }
  .schedule-session-card .schedule-name { grid-column: 2 / 4; }
  .schedule-review-actions { align-items: stretch; flex-direction: column-reverse; }
  .schedule-review-actions button { width: 100%; }
}

@media (max-width: 460px) {
  .schedule-capture-strip { grid-template-columns: 1fr; }
  .schedule-capture-strip::before { display: none; }
  .schedule-session-card { grid-template-columns: 22px minmax(0, 1fr); }
  .schedule-session-card::before { grid-row: 1 / 8; }
  .schedule-session-card .schedule-name { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-capture-button { transition: none; }
}

/* Weekly training calorie plan -------------------------------------------- */
.weekly-plan-sheet { margin-bottom: 22px; overflow: hidden; }
.weekly-plan-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.weekly-plan-heading .section-heading { margin: 0; }
.week-navigation { min-width: 220px; display: grid; grid-template-columns: 44px minmax(120px, 1fr) 44px; align-items: center; gap: var(--space-1); }
.week-navigation button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-muted); color: var(--route); font-size: 24px; line-height: 1; cursor: pointer; }
.week-navigation button:hover { border-color: var(--route); background: var(--route-soft); }
.week-navigation button:disabled { opacity: .42; cursor: wait; }
.week-navigation strong { font-family: var(--utility); font-size: var(--text-small); font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.weekly-plan-summary { margin: 18px 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel-muted); }
.weekly-plan-summary > div { min-width: 0; padding: 15px 17px; border-inline-start: 1px solid var(--line); }
.weekly-plan-summary > div:first-child { border-inline-start: 0; }
.weekly-plan-summary span, .weekly-plan-summary strong { display: block; }
.weekly-plan-summary span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.weekly-plan-summary strong { margin-top: 5px; font-family: var(--number); font-size: 21px; font-variant-numeric: tabular-nums; }
.weekly-plan-days { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--panel); }
.weekly-plan-day { position: relative; min-width: 0; padding: 13px 11px 14px; display: grid; grid-template-rows: auto 48px minmax(55px, auto) auto auto auto; align-content: start; gap: 11px; border-inline-start: 1px solid var(--line); background: var(--panel); }
.weekly-plan-day:first-child { border-inline-start: 0; }
.weekly-plan-day.today { box-shadow: inset 0 3px var(--sun); background: color-mix(in srgb, var(--sun) 6%, var(--panel)); }
.weekly-plan-day.completed { background: color-mix(in srgb, var(--recovery) 7%, var(--panel)); }
.weekly-plan-day > header { min-height: 43px; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 3px 6px; }
.weekly-plan-day > header span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; text-transform: uppercase; }
.weekly-plan-day > header strong { font-size: var(--text-small); text-align: end; }
.weekly-plan-day > header b { grid-column: 1 / -1; justify-self: start; padding: 3px 6px; border-radius: 999px; background: var(--surface-decision); color: var(--ink); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .06em; text-transform: uppercase; }
.weekly-day-load { position: relative; overflow: hidden; border-radius: 8px; background: var(--paper-deep); }
.weekly-day-load::after { position: absolute; inset: 50% 0 auto; content: ''; border-top: 1px dashed color-mix(in srgb, var(--ink-soft) 28%, transparent); }
.weekly-day-load i { position: absolute; right: 0; bottom: 0; left: 0; height: var(--training-load); min-height: 0; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--route), color-mix(in srgb, var(--route) 58%, var(--recovery))); transition: height .25s ease; }
.weekly-day-workout { min-width: 0; }
.weekly-day-workout strong, .weekly-day-workout small { display: block; }
.weekly-day-workout strong { min-height: 32px; overflow: hidden; font-size: var(--text-small); line-height: 1.3; }
.weekly-day-workout small { margin-top: 3px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); line-height: 1.35; text-transform: uppercase; }
.weekly-plan-day label { display: block; }
.weekly-plan-day label > span, .weekly-day-target > span, .weekly-day-actual > span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.weekly-plan-day label > div { position: relative; }
.weekly-plan-day input { width: 100%; height: 44px; min-height: 44px; padding: 9px 34px 9px 9px; border-radius: 9px; background: var(--input); font-family: var(--number); font-size: 18px; font-variant-numeric: tabular-nums; }
html[dir="rtl"] .weekly-plan-day input { padding: 9px 9px 9px 34px; }
.weekly-plan-day label > div small { position: absolute; top: 50%; right: 8px; color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); transform: translateY(-50%); pointer-events: none; }
html[dir="rtl"] .weekly-plan-day label > div small { right: auto; left: 8px; }
.weekly-day-target, .weekly-day-actual { padding-top: 10px; border-top: 1px solid var(--line); }
.weekly-day-target strong, .weekly-day-actual strong { font-family: var(--number); font-size: 17px; font-variant-numeric: tabular-nums; }
.weekly-day-target small, .weekly-day-actual small { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); }
.weekly-day-actual strong { color: var(--recovery); }
.weekly-plan-actions { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.weekly-plan-detail { max-width: 620px; }
.weekly-plan-detail p { margin-bottom: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
.weekly-plan-actions .primary-button { min-width: 132px; }
#weekly-plan-error { margin: 9px 0 0; }

@media (max-width: 1120px) {
  .weekly-plan-days { overflow-x: auto; grid-template-columns: repeat(7, minmax(142px, 1fr)); scroll-snap-type: x proximity; }
  .weekly-plan-day { scroll-snap-align: start; }
}

@media (max-width: 780px) {
  .tomorrow-plan-head { min-width: 0; padding-bottom: 0; border-bottom: 0; }
  .run-time-control, .run-time-control input { inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; }
  .tomorrow-meal-timeline { display: none; }
  .weekly-plan-sheet { margin-inline: 0; padding-inline: 14px; }
  .weekly-plan-heading { align-items: stretch; flex-direction: column; }
  .week-navigation { width: 100%; min-width: 0; grid-template-columns: 44px 1fr 44px; }
  .weekly-plan-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weekly-plan-summary > div { padding: 10px 8px; border-top: 0; border-inline-start: 1px solid var(--line); }
  .weekly-plan-summary > div:first-child { border-inline-start: 0; }
  .weekly-plan-summary span { font-size: var(--text-small); line-height: 1.35; }
  .weekly-plan-summary strong { font-size: 14px; }
  .weekly-plan-days {
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    scroll-snap-type: none;
  }
  .weekly-plan-day {
    padding: 11px 10px;
    grid-template-columns: 54px minmax(0, 1fr) 86px;
    grid-template-rows: auto 4px auto auto;
    gap: 7px 9px;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
    scroll-snap-align: none;
  }
  .weekly-plan-day:first-child { border-top: 0; }
  .weekly-plan-day > header {
    grid-column: 1;
    grid-row: 1 / 5;
    min-height: 0;
    padding-inline-end: 9px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    border-inline-end: 1px solid var(--line);
  }
  .weekly-plan-day > header span { font-size: var(--text-small); }
  .weekly-plan-day > header strong { font-size: var(--text-small); text-align: start; }
  .weekly-plan-day > header b { margin-top: 2px; }
  .weekly-day-workout { grid-column: 2 / 4; grid-row: 1; min-width: 0; }
  .weekly-day-workout strong { min-height: 0; overflow: hidden; font-size: var(--text-small); text-overflow: ellipsis; white-space: nowrap; }
  .weekly-day-workout small { display: none; }
  .weekly-day-load { grid-column: 2 / 4; grid-row: 2; height: 4px; border-radius: 999px; }
  .weekly-day-load::after { display: none; }
  .weekly-day-load i { inset: 0 auto 0 0; width: var(--training-load); height: 100%; border-radius: 999px; transition: width .25s ease; }
  html[dir="rtl"] .weekly-day-load i { right: 0; left: auto; }
  .weekly-plan-day label { grid-column: 2; grid-row: 3; min-width: 0; }
  .weekly-plan-day label > span, .weekly-day-target > span, .weekly-day-actual > span { margin-bottom: 4px; font-size: var(--text-small); }
  .weekly-plan-day input { inline-size: 100%; min-inline-size: 0; height: 40px; min-height: 40px; font-size: 16px; }
  .weekly-day-target { grid-column: 3; grid-row: 3; min-width: 0; padding-top: 0; border-top: 0; }
  .weekly-day-target strong { display: block; padding-top: 9px; font-size: 14px; white-space: nowrap; }
  .weekly-day-actual { grid-column: 2 / 4; grid-row: 4; padding-top: 7px; }
  .weekly-plan-actions { align-items: stretch; flex-direction: column; }
  .weekly-plan-actions .primary-button { width: 100%; }
}

@media (max-width: 520px) {
  #profile-form label, #profile-form .field-grid, #profile-weight-targets > label { min-width: 0; }
  .race-target-fields, .weekly-weigh-setting { grid-template-columns: 1fr; }
  .weekly-weigh-setting > span { grid-column: auto; }
  .weekly-weigh-setting .settings-choice { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-day-load i { transition: none; }
}

/* Compact daily fuel instrument -------------------------------------------- */
.fuel-hero {
  min-height: 246px;
  grid-template-columns: minmax(0, 1.45fr) minmax(370px, .75fr);
}
.fuel-hero::after {
  width: 250px;
  height: 250px;
  right: 25%;
  bottom: -200px;
}
.fuel-number-block {
  min-width: 0;
  padding: 22px 26px 20px;
}
.fuel-number-block::before {
  width: 228px;
  top: 55%;
  left: 19px;
  opacity: .72;
}
.fuel-number-block::after { display: none; }
.fuel-hero-heading {
  position: relative;
  z-index: 2;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.goal-context {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fuel-hero .text-button {
  min-height: var(--tap-min);
  flex: 0 0 auto;
  margin: 0;
  padding: 0 var(--space-3);
  border-color: var(--chrome-line);
  font-size: var(--text-small);
}
.calorie-overview {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--space-4);
  margin-top: var(--space-2);
}
.hero-number {
  min-width: 0;
  gap: var(--space-3);
  margin: 0;
}
.hero-number strong {
  font-size: clamp(68px, 7.4vw, 102px);
  line-height: .8;
}
.hero-number span {
  padding-bottom: 2px;
  font-size: var(--text-small);
}
.calorie-equation {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0 var(--space-4);
  padding-bottom: 3px;
  font-size: var(--text-small);
  line-height: 1.3;
}
.calorie-equation span {
  display: grid;
  gap: 2px;
}
.calorie-equation b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.calorie-equation > i { display: none; }
.fuel-meter {
  position: relative;
  inset: auto;
  height: 3px;
  margin-top: 18px;
}
.macro-panel {
  padding: 24px 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
}
.macro-row {
  min-width: 0;
  padding: 3px 13px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: var(--space-2);
  border-bottom: 0;
  border-inline-start: 1px solid var(--chrome-line);
}
.macro-row:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}
.macro-row:last-child { padding-inline-end: 0; }
.macro-row span {
  font-size: var(--text-small);
  line-height: 1.2;
}
.macro-row b {
  overflow: hidden;
  font-size: var(--text-small);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.macro-row div {
  grid-column: auto;
  height: 3px;
}

@media (max-width: 1120px) {
  .fuel-hero { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); }
  .hero-number strong { font-size: clamp(68px, 8vw, 88px); }
  .calorie-equation { gap: 0 var(--space-3); }
  .macro-panel { padding-inline: 18px; }
  .macro-row { padding-inline: 10px; }
}

@media (max-width: 780px) {
  .fuel-hero {
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .fuel-hero::after {
    right: -90px;
    bottom: -205px;
  }
  .fuel-number-block {
    min-height: 0;
    padding: 16px 18px 15px;
  }
  .fuel-number-block::before {
    width: 196px;
    top: 58%;
    left: 4px;
  }
  .calorie-overview {
    gap: var(--space-3);
    margin-top: var(--space-1);
  }
  .hero-number { gap: var(--space-2); }
  .hero-number strong { font-size: clamp(58px, 17vw, 72px); }
  .hero-number span { font-size: var(--text-small); }
  .calorie-equation {
    gap: 0 var(--space-3);
    padding-bottom: 1px;
    font-size: var(--text-small);
  }
  .calorie-equation b { font-size: 16px; }
  .fuel-meter { margin-top: var(--space-3); }
  .macro-panel {
    padding: 15px 18px 16px;
    border-top: 1px solid var(--chrome-line);
  }
  .macro-row {
    padding: 0 10px;
    gap: 7px;
  }
  .macro-row span { font-size: var(--text-small); }
  .macro-row b { font-size: var(--text-small); }
}

@media (max-width: 360px) {
  .fuel-hero .text-button { padding-inline: var(--space-2); }
  .goal-context { font-size: var(--text-small); }
  .hero-number strong { font-size: 54px; }
  .calorie-equation { gap: 0 var(--space-2); }
  .macro-panel { padding-inline: 14px; }
  .macro-row { padding-inline: 8px; }
}

/* One decision at a time ---------------------------------------------------- */
.coach-strip {
  padding: 16px 18px 17px;
  display: grid;
  gap: var(--space-1);
}
.coach-context,
.next-effort-mark {
  color: var(--route);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.coach-strip.fuel .coach-context { color: var(--sun); }
.coach-strip.caution .coach-context { color: var(--effort); }
.coach-strip > strong {
  font-size: 18px;
  line-height: 1.3;
}
.coach-strip > p {
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.5;
}
.coach-meal {
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 700;
}
#effort-route-list { display: contents; }
.fuel-stop {
  cursor: default;
  transition: none;
}
.fuel-stop:hover,
.fuel-stop:focus-visible,
html[dir="rtl"] .fuel-stop:hover,
html[dir="rtl"] .fuel-stop:focus-visible {
  background: transparent;
  transform: none;
}
.effort-stop.easy .route-node { background: var(--recovery); box-shadow: 0 0 0 1px var(--recovery); }
.effort-stop.quality .route-node { background: var(--effort); box-shadow: 0 0 0 1px var(--effort); }
.effort-stop.long .route-node { background: var(--sun); box-shadow: 0 0 0 1px var(--sun); }
.empty-effort-stop .route-node { background: var(--paper-deep); box-shadow: 0 0 0 1px var(--line); }
.next-effort-mark { display: block; margin: 6px 0 2px; }

.entry-mode-row { align-items: center; }
.entry-primary-label {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}
.entry-primary-label i { color: var(--route); font-style: normal; }
.entry-alternatives { position: relative; }
.entry-alternatives > summary {
  min-height: var(--tap-min);
  padding: 10px 13px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--ink-soft);
  font-size: var(--text-small);
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.entry-alternatives > summary::-webkit-details-marker { display: none; }
.entry-alternatives > summary::after { content: "+"; margin-inline-start: var(--space-2); color: var(--route); }
.entry-alternatives[open] > summary::after { content: "−"; }
.entry-alternatives > div {
  position: absolute;
  z-index: 10;
  top: calc(100% + var(--space-1));
  inset-inline-end: 0;
  width: 210px;
  padding: var(--space-1);
  display: grid;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.entry-alternatives > div button {
  min-height: var(--tap-min);
  padding: 9px 12px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--panel-muted);
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 750;
  text-align: start;
  cursor: pointer;
}
.entry-alternatives .barcode-scan-button { min-width: 0; justify-content: flex-start; }
.food-composer.manual-mode .entry-mode-row { display: none; }
.entry-return-button {
  width: fit-content;
  min-height: var(--tap-min);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--route);
  font-size: var(--text-small);
  font-weight: 750;
  cursor: pointer;
}

.update-input-shell { position: relative; }
.update-dock .update-input-shell #daily-update-text { padding-inline-end: 66px; }
.update-dock .update-input-shell .daily-update-record {
  position: absolute;
  top: var(--space-2);
  inset-inline-end: var(--space-2);
  width: var(--tap-min);
  height: var(--tap-min);
  min-height: var(--tap-min);
  display: grid;
  place-content: center;
  padding: 0;
  border-radius: 50%;
  box-shadow: none;
}
.update-dock-actions { grid-template-columns: 1fr; }
.update-dock-submit { width: 100%; }
.plan-step-detail {
  margin-top: var(--space-2) !important;
  color: var(--ink-soft);
  font-size: var(--text-small) !important;
  line-height: 1.45 !important;
}
.smart-picks > summary,
.weekly-plan-editor > summary {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.smart-picks > summary::-webkit-details-marker,
.weekly-plan-editor > summary::-webkit-details-marker { display: none; }
.smart-picks > summary strong { font-family: var(--display); font-size: 18px; }
.smart-picks > summary span {
  color: var(--route);
  font-size: 20px;
  transition: transform .2s ease;
}
.smart-picks[open] > summary span { transform: rotate(45deg); }
.smart-picks-content { padding-top: var(--space-3); border-top: 1px solid var(--line); }
.smart-picks-content > small {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.45;
}
.weekly-plan-editor { margin-top: var(--space-3); }
.weekly-plan-editor > summary {
  width: fit-content;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--ink-soft);
  font-size: var(--text-small);
  font-weight: 750;
}
.weekly-plan-editor > summary::after { content: "+"; color: var(--route); font-size: 15px; }
.weekly-plan-editor[open] > summary::after { content: "−"; }
.weekly-plan-editor > form { margin-top: var(--space-3); }

@media (max-width: 780px) {
  .fuel-line-sheet { padding: 18px 16px; }
  .fuel-line-sheet > .section-heading { margin-bottom: 10px; }
  .coach-strip { margin-bottom: 14px; padding: 12px 14px; gap: 3px; }
  .coach-strip > strong { font-size: 17px; }
  .coach-strip > p { font-size: var(--text-body); line-height: 1.4; }
  .coach-meal { margin-top: 3px; padding-top: 7px; font-size: var(--text-small); line-height: 1.4; }
  .fuel-line::before { left: 55px; }
  .fuel-stop { min-height: 76px; grid-template-columns: 46px 1fr; gap: 22px; padding: 3px 0 14px; }
  .recovery-stop { min-height: 122px; }
  .route-node { left: 48px; }
  .stop-time { padding-top: 9px; font-size: var(--text-small); }
  .fuel-stop-copy { padding-inline-start: 7px; }
  .fuel-stop h3 { margin: 3px 0; font-size: 19px; }
  .stop-summary { margin-top: 3px; font-size: var(--text-small); line-height: 1.35; }
  .mini-metrics { margin-top: 6px; gap: 5px; }
  .mini-metrics span { padding: 5px 7px; font-size: var(--text-small); }
  .next-effort-mark { margin-top: 4px; }
  .entry-mode-row { margin-bottom: var(--space-3); }
  .entry-primary-label { font-size: 15px; }
  .entry-alternatives > summary { font-size: var(--text-small); }
  .update-dock-actions { grid-template-columns: 1fr; }
  html[dir="rtl"] .fuel-line::before { right: 55px; }
  html[dir="rtl"] .route-node { right: 48px; }
}

/* Multi-meal review -------------------------------------------------------- */
.ai-batch-head {
  margin: -16px -16px 16px;
  padding: 17px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  border-radius: var(--control-radius) var(--control-radius) 0 0;
  background: var(--chrome);
  color: var(--on-inverse);
}
.ai-batch-head span { color: var(--recovery); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.ai-batch-head h3 { margin: 4px 0 0; color: var(--on-inverse); font-size: 22px; }
.ai-batch-head > strong { font-family: var(--display); font-size: 28px; white-space: nowrap; }
.ai-batch-head > strong small { font-family: var(--utility); font-size: var(--text-small); letter-spacing: .06em; text-transform: uppercase; }
.ai-draft-list { display: grid; gap: 14px; }
.ai-meal-draft { overflow: hidden; border: 1px solid var(--line); border-top: 3px solid var(--sun); border-radius: var(--radius-small); background: var(--panel); }
.ai-meal-draft:nth-child(2) { border-top-color: var(--recovery); }
.ai-meal-draft:nth-child(3) { border-top-color: var(--route); }
.ai-meal-draft:nth-child(4) { border-top-color: var(--effort); }
.ai-meal-draft .ai-preview-head { padding: 13px 14px; background: var(--panel-muted); }
.ai-preview-head label { display: block; margin-top: 3px; }
.ai-preview-head select {
  min-height: 34px;
  padding: 0 30px 0 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 0;
  background-color: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}
html[dir="rtl"] .ai-preview-head select { padding: 0 0 0 30px; }
.ai-meal-draft .ai-food-lines { margin: 0; padding: 12px; }
.ai-meal-draft .ai-unmatched { margin: 0 12px 12px; }
.meal-entry-editor { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel-muted) 72%, var(--panel)); }
.meal-entry-editor summary {
  min-height: var(--tap-min);
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--route);
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.meal-entry-editor summary::-webkit-details-marker { display: none; }
.meal-entry-editor summary::after { content: "+"; font-size: 17px; font-weight: 500; }
.meal-entry-editor[open] summary::after { content: "−"; }
.meal-entry-edit-note { margin: -2px 13px 11px; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }
.meal-entry-edit-grid { padding: 0 13px 13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.meal-entry-edit-grid label { min-width: 0; display: grid; gap: 5px; }
.meal-entry-edit-grid label.wide { grid-column: span 2; }
.meal-entry-edit-grid label > span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.meal-entry-edit-grid input,
.meal-entry-edit-grid select { width: 100%; min-height: 42px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--input); color: var(--ink); font: var(--text-body) var(--body); }
.meal-entry-edit-grid input:focus,
.meal-entry-edit-grid select:focus { border-color: var(--route); outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.meal-entry-confirm { display: flex; justify-content: flex-end; padding: 0 13px 13px; }
.meal-entry-confirm .quiet-button { min-height: 40px; padding: 8px 16px; }
.ai-save-guidance { margin: 13px 0 0; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--route) 28%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--route) 6%, var(--panel)); color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }

@media (max-width: 560px) {
  .ai-batch-head { align-items: flex-start; }
  .ai-batch-head h3 { font-size: 20px; }
  .meal-entry-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meal-entry-edit-grid label.wide { grid-column: 1 / -1; }
}

/* Daily nutrition log ----------------------------------------------------- */
.food-day-navigation {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: 46px minmax(220px, auto) 46px 1fr;
  align-items: center;
  gap: 8px;
}
.food-day-navigation > button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.food-day-navigation > button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.food-day-navigation > button:disabled { opacity: .38; cursor: default; }
.day-nav-icon { width: 20px; height: 20px; display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.food-day-current { position: relative; min-width: 250px; min-height: 46px; padding: 8px 42px 8px 14px; display: grid; align-content: center; justify-items: start; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); text-align: start; cursor: pointer; }
.food-day-current span { color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.food-day-current strong { margin-top: 2px; font-family: var(--display); font-size: 17px; line-height: 1.05; }
.food-day-calendar-icon { position: absolute; width: 21px; height: 21px; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); fill: none; stroke: var(--route); stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.food-day-current input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.food-day-current:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.food-day-navigation .food-day-today { width: fit-content; padding-inline: 16px; border-color: color-mix(in srgb, var(--route) 38%, var(--line)); color: var(--route); font-size: var(--text-small); font-weight: 800; }

.food-log-actions { display: flex; align-items: center; gap: 5px; }
.edit-button { min-height: 28px; padding: 4px 8px; border: 0; border-radius: 999px; background: var(--route-soft); color: var(--route); font-size: var(--text-small); font-weight: 800; cursor: pointer; }
.food-composer.editing-food { box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-soft); }
.food-composer.editing-food .manual-entry-panel { border-color: color-mix(in srgb, var(--route) 55%, var(--line)); }

.coach-meal:has(> span) { display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 7px 12px; }
.coach-meal > b { color: var(--route); font-family: var(--utility); font-size: var(--text-small); letter-spacing: .07em; text-transform: uppercase; }
.coach-meal > span { padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.plan-step-label { display: block; color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }

@media (max-width: 780px) {
  .food-day-navigation { position: sticky; top: 64px; z-index: 8; grid-template-columns: 42px minmax(0, 1fr) 42px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: var(--shadow-soft); backdrop-filter: blur(16px); }
  .food-day-navigation > button { min-height: 42px; }
  .food-day-current { min-width: 0; }
  .food-day-navigation .food-day-today { grid-column: 1 / -1; width: 100%; min-height: 36px; }
  .coach-meal:has(> span) { grid-template-columns: 1fr; }
  .coach-meal > span { padding: 6px 0 0; border: 0; border-top: 1px solid var(--line); }
  .tomorrow-meal-timeline { display: grid; grid-template-columns: 1fr; }
  .portion-presets > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .food-day-current strong { max-width: 190px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .food-log-item { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .food-log-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .piece-portion-fields, .spoon-portion-fields { grid-template-columns: 1fr; }
}

/* Meal diary and quick-entry sheet --------------------------------------- */
body.meal-entry-open { overflow: hidden; }
.food-layout { display: block; }
.meal-diary { max-width: 920px; margin-inline: auto; }
.meal-diary-heading { align-items: end; margin-bottom: 18px; }
.meal-diary-heading h2 { margin: 3px 0 2px; font-size: 31px; }
.meal-diary-heading p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); }
.meal-diary-totals { display: grid; justify-items: end; gap: 1px; }
.meal-diary-totals strong { font-family: var(--display); font-size: 22px; }
.meal-diary-totals span { color: var(--route); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .06em; }
.meal-diary-totals small { color: var(--ink-soft); font-size: var(--text-small); }
.meal-bucket-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meal-bucket {
  --meal-accent: var(--route);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow: 0 6px 22px rgba(8, 23, 31, .045);
}
.meal-bucket[data-meal="breakfast"] { --meal-accent: #d6a42c; }
.meal-bucket[data-meal="lunch"] { --meal-accent: #2f8fb7; }
.meal-bucket[data-meal="snack"] { --meal-accent: #4e9a77; }
.meal-bucket[data-meal="dinner"] { --meal-accent: #7667bd; }
.meal-bucket:is([data-meal="evening_snack"], [data-meal="night_snack"]) { --meal-accent: var(--route); }
.meal-danger-zone { display: block; color: var(--ink-soft); font-family: var(--body); font-size: var(--text-small); margin-block-start: var(--space-1); }
.meal-bucket::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--meal-accent); }
html[dir="rtl"] .meal-bucket::before { inset: 0 0 0 auto; }
.meal-bucket > header,
.meal-bucket:not(.has-food) > header { min-height: 76px; padding: 13px 14px 11px 16px; border-bottom: 0; background: transparent; }
html[dir="rtl"] .meal-bucket > header { padding: 13px 16px 11px 14px; }
.meal-bucket-name { min-width: 0; display: flex; align-items: center; gap: 11px; }
.meal-bucket > header > .meal-bucket-name { gap: 11px; }
.meal-bucket-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--meal-accent) 13%, var(--panel)); color: var(--meal-accent); }
.meal-bucket > header > div:first-child > .meal-bucket-icon { width: 39px; height: 39px; border-radius: 12px; background: color-mix(in srgb, var(--meal-accent) 13%, var(--panel)); color: var(--meal-accent); }
.meal-bucket-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.meal-bucket-name h3 { margin: 0; font-size: 20px; }
.meal-bucket-name small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: var(--text-small); }
.meal-bucket-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.meal-bucket > header .meal-bucket-head-actions { gap: 7px; }
.meal-bucket-head-actions b { color: var(--ink-soft); white-space: nowrap; }
.meal-add-button { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; }
.meal-add-button span { font-size: 16px; font-weight: 500; line-height: 1; }
.meal-empty-add { width: 100%; min-height: 55px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--meal-accent) 5%, var(--panel)); color: var(--ink); text-align: start; cursor: pointer; }
.meal-empty-add span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--meal-accent); color: white; font-size: 19px; line-height: 1; }
.meal-empty-add strong { color: var(--meal-accent); font-size: var(--text-small); }
.meal-empty-add:hover, .meal-empty-add:focus-visible { background: color-mix(in srgb, var(--meal-accent) 10%, var(--panel)); }
.meal-bucket.has-food > div { padding: 0 15px 10px; border-top: 1px solid var(--line); }
.meal-bucket .food-log-item { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 0; }
.meal-bucket .food-log-item strong { font-size: 18px; }
.meal-bucket .meal-clear-button { width: fit-content; min-height: 31px; margin: 2px 0 0 auto; display: block; }
html[dir="rtl"] .meal-bucket .meal-clear-button { margin: 2px auto 0 0; }

.meal-entry-dialog {
  --meal-accent: var(--route);
  width: min(680px, calc(100vw - 28px));
  max-width: none;
  max-height: min(820px, calc(var(--meal-viewport-height, 100dvh) - 28px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(3, 12, 18, .38);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
}
.meal-entry-dialog:not([open]) { display: none !important; }
.meal-entry-dialog::backdrop { background: rgba(2, 11, 16, .7); backdrop-filter: blur(7px); }
.meal-entry-dialog[data-meal="breakfast"] { --meal-accent: #d6a42c; }
.meal-entry-dialog[data-meal="lunch"] { --meal-accent: #2f8fb7; }
.meal-entry-dialog[data-meal="snack"] { --meal-accent: #4e9a77; }
.meal-entry-dialog[data-meal="dinner"] { --meal-accent: #7667bd; }
.meal-entry-sheet { display: block; }
.meal-entry-header { min-height: 86px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--meal-accent); }
html[dir="rtl"] .meal-entry-header { box-shadow: inset -4px 0 0 var(--meal-accent); }
.meal-entry-header span { color: var(--meal-accent); font-family: var(--utility); font-size: var(--text-small); font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.meal-entry-header h2 { margin: 3px 0 0; font-size: 28px; }
.meal-entry-header #meal-entry-timing-note { display: block; margin-top: 4px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 650; letter-spacing: 0; text-transform: none; }
.meal-entry-header > button { width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-muted); color: var(--ink); font-size: 24px; cursor: pointer; }
.meal-entry-tools { padding: 10px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; border-bottom: 1px solid var(--line); background: var(--panel-muted); }
.meal-entry-tools > button,
.meal-entry-tool { min-width: 0; min-height: 58px; margin: 0; padding: var(--space-1); position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 24px auto; place-items: center; align-content: start; gap: var(--space-1); border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink-soft); font: inherit; text-align: center; cursor: pointer; }
.meal-entry-tools > button svg,
.meal-entry-tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.meal-entry-tools > button span,
.meal-entry-tool span { display: block; min-width: 0; max-width: 100%; align-self: start; font-size: var(--text-small); font-weight: 750; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; text-wrap: balance; unicode-bidi: plaintext; }
.meal-entry-tools > button.active { border-color: color-mix(in srgb, var(--meal-accent) 35%, var(--line)); background: color-mix(in srgb, var(--meal-accent) 10%, var(--panel)); color: var(--meal-accent); }
.meal-entry-tool input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.meal-entry-tools .voice-button { width: auto; height: auto; inset: auto; box-shadow: none; }
.meal-entry-tools .voice-button.recording { border-color: var(--effort); background: var(--effort-soft); color: var(--effort); }
.meal-photo-tool.working { border-color: var(--meal-accent); color: var(--meal-accent); animation: record-pulse 1.1s ease-in-out infinite; pointer-events: none; }
.meal-photo-status { min-height: 0; margin: 0; padding: 0 20px; color: var(--recovery); font-size: var(--text-small); line-height: 1.4; }
.meal-photo-status:not(:empty) { padding-top: 10px; }
.meal-entry-panel { flex-shrink: 0; min-height: 0; padding: 18px 20px 22px; }
.meal-entry-dialog .manual-entry-panel,
.meal-entry-dialog .ai-entry-panel { padding: 0; background: transparent; color: var(--ink); }
.meal-entry-dialog .catalog-search { margin: 0 0 14px; padding: 0; border: 0; }
.meal-entry-dialog .catalog-search label > span:first-child { display: block; margin-bottom: 7px; color: var(--ink); font-size: var(--text-small); font-weight: 750; }
.meal-entry-dialog .catalog-search input { min-height: 52px; border-radius: 13px; background: var(--input); }
.meal-entry-dialog .catalog-search-icon { width: 20px; height: 20px; bottom: 16px; font-size: inherit; fill: none; stroke: var(--meal-accent); stroke-width: 1.7; stroke-linecap: round; }
.meal-entry-dialog .catalog-results { position: static; margin-top: var(--space-2); max-height: none; overflow: visible; overscroll-behavior: auto; border-radius: 13px; background: var(--panel); }
.direct-portion-editor { margin: 0 0 14px; padding: 14px; display: grid; gap: 12px; border: 1px solid color-mix(in srgb, var(--meal-accent) 32%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--meal-accent) 7%, var(--panel-muted)); }
.direct-portion-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.direct-portion-heading strong { font-size: 15px; }
.direct-portion-heading small, .direct-portion-editor > small { color: var(--ink-soft); font-size: var(--text-small); }
.direct-portion-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(120px, .8fr); gap: 10px; align-items: end; }
.direct-portion-amount, .direct-portion-unit { display: grid; gap: 6px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; }
.portion-stepper { display: grid; grid-template-columns: 48px minmax(70px, 1fr) 48px; align-items: stretch; border: 1px solid var(--line); border-radius: 13px; background: var(--input); overflow: hidden; }
.portion-stepper button { min-height: 50px; padding: 0; border: 0; background: var(--panel-muted); color: var(--meal-accent); font-size: 24px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.portion-stepper input { width: 100%; min-width: 0; min-height: 50px; padding: 8px; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: var(--input); color: var(--ink); font-size: 17px; font-weight: 800; text-align: center; }
.direct-portion-unit select { width: 100%; min-height: 52px; background: var(--input); font-size: 16px; }
.shared-meal-intro { margin-bottom: 14px; padding: 13px; border: 1px solid color-mix(in srgb, var(--meal-accent) 30%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--meal-accent) 7%, var(--panel-muted)); }
.shared-meal-intro strong { font-size: 17px; }
.shared-meal-intro p { margin: 5px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.shared-meal-name { margin-bottom: 13px; display: grid; gap: 7px; color: var(--ink); font-size: var(--text-small); font-weight: 780; }
.shared-meal-name input { min-height: 50px; background: var(--input); }
.shared-meal-toggle { margin: 12px 0; padding: 12px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); cursor: pointer; }
.shared-meal-toggle input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--meal-accent); }
.shared-meal-toggle span { display: grid; gap: 3px; }
.shared-meal-toggle strong { font-size: var(--text-small); }
.shared-meal-toggle small { color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }
.manual-primary-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.manual-primary-fields label,
.nutrition-adjustments label { display: grid; gap: 6px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; }
.manual-primary-fields input { min-height: 45px; }
.nutrition-adjustments { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); }
.nutrition-adjustments > summary { min-height: 42px; padding: 10px 12px; color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; cursor: pointer; }
.nutrition-adjustments > div { padding: 0 10px 10px; }
.manual-entry-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.manual-entry-footer .form-action-row { margin-inline-start: auto; }
.meal-entry-dialog .meal-description-label { color: var(--ink) !important; font-family: var(--body); font-size: var(--text-small); font-weight: 780; }
.meal-entry-dialog .voice-composer textarea { min-height: 104px; padding: 13px; border-color: var(--line); background: var(--input); color: var(--ink); font-size: var(--text-body); }
.meal-entry-dialog .ai-entry-panel > .primary-button { width: 100%; }
.meal-entry-dialog .voice-status { margin: 0; color: var(--recovery); }
.meal-entry-dialog .ai-meal-preview { padding: 12px; }
.meal-entry-dialog .smart-picks { margin: 0; padding: 0; border: 0; background: transparent; }
.meal-entry-dialog .smart-picks-heading { margin-bottom: 13px; }
.meal-entry-dialog .smart-picks-heading strong { font-size: 21px; }
.meal-entry-dialog .smart-picks-heading small { margin-top: 4px; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }
.meal-entry-dialog .shortcut-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meal-entry-dialog .shortcut-button { border-radius: 12px; }
.meal-entry-dialog :focus-visible { outline: 3px solid color-mix(in srgb, var(--meal-accent) 28%, transparent); outline-offset: 2px; }

@media (max-width: 780px) {
  .meal-diary { padding: 18px 15px; }
  .meal-diary-heading h2 { font-size: 27px; }
  .meal-diary-heading p { font-size: var(--text-body); }
  .meal-bucket-list { grid-template-columns: 1fr; gap: 10px; }
  .meal-bucket > header,
  .meal-bucket:not(.has-food) > header { min-height: 70px; }
  .meal-entry-dialog {
    width: 100vw;
    top: calc(var(--meal-viewport-top, 0px) + max(12px, env(safe-area-inset-top, 0px)));
    bottom: auto;
    max-height: calc(var(--meal-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top, 0px)));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 24px 24px 0 0;
  }
  .meal-entry-dialog input,
  .meal-entry-dialog select,
  .meal-entry-dialog textarea { font-size: 16px !important; }
  .direct-portion-grid { grid-template-columns: 1fr; }
  .meal-entry-header { min-height: 74px; padding: 13px 17px; }
  .meal-entry-header h2 { font-size: 25px; }
  .meal-entry-tools { padding: 8px 10px; gap: 3px; }
  .meal-entry-tools > button,
  .meal-entry-tool { min-height: 55px; padding-inline: 2px; }
  .meal-entry-tools > button span,
  .meal-entry-tool span { font-size: var(--text-small); }
  .meal-entry-panel { padding: 15px 16px 24px; }
  .manual-entry-footer { align-items: stretch; flex-direction: column; }
  .manual-entry-footer .form-action-row { width: 100%; margin: 0; flex-direction: row; }
  .manual-entry-footer .form-action-row > button { flex: 1; }
  .meal-entry-dialog .shortcut-row { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .meal-diary-heading { align-items: start; }
  .meal-diary-totals strong { font-size: 19px; }
  .meal-bucket .food-log-item { grid-template-columns: minmax(0, 1fr) auto; }
  .meal-bucket .food-log-actions { grid-column: 1 / -1; }
}

/* Weekly meal forecast */
.meal-forecast-sheet {
  --forecast-accent: var(--route);
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 5%, color-mix(in srgb, var(--forecast-accent) 10%, transparent) 0, transparent 29%),
    var(--panel);
}
.meal-forecast-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 26px; }
.meal-forecast-header h2 { margin: 5px 0 7px; font-size: clamp(29px, 3.2vw, 44px); line-height: .98; letter-spacing: -.045em; }
.meal-forecast-header p { max-width: 660px; margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.65; }
.meal-forecast-balance { min-width: 180px; padding: 13px 15px; display: grid; gap: 2px; border: 1px solid color-mix(in srgb, var(--forecast-accent) 30%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--forecast-accent) 7%, var(--panel)); }
.meal-forecast-balance span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.meal-forecast-balance strong { color: var(--forecast-accent); font-size: 22px; line-height: 1.15; }
.meal-forecast-balance small { color: var(--ink-soft); font-size: var(--text-small); }
.meal-forecast-balance.over { border-color: color-mix(in srgb, var(--effort) 44%, var(--line)); background: color-mix(in srgb, var(--effort) 7%, var(--panel)); }
.meal-forecast-balance.over strong { color: var(--effort); }
.meal-forecast-meter { height: 7px; margin: 21px 0 17px; position: relative; border-radius: 99px; background: var(--line); }
.meal-forecast-meter > span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--forecast-accent) 68%, #fff), var(--forecast-accent)); transition: width .35s ease; }
.meal-forecast-meter > i { width: 2px; height: 17px; position: absolute; top: -5px; border-radius: 2px; background: var(--ink); transform: translateX(-1px); }
.meal-forecast-days { display: grid; grid-template-columns: repeat(7, minmax(76px, 1fr)); gap: 7px; }
.meal-forecast-days > button { min-width: 0; min-height: 82px; padding: 10px 8px; display: grid; place-items: center; align-content: center; gap: 1px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel-muted) 75%, transparent); color: var(--ink-soft); font: inherit; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.meal-forecast-days > button:hover { border-color: color-mix(in srgb, var(--forecast-accent) 35%, var(--line)); transform: translateY(-1px); }
.meal-forecast-days > button span { font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meal-forecast-days > button strong { color: var(--ink); font-size: 22px; line-height: 1.05; }
.meal-forecast-days > button small { margin-top: 4px; font-size: var(--text-small); white-space: nowrap; }
.meal-forecast-days > button.today span::after { content: " ·"; }
.meal-forecast-days > button.active { border-color: color-mix(in srgb, var(--forecast-accent) 60%, var(--line)); background: var(--forecast-accent); color: rgba(255,255,255,.78); box-shadow: 0 9px 24px color-mix(in srgb, var(--forecast-accent) 25%, transparent); }
.meal-forecast-days > button.active strong { color: #fff; }
.meal-forecast-detail { margin-top: 16px; border: 1px solid var(--line); border-radius: 19px; background: color-mix(in srgb, var(--panel) 92%, transparent); overflow: hidden; }
.meal-forecast-detail > header { min-height: 82px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: var(--panel-muted); }
.meal-forecast-detail > header > div:first-child span { color: var(--ink-soft); font-family: var(--utility); font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meal-forecast-detail h3 { margin: 4px 0 0; font-size: 24px; }
.forecast-confidence { min-width: 126px; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; text-align: end; }
.forecast-confidence strong { grid-row: 1 / 3; color: var(--forecast-accent); font-size: 27px; }
.forecast-confidence span { color: var(--ink); font-size: var(--text-small); font-weight: 760; }
.forecast-confidence small { color: var(--ink-soft); font-size: var(--text-small); }
.forecast-meal-list { display: grid; }
.forecast-meal-row { min-height: 96px; padding: 14px 16px; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.forecast-meal-row:last-child { border-bottom: 0; }
.forecast-meal-time { align-self: start; padding-top: 3px; display: grid; gap: 3px; }
.forecast-meal-time span { color: var(--forecast-accent); font-family: var(--utility); font-size: var(--text-small); font-weight: 830; letter-spacing: .07em; text-transform: uppercase; }
.forecast-meal-time b { color: var(--ink-soft); font-size: var(--text-small); }
.forecast-meal-choice { min-width: 0; display: grid; gap: 3px; }
.forecast-meal-choice > strong { font-size: 15px; line-height: 1.25; }
.forecast-meal-choice > small { color: var(--ink-soft); font-size: var(--text-small); }
.forecast-history-proof { width: fit-content; margin-top: 4px; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--recovery) 11%, var(--panel)); color: var(--recovery); font-size: var(--text-small); font-style: normal; font-weight: 760; }
.forecast-options { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.forecast-options button,
.forecast-event-choices button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-muted); color: var(--ink-soft); font: inherit; font-size: var(--text-small); font-weight: 720; cursor: pointer; }
.forecast-options button.active,
.forecast-event-choices button.active { border-color: color-mix(in srgb, var(--forecast-accent) 48%, var(--line)); background: color-mix(in srgb, var(--forecast-accent) 11%, var(--panel)); color: var(--forecast-accent); }
.forecast-log-button { min-height: 38px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid color-mix(in srgb, var(--forecast-accent) 40%, var(--line)); border-radius: 11px; background: transparent; color: var(--forecast-accent); font: inherit; font-size: var(--text-small); font-weight: 800; cursor: pointer; white-space: nowrap; }
.forecast-log-button span { font-size: 15px; }
html[dir="rtl"] .forecast-log-button span { transform: rotate(180deg); }
.forecast-future-label { padding: 5px 9px; border-radius: 99px; background: var(--panel-muted); color: var(--ink-soft); font-size: var(--text-small); font-weight: 750; }
.forecast-variable-event { margin-top: 13px; padding: 15px 17px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; border: 1px dashed color-mix(in srgb, var(--recovery) 45%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--recovery) 6%, var(--panel)); }
.forecast-event-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--recovery) 15%, var(--panel)); color: var(--recovery); font-size: 20px; }
.forecast-variable-event strong { display: block; font-size: var(--text-small); }
.forecast-variable-event p { max-width: 660px; margin: 3px 0 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.45; }
.forecast-event-choices { display: flex; gap: 5px; }
.meal-forecast-footer { min-height: 45px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--ink-soft); font-size: var(--text-small); }
.meal-forecast-footer > span::before { content: "●"; margin-inline-end: 7px; color: var(--recovery); font-size: var(--text-small); }
.meal-forecast-footer button { padding: 5px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--ink-soft); font: inherit; font-size: var(--text-small); font-weight: 750; cursor: pointer; }

@media (max-width: 780px) {
  .meal-forecast-sheet { margin-inline: -2px; padding: 21px 15px; border-radius: 20px; }
  .meal-forecast-header { grid-template-columns: 1fr; align-items: stretch; gap: 15px; }
  .meal-forecast-header h2 { font-size: 33px; }
  .meal-forecast-balance { min-width: 0; grid-template-columns: 1fr auto; align-items: baseline; }
  .meal-forecast-balance small { grid-column: 1 / -1; }
  .meal-forecast-days { margin-inline: -15px; padding: 0 15px 5px; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .meal-forecast-days::-webkit-scrollbar { display: none; }
  .meal-forecast-days > button { min-width: 76px; scroll-snap-align: start; }
  .meal-forecast-detail > header { align-items: start; }
  .forecast-meal-row { grid-template-columns: 68px minmax(0, 1fr); gap: 12px; }
  .forecast-log-button,
  .forecast-future-label { grid-column: 2; width: fit-content; }
  .forecast-variable-event { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .forecast-event-choices { grid-column: 2; flex-wrap: wrap; }
  .meal-forecast-footer { align-items: start; flex-direction: column; gap: 8px; }
}

@media (max-width: 440px) {
  .meal-forecast-detail > header { gap: 10px; }
  .meal-forecast-detail h3 { font-size: 20px; }
  .forecast-confidence { min-width: 98px; }
  .forecast-confidence strong { font-size: 23px; }
  .forecast-confidence span { display: none; }
  .forecast-meal-row { grid-template-columns: 1fr; }
  .forecast-log-button,
  .forecast-future-label { grid-column: 1; }
  .forecast-options { flex-wrap: nowrap; margin-inline-end: -5px; padding-bottom: 3px; overflow-x: auto; }
  .forecast-options button { white-space: nowrap; }
}

/* Next weigh-in energy-balance forecast ---------------------------------- */
.weight-prediction-card {
  --prediction-accent: var(--recovery);
  min-height: 210px;
  margin-bottom: 14px;
  padding: clamp(22px, 3.5vw, 38px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  align-items: stretch;
  gap: clamp(24px, 4vw, 54px);
  overflow: hidden;
  position: relative;
  border: 1px solid color-mix(in srgb, var(--prediction-accent) 34%, var(--line));
  border-radius: 28px;
  background:
    radial-gradient(circle at 8% 125%, color-mix(in srgb, var(--prediction-accent) 15%, transparent), transparent 17rem),
    linear-gradient(135deg, color-mix(in srgb, var(--prediction-accent) 7%, var(--panel)), var(--panel));
  box-shadow: var(--shadow);
}
#progress-view .weight-prediction-card { margin: 22px 0 0; }
.weight-prediction-card::after {
  content: "";
  width: 170px;
  height: 170px;
  position: absolute;
  inset-inline-end: 31%;
  bottom: -138px;
  border: 1px solid color-mix(in srgb, var(--prediction-accent) 30%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 24px color-mix(in srgb, var(--prediction-accent) 4%, transparent);
  pointer-events: none;
}
.weight-prediction-card.is-gain { --prediction-accent: var(--sun); }
.weight-prediction-card.is-stable,
.weight-prediction-card.is-learning { --prediction-accent: var(--route); }
.weight-prediction-main,
.weight-prediction-confidence { min-width: 0; position: relative; z-index: 1; }
.weight-prediction-main .section-kicker { color: var(--prediction-accent); }
.weight-prediction-main h2 {
  max-width: 720px;
  margin: 5px 0 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.035em;
}
.weight-prediction-readout {
  margin-top: 21px;
  display: flex;
  align-items: flex-end;
  gap: 13px;
}
.weight-prediction-readout strong {
  color: var(--prediction-accent);
  font-family: var(--number, var(--display));
  font-size: clamp(70px, 8vw, 108px);
  font-weight: 700;
  line-height: .72;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
.weight-prediction-readout span {
  max-width: 120px;
  padding-bottom: 2px;
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}
.weight-prediction-main > p {
  max-width: 700px;
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.6;
}
.weight-prediction-confidence {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--prediction-accent) 24%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--prediction-accent) 5%, var(--panel-muted));
}
.weight-prediction-confidence header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.weight-prediction-confidence header span {
  color: var(--ink-soft);
  font-family: var(--utility);
  font-size: var(--text-small);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.weight-prediction-confidence header strong {
  color: var(--prediction-accent);
  font-family: var(--number, var(--display));
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}
.weight-prediction-meter {
  height: 7px;
  margin: 13px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.weight-prediction-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--prediction-accent) 55%, #fff), var(--prediction-accent));
  transition: width .45s ease;
}
.weight-prediction-confidence p { margin: 0; color: var(--ink-soft); font-size: var(--text-body); line-height: 1.55; }
.weight-prediction-card.is-learning .weight-prediction-readout strong { opacity: .45; }
.weight-prediction-card.is-learning .weight-prediction-readout span { max-width: 190px; text-transform: none; }

@media (max-width: 900px) {
  .weight-prediction-card { grid-template-columns: 1fr; gap: 20px; }
  .weight-prediction-card::after { inset-inline-end: -80px; }
}

@media (max-width: 780px) {
  .weight-prediction-card { min-height: 0; padding: 21px 17px; border-radius: 22px; }
  .weight-prediction-main h2 { font-size: 28px; }
  .weight-prediction-readout strong { font-size: clamp(68px, 22vw, 88px); }
  .weight-prediction-confidence { padding: 15px; }
}

@media (max-width: 440px) {
  .weight-prediction-readout { align-items: flex-end; gap: 10px; }
  .weight-prediction-readout strong { font-size: 66px; }
  .weight-prediction-readout span { max-width: 105px; font-size: var(--text-small); }
  .weight-prediction-card.is-learning .weight-prediction-readout span { max-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .weight-prediction-meter span { transition: none; }
}

.budget-details { margin-top: var(--space-3); }
.budget-details summary, #owner-requests summary { cursor: pointer; min-height: var(--tap-min); display: flex; align-items: center; }
.budget-details p { font-family: var(--body); line-height: 1.5; }
.weekly-budget-days { margin: 12px 0 0; font-size: var(--text-small); }
.weekly-budget-days > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.weekly-budget-days dd { margin: 0; font-variant-numeric: tabular-nums; }
#local-preview-control { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3); margin: var(--space-3) auto; width: calc(100% - 32px); max-width: 1280px; }
#local-preview-control label { display: flex; gap: var(--space-2); align-items: center; flex: 1; min-width: 220px; }
#local-preview-control small { flex: 1; color: var(--ink-soft); }
#local-preview-control a { padding: 10px; font-size: var(--text-small); }
.budget-buffer-note { margin: 8px 0 0; color: var(--ink-soft); font-size: var(--text-small); }
#local-preview-control select { min-width: 0; flex: 1; }
.budget-log-actions { display: grid; flex-shrink: 0; gap: var(--space-1); }
.today-budget-primary .budget-log-actions .budget-log-button { min-height: var(--tap-min); }
.training-entry-sheet { margin-bottom: var(--space-4); scroll-margin-top: var(--space-4); }
#training-entry-form { display: grid; gap: var(--space-3); }
#training-entry-form input, #training-entry-form select { min-width: 0; font-size: var(--text-body); }
#training-entry-form label { min-width: 0; }
#training-entry-form > button { justify-self: start; }
.request-item { padding-block: var(--space-3); overflow-wrap: anywhere; }
#owner-requests { margin-bottom: var(--space-3); }

#recipe-hint { margin: 0; padding: var(--space-2) var(--space-3); font: 14px/1.4 var(--body); color: var(--ink-soft); }

/* Keep budget values and actions readable at every breakpoint. */
.today-budget-equation b,
.weekly-budget-reference .weekly-budget-equation b,
.daily-macro b { font-size: var(--text-body); }
.today-budget-primary .today-budget-readout span,
.today-budget-primary .today-budget-equation,
.today-budget-primary .budget-buffer-note { color: color-mix(in srgb, var(--on-inverse) 78%, transparent); }
.today-budget-equation { flex-wrap: wrap; }
.today-budget-equation > span { white-space: nowrap; }
.today-budget-status { margin-inline-start: 0; }
#local-preview-control select { font-size: var(--text-body); }

/* Allow larger labels and real account names to wrap on narrow phones. */
.topbar > div, .account-card > div { min-width: 0; }
.topbar h1, .account-card strong { overflow-wrap: anywhere; }
.returning-account { flex-wrap: wrap; font-size: var(--text-body); }
.returning-account a { min-height: var(--tap-min); display: inline-flex; align-items: center; gap: var(--space-1); }
.returning-account button { min-height: var(--tap-min); padding: var(--space-1); border: 0; background: transparent; color: var(--route); font: inherit; font-weight: 850; cursor: pointer; }
.returning-account button:hover { text-decoration: underline; }
.returning-account button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
#setup-account-email { min-width: 0; overflow-wrap: anywhere; }
#setup-account-error { flex-basis: 100%; }
#setup-account-error:empty { display: none; }
.setup-route li { min-width: 0; }
.setup-route li b { white-space: normal; overflow: visible; overflow-wrap: anywhere; letter-spacing: .02em; }
.setup-card input, .setup-card textarea, .setup-card select { min-width: 0; max-width: 100%; font-size: var(--text-body); }
.setup-card button, .device-setup-card button { white-space: normal; overflow-wrap: anywhere; }
#setup-screen p, #setup-screen button, #device-setup-screen p, #device-setup-screen button { font-size: var(--text-body); }
.dish-oil { margin-block: var(--space-2); }
.dish-oil summary { cursor: pointer; min-height: var(--tap-min); align-content: center; font-size: var(--text-body); }
.dish-oil p { margin: var(--space-1) 0; font-size: var(--text-body); line-height: 1.45; color: var(--ink-soft); }
.dish-oil .oil-entry-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-2); margin-bottom: var(--space-2); }
.oil-entry-fields label { min-width: 0; }
.oil-entry-fields input, .oil-entry-fields select { min-width: 0; width: 100%; font-size: var(--text-body); }
.dish-oil small { font-size: var(--text-small); }
.meal-review-item > .dish-oil { margin-inline: var(--space-3); }
.editing-food #manual-oil { display: none; }
@media (max-width: 780px) {
  #local-preview-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); }
  #local-preview-control label { min-width: 0; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  #local-preview-control select { width: 100%; }
  #local-preview-control small { grid-column: 1; grid-row: 2; overflow-wrap: anywhere; }
  #local-preview-control a { grid-column: 2; grid-row: 2; }
  html.app-screen-active body:has(#local-preview-control:not(.hidden)) { display: flex; flex-direction: column; }
  html.app-screen-active body:has(#local-preview-control:not(.hidden)) .app-shell { flex: 1; height: auto; min-height: 0; }
  body:has(#local-preview-control:not(.hidden)) #local-preview-control { flex-shrink: 0; }
  .topbar { gap: var(--space-2); }
  .top-menu-button { flex-shrink: 0; }
}

/* A shared typing surface feeds either catalog portions or meal review. */
.meal-type-entry { padding: 18px 20px 0; }
.meal-search-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.meal-entry-dialog #food-search { width: 100%; min-height: 76px; resize: vertical; border-radius: 13px; background: var(--input); font: inherit; padding: 12px 14px; }
#food-type-hint { margin: 8px 0; color: var(--ink-soft); font-size: var(--text-small); line-height: 1.45; }
.food-composer:not(.has-food-selection):not(.editing-food) [data-meal-entry-panel="search"] { display: none; }
.typed-meal-actions, .camera-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.camera-actions > * { flex: 1 1 140px; text-align: center; }
.camera-actions .meal-photo-tool { position: relative; cursor: pointer; }
.camera-actions .meal-photo-tool span { display: inline; }
.camera-actions input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.camera-actions:has(input:focus-visible) .meal-photo-tool { outline: 2px solid var(--route); outline-offset: 3px; }
@media (max-width: 560px) { .meal-type-entry { padding: 15px 16px 0; } }

/* Spend the space above the phone keyboard on the input and food matches. */
@media (max-width: 780px) {
  .meal-entry-dialog.meal-entry-compact { padding-bottom: var(--space-2); scroll-padding-block: var(--space-2); }
  .meal-entry-compact .meal-entry-header { min-height: 0; padding: var(--space-1) var(--space-3); }
  .meal-entry-compact .meal-entry-header h2 { margin: 0; font-size: 20px; }
  .meal-entry-compact .meal-entry-header > button { width: var(--tap-min); height: var(--tap-min); }
  .meal-entry-compact #meal-entry-kicker,
  .meal-entry-compact #meal-entry-timing-note,
  .meal-entry-compact #recipe-hint,
  .meal-entry-compact .meal-entry-tools,
  .meal-entry-compact #food-type-hint { display: none; }
  .meal-entry-compact .meal-type-entry { padding: 0 var(--space-3); }
  .meal-entry-compact .meal-search-input { position: sticky; top: 0; z-index: 9; padding-bottom: var(--space-1); background: var(--panel); }
  .meal-entry-compact .meal-search-heading label > span:first-child { margin-bottom: 0; }
  .meal-entry-compact #food-search { display: block; height: 100px; min-height: 100px; padding: var(--space-2) var(--space-3); resize: vertical; }
  .meal-entry-compact .catalog-result { min-height: var(--tap-min); padding: var(--space-2) var(--space-3); }
}

/* Meal recognition and compact review share the same input surface. */
.meal-review-portion { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin-block: var(--space-3); padding-inline: 12px; }
.meal-review-portion label { display: grid; gap: 6px; min-width: 0; color: var(--ink-soft); font-size: var(--text-small); }
.meal-review-portion input, .meal-review-portion select { width: 100%; min-height: var(--tap-min); }
.meal-recognition {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 14px 4px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--route) 35%, var(--line));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--route) 8%, var(--panel));
}
.meal-recognition > div { min-width: 0; }
.meal-recognition strong { display: block; color: var(--ink); font: 750 15px/1.4 var(--body); }
.meal-recognition p { margin: 4px 0 0; color: var(--ink-soft); font: 13px/1.5 var(--body); }
.meal-recognition-spinner {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 3px solid color-mix(in srgb, var(--route) 20%, transparent);
  border-top-color: var(--route);
  border-radius: 50%;
  animation: meal-recognition-spin .9s linear infinite;
}
@keyframes meal-recognition-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .meal-recognition-spinner { animation: none; }
}
.food-composer.recognizing-meal .catalog-source-line { display: none; }
.food-composer .catalog-source-line:has(#food-search-status:empty),
#voice-status:empty, #ai-meal-error:empty { display: none; }
.food-composer .catalog-source-line { min-height: 0; margin-block: 8px 0; }
.food-composer #food-search-status { font-family: var(--body); letter-spacing: normal; text-transform: none; line-height: 1.5; }
.food-composer [data-meal-entry-panel="custom"] { padding: 0 16px 20px; }
.food-composer .ai-entry-panel { padding: 0; gap: 0; background: transparent; }
.food-composer .ai-entry-panel > [hidden] { display: none; }
.food-composer .ai-meal-preview { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.food-composer .ai-batch-head { margin: 0 0 12px; border-radius: var(--control-radius); }
.food-composer .ai-meal-draft { border: 1px solid var(--line); }
.food-composer .ai-preview-head { align-items: center; gap: 8px; padding: 10px 12px; }
.food-composer .ai-preview-head > div { min-width: 0; }
.food-composer .ai-preview-head label { margin: 0; }
.food-composer .ai-preview-head select { min-height: 44px; max-width: 100%; font-size: 18px; border: 0; }
.food-composer .ai-preview-head-actions > strong { font-size: 24px; white-space: nowrap; }
.food-composer .ai-preview-head-actions > button { min-height: 44px; color: var(--ink-soft); }
.food-composer .ai-meal-draft .ai-food-lines { padding: 10px; gap: 10px; }
.food-composer .meal-review-item { min-width: 0; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.food-composer .meal-review-item > header { padding: 12px; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.food-composer .meal-review-item header div > strong { margin: 0; overflow-wrap: anywhere; }
.food-composer .meal-review-item header p { font-family: var(--body); font-size: 13px; }
.food-composer .meal-review-item-actions { grid-column: auto; display: flex; align-items: center; gap: 4px; }
.food-composer .meal-review-item-actions > b { font-size: 19px; }
.food-composer .meal-review-item-actions > b small { font-family: var(--body); font-size: 11px; }
.food-composer .meal-review-item-actions > button { width: 44px; height: 44px; flex: 0 0 44px; font-size: 22px; background: transparent; }
.food-composer .meal-decision { min-width: 0; padding: 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--route) 4%, var(--panel)); }
.food-composer .meal-decision-prompt { margin: 0 0 10px; font: 700 14px/1.45 var(--body); }
.food-composer .portion-choice-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.food-composer .portion-choice-list button { min-width: 0; min-height: 62px; padding: 8px 4px; display: grid; align-content: center; gap: 3px; line-height: 1.3; overflow-wrap: anywhere; }
.food-composer .portion-choice-list button strong { font-size: 14px; }
.food-composer .portion-choice-list button small { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.food-composer .meal-review-item > .dish-oil { margin: 0; padding-inline: 12px; border-top: 1px solid var(--line); }
.food-composer .meal-review-item > .dish-oil summary { font-size: 13px; color: var(--ink-soft); }
.food-composer .ai-save-guidance { padding: 0 2px; border: 0; background: transparent; }
.food-composer .ai-total-row { margin-top: 12px; padding-top: 0; border: 0; }
@media (max-width: 380px) {
  .food-composer .ai-meal-draft .ai-food-lines { padding: 8px; }
  .food-composer .meal-review-item > header { padding: 10px; }
  .food-composer .meal-review-item-actions { flex-direction: column-reverse; gap: 0; }
}
html[dir="rtl"] .food-composer .meal-review-item { border: 1px solid var(--line); }
.food-composer.recognizing-meal #meal-photo-status { display: none; }

/* The coach extends the existing composer and shares its capture/review controls. */
.coach-settings { display: grid; gap: var(--space-3); }
.coach-settings h2 { margin: 0; font-family: var(--display); }
.coach-settings p { color: var(--ink-soft); font-size: var(--text-body); line-height: 1.5; }
.coach-enable { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); }
.coach-enable input { width: auto; }
.coach-settings summary { min-height: var(--tap-min); cursor: pointer; }
.coach-settings details > * + * { margin-top: var(--space-3); }
.coach-memory { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-block: var(--space-3); }
.coach-memory textarea { flex: 1 0 100%; max-width: 100%; font: inherit; font-size: var(--text-body); padding: var(--space-3); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--control-radius); }
.coach-conversation { padding-inline: var(--space-4); overflow: auto; max-height: 46dvh; }
.coach-history { display: grid; gap: var(--space-3); }
.coach-message { padding: var(--space-3); background: var(--panel-muted); border-radius: var(--control-radius); }
.coach-message-user { background: var(--route-soft); }
.coach-message p, .coach-action p { margin: var(--space-2) 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-body); line-height: 1.5; }
.coach-feedback, .coach-action-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.coach-feedback button { font-size: var(--text-small); min-height: var(--tap-min); }
.coach-actions { display: grid; gap: var(--space-3); padding-block: var(--space-3); }
.coach-action { padding: var(--space-3); border: 1px solid var(--sun); border-radius: var(--control-radius); background: var(--surface-decision); }
.coach-action-summary { border-inline-start: 2px solid var(--line); padding-inline-start: var(--space-2); }
.update-dock:has(.coach-conversation:not(.hidden)) { max-height: calc(100dvh - 118px); overflow-y: auto; }
.update-dock:has(.coach-conversation:not(.hidden)) .update-dock-kicker { display: none; }
.update-dock:has(.coach-conversation:not(.hidden)) #daily-update-text { min-height: var(--tap-min); font-size: var(--text-body); }

.coach-photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.coach-photo-tools button { min-height: var(--tap-min); display: inline-flex; align-items: center; gap: var(--space-2); }
.coach-photo-tools svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.coach-photo-preview { display: flex; align-items: center; gap: var(--space-2); }
.coach-photo-preview img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--control-radius); }
.coach-photo-marker { display: inline-block; margin-inline-start: var(--space-2); color: var(--ink-soft); font-size: var(--text-small); }

.update-dock:has(.coach-photo-preview:not(.hidden)) .coach-conversation { max-height: 24dvh; }


/* Launch portrait: the same Henia image on every full app load. */
html.app-is-loading { overflow: hidden; }
.boot-screen { display: block; overflow: hidden; background: var(--inverse); }
.boot-portrait, .boot-portrait-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-portrait { object-fit: cover; object-position: 50% 35%; }
.boot-portrait-shade { background: linear-gradient(180deg, rgba(7, 21, 31, .15), transparent 40%, rgba(7, 21, 31, .82)); }
.boot-brand { position: absolute; top: max(var(--space-4), env(safe-area-inset-top)); inset-inline-start: var(--space-4); display: inline-flex; align-items: center; gap: var(--space-2); color: var(--on-inverse); font-family: var(--display); font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.boot-brand img { display: block; width: 36px; height: 36px; border-radius: var(--control-radius); }
.boot-screen p { position: absolute; inset-inline: var(--space-4); bottom: max(calc(var(--space-4) * 2), env(safe-area-inset-bottom)); margin: 0; color: var(--on-inverse); font-family: var(--body); font-size: var(--text-body); letter-spacing: normal; text-transform: none; }
@media (min-width: 781px) {
  .boot-portrait { object-position: 50% 40%; }
  .boot-brand { top: var(--space-4); inset-inline-start: var(--space-4); }
}

/* FS-057 correction: direct selection, quiet collapsed meals, Home-colored title. */
.meal-diary-heading {
  padding: var(--space-4); border-radius: var(--radius); color: var(--on-inverse);
  background: radial-gradient(circle at 76% 20%, color-mix(in srgb, var(--route) 20%, transparent), transparent 19rem), linear-gradient(138deg, var(--inverse), color-mix(in srgb, var(--inverse) 84%, var(--route)));
  align-items: center; gap: var(--space-3);
}
.meal-diary-heading h2, .meal-diary-totals strong { color: var(--on-inverse); }
.meal-diary-heading p, .meal-diary-heading .section-kicker, .meal-diary-totals small { color: color-mix(in srgb, var(--on-inverse) 76%, transparent); }
.meal-diary-totals span { color: var(--recovery); letter-spacing: normal; }
.meal-bucket-list { align-items: start; }
.meal-bucket > header.diary-meal-header { display: flex; align-items: center; gap: 0; padding: var(--space-1); min-height: 76px; }
.diary-checkbox, .diary-checkbox-placeholder { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap-min); width: var(--tap-min); min-height: var(--tap-min); flex-shrink: 0; margin: 0; }
.diary-checkbox input { width: 22px; height: 22px; margin: 0; accent-color: var(--route); cursor: pointer; }
.diary-meal-toggle { flex: 1; min-width: 0; min-height: 64px; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1); border: 0; background: transparent; color: var(--ink); text-align: start; cursor: pointer; border-radius: var(--control-radius); }
.diary-meal-name { display: grid; gap: var(--space-1); flex: 1; min-width: 0; }
.diary-meal-title { font: 700 18px/1.3 var(--body); overflow-wrap: anywhere; }
.diary-meal-status { font: 400 var(--text-small)/1.4 var(--body); color: var(--ink-soft); }
.diary-meal-status.recorded { color: var(--ink); }
.diary-meal-status.recorded > span { color: color-mix(in srgb, var(--recovery) 60%, var(--ink)); font-weight: 700; }
.diary-meal-calories { font: 700 var(--text-body)/1.4 var(--body); text-align: end; }
.diary-meal-calories small { display: block; color: var(--ink-soft); font-size: var(--text-small); font-weight: 400; }
.diary-chevron { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
[aria-expanded="true"] > .diary-chevron { transform: rotate(180deg); }
.meal-bucket .food-log-item { grid-template-columns: var(--tap-min) minmax(0, 1fr) auto; gap: var(--space-1); align-items: center; }
.meal-bucket .food-log-actions { grid-column: 2 / -1; justify-content: flex-end; }
.diary-food-name { min-width: 0; overflow-wrap: anywhere; }
.meal-bucket .diary-move-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); background: var(--route-soft); }
.diary-move-tools > label { flex: 1; min-width: 130px; margin: 0; }
.diary-move-tools select { width: 100%; min-height: var(--tap-min); }
.diary-selected-count { font-size: var(--text-small); }
.meal-bucket .diary-move-tools[hidden], .meal-bucket .meal-bucket-content[hidden] { display: none; }
.meal-bucket .meal-clear-button { min-height: var(--tap-min); }
@media (max-width: 420px) {
  .diary-meal-toggle .meal-bucket-icon { display: none; }
  .meal-diary-heading { display: grid; grid-template-columns: 1fr; }
  .meal-diary-totals { justify-items: start; }
  .meal-diary-heading h2 { font-size: 26px; }
}

/* Optional product refinement reuses the meal editor controls. */
.product-detail .meal-entry-edit-grid input,
.product-detail .meal-entry-edit-grid button { min-height: var(--tap-min); }

/* FS-057: approved meal gradients and compact late snacks. */
.meal-bucket > header.diary-meal-header {
  background:
    radial-gradient(ellipse at 92% 15%, color-mix(in srgb, var(--meal-accent) 18%, transparent), transparent 72%),
    linear-gradient(138deg, color-mix(in srgb, var(--inverse) 88%, var(--on-inverse)), color-mix(in srgb, var(--inverse) 64%, var(--route)));
}
.diary-meal-toggle, .diary-meal-title, .diary-meal-calories { color: var(--on-inverse); }
.diary-meal-status, .diary-meal-status.recorded, .diary-meal-calories small, .diary-meal-toggle .meal-danger-zone { color: color-mix(in srgb, var(--on-inverse) 78%, transparent); }
.diary-meal-status.recorded > span { color: var(--recovery); }
.diary-meal-toggle .meal-bucket-icon { background: color-mix(in srgb, var(--meal-accent) 20%, transparent); color: color-mix(in srgb, var(--meal-accent) 65%, var(--on-inverse)); }
.diary-meal-header .diary-checkbox input { accent-color: var(--route); }
.meal-bucket > .meal-bucket-content { background: var(--panel); }

:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) > header.diary-meal-header { min-height: 64px; padding-block: var(--space-1); }
:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) .diary-meal-toggle { min-height: var(--tap-min); padding-block: 0; }
:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) .diary-meal-name { gap: 0; }
:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) .diary-meal-title { font-size: var(--text-body); }
:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) .meal-danger-zone { margin-block-start: 0; line-height: 1.2; }
:is(#meal-bucket-evening_snack,#meal-bucket-night_snack) .meal-bucket-icon { width: 32px; height: 32px; }

/* FS-057: selection actions never occupy space above diary entries. */
#diary-move-dock { position: fixed; z-index: 25; inset-inline: var(--space-2); bottom: calc(var(--diary-dock-bottom, 0px) + var(--space-2)); width: auto; max-width: 560px; margin-inline: auto; padding: var(--space-1); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: var(--shadow); max-height: 35vh; overflow-y: auto; }
#diary-move-dock[hidden] { display: none; }
#diary-move-dock .diary-move-tools { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-1); align-items: center; }
#diary-move-dock .diary-move-tools > label { min-width: 0; margin: 0; }
#diary-move-dock select { min-height: var(--tap-min); width: 100%; font-size: var(--text-body); background: var(--route-soft); color: var(--ink); }
#diary-move-dock .quiet-button { min-height: var(--tap-min); padding-inline: var(--space-2); }
#diary-move-dock .diary-selected-count { padding-inline: var(--space-1); white-space: nowrap; }

/* Selected rows expose their actions only through the shared dock. */
.meal-bucket .food-log-item:has([data-select-entry]:checked) { background: color-mix(in srgb, var(--route-soft) 45%, var(--panel)); }

@media (max-width: 780px) {
  .mobile-nav.diary-selecting { visibility: hidden; pointer-events: none; }
  #diary-move-dock { bottom: calc(env(safe-area-inset-bottom) + var(--space-2)); }
}

/* FS-057: balanced selection toolbar proportions across Safari and Chrome. */
#diary-move-dock { max-width: 440px; padding: var(--space-1) var(--space-2); border-radius: var(--radius-small); box-shadow: var(--shadow-soft); }
#diary-move-dock .diary-move-tools { grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-2); min-height: var(--tap-min); }
#diary-move-dock .diary-selected-count { display: flex; align-items: center; gap: var(--space-1); padding: 0; font: 500 14px/1.3 var(--body); color: var(--ink-soft); }
#diary-move-dock .diary-selected-count strong { display: grid; place-items: center; min-width: 24px; height: 24px; padding-inline: 4px; border-radius: 8px; background: var(--route-soft); color: var(--ink); font: 700 14px/1 var(--body); }
#diary-move-dock .diary-move-tools > label { position: relative; display: flex; }
#diary-move-dock select { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 112px; height: var(--tap-min); min-height: var(--tap-min); margin: 0; padding: 0 12px; padding-inline-end: 32px; border: 1px solid var(--line); border-radius: var(--control-radius); font: 650 16px/1.2 var(--body); background: var(--route-soft); text-align: start; }
#diary-move-dock .diary-action-chevron { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; fill: none; stroke: var(--ink); stroke-width: 1.8; }
#diary-move-dock .quiet-button { height: var(--tap-min); min-height: var(--tap-min); min-width: var(--tap-min); padding: 0 var(--space-1); border: 0; background: transparent; box-shadow: none; border-radius: var(--control-radius); color: var(--ink-soft); font: 600 16px/1.2 var(--body); }

/* Center the primary action between balanced side columns. */
#diary-move-dock .diary-move-tools { grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr); gap: var(--space-1); }
#diary-move-dock .diary-move-tools > label { justify-self: center; }
#diary-move-dock .quiet-button { justify-self: end; }
#diary-move-dock select { color: var(--on-inverse); border-color: transparent; background: linear-gradient(138deg, color-mix(in srgb, var(--inverse) 88%, var(--on-inverse)), color-mix(in srgb, var(--inverse) 64%, var(--route))); }
#diary-move-dock .diary-action-chevron { stroke: var(--on-inverse); }
#diary-move-dock select option, #diary-move-dock select optgroup { color: var(--ink); background: var(--panel); }

/* FS-015: full food framing; barcode detection still uses the whole image. */
#barcode-dialog { max-height: calc(100dvh - 20px); overflow-y: auto; }
#barcode-dialog .barcode-camera { aspect-ratio: 3 / 4; min-height: 0; }
#barcode-dialog .barcode-reticle { position: absolute; inset: 6% 7% 18%; width: auto; height: auto; border: none; }
#barcode-dialog .barcode-reticle i { display: none; }
#barcode-dialog .barcode-close { min-width: var(--tap-min); min-height: var(--tap-min); }
@media (max-width: 600px) {
  #barcode-dialog { width: calc(100vw - 12px); }
  #barcode-dialog .barcode-panel { padding: var(--space-2); }
}

/* FS-061: compact, accessible logging week. */
.logging-card { container-type: inline-size; }
#logging-consistency { margin-block: var(--space-3); padding:var(--space-2); }
.logging-heading { display:flex; align-items:center; gap:var(--space-3); padding:var(--space-3); border-radius:var(--radius-small); color:var(--on-inverse); background:radial-gradient(circle at 90% 0, color-mix(in srgb, var(--route) 24%, transparent), transparent 20rem), linear-gradient(138deg,var(--inverse),color-mix(in srgb,var(--inverse) 84%,var(--route))); }
.logging-heading .logging-total { font:650 44px/1 var(--number); font-variant-numeric:tabular-nums; }
.logging-heading h3 { margin:0; font-size:20px; line-height:1.2; }
.logging-heading span { font-size:14px; color:color-mix(in srgb,var(--on-inverse) 78%,transparent); }
.logging-week { display:grid; grid-template-columns:repeat(7,minmax(44px,1fr)); gap:0; margin-block:var(--space-3) var(--space-1); }
.logging-day { display:grid; justify-items:center; align-content:center; gap:var(--space-1); padding:var(--space-1) 0; min-width:44px; min-height:76px; border:0; border-radius:var(--control-radius); background:transparent; color:var(--ink-soft); font:inherit; cursor:pointer; }
.logging-day span { font-size:14px; line-height:20px; white-space:nowrap; }
.logging-day strong { display:grid; place-items:center; width:34px; height:34px; border:1px solid var(--line); border-radius:50%; font:650 16px/1 var(--body); color:var(--ink-soft); }
.logging-day[data-status="reported"] strong { background:var(--route-soft); color:var(--route); border-color:transparent; font-size:22px; }
.logging-day[data-status="estimated"] strong { border-style:dashed; color:var(--ink); }
.logging-day[aria-current="date"] { background:var(--input); box-shadow:inset 0 0 0 1px var(--line); }
.logging-day[aria-current="date"] span { font-weight:700; color:var(--ink); }
.logging-day:focus-visible { outline:3px solid var(--focus-ring); outline-offset:2px; }
.logging-day:disabled { opacity:.45; cursor:default; }
.logging-about { border-block-start:1px solid var(--line); color:var(--ink-soft); }
.logging-about summary, .logging-missing summary { min-height:var(--tap-min); cursor:pointer; align-content:center; font-size:14px; }
.logging-about p { margin-block:0 var(--space-2); font-size:16px; }
.logging-missing-day { padding-block:var(--space-2); border-block-start:1px solid var(--line); }
@container (max-width:307px) { .logging-week { grid-template-columns:repeat(4,minmax(44px,1fr)); } }

/* FS-022: shared emphasis gradient with light training form controls. */
.next-training-card { border-top:0; color:var(--on-inverse); background:radial-gradient(circle at 90% 0, color-mix(in srgb,var(--route) 24%,transparent),transparent 20rem),linear-gradient(138deg,var(--inverse),color-mix(in srgb,var(--inverse) 84%,var(--route))); }
.next-training-card > header span, .next-training-card > header strong, .next-training-card p { color:color-mix(in srgb,var(--on-inverse) 78%,transparent); }
.next-training-card h3, .next-training-card .next-training-details summary, .next-training-card .next-training-details > div p, .next-training-card .next-training-link { color:var(--on-inverse); }
.next-training-card .next-training-mark { color:var(--on-inverse); background:color-mix(in srgb,var(--on-inverse) 12%,transparent); }
.next-training-card .next-training-details { border-color:color-mix(in srgb,var(--on-inverse) 20%,transparent); }
.training-entry-sheet { overflow:hidden; padding:var(--space-4); }
.training-entry-sheet > .section-heading { margin:calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4); padding:var(--space-4); background:radial-gradient(circle at 90% 0,color-mix(in srgb,var(--route) 24%,transparent),transparent 20rem),linear-gradient(138deg,var(--inverse),color-mix(in srgb,var(--inverse) 84%,var(--route))); }
.training-entry-sheet > .section-heading h2 { color:var(--on-inverse); }
.sport-shortcuts { display:flex; flex-wrap:wrap; gap:var(--space-1); margin-top:var(--space-2); }
.sport-shortcuts.hidden { display:none; }
.sport-shortcuts button { min-height:var(--tap-min); padding:8px var(--space-3); border:1px solid var(--line); border-radius:999px; background:var(--panel); color:var(--ink); font:inherit; font-size:var(--text-body); font-weight:700; cursor:pointer; }
.sport-shortcuts button[aria-pressed="true"] { border-color:var(--route); background:var(--route-soft); color:var(--route); }
.sport-shortcuts button:focus-visible { outline:3px solid var(--focus-ring); outline-offset:2px; }

/* FS-064: keep the destination editable throughout food capture. */
.meal-entry-header > div { min-width: 0; flex: 1; }
#meal-entry-meal { width: 100%; min-width: 0; min-height: var(--tap-min); margin-top: var(--space-1); padding: var(--space-1) var(--space-2); border: 1px solid var(--line); border-radius: var(--control-radius); background-color: var(--input); color: var(--ink); font-family: var(--display); font-size: var(--text-body); font-weight: 700; }
.meal-entry-header > button { min-width: var(--tap-min); min-height: var(--tap-min); }

.meal-entry-meal-control { position: relative; }
.meal-entry-meal-control::after { content: ""; position: absolute; inset-inline-end: var(--space-3); top: 50%; width: var(--space-1); height: var(--space-1); border-inline-end: 2px solid var(--ink); border-block-end: 2px solid var(--ink); transform: translateY(-25%) rotate(45deg); pointer-events: none; }
html[dir="rtl"] .meal-entry-meal-control::after { transform: translateY(-25%) rotate(-45deg); }
#meal-entry-meal { appearance: none; -webkit-appearance: none; padding-inline-end: calc(var(--space-4) + var(--space-3)); cursor: pointer; }

/* FS-013: history entry reuses the shared outlined control style. */

/* FS-021: focused diary heading and adjacent capture/library actions. */
.diary-actions { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: var(--space-2); }
.diary-actions > button { flex: 1; min-width: 0; min-height: var(--tap-min); padding-inline: var(--space-2); }
#dish-partial-note:empty { display: none; }

/* FS-061: Daily rhythm belongs to Progress, with one chronological mark per date. */
.daily-rhythm{max-width:540px;margin-block:var(--space-3)}
.rhythm-heading,.rhythm-dates{display:flex;justify-content:space-between;align-items:center;gap:var(--space-3)}
.rhythm-title h2{font-size:23px;margin:0 0 var(--space-1)}
.rhythm-caption,.rhythm-total,.rhythm-dates{font-size:14px;color:var(--ink-soft);line-height:1.4}
.rhythm-total{max-width:110px;text-align:end}
.rhythm-track{display:flex;justify-content:space-around;margin-block:var(--space-4) var(--space-2);height:30px}
.rhythm-mark{display:block;position:relative;width:3px;height:30px;background:var(--line)}
.rhythm-mark.reported{background:var(--inverse)}
.rhythm-mark.reported.today{background:var(--route)}
.rhythm-mark:before,.rhythm-mark:after{content:"";position:absolute;left:-1.5px;right:-1.5px;height:2px;background:inherit}
.rhythm-mark:before{top:0}.rhythm-mark:after{bottom:0}

/* FS-012: food review uses the shared Home emphasis surface. */
.food-composer .meal-review-item > header {
  color: var(--on-inverse);
  background: radial-gradient(circle at 76% 20%, color-mix(in srgb, var(--route) 20%, transparent), transparent 19rem), linear-gradient(138deg, var(--inverse), color-mix(in srgb, var(--inverse) 84%, var(--route)));
}
.food-composer .meal-review-item header div > strong,
.food-composer .meal-review-item-actions > b,
.food-composer .meal-review-item-actions > button { color: var(--on-inverse); }
.food-composer .meal-review-item header p {
  color: color-mix(in srgb, var(--on-inverse) 82%, var(--route-soft));
  font-size: var(--text-small);
}
.food-composer .meal-review-item-actions > b small { font-size: var(--text-small); }
.food-composer .meal-review-item input,
.food-composer .meal-review-item select {
  background: linear-gradient(138deg, var(--route-soft), var(--input));
  color: var(--ink);
}
.food-composer .meal-review-item-actions > button:focus-visible { outline: 2px solid var(--on-inverse); outline-offset: -4px; }

/* FS-024: retain readable axis labels at the actual phone chart width. */
#weight-chart { display:block; width:100%; height:auto; min-height:0; }
#progress-view .weight-chart-sheet > .section-heading { flex-direction:column; align-items:flex-start; gap:10px; }
#progress-view .weight-chart-sheet .chart-key { font-family:var(--body); font-size:14px; text-transform:none; flex-wrap:wrap; }
#progress-view .weight-chart-sheet .chart-key span { white-space:nowrap; }
/* FS-012: match the approved native editable nutrition layout. */
.food-composer .meal-review-item input,
.food-composer .meal-review-item select { background:var(--input); }
.food-composer .meal-entry-edit-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.food-composer .meal-entry-edit-grid label.wide,
.food-composer .meal-entry-edit-grid label:has([data-ai-entry-field="calories"]) { grid-column:1/-1; }
.food-composer .meal-entry-edit-grid label > span { font-family:var(--body); font-weight:400; letter-spacing:normal; text-transform:none; }
.food-composer .meal-entry-edit-grid input { min-height:44px; border-radius:var(--control-radius); }


/* FS-012: keep the per-food search across the full editor width on phones. */
.meal-entry-edit-grid > div.wide { grid-column: 1 / -1; min-width: 0; }
.meal-item-search { display: grid; gap: var(--space-2); min-width: 0; }
.meal-item-search .meal-entry-edit-note { margin: 0; font-size: 16px; }
.meal-item-search > button { justify-self: start; min-height: 44px; max-width: 100%; white-space: normal; }
.meal-item-search [hidden] { display: none; }
.meal-item-search [data-item-search-results] { display: grid; gap: var(--space-2); min-width: 0; font-size: 16px; }
.meal-item-search .food-choice { width: 100%; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }

/* FS-012: compact photo review; use the shared meal editor and palette. */
.food-composer .compact-photo-review .photo-review-food > header { display: block; padding: 0; }
.food-composer .photo-review-row { width: 100%; min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 0; border-radius: 0; background: transparent; color: var(--on-inverse); text-align: start; }
.food-composer .photo-review-row > span:first-child { display: grid; gap: var(--space-1); min-width: 0; }
.food-composer .photo-review-row strong { font: 650 18px/1.35 var(--body); overflow-wrap: anywhere; }
.food-composer .photo-review-row [data-photo-portion] { font: 400 16px/1.4 var(--body); }
.food-composer .photo-review-edit { font: 400 14px/1.4 var(--body); text-decoration: underline; flex-shrink: 0; }
.food-composer .photo-review-needed { color: var(--sun); font: 400 14px/1.4 var(--body); }
.food-composer .photo-review-needed:empty { display: none; }
.food-composer .photo-review-editor[hidden] { display: none; }
.food-composer .photo-review-editor { padding: var(--space-3); }
.food-composer .photo-review-editor .meal-entry-editor { display: grid; gap: var(--space-3); padding: 0; border: 0; }
.food-composer .photo-review-editor label { display: grid; gap: var(--space-1); min-width: 0; }
.food-composer .photo-review-editor input, .food-composer .photo-review-editor select { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.food-composer .photo-review-editor .meal-review-portion { padding: 0; }
.food-composer .photo-review-editor .quiet-button { min-height: 44px; justify-self: start; }
.food-composer .photo-review-more { display: grid; gap: var(--space-3); }
.food-composer .photo-review-remove { color: var(--effort); }
.food-composer .photo-review-calories { font: 400 16px/1.4 var(--body); margin: 0; }
.food-composer .photo-review-total { display: flex; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-3); font: 400 16px/1.4 var(--body); }
.food-composer .compact-photo-review .ai-preview-head-actions > strong,
.food-composer .compact-photo-review .ai-batch-head > strong { display: none; }

.food-composer.photo-review-mode .meal-type-entry,
.food-composer.photo-review-mode #recipe-hint,
.food-composer.photo-review-mode #meal-entry-timing-note,
.food-composer.photo-review-mode #meal-photo-status { display: none; }
.food-composer .compact-photo-review.single-photo-meal .ai-preview-head { display: none; }

.meal-review-portion[hidden] { display: none; }

/* FS-072: compact conversation composer, shared outlined icons and light tokens. */
.food-entry-mode { display:flex; gap:var(--space-1); margin:var(--space-3) var(--space-4); padding:4px; background:var(--input); border:1px solid var(--line); border-radius:var(--radius-small); }
.food-entry-mode button { display:flex; align-items:center; justify-content:center; gap:var(--space-1); flex:1; min-width:0; min-height:var(--tap-min); padding:var(--space-1); border:0; border-radius:var(--control-radius); background:transparent; color:var(--ink-soft); font:600 var(--text-small)/1.3 var(--body); box-shadow:none; }
.food-entry-mode button[aria-pressed="true"] { background:var(--route-soft); color:var(--route); }
.food-entry-mode svg,#food-conversation-beta svg { width:22px; height:22px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.food-entry-mode[hidden],#food-conversation-beta[hidden] { display:none; }
.conversation-mode .meal-entry-sheet > :not(.meal-entry-header):not(#food-entry-mode):not(#food-conversation-beta) { display:none!important; }
#food-conversation-beta { padding:0 var(--space-4) var(--space-3); }
#food-conversation-beta button { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-1); min-height:var(--tap-min); padding:var(--space-1) var(--space-2); border:1px solid var(--line); border-radius:var(--control-radius); background:var(--panel); color:var(--ink); font:600 16px/1.3 var(--body); box-shadow:none; cursor:pointer; }
#food-conversation-beta button:disabled { opacity:.45; cursor:default; }
#food-conversation-beta button[hidden] { display:none; }
.food-beta-heading { display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); color:var(--ink-soft); font-size:var(--text-small); }
#food-conversation-beta .food-beta-restart { border:0; background:transparent; color:var(--ink-soft); font-size:var(--text-small); }
.food-beta-log { display:flex; flex-direction:column; max-height:36vh; overflow-y:auto; overscroll-behavior:contain; gap:var(--space-2); margin-block-end:var(--space-3); }
.food-beta-log.is-empty { padding-block:var(--space-4); text-align:center; gap:var(--space-1); }
.food-beta-log.is-empty h3 { margin:0; font:650 23px/1.3 var(--display); }
.food-beta-log.is-empty p { margin:0; color:var(--ink-soft); font-size:16px; }
.food-beta-message { white-space:pre-wrap; overflow-wrap:anywhere; padding:var(--space-2) var(--space-3); margin:0; border-radius:var(--radius-small); font-size:16px; line-height:1.55; }
#food-conversation-beta textarea:lang(he), #food-conversation-beta .food-beta-status:lang(he), #food-conversation-beta .food-beta-message:lang(he), #food-conversation-beta .food-beta-choices button:lang(he) { font-family:"Assistant",var(--body); }
.food-beta-message.user { align-self:flex-end; max-width:90%; background:var(--route-soft); }
.food-beta-message.assistant { align-self:stretch; background:var(--input); }
.food-beta-choices { display:flex; flex-wrap:wrap; gap:var(--space-1); margin-block:var(--space-2); }
#food-conversation-beta .food-beta-composer { display:block; padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius-small); background:var(--input); }
#food-conversation-beta .food-beta-composer:focus-within { border-color:var(--route); }
#food-conversation-beta textarea { display:block; box-sizing:border-box; width:100%; min-height:80px; max-height:180px; resize:vertical; padding:var(--space-2); border:1px solid var(--line); border-radius:var(--control-radius); background:var(--input); color:var(--ink); font:400 16px/1.5 var(--body); }
#food-conversation-beta .food-beta-composer textarea { border:0; box-shadow:none; outline:none; padding:var(--space-1); background:transparent; }
.food-beta-controls { display:flex; justify-content:space-between; align-items:center; gap:var(--space-2); padding-block-start:var(--space-1); }
.food-beta-capture { display:flex; gap:var(--space-1); min-width:0; }
#food-conversation-beta .food-beta-tool { flex-direction:column; gap:3px; min-width:48px; padding:var(--space-1); border:0; background:transparent; color:var(--ink-soft); font-size:var(--text-small); font-weight:500; }
#food-conversation-beta .food-beta-tool:hover,#food-conversation-beta .food-beta-restart:hover { background:var(--route-soft); color:var(--route); }
#food-conversation-beta .food-beta-send { width:var(--tap-min); height:var(--tap-min); flex:0 0 auto; padding:0; border:0; border-radius:50%; background:var(--route); color:var(--on-inverse); }
#food-conversation-beta .food-beta-save { width:100%; margin-block-start:var(--space-3); min-height:48px; border:0; border-radius:999px; background:var(--route); color:var(--on-inverse); }
#food-conversation-beta .is-recording { color:var(--effort); background:var(--panel); }
.food-beta-status { margin:var(--space-2) 0 0; color:var(--ink-soft); font-size:16px; white-space:pre-wrap; }
.food-beta-status:empty { display:none; }
.food-beta-footer { display:grid; grid-template-columns:1fr; gap:var(--space-2); margin-block-start:var(--space-2); }
.food-beta-footer details { min-width:0; }
.food-beta-footer summary { display:flex; align-items:center; gap:var(--space-1); min-height:var(--tap-min); color:var(--ink-soft); font-size:var(--text-small); cursor:pointer; list-style:none; }
.food-beta-footer summary::-webkit-details-marker { display:none; }
.food-beta-footer summary svg { width:18px!important; height:18px!important; }
.food-beta-footer details:last-child:not([open]) summary { justify-content:flex-end; }
.food-beta-footer details[open] { grid-column:1/-1; }
.food-beta-footer details[open] summary { color:var(--route); }
.food-beta-footer p { margin:var(--space-1) 0 var(--space-2); font-size:16px; color:var(--ink-soft); line-height:1.5; }
.food-beta-retry { margin-block-start:var(--space-2); }
@media(max-width:360px) {
 .food-entry-mode { margin-inline:var(--space-3); }
 #food-conversation-beta { padding-inline:var(--space-3); }
 .food-beta-capture { gap:0; }
}

/* Three weight values remain after moving pace diagnostics to Admin (FS-024). */
#progress-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 780px) {
  #progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #progress-stats .progress-stat:last-child { grid-column: 1 / -1; }
}
