:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65716b;
  --line: #d8ddd4;
  --paper: #f8f7f2;
  --white: #ffffff;
  --sage: #617b64;
  --sage-dark: #2f4c3b;
  --tomato: #b84f3c;
  --gold: #d7a64a;
  --blue: #456c89;
  --shadow: 0 18px 48px rgba(31, 42, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(23, 33, 29, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 33, 29, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  background: rgba(248, 247, 242, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(23, 33, 29, 0.1);
}

.brand,
.topnav a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--white);
  background: var(--sage-dark);
  border-radius: 4px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 27px;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-size: 0.98rem;
}

.brand small,
.month-heading small,
.panel-label,
.eyebrow {
  color: var(--muted);
}

.brand small {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.topnav a:hover,
.topnav a:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 22px;
  min-height: 310px;
  padding: 48px 0 26px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  min-height: 290px;
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(23, 33, 29, 0.84), rgba(47, 76, 59, 0.7)),
    url("https://images.unsplash.com/photo-1498837167922-ddd27525d352?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(3rem, 9vw, 7.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
}

.hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.today-panel,
.editor-panel,
.tool-panel,
.calendar-wrap {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.today-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-top: 8px solid var(--tomato);
}

.today-panel h2,
.editor-panel h2,
.section-heading h2 {
  margin: 0;
}

.today-panel h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0;
}

.today-panel p:last-child {
  color: var(--muted);
}

.panel-label,
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.control-band {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  margin: 8px 0 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.month-heading {
  display: grid;
  gap: 2px;
  text-align: center;
}

#monthLabel {
  font-weight: 800;
  font-size: 1.15rem;
}

.command,
.icon-command {
  min-height: 42px;
  border: 1px solid #bdc7bb;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.command {
  padding: 0 14px;
}

.icon-command {
  width: 44px;
  font-size: 1.8rem;
  line-height: 1;
}

.command:hover,
.icon-command:hover,
.command:focus-visible,
.icon-command:focus-visible {
  border-color: var(--sage-dark);
  outline: 3px solid rgba(97, 123, 100, 0.18);
}

.command.primary {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: var(--white);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.week-card {
  min-height: 116px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.week-card.today {
  border-color: var(--tomato);
  box-shadow: inset 0 0 0 2px rgba(184, 79, 60, 0.18);
}

.week-card span,
.day-number {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.week-card strong {
  display: block;
  margin-top: 10px;
  line-height: 1.25;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.calendar-wrap,
.editor-panel,
.tool-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage);
}

.dot.quick {
  background: var(--gold);
}

.dot.busy {
  background: var(--tomato);
}

.dot.flex {
  background: var(--blue);
}

.calendar-head,
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-head {
  margin-bottom: 6px;
  gap: 6px;
}

.calendar-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar {
  gap: 6px;
}

.day-cell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 126px;
  padding: 10px;
  text-align: left;
  background: #fcfcf8;
  border: 1px solid #dfe4db;
  border-radius: 4px;
}

.day-cell.empty {
  background: rgba(255, 255, 255, 0.36);
  border-style: dashed;
}

.day-cell.selected {
  border-color: var(--sage-dark);
  box-shadow: inset 0 0 0 2px rgba(47, 76, 59, 0.16);
}

.day-cell.today {
  border-color: var(--tomato);
}

.meal-title {
  margin-top: 10px;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.schedule-chip {
  justify-self: start;
  align-self: end;
  max-width: 100%;
  margin-top: 10px;
  padding: 4px 6px;
  color: var(--white);
  background: var(--blue);
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 800;
}

.schedule-chip.Busy,
.schedule-chip.Late,
.schedule-chip.No-cook {
  background: var(--tomato);
}

.schedule-chip.Leftovers {
  background: var(--gold);
  color: var(--ink);
}

.editor-panel {
  position: sticky;
  top: 78px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd4c8;
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}

input,
select {
  height: 44px;
  padding: 0 11px;
}

textarea {
  padding: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage-dark);
  outline: 3px solid rgba(97, 123, 100, 0.18);
}

.button-row,
.meal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.tools-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.meal-form {
  grid-template-columns: minmax(0, 1fr) 130px 82px;
  margin-bottom: 14px;
}

.meal-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfbf7;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.meal-pill small {
  color: var(--muted);
}

#shoppingList {
  min-height: 270px;
}

@media (max-width: 920px) {
  .hero,
  .planner-grid,
  .tools-band {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .week-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
  }

  .hero {
    padding-top: 18px;
  }

  .hero-copy,
  .today-panel,
  .calendar-wrap,
  .editor-panel,
  .tool-panel {
    padding: 14px;
  }

  .control-band {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .control-band .command {
    grid-column: span 3;
  }

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

  .calendar-head {
    display: none;
  }

  .calendar {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: 112px;
  }

  .day-cell.empty {
    display: none;
  }

  .meal-form,
  .button-row {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}
