:root {
  color-scheme: light;
  --bg: #f7f6f0;
  --surface: #ffffff;
  --surface-soft: #f0efe7;
  --ink: #1d2524;
  --muted: #6c7572;
  --line: #dfded6;
  --protein: #2f8f70;
  --protein-bg: #dff3eb;
  --fat: #b05e2a;
  --fat-bg: #f6e6d8;
  --carb: #4968b8;
  --carb-bg: #e3e9fb;
  --accent: #e35336;
  --shadow: 0 14px 34px rgba(35, 42, 40, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(227, 83, 54, 0.08), rgba(227, 83, 54, 0) 230px),
    var(--bg);
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
}

.icon-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(35, 42, 40, 0.08);
  text-decoration: none;
}

.icon-button span {
  font-size: 21px;
  line-height: 1;
}

.date-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.date-panel label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.date-panel input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: right;
}

.date-panel button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.summary {
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.summary-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 20px;
}

.summary-label {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  font-weight: 700;
}

.summary-main strong {
  font-size: 50px;
  line-height: 0.95;
}

.summary-unit {
  align-self: end;
  padding-bottom: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.macro-chip {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 13px 12px;
}

.macro-chip + .macro-chip {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.macro-chip span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.macro-chip strong {
  font-size: 15px;
}

.macro-chip.protein span {
  background: var(--protein-bg);
  color: var(--protein);
}

.macro-chip.fat span {
  background: var(--fat-bg);
  color: var(--fat);
}

.macro-chip.carb span {
  background: var(--carb-bg);
  color: var(--carb);
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin: 18px 0 22px;
}

.day-pill {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.day-pill.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: 21px;
}

.section-heading span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.food-list {
  display: grid;
  gap: 12px;
}

.status-text {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-text:empty {
  display: none;
}

.food-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(35, 42, 40, 0.06);
}

.food-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.food-name {
  max-width: 230px;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.18;
}

.food-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.accuracy-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--protein);
  background: var(--protein-bg);
  font-size: 12px;
  font-weight: 800;
}

.accuracy-badge.approximately {
  color: var(--fat);
  background: var(--fat-bg);
}

.calorie-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 14px 0 12px;
}

.calorie-row strong {
  font-size: 34px;
  line-height: 1;
}

.calorie-row span {
  color: var(--muted);
  font-weight: 700;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.nutrition-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.nutrition-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nutrition-grid dd {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 900;
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: 27px;
  }

  .summary-main strong {
    font-size: 43px;
  }

  .food-name {
    max-width: 190px;
  }
}
