/* Direction A — clean iOS native. Light is the default. */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --text: #000000;
  --muted: #6C6C70;
  --primary: #C8460C;
  --primary-dark: #7A2A06;
  --secondary: #FBE9DF;
  --secondary-dark: #C8460C;
  --accent: #FBE9DF;
  --danger: #B91C1C;
  --border: #E3E3E8;
  --shadow: none;
  --radius: 14px;
  --tap: 44px;
  --nav-h: 83px;
  --font: -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --smell-1: #34C759;
  --smell-2: #9BD35A;
  --smell-3: #FFCC00;
  --smell-4: #FF9500;
  --smell-5: #FF3B30;
  --protein: #0A84FF;
  --carbs: #34A853;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.24px;
  -webkit-font-smoothing: antialiased;
}
body {
  max-width: 520px;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3 { font-weight: 700; letter-spacing: -0.45px; }
button, input, select, textarea { font-family: inherit; }
button { min-height: 44px; }

.app-header { display: none; }

.page-hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 8px 4px 14px;
}
.page-hdr .back-link {
  color: var(--primary);
  background: none;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.4px;
  min-height: 44px;
  padding: 0 0 2px;
  align-self: flex-end;
}
.page-hdr .community-badge {
  align-self: center;
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  line-height: 18px;
}
.large-title, .section-title.large-title {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: -0.9px;
  margin: 0;
}
.avatar-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: #fff;
}
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}

.view { padding: 8px 16px calc(28px + var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
.sect {
  font-size: 20px;
  line-height: 25px;
  font-weight: 700;
  letter-spacing: -0.45px;
  margin: 22px 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sect button, .sect a {
  font-size: 15px;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: -0.2px;
  min-height: 44px;
  padding: 0 4px;
}

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 0;
  margin: 0 0 12px;
  border: none;
  box-shadow: none;
  overflow: hidden;
}
.card h3, #view-settings h3, #view-goals h3, #view-community h3, #view-culprits h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0;
  padding: 14px 16px 0;
}
#view-settings .card, #view-goals .card, #view-community .card, #view-culprits .card {
  padding-bottom: 12px;
}
#view-settings .card:not(.profile-links),
#view-community .card {
  padding: 4px 16px 14px;
}
#view-settings .card:not(.profile-links) > h3,
#view-community .card > h3 {
  padding-left: 0;
  padding-right: 0;
}
#view-settings .card:not(.profile-links) .settings-row,
#view-settings .card:not(.profile-links) .lookback-control,
#view-settings .card:not(.profile-links) .btn-row,
#view-settings .card:not(.profile-links) .hint,
#view-settings .card:not(.profile-links) .field,
#view-settings .card:not(.profile-links) .privacy-box,
#view-settings .card:not(.profile-links) .toggle-row,
#view-community .card > .hint {
  margin-left: 0;
  margin-right: 0;
}
#view-settings .settings-row {
  padding: 12px 0;
  border-bottom: none;
  position: relative;
}
#view-settings .settings-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 0.5px solid var(--border);
}
#view-settings .lookback-control { padding: 0 0 8px; }
#view-settings .card > :first-child, #view-goals .card > :first-child { margin-top: 0; }
#goals-editor > .btn-primary,
#goals-editor .hint,
#goals-history > .btn-row,
#goals-history .hint,
#goals-history .suspect-list {
  margin-left: 16px;
  margin-right: 16px;
}
#goals-editor > .btn-primary {
  display: block;
  width: calc(100% - 32px);
  box-sizing: border-box;
  margin-top: 8px;
}
.goal-date-block {
  padding: 4px 16px 12px;
}
.goal-date-label {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
  margin: 0 0 6px;
}
.goal-date-pill {
  display: flex;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
}
.goal-date-pill input {
  max-width: none;
}
.goal-date-text {
  font-size: 17px;
  letter-spacing: -0.4px;
}

#demo-banner.warning-banner {
  display: none;
  position: static;
  background: #E5E5EA;
  color: #3C3C43;
  border: none;
  border-radius: 8px;
  height: auto;
  min-height: 0;
  padding: 6px 10px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  white-space: normal;
  box-shadow: none;
}
#demo-banner.warning-banner.show { display: block; }

