:root {
  color-scheme: light;
  --ink: #1d2528;
  --muted: #667378;
  --line: #dce2df;
  --paper: #fffdf8;
  --surface: #ffffff;
  --sage: #4c7a68;
  --sage-dark: #2f5d50;
  --coral: #d96d57;
  --gold: #b9822a;
  --mist: #eef4f1;
  --shadow: 0 18px 48px rgba(32, 45, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(76, 122, 104, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(217, 109, 87, 0.13), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--sage);
  color: white;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  background: var(--sage-dark);
  box-shadow: 0 8px 20px rgba(47, 93, 80, 0.18);
  transform: translateY(-1px);
}

button.secondary,
.card-actions button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover,
.card-actions button:hover {
  background: var(--mist);
  box-shadow: none;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(76, 122, 104, 0.14);
}

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

.planner {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.25fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.intro,
.recommend-panel,
.entry-form,
.history-panel {
  border: 1px solid rgba(220, 226, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  align-content: end;
  min-height: 320px;
  padding: 30px;
  background:
    linear-gradient(rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.95)),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=1200&q=80")
      center/cover;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 9ch;
  margin-bottom: 14px;
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.intro p:last-child {
  max-width: 31rem;
  margin-bottom: 0;
  color: #445055;
  font-size: 1.05rem;
  line-height: 1.7;
}

.recommend-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.recommend-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr 136px;
  gap: 12px;
  align-items: end;
}

.recommendations {
  display: grid;
  gap: 10px;
}

.recommendation {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.recommendation strong {
  display: block;
  margin-bottom: 4px;
}

.recommendation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  border-radius: 999px;
  background: #f7ead9;
  color: #885b16;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: 24px;
  align-items: start;
}

.entry-form,
.history-panel,
.settings-panel {
  padding: 24px;
}

.entry-form {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.settings-panel {
  border: 1px solid rgba(220, 226, 223, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.settings-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.sync-status {
  border-radius: 999px;
  background: var(--mist);
  color: #36584d;
  padding: 7px 11px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--sage-dark);
  font-weight: 800;
}

.settings-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.history-panel {
  min-height: 420px;
}

.history-header {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.search {
  min-height: 44px;
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: #36584d;
  padding: 7px 11px;
  font-size: 0.88rem;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed #bac9c3;
  border-radius: 8px;
  background: rgba(238, 244, 241, 0.72);
  color: var(--muted);
  padding: 24px;
  line-height: 1.7;
  text-align: center;
}

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

.food-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.card-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.food-card h3 {
  margin-bottom: 6px;
  font-size: 1.12rem;
}

.meta,
.note {
  color: var(--muted);
  line-height: 1.5;
}

.meta {
  margin-bottom: 0;
}

.note {
  margin: 14px 0 0;
}

.score {
  border-radius: 8px;
  background: #1d2528;
  color: #fff;
  padding: 8px 10px;
  font-weight: 900;
}

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

.card-actions a,
.card-actions button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.card-actions a {
  background: var(--gold);
  color: #fff;
}

.delete-button {
  color: #9f3527 !important;
}

.place-block {
  display: grid;
  gap: 10px;
}

.place-picker {
  display: none;
}

.place-picker.ready {
  display: block;
}

.place-picker gmp-place-autocomplete {
  width: 100%;
}

.selected-place {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
  color: #36584d;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.tag-field {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.tag-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.chip span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #425257;
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.chip input:checked + span {
  border-color: var(--sage);
  background: var(--sage);
  color: #fff;
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(76, 122, 104, 0.14);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-list span {
  border-radius: 999px;
  background: #f4eee4;
  color: #6c502a;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .planner,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .entry-form {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 16px 0 24px;
  }

  .intro {
    min-height: 260px;
    padding: 22px;
  }

  .recommend-controls,
  .form-row,
  .form-actions,
  .history-header,
  .recommendation,
  .settings-header {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.2rem;
  }
}
