:root {
  color-scheme: light;
  --paper: #f8f1e4;
  --card: #fffaf0;
  --ink: #2c1c12;
  --muted: #6d5a4b;
  --line: #e2d3bc;
  --rust: #a63f17;
  --rust-deep: #7c2f12;
  --squash: #e7a33e;
  --forest: #3c5a41;
  --cream-on-dark: #fbeed6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; }
h2 { font-size: 1.6rem; }

.eyebrow {
  margin: 0 0 .4rem;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Party code screen */
.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--rust-deep);
}
.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  background: var(--card);
  border-radius: 14px;
  text-align: center;
}
.gate-card h1 { font-size: 2.1rem; }
.gate-card .eyebrow { margin-top: .75rem; color: var(--rust); }
.gate-card .lede { color: var(--muted); margin: .5rem 0 1.25rem; }
.gate-card form { text-align: left; }
.gate-card input { margin-bottom: .75rem; }
.gate-card button { width: 100%; }

/* Invitation header */
.hero {
  background: var(--rust-deep);
  color: var(--cream-on-dark);
  border-bottom: 6px solid var(--squash);
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 44px 16px 32px;
}
.hero .eyebrow { color: var(--squash); }
.hero h1 { font-size: clamp(2.4rem, 9vw, 3.75rem); }

.details { margin: 1.4rem 0 0; display: grid; gap: .75rem; }
.details div { display: grid; grid-template-columns: 4.5rem 1fr; }
.details dt { color: var(--squash); font-weight: 650; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details a { color: inherit; }

.note { margin: 1.1rem 0 0; font-family: var(--serif); font-size: 1.15rem; }

.share { margin-top: 1.4rem; display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
#share-status { font-size: .95rem; overflow-wrap: anywhere; }

/* Page */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}
section { margin-top: 36px; }

.host-banner {
  margin: 20px 0 0;
  padding: .6rem .85rem;
  background: var(--forest);
  color: #fff;
  border-radius: 8px;
  font-size: .95rem;
}

.card {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* Forms */
form.card { padding: 20px 16px; }
.field { margin: 0 0 1.1rem; padding: 0; border: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: .9rem; margin-left: .25rem; }

input:not([type="radio"]), select {
  width: 100%;
  min-height: 46px;
  padding: .55rem .7rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #b9a78f;
  border-radius: 8px;
}

:focus-visible { outline: 3px solid var(--squash); outline-offset: 2px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented label { margin: 0; font-weight: 600; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: block;
  padding: .6rem .25rem;
  text-align: center;
  background: #fff;
  border: 1px solid #b9a78f;
  border-radius: 8px;
}
.segmented input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--squash); outline-offset: 2px; }

button {
  min-height: 46px;
  padding: .55rem 1.2rem;
  font: inherit;
  font-weight: 650;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--rust); color: #fff; }
.primary:hover:not(:disabled) { background: var(--rust-deep); }
.on-dark { background: var(--squash); color: var(--ink); }
.quiet { background: transparent; color: var(--ink); border-color: #b9a78f; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.status { margin: .7rem 0 0; min-height: 1.5em; font-weight: 550; color: var(--forest); }
.status.error { color: #a11f1f; }

/* Dish rows and suggestions */
.dish-row { margin-bottom: .75rem; }
.dish-details { display: grid; gap: 8px; margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--line); }
.dish-remove {
  min-height: 40px;
  padding: .2rem 0;
  justify-self: start;
  background: none;
  color: var(--rust);
  font-size: .9rem;
  text-decoration: underline;
}
.add-dish { min-height: 40px; padding: .3rem .9rem; font-size: .95rem; }

.suggestions { margin: 0 0 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.suggestions-title { margin: 0 0 .5rem; font-weight: 600; }
.suggestion-group { margin-top: .6rem; }
.suggestion-group h3 { font-family: var(--sans); font-size: .85rem; font-weight: 650; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chips button {
  min-height: 40px;
  padding: .25rem .75rem;
  background: #fff;
  color: var(--ink);
  border-color: #b9a78f;
  border-radius: 20px;
  font-size: .95rem;
  font-weight: 550;
}
.chips button:hover { border-color: var(--rust); color: var(--rust-deep); }

/* Lists */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.headcount { margin: 0; color: var(--muted); font-weight: 600; }
.needed {
  margin: 12px 0 0;
  padding: .6rem .85rem;
  background: #fbe7c2;
  border-left: 4px solid var(--squash);
  border-radius: 0 8px 8px 0;
}

.category { margin-top: 18px; }
.category h3 { font-size: 1.2rem; color: var(--rust-deep); }
.category .card { margin-top: 8px; }

.rows { list-style: none; padding: 0; margin-bottom: 0; }
.rows li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; }
.row-text { min-width: 0; overflow-wrap: anywhere; }
.row-title { font-weight: 650; }
.row-sub, .row-note { color: var(--muted); font-size: .95rem; }
.row-note { font-style: italic; }

.row-actions { display: flex; flex: none; gap: 2px; }
.row-actions button {
  min-height: 40px;
  padding: .2rem .55rem;
  background: none;
  color: var(--rust);
  font-size: .9rem;
  text-decoration: underline;
}

.empty {
  margin-top: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed #c9b79e;
  border-radius: 12px;
}

.fine { margin-top: 32px; color: var(--muted); font-size: .9rem; }
.noscript { padding: 24px 16px; text-align: center; }
