:root {
  --bg: #f0f1ee;
  --surface: #ffffff;
  --surface-soft: #e7e8e5;
  --ink: #131314;
  --ink-soft: #5f605d;
  --ink-faint: #969792;
  --accent: #ddfc31;
  --accent-soft: #e8ff70;
  --line: rgba(19, 19, 20, 0.09);
  --line-strong: rgba(19, 19, 20, 0.2);
  --runtime-bg: #eef4f6;
  --runtime-ink: #315866;
  --urgent-bg: #fff1f0;
  --urgent: #b42318;
  --stop-bg: #fff7ed;
  --stop: #b54708;
  --shadow-card: 0 12px 30px rgba(19, 19, 20, 0.08);
  --shadow-float: 0 14px 36px rgba(19, 19, 20, 0.14);
  --radius-hero: 26px;
  --radius-card: 20px;
  --radius-control: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; }

button { color: inherit; }
button,
[role="button"] { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button:disabled { cursor: not-allowed; opacity: 0.45; }

.skip-link {
  position: fixed;
  z-index: 120;
  top: -80px;
  left: 12px;
  padding: 10px 14px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 999px;
}

.skip-link:focus { top: 12px; }

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: clip;
  background: var(--bg);
}

.runtime-banner {
  position: relative;
  z-index: 35;
  width: 100%;
  min-height: 34px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 20px 8px;
  color: var(--runtime-ink);
  text-align: center;
  background: var(--runtime-bg);
  border-bottom: 1px solid rgba(49, 88, 102, 0.12);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.runtime-banner[hidden] { display: none; }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 20px 0;
  background: rgba(240, 241, 238, 0.91);
  backdrop-filter: blur(18px) saturate(1.1);
}

.runtime-banner:not([hidden]) + .topbar {
  min-height: 64px;
  padding-top: 0;
}

.brand {
  justify-self: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.icon-button,
.avatar-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(19, 19, 20, 0.06);
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar-button {
  justify-self: end;
  color: var(--accent);
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

main { min-height: calc(100dvh - 132px); }

.tab-panel { padding: 10px 20px calc(104px + var(--safe-bottom)); }
.tab-panel[hidden] { display: none; }
.tab-panel.is-active { animation: panel-in 180ms ease-out both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal { animation: reveal 280ms ease-out both; }
.reveal-1 { animation-delay: 0ms; }
.reveal-2 { animation-delay: 30ms; }
.reveal-3 { animation-delay: 60ms; }
.reveal-4 { animation-delay: 90ms; }
.reveal-5 { animation-delay: 120ms; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1,
h2,
p { text-wrap: pretty; }

h1,
h2 {
  margin: 0;
  font-weight: 650;
  line-height: 1.16;
  letter-spacing: -0.045em;
}

h1 { font-size: clamp(29px, 8.2vw, 35px); }
h2 { font-size: 22px; }

.eyebrow {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.07em;
}

.day-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 14px;
  align-items: center;
  padding: 17px 2px 18px;
}

.day-heading h1 { max-width: 290px; }

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.streak-chip,
.shield-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.streak-chip { gap: 5px; cursor: pointer; }
.streak-chip > span { color: var(--accent); text-shadow: 0 0 0 var(--ink); }
.shield-chip { color: var(--ink-soft); background: var(--surface-soft); }

.day-orbit {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
}

.day-orbit svg { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.day-orbit circle { fill: none; stroke-width: 7; }
.orbit-track { stroke: rgba(19, 19, 20, 0.1); }
.orbit-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 300ms ease;
}

.day-orbit > span { display: grid; place-items: center; line-height: 1; }
.day-orbit strong { font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 22px; font-weight: 700; }
.day-orbit small { margin-top: 4px; color: var(--ink-soft); font-size: 9px; font-weight: 700; letter-spacing: 0.09em; }

.mode-pills {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mode-pills button {
  min-height: 48px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mode-pills button.is-selected { background: var(--accent); }
.mode-pills .mode-filter { display: grid; width: 48px; padding: 12px; place-content: center; gap: 4px; }
.mode-filter span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.mode-filter span:nth-child(2) { width: 13px; }
.mode-filter span:nth-child(3) { width: 8px; }

.status-card {
  position: relative;
  margin-bottom: 12px;
  padding: 17px 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  box-shadow: 0 6px 20px rgba(19, 19, 20, 0.045);
  transition: background 160ms ease, border-color 160ms ease;
}

.status-card-topline { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.status-time { margin-left: auto; }
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  background: var(--ink-faint);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(19, 19, 20, 0.07);
}

.status-card h2 { margin: 11px 0 6px; font-size: 20px; }
.status-card p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.status-card.status-pending,
.status-card[data-state="pending"] { background: var(--accent); }

.status-card.status-pending .status-dot,
.status-card[data-state="pending"] .status-dot,
.status-card[data-state="standard"] .status-dot {
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(19, 19, 20, 0.09);
}

.status-card.status-pending .status-card-topline,
.status-card.status-pending p,
.status-card[data-state="pending"] .status-card-topline,
.status-card[data-state="pending"] p { color: rgba(19, 19, 20, 0.68); }

.status-card[data-state="light"],
.status-card[data-state="recovery"] { background: var(--surface-soft); border-color: var(--line); }

.status-card[data-state="light"] .status-dot,
.status-card[data-state="recovery"] .status-dot {
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(19, 19, 20, 0.08);
}

.status-card[data-state="stop"] {
  color: var(--stop);
  background: var(--stop-bg);
  border-color: rgba(181, 71, 8, 0.2);
}

.status-card[data-state="stop"] p,
.status-card[data-state="stop"] .status-card-topline { color: var(--stop); }
.status-card[data-state="stop"] .status-dot { background: var(--stop); box-shadow: 0 0 0 5px rgba(181, 71, 8, 0.11); }

.status-card[data-state="urgent"] {
  color: var(--urgent);
  background: var(--urgent-bg);
  border-color: rgba(180, 35, 24, 0.2);
}

.status-card[data-state="urgent"] p,
.status-card[data-state="urgent"] .status-card-topline { color: var(--urgent); }
.status-card[data-state="urgent"] .status-dot { background: var(--urgent); box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.1); }

.text-button,
.small-link { border: 0; background: transparent; font-weight: 650; cursor: pointer; }
.text-button { min-height: 38px; margin: 8px 0 -7px; padding: 0; font-size: 12px; }
.text-button span { display: inline-block; margin-left: 4px; }
.small-link { min-width: 44px; min-height: 44px; padding: 0; color: var(--ink-soft); font-size: 11px; }
.status-card[data-state="stop"] .text-button { color: var(--stop); }
.status-card[data-state="urgent"] .text-button { color: var(--urgent); }

.coach-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius-hero);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

.coach-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 82% 9%, rgba(221, 252, 49, 0.18), transparent 29%),
    linear-gradient(180deg, transparent 25%, rgba(19, 19, 20, 0.96) 70%);
}

.coach-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 72% 19%, rgba(221, 252, 49, 0.15), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 45%),
    #202022;
}

