:root {
  --ink: #2a2328;
  --muted: #716670;
  --paper: #fbf4ec;
  --surface: #fffdf9;
  --line: #e6d7ca;
  --wine: #7d2436;
  --wine-dark: #531725;
  --teal: #4f7f6f;
  --teal-soft: #e5efe9;
  --gold: #b88937;
  --amber: #ddb66e;
  --rose: #f3e3e0;
  --shadow: 0 18px 52px rgba(71, 43, 32, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #faf4ec 0%, #f7efe7 100%);
  color: var(--ink);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(125, 36, 54, 0.03), transparent 38%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 1px,
      transparent 1px,
      transparent 112px
    );
  opacity: 0.8;
}

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

button {
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(49, 16, 25, 0.92), rgba(84, 39, 34, 0.66) 48%, rgba(125, 36, 54, 0.42)),
    url("assets/birthday-45-hero-wild.png") center top / cover;
  color: #fffaf3;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 239, 225, 0.18);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  background: linear-gradient(0deg, var(--paper), rgba(255, 250, 242, 0));
  pointer-events: none;
}

.topbar,
.hero-grid,
.summary-grid,
.organizer,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 236, 214, 0.62);
  background: rgba(255, 248, 237, 0.12);
  box-shadow: inset 0 0 0 1px rgba(125, 36, 54, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 239, 225, 0.26);
  background: rgba(41, 23, 23, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(36, 18, 19, 0.14);
  border-radius: 8px;
}

.mode-tab {
  min-width: 112px;
  border: 0;
  padding: 10px 14px;
  background: transparent;
  color: rgba(255, 248, 242, 0.82);
  font-weight: 650;
}

.mode-tab.is-active,
.mode-tab:hover {
  background: #fff7ef;
  color: var(--wine-dark);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 34px;
  align-items: start;
  padding: 54px 0 96px;
}

.event-intro {
  max-width: 700px;
  padding: 38px 40px 34px;
  border: 1px solid rgba(255, 236, 216, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 247, 238, 0.88));
  color: var(--wine-dark);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  border-radius: 8px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.event-intro h1 {
  margin: 0;
  max-width: 10ch;
  color: var(--wine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 8vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.event-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 620px;
  margin: 34px 0 0;
}

.event-facts div {
  border-left: 4px solid var(--gold);
  padding: 4px 0 4px 14px;
}

.event-facts dt {
  color: rgba(83, 23, 37, 0.66);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-facts dd {
  margin: 4px 0 0;
  color: var(--wine-dark);
  font-size: 1.08rem;
  font-weight: 760;
}

.place-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.place-link.has-map {
  cursor: pointer;
}

.place-link.has-map:hover,
.place-link.has-map:focus {
  color: var(--wine);
}

.place-pin {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid var(--gold);
  border-radius: 50% 50% 50% 0;
  background: rgba(184, 137, 55, 0.14);
  transform: rotate(-45deg);
}

.place-pin::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--wine);
}

.guest-console,
.organizer {
  border: 1px solid rgba(125, 36, 54, 0.12);
  background: rgba(255, 252, 247, 0.95);
  box-shadow: var(--shadow);
}

.guest-console {
  position: relative;
  padding: 28px 24px 24px;
  color: var(--ink);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}

.guest-console::before {
  content: "";
  position: absolute;
  inset: 14px 14px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 36, 54, 0.38), transparent);
}

.guest-console h2,
.section-heading h2 {
  margin: 0 0 20px;
  color: var(--wine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--wine-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-label.compact {
  margin: 0;
  align-self: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9c8bb;
  background: #fffdfb;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(125, 36, 54, 0.14);
}

.guest-current {
  min-height: 52px;
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, rgba(221, 182, 110, 0.12), rgba(227, 203, 184, 0.18));
  color: var(--wine-dark);
  font-weight: 800;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}

.status-choice,
.primary-button,
.secondary-button,
.danger-button,
.small-button,
.icon-button {
  border: 0;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 850;
}

.status-choice {
  color: var(--ink);
  background: #fffdfb;
  border: 1px solid #dccbc0;
}

.status-choice.is-active {
  color: #fff;
}

.status-yes.is-active,
.badge-yes {
  background: var(--teal);
}

.status-maybe.is-active,
.badge-maybe {
  background: var(--gold);
}

.status-no.is-active,
.badge-no {
  background: var(--wine);
}

.console-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.save-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.primary-button {
  background: var(--wine);
  color: #fff;
}

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

.secondary-button,
.small-button,
.icon-button {
  background: #2d2326;
  color: #fff;
}

.danger-button {
  background: #fff4ef;
  color: var(--wine-dark);
  border: 1px solid #e3c1b5;
}

.summary-band {
  position: relative;
  z-index: 2;
  margin-top: -30px;
}

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

.party-meter {
  margin-top: 14px;
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(251, 243, 233, 0.96));
  border: 1px solid rgba(125, 36, 54, 0.12);
  border-top: 4px solid rgba(184, 137, 55, 0.76);
  box-shadow: 0 12px 28px rgba(73, 43, 34, 0.08);
  border-radius: 8px;
}

