:root {
  color-scheme: light;
  --panel: rgba(255, 253, 248, 0.58);
  --ink: #23302d;
  --muted: #64706f;
  --line: #d8d0bf;
  --accent: #d83d42;
  --accent-dark: #a92e32;
  --green: #28745d;
  --leaf: #9fb84e;
  --gold: #d99c2b;
  --cloth-red: rgba(216, 61, 66, 0.08);
  --cloth-white: rgba(255, 255, 255, 0.28);
  --shadow: 0 18px 50px rgba(43, 52, 49, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--cloth-red) 50%, transparent 50%) 0 0 / 72px 72px,
    linear-gradient(var(--cloth-red) 50%, transparent 50%) 0 0 / 72px 72px,
    linear-gradient(rgba(255, 252, 244, 0.74), rgba(255, 252, 244, 0.82)),
    url("/watercolor-watermelon-theme-wallpaper.jpg") center / cover fixed;
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

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

.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.summer-title {
  position: relative;
  display: inline-block;
  max-width: min(720px, 100%);
  padding: 14px 22px 16px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 214, 82, 0.82) 0 16%, transparent 17%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 239, 207, 0.56));
  color: #1f5949;
  box-shadow:
    0 14px 34px rgba(54, 69, 60, 0.16),
    inset 0 -5px 0 rgba(216, 61, 66, 0.15);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.75),
    0 5px 18px rgba(31, 89, 73, 0.16);
}

.summer-title::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -10px;
  width: 64px;
  height: 24px;
  border-radius: 0 0 80px 80px;
  background:
    radial-gradient(circle at 50% 42%, #23302d 0 3px, transparent 4px),
    radial-gradient(circle at 30% 38%, #23302d 0 2px, transparent 3px),
    radial-gradient(circle at 70% 38%, #23302d 0 2px, transparent 3px),
    linear-gradient(#e94b51 0 68%, #fbf7dc 69% 78%, #28745d 79%);
  box-shadow: 0 5px 12px rgba(54, 69, 60, 0.18);
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: #42514e;
  font-size: 1rem;
  line-height: 1.45;
}

.summary-stack {
  display: grid;
  gap: 6px;
  max-width: 760px;
  position: relative;
  z-index: 3;
}

.participant-summary,
.summary-panel {
  display: grid;
  gap: 4px;
}

.participant-summary {
  grid-template-columns: repeat(3, minmax(66px, 1fr));
}

.summary-panel {
  grid-template-columns: repeat(5, minmax(58px, 1fr));
}

.summary-button,
.summary-loading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  place-items: center;
  min-height: 30px;
  border: 1px solid rgba(40, 116, 93, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 225, 0.9));
  color: #1f5949;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
}

.summary-button {
  cursor: pointer;
  position: relative;
}

.summary-button::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(40, 116, 93, 0.12);
  color: currentColor;
  font-size: 0.72rem;
  line-height: 1;
}

.summary-button[aria-expanded="true"]::after {
  content: "-";
  background: rgba(255, 255, 255, 0.24);
}

.summary-loading {
  opacity: 0.72;
}

.summary-button:hover,
.summary-button[aria-expanded="true"] {
  border-color: rgba(31, 89, 73, 0.64);
  background:
    linear-gradient(135deg, rgba(31, 89, 73, 0.94), rgba(40, 116, 93, 0.9));
  color: #fffaf2;
  transform: translateY(-1px);
}

.participant-summary .summary-button:hover,
.participant-summary .summary-button[aria-expanded="true"] {
  background:
    linear-gradient(135deg, rgba(31, 89, 73, 0.94), rgba(40, 116, 93, 0.9));
  color: #fffaf2;
}

.summary-button[aria-expanded="true"] {
  color: #fffaf2;
  box-shadow:
    inset 0 -2px 0 rgba(159, 184, 78, 0.5),
    0 4px 12px rgba(31, 89, 73, 0.18);
}

.participant-summary .summary-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 225, 0.9));
  color: #1f5949;
}

.summary-detail {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(420px, 100%);
  max-height: 210px;
  overflow: auto;
  border: 1px solid rgba(40, 116, 93, 0.18);
  border-radius: 8px;
  background: rgba(31, 89, 73, 0.72);
  box-shadow:
    0 12px 30px rgba(31, 89, 73, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px) saturate(1.1);
  padding: 10px 12px;
  z-index: 10;
}

.summary-detail h3 {
  margin-bottom: 8px;
  color: #fff8df;
  font-size: 0.98rem;
}

.summary-detail ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-detail li {
  border-radius: 6px;
  color: #173d35;
  font-size: 0.9rem;
  padding: 0;
}

.summary-detail li:nth-child(odd) {
  background: rgba(255, 246, 225, 0.72);
}

.summary-detail li:nth-child(even) {
  background: rgba(232, 247, 221, 0.66);
}

.summary-detail li:last-child {
  border-bottom: 0;
}

.summary-detail .empty-detail {
  color: var(--muted);
  padding: 6px 8px;
}

.detail-edit-button {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 6px 8px;
  text-align: left;
}

.detail-edit-button:hover,
.detail-edit-button:focus {
  background: rgba(255, 255, 255, 0.42);
  outline: none;
}

.signup-section {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.62), rgba(255, 250, 238, 0.48)),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px) saturate(1.12);
  overflow: hidden;
  position: relative;
}

.signup-section::before {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--leaf), var(--green));
}

.signup-form {
  padding: clamp(16px, 3vw, 28px);
}

.form-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.form-heading h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  color: #1f5949;
}

.form-heading p,
.section-row p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.participants {
  margin: 16px 0 20px;
  padding: 14px;
  border: 1px solid rgba(40, 116, 93, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
}

.participants legend {
  padding: 0 8px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 8px 10px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

input:disabled {
  background: rgba(241, 238, 231, 0.68);
  color: #8a918f;
}

input:focus {
  outline: 3px solid rgba(40, 116, 93, 0.24);
  border-color: var(--green);
}

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

.section-row h3 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

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

.dish-option {
  display: grid;
  grid-template-columns: minmax(74px, 0.35fr) minmax(140px, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(40, 116, 93, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 248, 232, 0.42));
  box-shadow: inset 0 3px 0 rgba(159, 184, 78, 0.18);
}

.checkbox-field {
  display: flex;
  min-height: 26px;
  align-items: center;
  gap: 10px;
  color: #1f5949;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.message.success {
  color: var(--green);
}

.message.error {
  color: var(--accent-dark);
}

button[disabled] {
  cursor: wait;
  opacity: 0.68;
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: min(100% - 24px, 1120px);
    padding: 16px 0;
  }

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

  .summary-panel {
    grid-template-columns: repeat(5, minmax(48px, 1fr));
  }

  .participant-summary {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }

  .summer-title {
    padding: 12px 16px 15px;
  }

  .summer-title::after {
    right: 10px;
    width: 54px;
  }

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

  .dish-option {
    grid-template-columns: minmax(74px, 0.35fr) minmax(0, 1fr);
    min-height: 0;
  }

  .actions {
    justify-content: stretch;
  }

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