:root {
  --bg: #fff7ed;
  --paper: #fffdf9;
  --card: #ffffff;
  --text: #211611;
  --soft-text: #6f6158;
  --muted: #8a7a6e;
  --line: #ead8c9;
  --line-strong: #dfc6b2;
  --accent: #ff7a1a;
  --accent-2: #ff9d42;
  --accent-dark: #8f3609;
  --accent-soft: #ffead6;
  --accent-tint: #fff3e8;
  --green: #15803d;
  --green-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --shadow: 0 24px 60px rgba(67, 40, 18, 0.13);
  --shadow-soft: 0 12px 30px rgba(67, 40, 18, 0.075);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -4%, rgba(255, 122, 26, 0.22), transparent 23rem),
    radial-gradient(circle at 96% 16%, rgba(255, 183, 104, 0.2), transparent 24rem),
    linear-gradient(180deg, #fff7ed 0%, #fffaf5 48%, #ffffff 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(255, 122, 26, 0.22);
  outline-offset: 3px;
}

.app-shell {
  width: min(760px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 13px 112px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 247, 237, 0.72));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 28px rgba(255, 122, 26, 0.28);
  font-size: 1.45rem;
  font-weight: 1000;
  letter-spacing: -0.08em;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 1.09rem;
  letter-spacing: -0.045em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

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

h1 {
  margin-bottom: 9px;
  font-size: clamp(2.25rem, 10vw, 4.55rem);
  line-height: 0.94;
  letter-spacing: -0.078em;
}

h2 {
  margin-bottom: 7px;
  font-size: clamp(1.24rem, 5vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -0.046em;
}

h3 {
  margin-bottom: 5px;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.muted {
  color: var(--soft-text);
  line-height: 1.5;
}

.small-copy {
  font-size: 0.96rem;
}

.card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(234, 216, 201, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.hero {
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 26, 0.14), transparent 13rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 243, 232, 0.98) 100%);
  box-shadow: var(--shadow);
}

.hero-topline,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 11px;
}

.hero-subtitle {
  max-width: 34rem;
  margin-bottom: 17px;
  color: var(--soft-text);
  font-size: 1.08rem;
  line-height: 1.45;
}

.mode-pill,
.progress-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 950;
}

.mode-pill {
  color: var(--accent-dark);
  background: rgba(255, 234, 214, 0.9);
}

.progress-pill {
  color: var(--green);
  background: var(--green-soft);
}

.now-meal-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  border-radius: 27px;
  background:
    radial-gradient(circle at 96% 12%, rgba(255, 122, 26, 0.28), transparent 9rem),
    linear-gradient(145deg, #211611, #3b2417);
  color: white;
  box-shadow: 0 22px 46px rgba(32, 23, 19, 0.22);
}

.now-meal-card::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -54px;
  width: 156px;
  height: 156px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.now-meal-card > * {
  position: relative;
  z-index: 1;
}

.now-meal-card .meal-label {
  color: rgba(255, 255, 255, 0.64);
}

.now-meal-card h2 {
  margin-bottom: 8px;
  color: white;
  font-size: clamp(1.5rem, 7vw, 2.2rem);
}

.now-meal-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.now-meal-card .tag {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.13);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 12px;
}

.primary-btn,
.ghost-btn,
.chip-button,
.text-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 950;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-btn,
.ghost-btn,
.chip-button {
  min-height: 46px;
  padding: 11px 16px;
}

.primary-btn {
  color: white;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 26px rgba(255, 122, 26, 0.25);
}

.ghost-btn,
.chip-button {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.chip-button {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 0.9rem;
}

.primary-btn:hover,
.ghost-btn:hover,
.chip-button:hover,
.text-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.chip-button:active,
.text-btn:active {
  transform: translateY(1px);
}

.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.day-progress {
  margin-top: 16px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--soft-text);
  font-size: 0.85rem;
  font-weight: 850;
}

.progress-labels strong {
  color: var(--text);
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.progress-dot {
  min-height: 11px;
  border-radius: 999px;
  background: rgba(154, 61, 12, 0.14);
}

.progress-dot.done {
  background: var(--green);
}

.progress-dot.current {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.14);
}

.screen {
  display: none;
}

.active-screen {
  display: block;
}

.hidden {
  display: none !important;
}

.setup-panel {
  margin-bottom: 14px;
}

.setup-card {
  background:
    radial-gradient(circle at 96% 0%, rgba(255, 122, 26, 0.14), transparent 13rem),
    #ffffff;
}

.quiz-form,
.profile-form {
  display: grid;
  gap: 12px;
}

.quiz-form label,
.profile-form label {
  display: grid;
  gap: 7px;
  color: var(--soft-text);
  font-size: 0.92rem;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 49px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 11px 13px;
  color: var(--text);
  background: white;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.13);
}

