:root{
  --bg:#f5f6f8; --ink:#0f0f10; --muted:#6b7280; --line:#e8e9ee;
  --pill:#f2f3f5; --brand:#111;
  --radius:22px; --radius-sm:14px; --shadow:0 12px 36px rgba(0,0,0,.08);
  --field-h:56px; --field-h-lg:64px; --field-h-xl:70px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:var(--ink)}

.page{min-height:100vh;display:flex;align-items:flex-start;justify-content:center;padding:48px 16px}
.wrap{width:min(980px,100%);background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);overflow:visible}

/* Hero */
.hero{position:relative;border-radius:var(--radius) var(--radius) 0 0;overflow:hidden}
.hero .media{position:relative;aspect-ratio:16/9;background:#dbeafe}
.hero .media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hero .fade{position:absolute;inset:auto 0 0;height:38%;background:linear-gradient(180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.85) 50%,#fff 100%)}
.hero .meta{position:absolute;left:28px;right:28px;bottom:18px}
h1{margin:0 0 12px;font-weight:800;font-size:clamp(28px,4vw,40px);text-shadow:0 1px 0 rgba(255,255,255,.7)}
.chips{display:flex;gap:10px;flex-wrap:wrap}
.chip{display:inline-flex;align-items:center;gap:8px;background:var(--pill);border:1px solid var(--line);padding:10px 14px;border-radius:999px;font-size:14px}
.chip svg{width:16px;height:16px}

/* Body */
.body{padding:22px 28px 30px}
.progress{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:8px 0 22px}
.progress .bar{height:8px;background:#eceff3;border-radius:999px;overflow:hidden}
.progress .bar>span{display:block;height:100%;width:0;background:#111;transition:width .3s ease}

/* Form */
form{display:block}
fieldset{margin:0;padding:0;border:0;display:none;animation:fade .25s ease}
fieldset.active{display:block}
@keyframes fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.group{display:grid;gap:14px}
.row-2{grid-template-columns:1fr}
@media (min-width:700px){.row-2{grid-template-columns:1fr 1fr}}
.field{position:relative}
.field-wide{max-width:820px}
label.lbl{font-weight:700;margin:6px 0}
.lbl-lg{font-size:20px;margin-top:6px}
.hint{color:var(--muted);font-size:13px;margin-top:6px}

.input{width:100%;height:var(--field-h);padding:0 16px;border:1.5px solid var(--line);background:#fff;border-radius:14px;font-size:16px;color:var(--ink)}
.input::placeholder{color:#444;opacity:.65}
.input:focus{outline:none;border-color:#111;box-shadow:0 0 0 3px rgba(0,0,0,.08)}
.input-lg{height:var(--field-h-lg);font-size:17px;padding:0 18px}
.input-xl{height:var(--field-h-xl);font-size:18px;padding:0 20px}

/* Guests */
.head-inline{display:flex;align-items:center;gap:12px;margin-top:8px}
.btn{appearance:none;border:0;cursor:pointer;font-weight:700;border-radius:999px;padding:14px 18px}
.btn-primary{background:#111;color:#fff}
.btn-ghost{background:var(--pill);color:#111}
.btn-sm{padding:10px 14px;font-weight:600}
.btns{display:flex;gap:10px;margin-top:16px}

.guest-card{border:1.5px dashed var(--line);border-radius:16px;padding:16px;background:#fafbfc}
.guest-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.guest-top h4{margin:0;font-size:18px}
.guest-remove{margin-left:auto}

/* YouTube */
.yt{position:relative}
.input-icon{position:relative}
.input-icon svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:22px;height:22px}
.input-icon input{padding-left:46px}
.pill{display:inline-block;margin-top:8px;background:var(--pill);border:1px solid var(--line);padding:10px 14px;border-radius:999px}
.yt-error{margin-top:10px;display:none;border:1px solid #ffd5cf;background:#fff6f5;color:#a12016;padding:12px;border-radius:12px;font-size:13px}
.yt-results{margin-top:10px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 28px rgba(0,0,0,.12);max-height:50vh;overflow:auto;display:none}
.yt-item{display:flex;gap:12px;padding:12px;cursor:pointer}
.yt-item:hover{background:#f7f7f9}
.yt-thumb{width:64px;height:64px;border-radius:12px;object-fit:cover}
.yt-title{font-weight:700;font-size:16px}
.yt-sub{font-size:13px;color:var(--muted)}

/* spacing between the add button row and the list */
.guest-toolbar { display:flex; gap:10px; align-items:center; margin: 8px 0 16px; }
.guest-list { display:flex; flex-direction:column; gap:14px; }

/* guest card visual polish */
.guest-card { border:1px dashed #e3e6eb; background:#f9fafb; border-radius:16px; padding:18px; }
.guest-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.guest-title { font-size:20px; font-weight:700; color:#0e1116; }

/* small “pill” link used for Remove */
.w-button.pill.subtle { background:#efeff1; color:#0e1116; border-radius:999px; padding:10px 16px; }

/* bigger fields on email + YouTube sections (already desktop-friendly; improves mobile too) */
#email, #song-search { font-size:16px; padding:16px 18px; }

/* YouTube dropdown must float over wrapper */
.yt-results { z-index: 9999; }

/* MOBILE hero text readability over the light image */
@media (max-width: 560px) {
  .rsvp-hero h1 { color:#fff; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
  .hero-media::after {
    content:"";
    position:absolute; inset:0;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.28) 30%, rgba(0,0,0,0) 60%);
    pointer-events:none;
  }
}

/* Space between "Add guest" row and the first guest card/list */
#guestList { margin-top: 16px; }
.guest-card { margin-top: 16px; }

/* Mobile hero title contrast over light photo */
.hero { position: relative; }
.hero .scrim { position:absolute; inset:0; pointer-events:none; opacity:0; }
@media (max-width: 640px) {
  .hero .scrim { 
    opacity: 1;
    /* darken lower half so white title/chips pop */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.55) 85%);
  }
  .hero .meta h1 { color:#fff; text-shadow:0 2px 8px rgba(0,0,0,.35); }
  /* keep chips readable over darker scrim */
  .hero .chip { background: rgba(255,255,255,.92); border-color: rgba(0,0,0,.06); }
}

/* Brand header */
.brandbar{
  max-width: 1024px;
  margin: 20px auto 8px;
  padding: 0 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand .brandmark{
  display:block;
  height: 36px;        /* desktop size */
}
@media (max-width: 640px){
  .brand .brandmark{ height: 30px; }
}

/* Back button (pretty pill) */
.backlink{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:999px;
  color:#111;
  font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,.04);
  cursor:pointer;
  transition:transform .06s ease, box-shadow .2s ease, background .2s ease;
}
.backlink:hover{ box-shadow:0 6px 18px rgba(0,0,0,.08); background:#f8f8f8; }
.backlink:active{ transform:translateY(1px); }
.backlink svg{ width:20px; height:20px; }

/* Nudge the main card down a touch so the header breathes */
.page .wrap{ margin-top: 8px; }

/* Fix link-style buttons (e.g. on success page) */
a.btn {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.btn:hover {
  text-decoration: none;
}

/* Optional: tidy spacing for .btn-outline + .btn-ghost */
.btn-outline,
.btn-ghost {
  text-decoration: none;
  font-weight: 600;
}

/* --- Chips-style calendar buttons --- */
.calendar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn.btn-chip {
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
  transition: transform .02s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.btn.btn-chip .ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  fill: currentColor; /* 1-color fallback */
}

.btn.btn-chip:hover {
  border-color: #d8d8d8;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

/* Brochure CTA block */
.brochure-cta .lead {
  font-weight: 600;
  margin-top: 2px;
}

.btn.btn-pill {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}

.btn-outline {
  background: #fff;
  border: 1.5px solid #e6e6e6;
}

.btn-outline:hover {
  border-color: #d0d0d0;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* Sign-off */
.signoff {
  text-align: center;
  font-size: 1.05rem;
}

.signoff .sign {
  font-weight: 800;
  margin-top: 6px;
}

/* Summary layout tweaks */
.summary.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin: 8px 0 10px;
}

.summary-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}

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

.summary-key { color: #6b7280; font-weight: 600; }
.summary-val { color: #111; }

/* Make link-buttons look like buttons (no underline) */
a.btn, .btn a {
  text-decoration: none;
  color: inherit;
}
a.btn:hover, .btn a:hover { text-decoration: none; }

/* Responsive */
@media (max-width: 720px) {
  .summary.grid-2 { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: 130px 1fr; }
  .calendar-actions { gap: 10px; }
  .btn.btn-chip .ico { width: 17px; height: 17px; }
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.backlink:hover {
  text-decoration: underline;
}

/* ---- Mobile refinements for YouTube search ---- */
@media (max-width: 640px){
  .input-xl{ height: 58px; font-size: 16px; }
  .yt .input-icon svg{ width:18px; height:18px; left:12px; }
  .yt .input-icon input{ padding-left: 44px; }
  .yt-results{ max-height:45vh; }
  .yt-item{ padding:10px; gap:10px; }
  .yt-thumb{ width:48px; height:48px; border-radius:10px; }
  .yt-title{ font-size:15px; }
  .yt-sub{ font-size:12px; }
}

/* ===== Shared card + spacing utilities (used on success page) ===== */
.card{ background:#fff; border:1px solid #eef0f3; border-radius:20px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.pad-xl{ padding:24px; }
.pad-lg{ padding:18px; }
.stack-lg{ display:flex; flex-direction:column; gap:18px; }
.stack-md{ display:flex; flex-direction:column; gap:12px; }
.h4{ font-size:20px; font-weight:800; margin:0 0 8px; }
.muted{ color: var(--muted); }
.key{ color:#555; font-weight:600; }

/* refine summary table look on success page */
.summary-row{ border-bottom:1px dashed #eee; }
.summary-row:last-child{ border-bottom:0; }
.summary-key{ color:#555; font-weight:600; }
.summary-val a{ color:#0f62fe; text-decoration:underline; }

/* ===== Simple accordion (success page) ===== */
.acc{ border:1px solid #eef0f3; border-radius:14px; }
.acc + .acc{ margin-top:12px; }
.acc-h{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; cursor:pointer; }
.acc-h .title{ display:flex; align-items:center; gap:10px; font-weight:700; }
.acc-h .badge{ background:#f2f3f5; border:1px solid #e8e9ee; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:700; color:#111; }
.acc-body{ padding:12px 14px; border-top:1px dashed #eef0f3; }
.chev{ width:18px; height:18px; transition: transform .2s ease; }
.acc[data-open="false"] .acc-body{ display:none; }
.acc[data-open="true"] .chev{ transform: rotate(180deg); }