.coach-art::before {
  content: "";
  position: absolute;
  top: 38px;
  right: 38px;
  width: 118px;
  height: 76px;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-radius: 58% 42% 54% 46%;
  transform: rotate(-12deg);
}

.coach-art::after {
  content: "";
  position: absolute;
  top: -64px;
  right: -64px;
  width: 220px;
  height: 220px;
  border: 34px solid rgba(221, 252, 49, 0.1);
  border-radius: 50%;
}

.coach-art svg {
  position: absolute;
  top: 26px;
  right: -12px;
  width: 214px;
  height: 238px;
  opacity: 0.72;
  transform: rotate(-4deg);
}

.coach-line { fill: none; stroke-width: 7; stroke-linecap: round; }
.line-a { stroke: var(--accent); }
.line-b { stroke: rgba(255, 255, 255, 0.55); stroke-width: 4; }
.coach-art circle { fill: var(--surface); }
.coach-number {
  position: absolute;
  top: 18px;
  left: 20px;
  color: rgba(255, 255, 255, 0.16);
  font-family: "DIN Alternate", "Avenir Next", sans-serif;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}

.coach-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 112px 20px 19px;
}

.coach-content .eyebrow { color: var(--accent); }
.coach-content h2 { max-width: 315px; font-size: 27px; }
.coach-content > p:not(.eyebrow) { max-width: 330px; margin: 10px 0 13px; color: rgba(255, 255, 255, 0.7); font-size: 12px; line-height: 1.55; }
.coach-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.coach-meta span { padding: 6px 10px; color: rgba(255, 255, 255, 0.82); background: rgba(255, 255, 255, 0.1); border-radius: 999px; font-size: 10px; font-weight: 600; }

.primary-button,
.secondary-button,
.ghost-button,
.danger-outline-button,
.compact-button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.primary-button { color: var(--ink); background: var(--accent); }
.secondary-button { color: var(--surface); background: var(--ink); }
.ghost-button { color: var(--ink); background: var(--surface-soft); }
.danger-outline-button { color: var(--urgent); background: var(--urgent-bg); border: 1px solid rgba(180, 35, 24, 0.18); }
.compact-button { min-height: 38px; padding: 0 13px; color: var(--ink); background: var(--surface-soft); font-size: 11px; }

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.danger-outline-button:active,
.compact-button:active { transform: scale(0.985); }