.forecast-card { margin: 0; }
.fc-row { display: flex; gap: 12px; padding: 14px; align-items: center; }
.icon-well {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #FBE9DF;
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}
.fc-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 22px;
  overflow-wrap: normal;
  word-break: normal;
}
.fc-range { white-space: nowrap; }
#meal-warning.warning-banner,
#forecast-list,
.forecast-item {
  background: none;
  border: none;
  padding: 0;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--muted);
  display: block;
}
#meal-warning.warning-banner { display: none; }
#meal-warning.warning-banner.show { display: block; }
.forecast-item strong { color: inherit; font-weight: 600; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.big-btn {
  border-radius: 16px;
  padding: 14px;
  height: 124px;
  min-height: 124px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  box-shadow: none;
  border: none;
  min-width: 0;
}
.big-btn .emoji, .big-btn .tile-ico {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0;
}
.big-btn .tile-copy { margin-top: auto; min-width: 0; width: 100%; }
.sub-narrow { display: none; }
@media (max-width: 389px) {
  .sub-wide { display: none; }
  .sub-narrow { display: inline; }
}
.big-btn .sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: -0.05px;
}
.big-btn.meal {
  background: #fff;
  color: #000;
}
.big-btn.meal .tile-ico { background: #FFF1D6; color: #B45309; }
.big-btn.meal .sub { color: var(--muted); }
.big-btn.toot {
  background: var(--primary);
  color: #fff;
}
.big-btn.toot .tile-ico { background: rgba(255, 255, 255, 0.2); color: #fff; }
.big-btn.toot .sub { color: rgba(255, 255, 255, 0.9); }
.big-btn.quick {
  margin-top: 12px;
  height: 50px;
  min-height: 50px;
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fff;
  color: var(--primary);
}
.big-btn.quick .sub {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-weight: 400;
}
.big-btn.joke { display: none; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat { padding: 12px 14px; }
.stat + .stat { border-left: 0.5px solid var(--border); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 400; }
.stat .v {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin-top: 2px;
  line-height: 29px;
}
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .v.name { font-size: 17px; line-height: 22px; letter-spacing: -0.4px; }

.goal-bars .goal {
  padding: 12px 16px;
}
#goals-today-body > .hint {
  margin: 0;
  padding: 14px 16px;
}
.goal-bars .goal + .goal { border-top: 0.5px solid var(--border); }
.goal-bars .goal-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.goal-bars .goal-top .amt {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.goal-bars .goal-top .amt b { color: #000; font-weight: 600; }
.goal-bars .bar, .bar-track {
  height: 8px;
  border-radius: 4px;
  background: #ECECF0;
  overflow: hidden;
}
.goal-bars .bar i, .bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
}
.weight-home {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.weight-latest { font-size: 24px; font-weight: 700; letter-spacing: -0.6px; margin: 0; }
.weight-latest strong { font-weight: 700; }
#home-tip {
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  margin: 8px 4px 0;
}

.bottom-nav {
  height: calc(83px + env(safe-area-inset-bottom, 0px));
  background: #F9F9F9 linear-gradient(rgba(249, 249, 249, 0.94), rgba(249, 249, 249, 0.94));
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
  padding: 6px 4px env(safe-area-inset-bottom, 0px);
  z-index: 100;
}
.bottom-nav button {
  color: #6C6C70;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1px;
  gap: 3px;
  min-height: 49px;
  height: 49px;
  justify-content: flex-start;
  padding-top: 2px;
}
.bottom-nav button .ico { display: block; width: 26px; height: 26px; }
.bottom-nav button .ico svg { display: block; }
.bottom-nav button.active { color: var(--primary); }
.bottom-nav button.active .ico svg { stroke-width: 2.1; }

.profile-links { padding: 4px 0; }
.profile-links button, button.ios-row {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: #000;
  background: #fff;
  border-radius: 0;
  text-align: left;
}
.profile-links button + button { box-shadow: inset 0 0.5px 0 var(--border); }
.profile-links button span.chev, .ios-row .chev { color: #C7C7CC; font-size: 20px; font-weight: 400; }

.modal-overlay {
  background: rgba(0, 0, 0, 0.4);
  align-items: flex-end;
  padding: 0;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(94vh, 900px);
  margin: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  overflow: hidden;
}
.modal-handle {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: #C7C7CC;
  margin: 6px auto 0;
}
.sheet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 8px 0 4px;
  gap: 8px;
}
.sheet-nav h2, #modal-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0;
}
#sheet-cancel-slot { min-width: 72px; }
#sheet-cancel-slot .btn, #modal-cancel.sheet-link {
  background: none;
  color: var(--primary);
  font-size: 17px;
  font-weight: 400;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  box-shadow: none;
}
.sheet-nav-end { min-width: 72px; }
#modal-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
}
#sheet-cta-slot { flex: none; }
#sheet-cta-slot:empty { display: none; }
label[for="meal-foods-input"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.group-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1px;
  margin: 16px 16px 7px 32px;
  font-weight: 400;
}
.group {
  margin: 0 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}