.situation-scroll {
  display: flex;
  gap: 10px;
  margin: 0 -4px;
  padding: 2px 4px 9px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.situation-scroll::-webkit-scrollbar {
  height: 7px;
}

.situation-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(143, 54, 9, 0.22);
}

.situation-choice {
  min-width: 134px;
  min-height: 92px;
  scroll-snap-align: start;
  border: 1px solid rgba(234, 216, 201, 0.95);
  border-radius: 23px;
  padding: 12px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #fffaf4);
  box-shadow: 0 8px 20px rgba(67, 40, 18, 0.055);
  font-weight: 950;
  text-align: left;
}

.situation-choice.active {
  border-color: rgba(255, 122, 26, 0.65);
  background: var(--accent-tint);
  box-shadow: 0 12px 26px rgba(255, 122, 26, 0.14);
}

.quick-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: 1.05rem;
}

.situation-choice span:not(.quick-icon) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.quick-answer {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(255, 122, 26, 0.19);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff7ed, #ffffff);
  box-shadow: 0 12px 26px rgba(67, 40, 18, 0.065);
}

.quick-answer h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.quick-answer .lead {
  margin-bottom: 12px;
  color: #7c2d12;
  line-height: 1.45;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-card {
  padding: 13px;
  border: 1px solid rgba(234, 216, 201, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
}

.option-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rank-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--text);
  font-size: 0.83rem;
  font-weight: 950;
}

.option-card p {
  margin-bottom: 0;
}

.order-text {
  color: var(--text);
  font-weight: 850;
  line-height: 1.38;
}

.why-text {
  margin-top: 6px;
  color: var(--soft-text);
  line-height: 1.42;
}

.option-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.text-btn {
  padding: 8px 11px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.86rem;
}

.coach-card {
  display: grid;
  gap: 12px;
}

.coach-form {
  display: flex;
  gap: 10px;
}

.coach-form input {
  min-width: 0;
  flex: 1;
}

.coach-reply {
  margin: 0;
}

.about-strip {
  padding: 16px;
}

.about-grid {
  display: grid;
  gap: 10px;
}

.about-grid div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 19px;
  background: var(--paper);
}

.about-grid strong {
  letter-spacing: -0.02em;
}

.about-grid span {
  color: var(--soft-text);
  line-height: 1.4;
}

.meal-list,
.grocery-list {
  display: grid;
  gap: 10px;
}

.meal-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(180deg, #ffffff, #fffdfa);
  box-shadow: 0 8px 18px rgba(67, 40, 18, 0.045);
}

.meal-row.completed {
  border-color: rgba(21, 128, 61, 0.32);
  background: var(--green-soft);
}

.meal-row input[type="checkbox"] {
  width: 25px;
  min-height: 25px;
  margin-top: 2px;
  accent-color: var(--green);
}

.meal-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.meal-row p {
  margin-bottom: 0;
}

.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.grocery-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(180deg, #ffffff, #fffdfa);
  box-shadow: 0 8px 18px rgba(67, 40, 18, 0.045);
}

.grocery-group h3 {
  margin: 0 0 8px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--soft-text);
  line-height: 1.35;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  margin-top: 0;
  accent-color: var(--green);
}

.profile-save,
.setup-actions {
  margin-top: 2px;
}

.mini-note {
  margin: 4px 0 14px;
  padding: 11px 13px;
  border: 1px solid #fed7aa;
  border-radius: 18px;
  color: #7c2d12;
  background: rgba(255, 247, 237, 0.92);
  font-size: 0.84rem;
  line-height: 1.4;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(720px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 6px;
  border: 1px solid rgba(234, 216, 201, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 50px rgba(67, 40, 18, 0.18);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  min-height: 43px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 950;
}

.bottom-nav a.active {
  color: white;
  background: linear-gradient(145deg, #211611, #3b2417);
}

.app-footer {
  display: grid;
  gap: 4px;
  margin: 16px 4px 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 60;
  width: min(92%, 520px);
  transform: translateX(-50%);
  padding: 13px 15px;
  border-radius: 18px;
  color: white;
  background: var(--text);
  box-shadow: 0 18px 50px rgba(67, 40, 18, 0.22);
  text-align: center;
  font-weight: 850;
}

.toast button {
  margin-left: 10px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  background: white;
  font-weight: 950;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 24px;
  }

  .card {
    padding: 24px;
  }

  .hero {
    padding: 28px;
  }

  .quiz-form,
  .profile-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-save,
  .setup-actions {
    grid-column: 1 / -1;
  }

  .about-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 16px;
  }

  .coach-form {
    display: grid;
  }

  .coach-form .primary-btn,
  .hero-actions .primary-btn,
  .hero-actions .ghost-btn {
    width: 100%;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.45rem);
  }
}