.full-width { width: 100%; }
.coach-content > .primary-button { width: 100%; }
.coach-content > .primary-button.is-deferred {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.coach-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.coach-options button {
  min-height: 36px;
  padding: 4px 6px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.status-card[data-state="stop"] + .coach-card .primary-button { color: var(--surface); background: var(--stop); }
.status-card[data-state="urgent"] + .coach-card .primary-button { color: var(--surface); background: var(--urgent); }

.minimum-card,
.timeline-section,
.evidence-section { margin-top: 24px; padding: 20px; background: var(--surface); border-radius: var(--radius-card); }

.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.section-intro h2 { font-size: 21px; }
.fraction { font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 25px; font-weight: 700; }
.minimum-steps { display: grid; gap: 8px; margin-top: 15px; }

.minimum-step {
  display: grid;
  grid-template-columns: 34px 1fr 20px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 9px 12px;
  text-align: left;
  background: var(--bg);
  border: 0;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}

.minimum-step:active { transform: scale(0.99); }
.step-index { color: var(--ink-faint); font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 13px; font-weight: 650; }
.minimum-step > span:nth-child(2) { display: grid; gap: 3px; }
.minimum-step strong { font-size: 13px; }
.minimum-step small { color: var(--ink-soft); font-size: 11px; }
.minimum-step i { width: 19px; height: 19px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.minimum-step.is-done { background: var(--accent); }
.minimum-step.is-done .step-index,
.minimum-step.is-done small { color: rgba(19, 19, 20, 0.65); }

.minimum-step.is-optional:not(.is-done) {
  background: transparent;
  border: 1px dashed var(--line-strong);
}

.minimum-step.is-optional:not(.is-done) i { border-style: dashed; }

.minimum-step.is-done i { position: relative; border-color: var(--ink); background: var(--ink); }
.minimum-step.is-done i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.nutrition-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 12px;
  min-height: 156px;
  margin-top: 24px;
  padding: 20px;
  overflow: hidden;
  background: var(--accent);
  border-radius: var(--radius-hero);
}

.nutrition-strip::before {
  content: "";
  position: absolute;
  top: -54px;
  right: -68px;
  width: 170px;
  height: 170px;
  border: 28px solid rgba(19, 19, 20, 0.08);
  border-radius: 50%;
}

.nutrition-copy { position: relative; z-index: 1; align-self: center; }
.nutrition-copy .eyebrow { color: rgba(19, 19, 20, 0.62); }
.nutrition-copy h2 { max-width: 210px; font-size: 21px; }
.nutrition-copy > p:last-child { max-width: 225px; margin: 8px 0 0; color: rgba(19, 19, 20, 0.68); font-size: 11px; line-height: 1.5; }
.meal-preview-stack { position: relative; z-index: 1; display: flex; min-height: 112px; align-items: center; justify-content: flex-end; }

.add-meal-card,
.meal-thumb {
  width: 92px;
  height: 112px;
  overflow: hidden;
  border: 0;
  border-radius: 17px;
  box-shadow: 0 8px 20px rgba(19, 19, 20, 0.14);
}

.add-meal-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--surface);
  background: var(--ink);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.add-meal-card span { color: var(--accent); font-size: 28px; font-weight: 350; }
.meal-thumb { position: absolute; right: 0; padding: 0; background: var(--ink); }
.meal-thumb:nth-child(2) { right: 18px; }
.meal-thumb:nth-child(3) { right: 36px; }
.meal-thumb img { width: 100%; height: 100%; object-fit: cover; }

.timeline-section { padding-bottom: 14px; }
.timeline { list-style: none; margin: 15px 0 0; padding: 0; }
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 50px 15px 1fr;
  gap: 9px;
  min-height: 63px;
  color: var(--ink-soft);
  font-size: 11px;
}

.timeline li::after { content: ""; position: absolute; top: 24px; bottom: 0; left: 64px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { padding-top: 3px; font-variant-numeric: tabular-nums; }
.timeline i {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  background: #c8c9c5;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #c8c9c5;
}

.timeline li.is-done i { background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.timeline li.is-now i { background: var(--accent); box-shadow: 0 0 0 4px rgba(221, 252, 49, 0.34); }
.timeline li.is-optional:not(.is-done) i { background: var(--surface); border-style: dashed; }
.timeline strong { display: block; color: var(--ink); font-size: 12px; }
.timeline small { display: block; margin-top: 3px; color: var(--ink-soft); }

.page-heading { padding: 22px 2px 26px; }
.page-heading > p:last-child { max-width: 370px; margin: 12px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.camera-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  color: var(--ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-hero);
  cursor: pointer;
}

.camera-stage::before { content: ""; position: absolute; top: -65px; left: -55px; width: 190px; height: 190px; background: var(--ink); border-radius: 50%; opacity: 0.08; }
.camera-stage::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(19, 19, 20, 0.12); border-radius: 20px; }
.camera-stage strong { z-index: 1; margin-top: 10px; font-size: 21px; }
.camera-stage small { z-index: 1; color: rgba(19, 19, 20, 0.62); font-size: 11px; }
.camera-reticle { position: relative; z-index: 1; display: block; width: 68px; height: 68px; background: var(--ink); border-radius: 50%; }
.camera-reticle::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255, 255, 255, 0.62); border-radius: 50%; }
.camera-reticle i { position: absolute; z-index: 1; background: var(--accent); }
.camera-reticle i:first-child { top: 33px; left: 24px; width: 20px; height: 2px; }
.camera-reticle i:last-child { top: 24px; left: 33px; width: 2px; height: 20px; }

