:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --orange: #ffd6a5;
  --yellow: #ffe8a3;
  --tomato: #ff6b6b;
  --brown: #4a2f24;
  --muted: #8f786d;
  --light: #fff1df;
  --line: rgba(74, 47, 36, 0.1);
  --shadow: 0 18px 48px rgba(160, 96, 45, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 165, 0.7), transparent 34rem),
    linear-gradient(180deg, var(--bg), #ffe7cf);
  color: var(--brown);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.today-card,
.panel,
.dish-card,
.summary-card,
.history-card,
.stat-card,
.dialog-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 40px;
}

.emoji-row {
  margin: 0 0 18px;
  font-size: 34px;
}

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

h1 {
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.tagline {
  margin-top: 18px;
  color: var(--tomato);
  font-size: 28px;
  font-weight: 800;
}

.intro {
  max-width: 680px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.today-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 260px;
  padding: 28px;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--orange);
  font-weight: 800;
}

.today-card h2 {
  margin-top: 18px;
  font-size: 28px;
}

.today-card p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.nav-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 24px 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(160, 96, 45, 0.12);
  backdrop-filter: blur(14px);
}

.nav-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-tab.active {
  background: var(--tomato);
  color: #ffffff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0 20px;
}

.section-heading:not(.with-action) {
  display: block;
}

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

.section-heading p {
  margin-top: 8px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 24px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel h3 {
  margin-bottom: 16px;
  font-size: 20px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--light);
  color: var(--brown);
  font-weight: 700;
}

.chip.active {
  background: var(--tomato);
  color: #ffffff;
}

.field {
  width: 100%;
  margin-top: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--bg);
  color: var(--brown);
  outline: none;
}

.field.no-top {
  margin-top: 0;
}

.field:focus {
  border-color: var(--tomato);
  background: #ffffff;
}

.field-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.textarea {
  min-height: 118px;
  resize: vertical;
}

.textarea.compact {
  min-height: 88px;
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dish-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 2px solid transparent;
}

.dish-card.selectable {
  cursor: pointer;
}

.dish-card.selected {
  border-color: var(--tomato);
  background: #fff2e2;
}

.dish-emoji {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--yellow);
  font-size: 30px;
}

.dish-body {
  min-width: 0;
}

.dish-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
}

.dish-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.dish-desc {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 900;
}

.primary-action {
  min-height: 54px;
  background: var(--tomato);
  color: #ffffff;
}

.primary-action.small {
  min-height: auto;
}

.secondary-action {
  background: var(--yellow);
  color: var(--brown);
}

.ghost-action {
  background: var(--light);
  color: var(--brown);
}

.danger-action {
  background: #ffe1e1;
  color: #b82727;
}

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

.summary-card,
.history-card {
  padding: 24px;
  margin-bottom: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.summary-item {
  padding: 14px;
  border-radius: 16px;
  background: var(--bg);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-weight: 800;
}

.empty-state {
  padding: 42px;
  border-radius: 24px;
  background: #ffffff;
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.menu-actions button {
  padding: 9px 12px;
  font-size: 14px;
}

.stars {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}

.star {
  border: 0;
  background: transparent;
  color: #e3d1bf;
  font-size: 36px;
}

.star.active {
  color: #ffb703;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
}

.stat-value {
  display: block;
  color: var(--tomato);
  font-size: 30px;
  font-weight: 900;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.dish-dialog {
  width: min(520px, calc(100% - 32px));
  border: 0;
  padding: 0;
  background: transparent;
}

.dish-dialog::backdrop {
  background: rgba(74, 47, 36, 0.34);
}

.dialog-card {
  padding: 26px;
}

.dialog-card label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 860px) {
  .hero,
  .form-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dish-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 10px;
  }

  .hero-copy,
  .today-card,
  .panel,
  .summary-card,
  .history-card {
    border-radius: 18px;
    padding: 20px;
  }

  .dish-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-heading.with-action {
    flex-direction: column;
  }
}
