/* Quiet by default: new UI must follow ../DESIGN_SYSTEM.md. */
:root {
  color-scheme: 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;
  --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);
  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: 11px; 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: 10px;
  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; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.auth-proof span { border: 1px solid rgba(255,255,255,.28); padding: 8px 11px; font-family: var(--utility); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

.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: 14px; 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: 11px; }
.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: 12px; 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: 9px; 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: 12px; 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; }
.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: 10px;
  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: 12px; }
.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: 11px; 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: 9px; 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: 12px; }
.rail-status small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
.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: 11px;
  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: 10px; line-height: 1.5; text-transform: uppercase; }
.calorie-equation { display: flex; flex-wrap: wrap; gap: 14px; color: #b6c6c1; font-family: var(--utility); font-size: 9px; text-transform: uppercase; }
.calorie-equation b { color: white; font-size: 12px; }
.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: 13px; font-weight: 700; }
.macro-row b { font-family: var(--utility); font-size: 10px; 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: 12px; 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: 11px; }
.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: 11px; 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.lactation { border-inline-start-color: var(--recovery); background: var(--surface-resolved); }
.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: 14px; 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: 8px; 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: 9px; 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: 12px; }
.fuel-stop small { color: var(--ink-soft); font-size: 11px; 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: 11px; }
.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: 14px; line-height: 1.55; }
.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: 8px; 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: 7px; 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: 8px; 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: 8px; 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: 11px; 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: 9px; font-weight: 800; text-transform: uppercase; }
.fuel-guidance p { margin: 0; color: var(--ink-soft); font-size: 12px; 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: 12px; 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: 8px; 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 { margin: 0; color: var(--ink-soft); font-size: 11px; }
.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: 11px; }
.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(4, 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: 11px; font-variant-numeric: tabular-nums; }
.timing-window small { margin-inline-end: 6px; font-family: var(--utility); font-size: 7px; 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: 7px; 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: 12px; 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: 7px; 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; }
.learning-note { margin: 16px 0 0; padding-inline-start: 15px; border-inline-start: 3px solid var(--recovery); color: var(--ink-soft); font-size: 10px; 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: 11px; 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: 11px; 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: 12px; 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: 12px; 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: 15px; }
.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: 7px; 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: 12px; }
.catalog-result > span { font-family: var(--display); font-size: 19px; }
.catalog-result small { color: var(--ink-soft); font-size: 9px; }
.catalog-result em { grid-column: 2; color: var(--ink-soft); font-family: var(--utility); font-size: 7px; 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: 12px; 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: 11px; 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: 10px; }
.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: 10px; line-height: 1.45; text-align: center; }
.food-composer form { display: grid; gap: 14px; }
.compact-grid label { font-size: 10px; }
.form-action-row { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.learning-inline { color: var(--ink-soft); font-size: 9px; 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: 7px; }
.meal-flow li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--utility); font-size: 7px; 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: 14px/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: 9px; }
.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: 7px; 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: 9px; }
.ai-preview-head > strong { font-family: var(--display); font-size: 28px; }
.ai-preview-head > strong small { font-family: var(--utility); font-size: 7px; text-transform: uppercase; }
.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: 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 11px; }
.meal-item-index { width: 28px; height: 28px; display: grid; place-content: center; border-radius: 50%; background: var(--inverse); color: var(--on-inverse); font-family: var(--utility); font-size: 7px; }
.meal-review-item header div > small { display: block; overflow: hidden; color: var(--ink-soft); font-family: var(--utility); font-size: 7px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.meal-review-item header div > strong { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; }
.meal-review-item header p { margin: 3px 0 0; color: var(--ink-soft); font-family: var(--utility); font-size: 7px; line-height: 1.4; }
.meal-review-item header > b { color: var(--ink); font-family: var(--display); font-size: 20px; white-space: nowrap; }
.meal-review-item header > b small { font-family: var(--utility); font-size: 7px; text-transform: uppercase; }
.meal-decision { margin: 0; padding: 13px; border: 0; border-top: 1px solid #eadcae; background: var(--surface-decision); }
.meal-decision legend { width: 100%; padding: 0 0 9px; font-family: var(--body); font-size: 11px; font-weight: 700; }
.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: var(--tap-min); padding: 9px 10px; 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: 10px; font-weight: 700; line-height: 1.3; }
.food-choice small { color: var(--ink-soft); font-family: var(--utility); font-size: 7px; }
.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 130px; font-size: 9px; }
.ai-unmatched { margin: 12px 0 0; color: var(--effort); font-size: 9px; 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: 10px; font-weight: 750; cursor: pointer; }
.ai-engine-note p { margin: 0; padding: 0 12px 11px; color: var(--ink-soft); font-size: 10px; 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: 8px; }
.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: 8px; 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: 9px; font-weight: 700; }
.portion-presets > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.portion-presets button { min-height: 48px; display: grid; gap: 2px; }
.portion-presets button strong { font-size: 10px; }
.portion-presets button small { color: var(--ink-soft); font-family: var(--utility); font-size: 7px; }
.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: 8px; 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: 10px; font-weight: 800; cursor: pointer; }
.meal-add-button:hover { border-color: var(--route); background: var(--route-soft); }
.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: 13px; }
.food-log-item p { margin: 0; color: var(--ink-soft); font-family: var(--utility); font-size: 8px; 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: 9px; 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: 12px; 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: 8px; text-transform: uppercase; }
.workout-copy h3 { margin: 0 0 4px; font-size: 18px; }
.workout-copy p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.workout-kind { padding: 5px 7px; background: var(--route-soft); color: var(--route); font-family: var(--utility); font-size: 7px; 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: 7px; text-transform: uppercase; }
.activity-stat b { font-size: 12px; }