.history-heading { margin-top: 28px; }
.data-pill,
.local-badge { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; color: var(--ink); background: var(--surface-soft); border-radius: 999px; font-size: 10px; font-weight: 650; }
.meal-history { display: grid; gap: 10px; margin-top: 14px; }

.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
}

.empty-state strong { display: block; color: var(--ink); font-size: 19px; }
.empty-state p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }
.meal-history-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  min-height: 102px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 5px 16px rgba(19, 19, 20, 0.04);
}

.meal-history-card img { width: 82px; height: 82px; object-fit: cover; border-radius: 14px; }
.meal-history-card h3 { margin: 0; font-size: 16px; }
.meal-history-card p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.meal-history-card time { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 10px; }
.meal-delete { min-width: 44px; min-height: 44px; padding: 0; color: var(--urgent); background: transparent; border: 0; cursor: pointer; }

.trends-heading { position: relative; padding-bottom: 16px; }
.segmented { display: inline-flex; margin-top: 18px; padding: 4px; background: var(--surface-soft); border-radius: 999px; }
.segmented button { min-width: 68px; min-height: 38px; padding: 0 14px; background: transparent; border: 0; border-radius: 999px; font-size: 11px; font-weight: 650; }
.segmented button.is-selected { color: var(--ink); background: var(--accent); }

.week-score-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  color: var(--ink);
  background: var(--accent);
  border-radius: var(--radius-hero);
}

.week-score-card::after { content: ""; position: absolute; top: -42px; right: -52px; width: 150px; height: 150px; border: 24px solid rgba(19, 19, 20, 0.07); border-radius: 50%; }
.week-score-card .eyebrow { color: rgba(19, 19, 20, 0.62); }
.week-score { position: relative; z-index: 1; display: inline-flex; align-items: baseline; font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 52px; font-weight: 700; letter-spacing: -0.04em; }
.week-score small { margin-left: 5px; color: rgba(19, 19, 20, 0.58); font-size: 12px; font-weight: 600; }
.week-dots { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0 13px; }
.week-dot { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-soft); background: rgba(255, 255, 255, 0.55); border-radius: 10px; font-size: 9px; font-weight: 650; }
.week-dot.is-done { color: var(--ink); background: var(--surface); }
.week-dot.is-today { color: var(--accent); background: var(--ink); box-shadow: none; }
.week-score-card > p { position: relative; z-index: 1; margin: 0; color: rgba(19, 19, 20, 0.65); font-size: 11px; line-height: 1.55; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.metric-card { position: relative; min-height: 164px; overflow: hidden; padding: 16px; background: var(--surface); border-radius: var(--radius-card); }
.metric-icon { display: grid; width: 32px; height: 32px; place-items: center; color: var(--surface); background: var(--ink); border-radius: 50%; font-size: 11px; font-weight: 700; }
.metric-card > p { margin: 18px 0 5px; color: var(--ink-soft); font-size: 11px; }
.metric-card > strong { font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 32px; }
.metric-card > small { margin-left: 3px; color: var(--ink-soft); font-size: 10px; }
.micro-chart { position: absolute; right: 14px; bottom: 14px; left: 14px; display: flex; height: 27px; align-items: end; gap: 4px; }
.micro-chart i { flex: 1; min-height: 3px; background: var(--surface-soft); border-radius: 5px 5px 1px 1px; }
.micro-chart i:last-child { background: var(--accent); }

.insight-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  margin-top: 10px;
  padding: 22px 18px;
  overflow: hidden;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius-card);
}

.insight-card::after { content: ""; position: absolute; top: -50px; right: -45px; width: 110px; height: 110px; border: 18px solid rgba(221, 252, 49, 0.1); border-radius: 50%; }
.insight-number { color: var(--accent); font-family: "DIN Alternate", "Avenir Next", sans-serif; font-size: 25px; font-weight: 700; }
.insight-card .eyebrow { color: var(--accent); }
.insight-card h2 { font-size: 20px; }
.insight-card p:last-child { margin: 8px 0 0; color: rgba(255, 255, 255, 0.68); font-size: 11px; line-height: 1.55; }