.group .field { margin: 0; }
.group .field-label { display: none; }
.cell {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  gap: 12px;
  position: relative;
  font-size: 17px;
  letter-spacing: -0.4px;
}
.cell + .cell::before,
.group .cell + .cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  border-top: 0.5px solid var(--border);
}
.cell .val { margin-left: auto; color: var(--muted); }
.cell input[type="datetime-local"],
.cell input[type="text"],
.cell input[type="number"],
.cell textarea,
.cell select {
  margin-left: auto;
  width: auto;
  max-width: 62%;
  border: none;
  background: #EEEEF0;
  border-radius: 7px;
  padding: 6px 10px;
  min-height: 34px;
  text-align: right;
  box-shadow: none;
  font-size: 16px;
}
input:focus:not([type="checkbox"]):not([type="range"]):not([type="file"]),
select:focus,
textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--primary);
}
.ios-pill input:focus,
.ios-pill input:focus:not([type="checkbox"]):not([type="range"]):not([type="file"]) {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}
.ios-pill:focus-within {
  box-shadow: 0 0 0 2px var(--primary);
}
.ios-pill input::-webkit-calendar-picker-indicator {
  background: none;
  color: transparent;
  opacity: 0;
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
}
.cell textarea {
  width: 100%;
  max-width: none;
  text-align: left;
  min-height: 44px;
  background: transparent;
  padding: 8px 0;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 8px 4px;
}
.rating-btn {
  min-width: 0;
  min-height: 72px;
  padding: 8px 1px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #3C3C43;
  letter-spacing: 0;
  gap: 7px;
  transform: none;
  box-sizing: border-box;
  overflow: visible;
}
.rating-btn span.lbl {
  font-size: 9px;
  font-weight: 500;
  color: #3C3C43;
  line-height: 1.15;
  letter-spacing: -0.15px;
  text-align: center;
  display: block;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.rating-btn.selected {
  background: #FBE9DF;
  color: #7A2A06;
  box-shadow: inset 0 0 0 2px var(--primary);
  transform: none;
}
.rating-btn.selected span.lbl { color: #7A2A06; font-weight: 700; }
.smell-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.vbars { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.vbars i { width: 4px; border-radius: 2px; display: block; }
.score-readout {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.score-readout i {
  width: 18px;
  height: 8px;
  border-radius: 4px;
  background: #E0E0E5;
  display: block;
}
.score-readout i.on { background: var(--primary); }
.score-readout b { color: #000; margin-left: 6px; font-weight: 600; }

.sheet-cta {
  position: static;
  bottom: auto;
  background: #F9F9F9;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top: 0.5px solid rgba(0, 0, 0, 0.12);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  z-index: 4;
  width: 100%;
  box-sizing: border-box;
}
#modal-body { scroll-padding-bottom: 12px; }
#modal-save-meal:disabled, #modal-save-toot:disabled, .btn-primary:disabled {
  background: #E5E5EA;
  color: #8E8E93;
  opacity: 1;
}
.sheet-cta .btn { width: 100%; }
#modal-save-meal, #modal-save-toot, .btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  min-height: 50px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.btn-secondary, .btn-danger, .btn-ghost {
  border-radius: 12px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 600;
}
.btn-secondary { background: #fff; color: var(--primary); border: none; box-shadow: inset 0 0 0 0.5px var(--border); }
.btn-danger { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 0.5px var(--border); }

.entry-modes {
  display: flex;
  background: #E4E4E9;
  border-radius: 9px;
  padding: 2px;
  margin: 4px 16px 12px;
  height: 44px;
  gap: 0;
  overflow-x: auto;
}
.entry-mode {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.entry-mode.active {
  background: #fff;
  color: #000;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  font-weight: 600;
}
.meal-search {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0 16px 8px;
  padding: 0 10px;
  background: #E4E4E9;
  border-radius: 10px;
}
.meal-search input, #meal-foods-input, #photo-food-input {
  background: transparent;
  border: none;
  min-height: 36px;
  padding: 6px 4px 6px 2px;
  width: 100%;
}
.meal-search:focus-within {
  box-shadow: 0 0 0 2px var(--primary);
}
#meal-foods-input:focus,
#photo-food-input:focus,
.meal-search input:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}
.suggest-list {
  margin: 0 16px 8px;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  gap: 0;
}
.suggest-list button.suggest-hit {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: none;
  border-radius: 0;
  background: #fff;
  text-align: left;
  font-weight: 400;
  position: relative;
  touch-action: manipulation;
}
.suggest-list .suggest-group + button.suggest-hit {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.suggest-list button.suggest-hit:has(+ .suggest-group),
.suggest-list button.suggest-hit:has(+ .hint),
.suggest-list button.suggest-hit:last-of-type {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.suggest-list button.suggest-hit + button.suggest-hit::before {
  content: "";
  position: absolute;
  top: 0;
  left: 64px;
  right: 0;
  border-top: 0.5px solid var(--border);
}
.suggest-copy { flex: 1; min-width: 0; }
.suggest-copy .nm { display: block; font-size: 17px; letter-spacing: -0.4px; color: #000; }
.suggest-list button .suggest-meta {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}
.suggest-add {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FBE9DF;
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
}
.suggest-add::after { content: ""; position: absolute; inset: -7px; }
.suggest-group {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1px;
  padding: 12px 4px 6px 16px;
  background: transparent;
}
.letter-tile {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
  line-height: 1;
}
.chip-scroller, #recent-food-chips, #selected-food-chips {
  display: flex;
  flex-wrap: wrap;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 8px;
  margin: 0 16px;
  padding-bottom: 4px;
  max-height: 88px;
  max-width: 100%;
}
.chip-scroller .chip, #recent-food-chips .chip, #selected-food-chips .chip { flex: none; min-height: 32px; height: 32px; }
.chip {
  background: #fff;
  border: none;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  min-height: 32px;
  font-size: 15px;
  font-weight: 500;
  color: #000;
}
.chip.selected, .chip.food-pick.selected {
  background: #FBE9DF;
  color: #7A2A06;
  box-shadow: inset 0 0 0 1.5px var(--primary);
}
#selected-food-chips { margin: 8px 16px 0; }
.foot-note { font-size: 13px; color: var(--muted); margin: 7px 32px 8px; line-height: 18px; }

.insight-seg {
  display: flex;
  background: #E4E4E9;
  border-radius: 9px;
  padding: 2px;
  height: 44px;
  margin: 0 0 8px;
}
.insight-seg button {
  flex: 1;
  min-height: 40px;
  height: 40px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #000;
}
.insight-seg button.on {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.when-cell { min-height: 52px; }
.when-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  letter-spacing: -0.4px;
  text-transform: none;
  color: #000;
  font-weight: 400;
}
.when-label svg { color: var(--muted); flex: none; }
.when-pills { margin-left: auto; display: flex; gap: 8px; }
.ios-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: #EEEEF0;
  overflow: hidden;
}
.ios-pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 1;
  border: none;
  background: transparent;
  min-height: 34px;
  max-width: none;
  padding: 0;
  color: transparent;
  text-align: center;
}
.ios-pill input::-webkit-datetime-edit,
.ios-pill input::-webkit-datetime-edit-fields-wrapper,
.ios-pill input::-webkit-datetime-edit-text,
.ios-pill input::-webkit-datetime-edit-month-field,
.ios-pill input::-webkit-datetime-edit-day-field,
.ios-pill input::-webkit-datetime-edit-year-field,
.ios-pill input::-webkit-datetime-edit-hour-field,
.ios-pill input::-webkit-datetime-edit-minute-field,
.ios-pill input::-webkit-datetime-edit-ampm-field {
  color: transparent;
}
.ios-pill span {
  font-size: 17px;
  letter-spacing: -0.4px;
  color: #000;
  pointer-events: none;
}
.culprit-card { padding-bottom: 4px; }
.culprit-card .stink-item { padding: 0; border-bottom: none; }
.culprit-caption { padding: 10px 16px 4px; margin: 0; }
.culprit-detail .stink-blurb { margin: 0 0 4px; font-weight: 400; }
.culprit-detail .stink-meta { margin: 0; }
.culprit-hit, .stink-item > .hbar {
  width: 100%;
  min-height: 44px;
  height: 44px;
  max-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  text-align: left;
  font-weight: 400;
}
.culprit-detail { padding: 0 16px 10px 60px; }
.culprit-detail[hidden] { display: none; }
.more-insights { margin-top: 8px; }
.more-insights summary {
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--primary);
  cursor: pointer;
}
.more-insights summary::-webkit-details-marker { display: none; }
.hbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: 44px;
}
.hbar .nm { width: 88px; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .tr { flex: 1; height: 22px; background: #F2F2F7; border-radius: 6px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 6px; }
.hbar .x { width: 48px; text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stink-blurb { font-size: 13px; font-weight: 400; color: var(--muted); margin: 0 14px 8px; }
.smell-mix { display: flex; height: 140px; align-items: flex-end; padding: 14px 16px 0; }
#more-insights .card > .hint,
#more-insights .card > h4,
#more-insights #stink-ingredients-list,
#more-insights #ingredient-suspects-list,
#more-insights .suspect-list {
  margin-left: 16px;
  margin-right: 16px;
}
.smell-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.smell-col .stack { width: 18px; display: flex; flex-direction: column-reverse; gap: 2px; }
.smell-col .stack i { display: block; width: 100%; border-radius: 3px; min-height: 4px; }
.smell-col .day { margin-top: 6px; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 10px 8px 12px; font-size: 11px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.vs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 58px;
  position: relative;
}
.vs-item + .vs-item::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 0;
  border-top: 0.5px solid var(--border);
}
.vs-verdict { font-size: 17px; font-weight: 600; letter-spacing: -0.4px; margin: 0; }
.vs-meta { font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.vs-flag {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  flex: none;
}
.vs-flag.unique { background: #FDE7DA; color: #9A3412; }
.vs-flag.tough { background: #E3F5E8; color: #1E6B34; }
.vs-flag.same, .vs-flag.neutral, .vs-flag.learning { background: #E5E5EA; color: #3C3C43; }
.suspect-item, .timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 60px;
  background: #fff;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}
.timeline-day {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 16px 4px 6px;
  font-weight: 400;
}
.timeline-group {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 12px;
}
.timeline-group .timeline-item {
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
  position: relative;
}
.timeline-group .timeline-item + .timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 0;
  border-top: 0.5px solid var(--border);
}
#timeline { background: transparent; }
.timeline-item .body { flex: 1; min-width: 0; }
.timeline-item .body .title { font-size: 17px; font-weight: 400; letter-spacing: -0.4px; overflow-wrap: anywhere; }
.timeline-item .body .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.suspect-info, .vs-copy { min-width: 0; flex: 1; }
.suspect-score {
  width: 52px;
  flex: 0 0 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
}
.bar-track { width: 100%; margin-right: 0; }
.suspect-name, .suspect-meta { overflow-wrap: anywhere; }
.timeline-item .badge { display: none; }
.row-menu { position: relative; flex: none; }
.row-menu summary {
  list-style: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-pop {
  position: absolute;
  right: 0;
  top: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  z-index: 5;
  min-width: 140px;
  overflow: hidden;
}
.row-menu-pop button {
  width: 100%;
  min-height: 44px;
  text-align: left;
  padding: 0 14px;
  font-size: 17px;
  background: #fff;
}
.row-menu-pop .act-del { color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 12px; }
.stat-card {
  background: #fff;
  border-radius: 0;
  padding: 10px 8px;
  box-shadow: none;
}
.stat-card:first-child { border-radius: 12px 0 0 12px; }
.stat-card:last-child { border-radius: 0 12px 12px 0; }
.stat-card .val { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.stat-card .lbl { font-size: 11px; color: var(--muted); font-weight: 500; }

.goal-edit { margin: 0; }
.goal-edit + .goal-edit { box-shadow: inset 0 0.5px 0 var(--border); }
.ios-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 6px 16px;
  font-size: 17px;
}
.ios-cell select, .ios-cell input[type="number"], .ios-cell input[type="date"], .ios-cell input[type="text"] {
  min-height: 34px;
  max-width: 58%;
  text-align: right;
  border: none;
  background: #EEEEF0;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 16px;
  box-shadow: none;
}
.ios-cell input[type="number"],
.cell input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.ios-cell input[type="number"]::-webkit-outer-spin-button,
.ios-cell input[type="number"]::-webkit-inner-spin-button,
.cell input[type="number"]::-webkit-outer-spin-button,
.cell input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  color: var(--muted);
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: #E9E9EB;
  border: none;
  position: relative;
  flex: none;
  margin: 0;
}
input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
input[type="checkbox"]:checked { background: #34C759; }
input[type="checkbox"]:checked::after { left: 22px; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.suggest-list .food-attribution {
  font-size: 11px;
  line-height: 14px;
  margin: 8px 16px 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#height-ft, #height-in, #height-cm, #meal-servings, #weight-value, select, input[type="number"], input[type="date"] {
  min-height: 44px;
  font-size: 16px;
}
.ios-cell select,
.ios-cell input[type="number"],
.cell input[type="number"],
#weight-value {
  -webkit-appearance: none;
  appearance: none;
  min-height: 34px;
  background-color: #EEEEF0;
  border: none;
  border-radius: 7px;
}
.ios-cell select {
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, #6C6C70 50%), linear-gradient(135deg, #6C6C70 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.group #weight-error { margin: 0 16px 10px; }
.ios-pill input[type="date"], .ios-pill input[type="time"] {
  min-height: 34px;
  font-size: 17px;
}
#view-settings select, #view-settings input[type="text"], #view-goals select, #view-goals input {
  font-size: 16px;
}
.toggle {
  width: 51px;
  height: 31px;
  min-height: 31px;
  border-radius: 16px;
  background: #E9E9EB;
  position: relative;
}
.toggle::after {
  width: 27px;
  height: 27px;
  top: 2px;
  left: 2px;
}
.toggle.on { background: #34C759; }
.toggle.on::after { left: 22px; }

#weight-panel {
  padding: 4px 16px 4px;
}
#weight-panel h3 {
  padding-left: 0;
  padding-right: 0;
}
#weight-panel [data-track="toggle-bmi"] {
  width: 100%;
  margin-top: 8px;
}
.height-block { margin-top: 12px; }
.height-label {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.height-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 8px;
}
.height-pill {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 58%;
  min-height: 34px;
  margin: 0;
  padding: 4px 12px;
  box-sizing: border-box;
  background: #EEEEF0;
  border-radius: 10px;
}
.height-name {
  font-size: 15px;
  color: var(--muted);
  flex: none;
}
.height-unit {
  font-size: 15px;
  color: var(--muted);
  flex: none;
}
.height-pill input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 0;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: right;
  font-size: 16px;
}
.height-pill input:focus,
.height-pill input:focus:not([type="checkbox"]):not([type="range"]):not([type="file"]) {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}
.height-pill:focus-within {
  box-shadow: 0 0 0 2px var(--primary);
}
#weight-panel [data-track="save-height"] {
  display: block;
  width: 100%;
  margin: 4px 0 10px;
}
.weight-log {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
}
.weight-log span { flex: 1; min-width: 0; }
.weight-log button {
  border: none;
  background: none;
  color: var(--primary);
  min-height: 44px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 400;
}
.weight-log button[data-track="delete-weight"] { color: var(--danger); }

#modal-body > .hint,
#modal-body > .field,
#modal-body > [data-entry-panel],
#modal-body > #food-editor-root,
#modal-body > .joke-card,
#modal-body > .privacy-box,
#modal-body > .btn-row {
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}
#modal-body .meal-search,
#modal-body .suggest-list,
#modal-body .chip-scroller,
#modal-body .chips,
#modal-body .foot-note,
#modal-body #selected-food-chips,
#modal-body #recent-food-chips,
#modal-body #frequent-food-chips {
  margin-left: 0;
  margin-right: 0;
}
#modal-body .field-label,
#view-settings .field-label,
#view-goals .field-label,
#view-culprits .field-label {
  text-transform: none;
  letter-spacing: -0.2px;
  font-size: 13px;
  font-weight: 600;
}
#modal-body input[type="text"]:not(#meal-foods-input):not(#photo-food-input),
#modal-body input[type="number"]:not(.height-pill input),
#modal-body input[type="datetime-local"],
#modal-body select,
#modal-body textarea,
#view-settings input[type="text"],
#view-settings select,
#view-culprits select,
#cohort-select {
  background-color: #EEEEF0;
  border: none;
  border-radius: 10px;
  box-shadow: none;
  min-height: 44px;
  font-size: 16px;
}
#view-settings select,
#view-culprits select,
#modal-body select,
#cohort-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, #6C6C70 50%), linear-gradient(135deg, #6C6C70 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#meal-time::-webkit-calendar-picker-indicator {
  background: none;
  color: transparent;
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#meal-time { position: relative; }
#photo-food-input {
  background-color: #EEEEF0;
  border: none;
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 12px;
}
#photo-food-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary);
}
.ios-cell select {
  background-color: #EEEEF0;
  border: none;
}
#view-culprits .field {
  padding-left: 16px;
  padding-right: 16px;
}
#height-ft, #height-in, #height-cm {
  min-height: 34px;
  border: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: textfield;
  box-shadow: none;
}
#meal-servings {
  -webkit-appearance: none;
  appearance: textfield;
  border: none;
  background-color: #EEEEF0;
  width: 100%;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.joke-card .joke-text {
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.nutri-pill {
  background: #EEEEF0;
  border: none;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.nutri-pill.flag { background: #FBE9DF; color: #7A2A06; }
.ing-chip {
  background: #EEEEF0;
  border: none;
  border-radius: 999px;
}

.hint { font-size: 13px; line-height: 18px; color: var(--muted); }
.empty { color: var(--muted); font-size: 15px; padding: 16px; }
.personal-badge, .community-badge {
  font-size: 12px;
  font-weight: 600;
  background: #E5E5EA;
  color: #3C3C43;
  border-radius: 6px;
  padding: 2px 7px;
}
#home-log-weight, [data-track="log-weight"].text-link {
  background: none;
  color: var(--primary);
  font-size: 15px;
  font-weight: 400;
  min-height: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1C1E;
    --card: #2C2C2E;
    --text: #F2F2F7;
    --muted: #AEAEB2;
    --border: #3A3A3C;
    --primary: #FF7A45;
    --primary-dark: #FFD0BE;
    --secondary: #3A241C;
    --accent: #3A241C;
  }
  .bottom-nav, .sheet-cta {
    background: #1C1C1E linear-gradient(rgba(28, 28, 30, 0.94), rgba(28, 28, 30, 0.94));
    border-top-color: rgba(255, 255, 255, 0.12);
  }
  .big-btn.meal, .big-btn.quick, .card, .group, .suggest-list, .chip, .btn-secondary { background: var(--card); color: var(--text); }
  .big-btn.meal { color: var(--text); }
  .entry-modes, .insight-seg, .meal-search, #demo-banner.warning-banner { background: #3A3A3C; color: var(--text); }
  .goal-bars .goal-top .amt b, .score-readout b { color: var(--text); }
  .profile-links button, button.ios-row { background: var(--card); color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
