:root {
  color-scheme: light;
  --ink: #173044;
  --muted: #536878;
  --soft-ink: #315267;
  --paper: #f7f4ec;
  --panel: #fffdf8;
  --line: #d7e0df;
  --teal: #006b68;
  --teal-dark: #004e4c;
  --alert: #a23923;
  --alert-soft: #fff0eb;
  --focus: #b24d20;
  --accent-dark: #8e4c0c;
  --appetizer: #a33d27;
  --main: #0a6965;
  --side: #596a1e;
  --dessert: #754c85;
  --drink: #285e91;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  padding: 3.25rem 0 2.5rem;
  color: #fffdf8;
  background: var(--teal-dark);
}

.header-inner {
  max-width: 780px;
  margin-left: max(1rem, calc((100% - 1120px) / 2));
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.55rem;
  color: #f1bc65;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.section-kicker {
  color: var(--accent-dark);
}

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

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}

h1 {
  max-width: 680px;
  margin-bottom: 0.8rem;
  font-size: clamp(2.65rem, 6vw, 4.75rem);
  letter-spacing: -0.045em;
}

.intro {
  max-width: 580px;
  margin-bottom: 0;
  color: #e5f0ed;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem 0 3rem;
}

.planning-column {
  display: grid;
  gap: 1.25rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 0.75rem 2rem rgba(23, 48, 68, 0.07);
}

.add-panel,
.list-panel,
.summary-panel {
  padding: clamp(1.15rem, 3vw, 1.75rem);
}

.section-heading {
  margin-bottom: 1.35rem;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.form-field {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--soft-ink);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 2.9rem;
  border: 1px solid #94a9ab;
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--alert);
}

.field-error {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--alert);
  font-size: 0.84rem;
  line-height: 1.35;
}

.primary-button {
  width: 100%;
  min-height: 3rem;
  margin-top: 0.35rem;
  border: 2px solid var(--teal-dark);
  border-radius: 0.45rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.list-heading {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
}

.entry-total {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e2f0ec;
  font-size: 0.82rem;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 1rem;
}

.category-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.category-appetizer {
  --category-color: var(--appetizer);
}

.category-main {
  --category-color: var(--main);
}

.category-side {
  --category-color: var(--side);
}

.category-dessert {
  --category-color: var(--dessert);
}

.category-drink {
  --category-color: var(--drink);
}

.category-heading {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  border-left: 0.4rem solid var(--category-color);
  background: #f4f7f5;
}

.category-heading h3 {
  margin: 0;
  color: var(--category-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.category-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.category-entries {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem;
}

.dish-entry {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.5rem;
  background: #fff;
}

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

.dish-name,
.guest-name {
  overflow-wrap: anywhere;
}

.dish-name {
  margin: 0 0 0.2rem;
  color: var(--ink);
  font-weight: 700;
}

.guest-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.delete-button {
  flex: 0 0 auto;
  border: 1px solid #b4c3c2;
  border-radius: 0.4rem;
  padding: 0.45rem 0.65rem;
  color: var(--alert);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.delete-button:hover {
  border-color: var(--alert);
  background: var(--alert-soft);
}

.empty-category {
  margin: 0;
  padding: 0.9rem 1rem;
  color: var(--alert);
  background: var(--alert-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.summary-panel {
  position: sticky;
  top: 1rem;
}

.summary-help {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.summary-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.summary-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.9rem;
  border-left: 0.4rem solid var(--category-color);
  border-radius: 0.35rem;
  background: #edf4f1;
}

.summary-item.is-empty {
  border: 2px solid var(--alert);
  border-left-width: 0.4rem;
  color: var(--alert);
  background: var(--alert-soft);
}

.summary-category {
  font-weight: 700;
}

.summary-count {
  font-size: 1.2rem;
  font-weight: 700;
}

noscript {
  display: block;
  padding: 1rem;
  color: #fff;
  background: var(--alert);
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    padding: 2.5rem 0 2rem;
  }

  .header-inner {
    margin-left: auto;
  }

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

  .summary-panel {
    position: static;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: min(100% - 1rem, 1120px);
  }

  .list-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .dish-entry {
    align-items: start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .delete-button {
    width: 100%;
  }
}