.evidence-row { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.evidence-row:last-child { border-bottom: 0; padding-bottom: 0; }
.evidence-row > span { font-size: 11px; font-weight: 650; }
.evidence-row p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

.profile-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 18px;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius-hero);
}

.profile-monogram { display: grid; width: 60px; height: 60px; place-items: center; color: var(--ink); background: var(--accent); border-radius: 50%; font-size: 23px; font-weight: 700; }
.profile-card .eyebrow { color: var(--accent); }
.profile-card h2 { font-size: 19px; }
.profile-card p:last-child { margin: 4px 0 0; color: rgba(255, 255, 255, 0.62); font-size: 10px; }
.profile-card .local-badge { color: var(--ink); background: var(--accent); }
.profile-edit-button {
  min-height: 34px;
  margin: 10px 0 0;
  padding: 0 12px;
  color: var(--surface);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.settings-group { margin-top: 12px; padding: 20px 18px; background: var(--surface); border-radius: var(--radius-card); }
.settings-group > h2 { margin-bottom: 13px; font-size: 20px; }
.setting-row { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 13px; border-top: 1px solid var(--line); font-size: 12px; }
.setting-row strong { text-align: right; font-size: 11px; }
.setting-row span:has(small) { display: grid; gap: 3px; }
.setting-row small { color: var(--ink-soft); font-size: 10px; }
.attention-row { margin-top: 4px; padding: 10px 0; }

.runtime-mode-note {
  margin: 12px 0 0;
  padding: 11px 13px;
  color: var(--runtime-ink);
  background: var(--runtime-bg);
  border: 1px solid rgba(49, 88, 102, 0.12);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
}

.runtime-mode-note[hidden] { display: none; }
.reminder-state { display: flex; gap: 11px; align-items: center; margin: 5px 0 14px; padding: 13px; background: var(--bg); border-radius: var(--radius-control); }
.reminder-state > div { display: grid; gap: 3px; }
.reminder-state strong { font-size: 12px; }
.reminder-state small { color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.settings-group > .full-width + .full-width { margin-top: 8px; }
.fine-print { margin: 12px 2px 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }

.boundary-list { list-style: none; margin: 0; padding: 0; }
.boundary-list li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.boundary-list span { align-self: start; color: var(--stop); font-weight: 700; }
.boundary-list li:last-child span { color: var(--urgent); }
.safety-group .danger-outline-button { margin-top: 10px; }
.button-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.data-action-button { margin-top: 8px; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: max(10px, var(--safe-bottom));
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 28px), 402px);
  height: 68px;
  margin: 0 auto;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.91);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(20px) saturate(1.15);
}