.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: 8px; 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; }
.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: 7px; 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: 11px; 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: 8px; 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: 11px; 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: 11px; 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: 13px; 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: 9px;
  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: 11px; 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; }
.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: 11px; 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: 11px; }
.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: 10px; 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: 8px; 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: 12px; 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: 13px; }
  .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: 13px; line-height: 1.35; }
  .calorie-equation { gap: 12px; font-size: 13px; 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: 15px; }
  .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: 11px; }
  .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: 13px; font-weight: 650; }
  .context-panel strong { font-size: 17px; }
  .context-panel p { font-size: 15px; }
  .fuel-line > .context-panel { margin-inline-start: 80px; }
  .weight-status, .learning-note { font-size: 13px; }
  .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: 9px; }
  .voice-status { font-size: 12px; }
  .food-log-item h3 { font-size: 16px; }
  .food-log-item p { font-size: 11px; }
  .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: 15px; line-height: 1.55; }
  .form-action-row { align-items: stretch; flex-direction: column; }
  .empty-state strong { font-size: 23px; }
  .empty-state p { font-size: 15px; }
  .workout-copy p { font-size: 14px; line-height: 1.45; }
  .workout-kind { font-size: 10px; }
  .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: 10px; }
  .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: 10px; }
  .integration-card p:not(.section-kicker) { font-size: 14px; }
  .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: 12px; 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: 8px; }
  .food-choice-list { grid-template-columns: 1fr; }
  .meal-review-item > header { grid-template-columns: auto minmax(0, 1fr); }
  .meal-review-item header > b { grid-column: 2; }
  .ai-action-row { grid-template-columns: 1fr; }
  .ai-total-row { align-items: stretch; flex-direction: column; }
  .ai-total-row .primary-button { width: 100%; }
}

