:root {
  --charcoal: #41413D;
  --charcoal-deep: #343A36;
  --sage: #7D8872;
  --cream: #F3EFE5;
  --white: #FFFFFF;
  --line: rgba(65, 65, 61, 0.14);
  --muted: rgba(65, 65, 61, 0.68);
  --shadow: 0 10px 30px rgba(43, 45, 42, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  color: var(--charcoal-deep);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 16px calc(36px + env(safe-area-inset-bottom));
}

.hero {
  margin: 0 -16px 26px;
  padding: calc(30px + env(safe-area-inset-top)) 24px 30px;
  color: var(--white);
  background:
    radial-gradient(circle at 85% 14%, rgba(255,255,255,.10), transparent 28%),
    linear-gradient(145deg, var(--charcoal) 0%, #343733 100%);
  border-radius: 0 0 32px 32px;
  text-align: center;
}
.church-logo { width: min(180px, 48vw); max-height: 76px; object-fit: contain; margin-bottom: 8px; }
.hero-mark {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35);
  font-family: Georgia, serif; letter-spacing: .04em;
}
.hero:has(.church-logo:not([style*="display: none"])) .hero-mark { display:none; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 750; letter-spacing: .18em; opacity: .78; }
.eyebrow.dark { color: var(--sage); opacity: 1; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin: 0; font-size: clamp(38px, 9vw, 58px); line-height: .98; letter-spacing: -.035em; }
.event-date { margin: 14px 0 0; font-size: 17px; font-weight: 700; }
.hero-copy { max-width: 540px; margin: 13px auto 0; line-height: 1.55; color: rgba(255,255,255,.83); }

.section-heading { display:flex; align-items:end; justify-content:space-between; gap:16px; margin: 0 2px 12px; }
.section-heading h2 { margin:0; font-size:31px; letter-spacing:-.025em; }
.icon-button { width:42px; height:42px; border-radius:50%; border:1px solid var(--line); background:rgba(255,255,255,.55); color:var(--charcoal); font-size:22px; cursor:pointer; }

.slots { display:grid; gap:11px; }
.slot-card {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(65,65,61,.10);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 3px 14px rgba(43,45,42,.025);
}
.slot-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.slot-time { font-size:17px; font-weight:800; color:var(--charcoal-deep); }
.slot-count { font-size:12px; font-weight:800; color:var(--sage); background:rgba(125,136,114,.12); border-radius:999px; padding:6px 9px; }
.slot-count.full { color:var(--charcoal); background:rgba(65,65,61,.09); }
.names { display:grid; gap:7px; margin-top:12px; }
.name-row { display:flex; align-items:center; gap:9px; min-height:28px; color:var(--charcoal); }
.name-dot { width:7px; height:7px; border-radius:50%; background:var(--sage); flex:0 0 auto; }
.empty-name { color:var(--muted); font-style:italic; }
.signup-button {
  width:100%; margin-top:13px; border:0; border-radius:13px; padding:12px 14px;
  background:var(--sage); color:white; font-weight:800; cursor:pointer;
}
.signup-button:active { transform:translateY(1px); }
.signup-button:disabled { background:rgba(65,65,61,.13); color:rgba(65,65,61,.55); cursor:default; }

.loading-card, .status-card {
  padding:20px; background:rgba(255,255,255,.65); border:1px solid var(--line); border-radius:var(--radius-lg); text-align:center; color:var(--muted);
}
.status-card { margin-bottom:18px; }
.footer-note { padding:26px 0 10px; text-align:center; color:var(--muted); font-size:12px; }

.modal-backdrop {
  position:fixed; inset:0; z-index:50; background:rgba(30,31,29,.55); display:flex; align-items:flex-end; justify-content:center; padding:12px;
}
.modal {
  position:relative; width:min(100%,560px); background:var(--cream); border-radius:26px 26px 18px 18px;
  padding:28px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow:0 18px 60px rgba(0,0,0,.22);
}
.modal-close { position:absolute; top:14px; right:14px; width:38px; height:38px; border:0; border-radius:50%; background:rgba(65,65,61,.08); color:var(--charcoal); font-size:25px; }
.modal h2 { margin:0; font-size:31px; }
.selected-slot { margin:8px 0 22px; color:var(--sage); font-weight:800; }
label { display:block; margin-bottom:7px; font-size:13px; font-weight:800; }
input { width:100%; border:1px solid rgba(65,65,61,.22); background:#fffdf8; border-radius:14px; padding:14px 15px; outline:none; font-size:16px; }
input:focus { border-color:var(--sage); box-shadow:0 0 0 3px rgba(125,136,114,.12); }
.primary-button { width:100%; margin-top:12px; border:0; border-radius:14px; padding:14px 16px; background:var(--charcoal); color:white; font-weight:850; cursor:pointer; }
.privacy-note { margin:13px 2px 0; color:var(--muted); font-size:12px; line-height:1.45; }
.toast { position:fixed; left:50%; bottom:calc(22px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:100; width:min(calc(100% - 32px),480px); background:var(--charcoal); color:white; border-radius:14px; padding:13px 16px; text-align:center; box-shadow:var(--shadow); font-weight:700; }

@media (min-width:700px) {
  .app-shell { padding-left:24px; padding-right:24px; }
  .hero { margin-left:-24px; margin-right:-24px; }
  .slots { grid-template-columns:1fr 1fr; }
  .modal-backdrop { align-items:center; }
  .modal { border-radius:26px; }
}

.day-header {
  grid-column: 1 / -1;
  margin-top: 18px;
  margin-bottom: 4px;
  padding: 10px 4px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7D8872;
  border-bottom: 1px solid rgba(65, 65, 61, 0.14);
}

.day-header:first-child {
  margin-top: 0;
}