.nav-item {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 3px;
  color: #9a9b97;
  background: transparent;
  border: 0;
  border-radius: 17px;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.nav-item > svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active { color: var(--ink); background: var(--bg); }
.nav-item.is-active > span:last-child::after { display: none; }
.camera-button { display: grid; width: 43px; height: 43px; margin-top: -15px; place-items: center; color: var(--ink); background: var(--accent); border: 4px solid var(--surface); border-radius: 50%; box-shadow: 0 7px 18px rgba(19, 19, 20, 0.18); }
.camera-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

dialog { color: var(--ink); border: 0; padding: 0; }
dialog::backdrop { background: rgba(19, 19, 20, 0.62); backdrop-filter: blur(5px); }

.sheet-dialog {
  width: min(100%, 430px);
  max-width: none;
  max-height: min(92dvh, 860px);
  margin: auto auto 0;
  overflow: hidden;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 60px rgba(19, 19, 20, 0.22);
}

.sheet-dialog[open] { animation: sheet-up 180ms ease-out both; }

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-dialog form { display: flex; max-height: min(92dvh, 860px); flex-direction: column; }
.sheet-handle { width: 38px; height: 4px; margin: 9px auto 2px; background: #c8c9c5; border-radius: 5px; }
.sheet-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; }
.sheet-header h2 { font-size: 23px; }

.dialog-close {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--surface);
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.sheet-body { overflow-y: auto; padding: 0 20px 22px; overscroll-behavior: contain; }
.sheet-footer { padding: 12px 20px calc(14px + var(--safe-bottom)); background: rgba(255, 255, 255, 0.92); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }

.range-field { display: block; padding: 16px 0; border-top: 1px solid var(--line); }
.range-field > span { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.range-field output { display: grid; width: 38px; height: 38px; place-items: center; color: var(--surface); background: var(--ink); border-radius: 50%; font-weight: 700; }
.range-field input { width: 100%; margin: 15px 0 5px; accent-color: var(--ink); }
.range-field small { color: var(--ink-soft); font-size: 10px; }

fieldset { min-width: 0; border: 0; padding: 0; }
.choice-field { padding: 16px 0; border-top: 1px solid var(--line); }
.choice-field legend { margin-bottom: 10px; font-size: 12px; font-weight: 650; }
.choice-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice-pills.multi { grid-template-columns: repeat(2, 1fr); }
.choice-pills label { min-width: 0; }
.choice-pills input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pills span { display: grid; min-height: 44px; place-items: center; padding: 6px; text-align: center; background: var(--surface); border: 1px solid transparent; border-radius: 999px; font-size: 11px; cursor: pointer; }
.choice-pills input:checked + span { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.choice-pills input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.two-column-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.two-column-fields label { position: relative; display: grid; gap: 7px; min-width: 0; padding: 12px; background: var(--surface); border-radius: var(--radius-control); font-size: 10px; }
.two-column-fields input,
.two-column-fields select { width: 100%; min-width: 0; min-height: 32px; padding: 0 0 4px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); font-size: 15px; font-weight: 650; }
.two-column-fields small { position: absolute; right: 12px; bottom: 18px; color: var(--ink-soft); font-size: 8px; pointer-events: none; }

.safety-screen { padding: 16px 0; border-top: 1px solid var(--line); }
.safety-screen > legend { margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.safety-screen > label,
.red-flag-block label,
.confirm-row { display: flex; min-height: 50px; align-items: start; gap: 11px; padding: 9px 0; font-size: 13px; }

.safety-screen input,
.confirm-row input { width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0; accent-color: var(--urgent); }
.safety-screen label span { display: grid; gap: 2px; }
.safety-screen small { color: var(--ink-soft); font-size: 13px; line-height: 1.45; }

.red-flag-block {
  margin-top: 10px;
  padding: 14px;
  color: var(--urgent);
  background: var(--urgent-bg);
  border: 1px solid rgba(180, 35, 24, 0.17);
  border-radius: var(--radius-control);
}

.red-flag-block > strong { display: block; margin-bottom: 5px; font-size: 14px; }
.red-flag-block label { min-height: 44px; padding: 8px 0; border-top: 1px solid rgba(180, 35, 24, 0.1); }
.confirm-row { align-items: center; margin-top: 6px; padding: 12px; background: var(--surface); border-radius: var(--radius-control); }
.warning-confirm { color: var(--stop); background: var(--stop-bg); border: 1px solid rgba(181, 71, 8, 0.16); }
.warning-confirm input { accent-color: var(--stop); }

.prestart-plan {
  margin: 0 0 15px;
  padding: 13px 14px;
  color: var(--ink-soft);
  background: var(--surface);
  border-radius: var(--radius-control);
  font-size: 12px;
  line-height: 1.55;
}

.prestart-options { display: grid; gap: 8px; }
.prestart-options legend { margin-bottom: 3px; font-size: 12px; font-weight: 650; }
.prestart-options label { position: relative; display: block; }
.prestart-options input { position: absolute; opacity: 0; pointer-events: none; }
.prestart-options label > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 4px;
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
}
.prestart-options b { font-size: 13px; }
.prestart-options small { color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.prestart-options input:checked + span { background: var(--accent); border-color: var(--ink); }
.prestart-options input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.prestart-options .stop-choice > span { color: var(--stop); background: var(--stop-bg); }
.prestart-options .stop-choice small { color: var(--stop); }
.prestart-options .urgent-choice > span { color: var(--urgent); background: var(--urgent-bg); }
.prestart-options .urgent-choice small { color: var(--urgent); }
.prestart-options .stop-choice input:checked + span { border-color: var(--stop); }
.prestart-options .urgent-choice input:checked + span { border-color: var(--urgent); }
.local-profile-note { margin-bottom: 4px; }
.local-profile-note > span { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.profile-fields { border-top: 0; }

.photo-picker {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 196px;
  place-items: center;
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
  cursor: pointer;
}

.photo-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-picker > span { z-index: 1; display: grid; gap: 6px; max-width: 250px; padding: 16px; text-align: center; }
.photo-picker > span b { font-size: 14px; }
.photo-picker > span small { color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.photo-picker.has-image > span { position: absolute; right: 10px; bottom: 10px; display: block; padding: 7px 11px; color: var(--surface); background: rgba(19, 19, 20, 0.78); border-radius: 999px; font-size: 9px; backdrop-filter: blur(6px); }
.photo-picker.has-image > span b { font-size: 9px; }
.photo-picker.has-image > span small { display: none; }
.meal-tags { margin-top: 0; }

.textarea-field { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 11px; font-weight: 650; }
.textarea-field textarea { width: 100%; padding: 12px; resize: vertical; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); font-size: 12px; line-height: 1.5; }
.honesty-note { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 13px; background: var(--surface-soft); border-radius: var(--radius-control); }
.honesty-note > span { display: grid; width: 24px; height: 24px; place-items: center; color: var(--surface); background: var(--ink); border-radius: 50%; font-size: 11px; font-weight: 700; }
.honesty-note p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.honesty-note b { display: block; margin-bottom: 2px; color: var(--ink); }

.workout-dialog { width: min(100%, 430px); max-width: none; height: 100%; max-height: none; background: var(--ink); }
.workout-shell { display: flex; min-height: 100dvh; flex-direction: column; color: var(--surface); background: var(--ink); }
.workout-header { display: grid; grid-template-columns: 64px 1fr 92px; gap: 8px; align-items: center; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; }
.workout-header button { min-height: 44px; padding: 0 9px; color: var(--surface); background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 999px; font-size: 10px; font-weight: 650; cursor: pointer; }
.workout-header > div { display: grid; gap: 6px; text-align: center; font-size: 9px; }
.workout-progress { height: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.13); border-radius: 6px; }
.workout-progress i { display: block; width: 25%; height: 100%; background: var(--accent); border-radius: inherit; transition: width 220ms ease; }
.workout-help { color: var(--surface) !important; background: rgba(255, 255, 255, 0.1) !important; border: 1px solid rgba(255, 255, 255, 0.14) !important; }

.workout-content { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 20px 22px; text-align: center; }
.workout-content .eyebrow { color: var(--accent); }
.workout-content h2 { max-width: 380px; font-size: clamp(32px, 9vw, 44px); }
.workout-dose { margin: 11px 0 0; color: var(--accent); font-size: 18px; font-weight: 650; }
.workout-cue { max-width: 360px; margin: 17px 0; color: rgba(255, 255, 255, 0.68); font-size: 12px; line-height: 1.6; }
.workout-safety-line { padding: 8px 13px; color: rgba(255, 255, 255, 0.64); background: rgba(255, 255, 255, 0.07); border-radius: 999px; font-size: 10px; }
.workout-safety-line span { margin-right: 5px; color: var(--surface); }

.movement-visual {
  position: relative;
  display: grid;
  width: 176px;
  height: 176px;
  margin-bottom: 24px;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.movement-visual::before,
.movement-visual::after { content: ""; position: absolute; inset: 20px; border: 2px solid rgba(221, 252, 49, 0.38); border-left-color: transparent; border-radius: 50%; animation: breathe 4.5s ease-in-out infinite; }
.movement-visual::after { inset: 38px; border-color: rgba(255, 255, 255, 0.22); border-right-color: transparent; animation-delay: -2.25s; }
.movement-visual span { display: grid; width: 68px; height: 68px; place-items: center; color: var(--ink); background: var(--accent); border-radius: 50%; font-size: 27px; font-weight: 700; }
.movement-visual i { position: absolute; width: 7px; height: 7px; background: var(--surface); border-radius: 50%; }
.movement-visual i:first-of-type { top: 13px; }
.movement-visual i:last-of-type { right: 18px; bottom: 33px; }

@keyframes breathe {
  50% { opacity: 0.56; transform: scale(0.88) rotate(28deg); }
}

.workout-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 9px; padding: 12px 16px calc(16px + var(--safe-bottom)); }
.workout-footer .secondary-button { color: var(--surface); background: rgba(255, 255, 255, 0.1); }

.symptom-options { display: grid; gap: 9px; padding-bottom: calc(25px + var(--safe-bottom)); }
.symptom-options button { display: grid; gap: 5px; min-height: 74px; padding: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.symptom-options b { font-size: 14px; }
.symptom-options small { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.symptom-options button[data-symptom-level="stop"] { color: var(--stop); background: var(--stop-bg); border-color: rgba(181, 71, 8, 0.18); }
.symptom-options button[data-symptom-level="stop"] small { color: var(--stop); }
.symptom-options .urgent-option { color: var(--urgent); background: var(--urgent-bg); border-color: rgba(180, 35, 24, 0.18); }
.symptom-options .urgent-option small { color: var(--urgent); }

.alert-dialog { width: min(calc(100% - 32px), 398px); padding: 27px 22px 21px; text-align: center; background: var(--surface); border-radius: 25px; box-shadow: var(--shadow-float); }
.alert-dialog[open] { animation: alert-in 150ms ease-out both; }

@keyframes alert-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.alert-symbol { display: grid; width: 56px; height: 56px; margin: 0 auto 14px; place-items: center; color: var(--surface); background: var(--ink); border-radius: 50%; font-size: 25px; font-weight: 700; }
.alert-dialog h2 { font-size: 24px; }
.alert-dialog > p:not(.eyebrow) { margin: 9px 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.alert-actions { display: grid; gap: 8px; }

/* Safety actions use explicit classes and never inherit the yellow action color. */
.alert-dialog .primary-button { color: var(--surface); background: var(--ink); }
.urgent-action-button {
  color: var(--surface) !important;
  background: var(--urgent) !important;
  border-color: var(--urgent) !important;
}
.stop-action-button {
  color: var(--surface) !important;
  background: var(--stop) !important;
  border-color: var(--stop) !important;
}
.alert-dialog[data-level="urgent"] { background: var(--urgent-bg); }
.alert-dialog[data-level="urgent"] .alert-symbol { color: var(--surface); background: var(--urgent); }
.alert-dialog[data-level="stop"] { background: var(--stop-bg); }
.alert-dialog[data-level="stop"] .alert-symbol { color: var(--surface); background: var(--stop); }
.alert-dialog[data-level="urgent"] > p:not(.eyebrow),
.alert-dialog[data-level="urgent"] .eyebrow { color: var(--urgent); }
.alert-dialog[data-level="stop"] > p:not(.eyebrow),
.alert-dialog[data-level="stop"] .eyebrow { color: var(--stop); }

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: calc(92px + var(--safe-bottom));
  left: 18px;
  max-width: 394px;
  margin: 0 auto;
  padding: 13px 16px;
  color: var(--surface);
  text-align: center;
  background: rgba(19, 19, 20, 0.94);
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 150ms ease, transform 150ms ease;
  font-size: 11px;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 350px) {
  .runtime-banner { padding-right: 15px; padding-left: 15px; }
  .topbar,
  .tab-panel { padding-right: 15px; padding-left: 15px; }
  .day-heading { grid-template-columns: minmax(0, 1fr) 66px; }
  .day-orbit { width: 66px; height: 66px; }
  .mode-pills { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .mode-pills button { min-height: 44px; padding: 0 9px; font-size: 11px; }
  .mode-pills .mode-filter { width: 44px; }
  .coach-card,
  .coach-content { min-height: 348px; }
  .coach-content { padding-right: 16px; padding-left: 16px; }
  .coach-content h2 { font-size: 24px; }
  .coach-options { gap: 4px; }
  .coach-options button { padding: 3px; font-size: 9px; }
  .minimum-card,
  .timeline-section,
  .evidence-section { padding: 17px; }
  .nutrition-strip { grid-template-columns: minmax(0, 1fr) 88px; padding: 17px; }
  .add-meal-card,
  .meal-thumb { width: 82px; height: 104px; }
  .metric-card { min-height: 158px; padding: 14px; }
  .two-column-fields { grid-template-columns: 1fr; }
  .meal-history-card { grid-template-columns: 72px minmax(0, 1fr) 38px; gap: 9px; }
  .meal-history-card img { width: 72px; height: 72px; }
  .workout-header { grid-template-columns: 58px 1fr 84px; padding-right: 12px; padding-left: 12px; }
}

@media (min-width: 411px) and (max-width: 430px) {
  .runtime-banner,
  .topbar,
  .tab-panel { padding-right: 24px; padding-left: 24px; }
  .coach-content { padding-right: 22px; padding-left: 22px; }
  .bottom-nav { width: 402px; }
}

@media (min-width: 431px) {
  html,
  body { background: #0d0d0e; }
  body { padding: 20px 0; }
  .app-shell { min-height: calc(100dvh - 40px); border-radius: 34px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42); }
  .runtime-banner { border-radius: 34px 34px 0 0; }
  .runtime-banner[hidden] + .topbar { border-radius: 34px 34px 0 0; }
  .bottom-nav { bottom: 30px; }
  .sheet-dialog { margin-bottom: 20px; border-radius: 28px; }
  .workout-dialog { height: calc(100dvh - 40px); max-height: 900px; border-radius: 34px; }
  .workout-shell { min-height: min(calc(100dvh - 40px), 900px); border-radius: 34px; }
}

@media (hover: hover) {
  .primary-button:hover,
  .compact-button:hover,
  .camera-stage:hover,
  .add-meal-card:hover { filter: brightness(0.97); }
  .nav-item:hover { color: var(--ink); }
  .minimum-step:hover { background: #e9eae7; }
  .minimum-step.is-done:hover { background: var(--accent); }
}

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

@media (prefers-contrast: more) {
  :root {
    --line: rgba(19, 19, 20, 0.34);
    --line-strong: rgba(19, 19, 20, 0.62);
    --ink-soft: #363735;
  }
  .eyebrow,
  .fine-print,
  .minimum-step small { color: var(--ink); }
  .bottom-nav { background: var(--surface); border: 1px solid var(--ink); }
}