@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; }
  .auth-proof { margin-top: 18px; }
}

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; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #0b151c;
    --paper-deep: #13232c;
    --panel: #172730;
    --panel-muted: #12212a;
    --input: #1a2c36;
    --inverse: #071117;
    --on-inverse: #ffffff;
    --ink: #f4f7f5;
    --ink-soft: #b4c2be;
    --line: #344750;
    --route: #69a8ff;
    --route-soft: #173b61;
    --effort: #ef7891;
    --effort-soft: #4d2631;
    --recovery: #8fd1b5;
    --sun: #f1c75b;
    --surface-capture: #081219;
    --surface-review: #172730;
    --surface-decision: #3a321d;
    --surface-resolved: #173229;
    --shadow: 0 18px 60px rgba(0, 0, 0, .32);
  }
  :root:not([data-theme]) body { background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px); }
  :root:not([data-theme]) .topbar { border-color: var(--line); background: rgba(11,21,28,.92); }
  :root:not([data-theme]) .quiet-button { background: var(--panel-muted); color: var(--ink); }
  :root:not([data-theme]) .fuel-hero, :root:not([data-theme]) .ai-entry-panel { background: var(--surface-capture); }
  :root:not([data-theme]) .macro-panel, :root:not([data-theme]) .field-sheet, :root:not([data-theme]) .settings-preferences, :root:not([data-theme]) .integration-card, :root:not([data-theme]) .connection-catalog, :root:not([data-theme]) .plan-step, :root:not([data-theme]) .meal-bucket.has-food, :root:not([data-theme]) .food-choice, :root:not([data-theme]) .portion-choice-list button, :root:not([data-theme]) .portion-presets button, :root:not([data-theme]) .catalog-result, :root:not([data-theme]) .catalog-results { background: var(--panel); }
  :root:not([data-theme]) .entry-mode-switch button.active, :root:not([data-theme]) .meal-tabs button.active, :root:not([data-theme]) .shortcut-button { background: var(--panel); color: var(--ink); }
  :root:not([data-theme]) .entry-mode-switch, :root:not([data-theme]) .meal-bucket > header, :root:not([data-theme]) .delete-button { background: var(--paper-deep); }
  :root:not([data-theme]) .voice-composer textarea { border-color: var(--line); background: #102029; color: var(--ink); }
  :root:not([data-theme]) .voice-button { border-color: var(--line); background: #1b313d; }
  :root:not([data-theme]) .ai-meal-preview { background: var(--panel); color: var(--ink); }
  :root:not([data-theme]) .auto-calorie-field { border-color: #396657; background: #173229; }
  :root:not([data-theme]) .auto-calorie-details[open] { background: var(--panel); }
  :root:not([data-theme]) .mobile-nav { border-color: var(--line); background: var(--paper); }
}

/* 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;
  --effort: #e55567;
  --effort-soft: #fde6e9;
  --recovery: #58bd9b;
  --sun: #efb943;
  --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 { 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: 5px; font-size: 17px; font-weight: 800; letter-spacing: .14em; }
.wordmark::before {
  content: "";
  width: 25px;
  height: 25px;
  margin-inline-end: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: conic-gradient(from 215deg, transparent 0 18%, var(--route) 18% 43%, transparent 43% 63%, var(--sun) 63% 70%, transparent 70%);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, currentColor 6%, transparent);
}
.wordmark i { color: var(--sun); }
.wordmark-light { font-size: 18px; }
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: 11px; 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: 11px;
  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: 13px;
  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: 9px; 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: 9px; letter-spacing: .1em; }
.calorie-equation { gap: 15px; color: color-mix(in srgb, var(--on-inverse) 52%, transparent); font-size: 8px; letter-spacing: .06em; }
.calorie-equation b { color: var(--on-inverse); font-size: 11px; }
.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: 10px; }
.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.lactation { border-inline-start-color: var(--recovery); background: var(--surface-resolved); }
.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: hidden; }
.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 (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #071016;
    --paper-deep: #111f27;
    --panel: #0e1a22;
    --panel-muted: #101f27;
    --input: #12232c;
    --inverse: #050c11;
    --inverse-soft: #102630;
    --on-inverse: #f7fbf9;
    --ink: #eef4f1;
    --ink-soft: #93a49f;
    --line: rgba(225, 238, 234, .12);
    --line-strong: rgba(225, 238, 234, .22);
    --route: #5c91ff;
    --route-soft: #162e55;
    --effort: #f27080;
    --effort-soft: #43222a;
    --recovery: #6acbab;
    --sun: #f2c55c;
    --glass-light: rgba(7, 16, 22, .78);
    --surface-review: #12212a;
    --surface-decision: #362f1b;
    --surface-resolved: #153027;
    --shadow: 0 28px 90px rgba(0, 0, 0, .42);
    --shadow-soft: 0 16px 42px rgba(0, 0, 0, .2);
  }
  :root:not([data-theme]) body { background: radial-gradient(circle at 84% 5%, color-mix(in srgb, var(--route) 7%, transparent), transparent 28rem), var(--paper); }
  :root:not([data-theme]) .field-sheet, :root:not([data-theme]) .settings-preferences, :root:not([data-theme]) .account-card, :root:not([data-theme]) .integration-card, :root:not([data-theme]) .connection-catalog { background: color-mix(in srgb, var(--panel) 95%, transparent); }
  :root:not([data-theme]) .topbar { background: var(--glass-light); }
  :root:not([data-theme]) .quiet-button { background: color-mix(in srgb, var(--panel) 78%, transparent); }
  :root:not([data-theme]) .quiet-button:hover { background: var(--panel-muted); }
  :root:not([data-theme]) .entry-mode-switch button.active, :root:not([data-theme]) .meal-tabs button.active, :root:not([data-theme]) .shortcut-button, :root:not([data-theme]) .meal-bucket.has-food, :root:not([data-theme]) .food-choice, :root:not([data-theme]) .portion-choice-list button, :root:not([data-theme]) .portion-presets button, :root:not([data-theme]) .catalog-result, :root:not([data-theme]) .catalog-results, :root:not([data-theme]) .plan-step { background: var(--panel); }
  :root:not([data-theme]) .voice-composer textarea { background: color-mix(in srgb, var(--on-inverse) 5%, transparent); }
  :root:not([data-theme]) .auto-calorie-field { background: var(--surface-resolved); }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #071016;
  --paper-deep: #111f27;
  --panel: #0e1a22;
  --panel-muted: #101f27;
  --input: #12232c;
  --inverse: #050c11;
  --inverse-soft: #102630;
  --on-inverse: #f7fbf9;
  --ink: #eef4f1;
  --ink-soft: #93a49f;
  --line: rgba(225, 238, 234, .12);
  --line-strong: rgba(225, 238, 234, .22);
  --route: #5c91ff;
  --route-soft: #162e55;
  --effort: #f27080;
  --effort-soft: #43222a;
  --recovery: #6acbab;
  --sun: #f2c55c;
  --glass-light: rgba(7, 16, 22, .78);
  --surface-review: #12212a;
  --surface-decision: #362f1b;
  --surface-resolved: #153027;
  --shadow: 0 28px 90px rgba(0, 0, 0, .42);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, .2);
}
html[data-theme="dark"] body { background: radial-gradient(circle at 84% 5%, color-mix(in srgb, var(--route) 7%, transparent), transparent 28rem), var(--paper); }
html[data-theme="dark"] .topbar { border-color: var(--line); background: var(--glass-light); }
html[data-theme="dark"] .quiet-button { background: color-mix(in srgb, var(--panel) 78%, transparent); color: var(--ink); }
html[data-theme="dark"] .quiet-button:hover { background: var(--panel-muted); }
html[data-theme="dark"] .fuel-hero { background: var(--surface-capture); }
html[data-theme="dark"] .macro-panel, html[data-theme="dark"] .plan-step, html[data-theme="dark"] .meal-bucket.has-food, html[data-theme="dark"] .food-choice, html[data-theme="dark"] .portion-choice-list button, html[data-theme="dark"] .portion-presets button, html[data-theme="dark"] .catalog-result, html[data-theme="dark"] .catalog-results { background: var(--panel); }
html[data-theme="dark"] .field-sheet, html[data-theme="dark"] .settings-preferences, html[data-theme="dark"] .account-card, html[data-theme="dark"] .integration-card, html[data-theme="dark"] .connection-catalog { background: color-mix(in srgb, var(--panel) 95%, transparent); }
html[data-theme="dark"] .entry-mode-switch button.active, html[data-theme="dark"] .meal-tabs button.active, html[data-theme="dark"] .shortcut-button { background: var(--panel); color: var(--ink); }
html[data-theme="dark"] .entry-mode-switch, html[data-theme="dark"] .meal-bucket > header, html[data-theme="dark"] .delete-button { background: var(--paper-deep); }
html[data-theme="dark"] .voice-composer textarea { border-color: var(--line); background: color-mix(in srgb, var(--on-inverse) 5%, transparent); color: var(--ink); }
html[data-theme="dark"] .voice-button { border-color: var(--line); background: #1b313d; }
html[data-theme="dark"] .ai-meal-preview, html[data-theme="dark"] .auto-calorie-details[open] { background: var(--panel); color: var(--ink); }
html[data-theme="dark"] .auto-calorie-field { border-color: #396657; background: var(--surface-resolved); }
html[data-theme="dark"] .mobile-nav { border-color: var(--line); background: var(--paper); }

@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: 9px; }
  .calorie-equation { gap: 10px; font-size: 10px; }
  .calorie-equation b { font-size: 13px; }
  .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: 13px; }
  .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: 13px; }
  .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: 11px; }
  .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: 8px; }
  .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: 11px; }
  .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: 13px; }
.care-mode-control small { color: var(--ink-soft); font-size: 11px; }
.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: 11px; font-weight: 750; cursor: pointer; }
.care-mode-detail p { margin: 8px 0 0; color: var(--ink-soft); font-size: 11px; 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-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; }
.secondary-goal-settings > summary::-webkit-details-marker { display: none; }
.secondary-goal-settings > summary span { color: var(--ink); font-size: 13px; font-weight: 750; }
.secondary-goal-settings > summary b { color: var(--ink-soft); font-size: 11px; }
.secondary-goal-settings > summary i { color: var(--route); font-size: 20px; font-style: normal; transition: transform .2s ease; }
.secondary-goal-settings[open] > summary i { transform: rotate(90deg); }
.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: 11px; 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) { opacity: .42; cursor: default; }
.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); }
.goal-description-label { display: block; color: var(--ink); font-size: 12px; font-weight: 700; }
.goal-description-label textarea { width: 100%; min-height: 86px; margin-top: 8px; resize: vertical; border-color: var(--line); border-radius: var(--control-radius); background: var(--input); color: var(--ink); line-height: 1.45; }
.secondary-goal-body > p { margin: 10px 0 0; color: var(--ink-soft); font-size: 11px; 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: 13px; font-weight: 750; }
.preference-settings > summary b { color: var(--ink-soft); font-size: 11px; 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: 11px; }

.meal-source,
.meal-options {
  margin: 6px 0 0 !important;
  color: var(--ink-soft);
  font-size: 11px !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: 11px;
  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: 12px !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: 12px; 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: 10px; }
.plan-step.rest-plan { align-items: flex-start; }

@media (max-width: 780px) {
  .preference-settings > summary { min-height: 64px; }
  .meal-source, .meal-options { font-size: 13px !important; }
  .progressive-detail > summary { min-height: 38px; font-size: 13px; }
  .progressive-detail > p { font-size: 14px !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: 10px; 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: 11px; }
.goal-picker-settings label > b { font-size: 11px; }
.goal-context {
  margin: 0;
  color: var(--recovery);
  font-family: var(--utility);
  font-size: 9px;
  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; }
}