.party-meter-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.party-meter-header strong {
  display: block;
  margin-top: 4px;
  color: var(--wine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  line-height: 1.1;
}

.party-meter-percent {
  flex: 0 0 auto;
  color: var(--gold-deep);
  font-size: 1.2rem;
  font-weight: 800;
}

.party-meter-track {
  overflow: hidden;
  height: 16px;
  background: rgba(125, 36, 54, 0.08);
  border-radius: 999px;
  border: 1px solid rgba(125, 36, 54, 0.12);
}

.party-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #c48a2b 0%, #9b2438 55%, #6e1124 100%);
  transition: width 240ms ease;
}

.party-meter-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.party-meter-milestones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.party-milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(125, 36, 54, 0.1);
  border-radius: 8px;
  color: var(--muted);
}

.party-milestone.is-passed {
  background: rgba(255, 249, 239, 0.9);
  border-color: rgba(184, 137, 55, 0.28);
  color: var(--wine-dark);
}

.party-milestone.is-current {
  box-shadow: inset 0 0 0 1px rgba(184, 137, 55, 0.46);
}

.party-milestone-threshold {
  flex: 0 0 auto;
  min-width: 44px;
  color: var(--gold-deep);
  font-size: 0.82rem;
  font-weight: 800;
}

.party-milestone-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(125, 36, 54, 0.12);
  color: transparent;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.72);
}

.party-milestone.is-passed .party-milestone-check {
  border-color: rgba(184, 137, 55, 0.36);
  background: linear-gradient(180deg, #d8b15d, #b88937);
  color: #fffdf8;
}

.party-milestone-label {
  font-size: 0.92rem;
  line-height: 1.25;
}

.metric {
  min-height: 126px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 240, 0.92));
  border: 1px solid rgba(125, 36, 54, 0.12);
  border-top: 4px solid rgba(184, 137, 55, 0.76);
  box-shadow: 0 12px 28px rgba(73, 43, 34, 0.08);
  border-radius: 8px;
}

.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.metric strong {
  display: block;
  margin: 4px 0;
  color: var(--wine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  line-height: 1;
}

.organizer {
  margin-top: 48px;
  margin-bottom: 48px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(250, 243, 236, 0.96));
  border-radius: 8px;
}

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

.section-heading .section-kicker {
  color: var(--gold);
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.organizer-auth {
  max-width: 520px;
}

.admin-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.admin-login-row .primary-button {
  min-width: 128px;
}

.event-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.guest-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  padding-top: 24px;
}

.add-guests {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guest-list-panel {
  min-width: 0;
}

.list-toolbar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto 190px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #e4d4c9;
  background: #fff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f6efe7;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fff9f1;
}

.guest-name {
  font-weight: 850;
}

.badge {
  display: inline-flex;
  min-width: 104px;
  justify-content: center;
  padding: 6px 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
}

.badge-unknown {
  background: #7b7177;
}

.note-cell {
  max-width: 260px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.small-button,
.icon-button {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #f8ece7;
  color: var(--wine-dark);
  border: 1px solid #e2c4b7;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 0 0 32px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

@media (max-width: 920px) {
  .hero {
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 24px;
  }

  .event-intro h1 {
    max-width: 9ch;
  }

  .summary-grid,
  .event-form,
  .guest-workspace {
    grid-template-columns: 1fr 1fr;
  }

  .guest-workspace,
  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .field-label.compact {
    margin-top: 6px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-tabs {
    width: 100%;
  }

  .mode-tab {
    flex: 1;
    min-width: 0;
  }

  .event-facts,
  .summary-grid,
  .party-meter-milestones,
  .event-form,
  .guest-workspace,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .guest-console,
  .organizer {
    padding: 18px;
  }

  .section-heading,
  .console-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .party-meter-header {
    align-items: start;
    flex-direction: column;
  }

  .admin-login-row {
    grid-template-columns: 1fr;
  }

  .heading-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
