/* RSVP panel - dark, phone first, same colours as the invite */
:root {
  --red: #e50914;
  --bg: #0b0b0b;
  --card: #171717;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #9a9a9a;
  --gold: #f0d49a;
  --green: #46d369;
  --ui: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { background: radial-gradient(90% 40% at 50% 0%, #3a0507 0%, var(--bg) 70%) fixed, var(--bg); color: #fff; font: 15px/1.45 var(--ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 18px; border: 0; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: 0.6; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: #333; color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 360px); padding: 28px 22px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.login-card img { margin: 0 auto 10px; border-radius: 12px; }
.login-card h1 { margin: 0; font-size: 26px; }
.login-sub { margin: 4px 0 18px; color: var(--muted); }
.login-card input { width: 100%; margin-bottom: 10px; padding: 14px; border: 1px solid #444; border-radius: 6px; background: #262626; font-size: 16px; outline: none; }
.login-card input:focus { border-color: #fff; }
.login-card .btn { width: 100%; }
.login-err { min-height: 20px; margin: 10px 0 0; color: #ff7a7a; font-size: 14px; }

/* app */
#app { max-width: 1100px; margin: 0 auto; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -14px; padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; background: rgba(11, 11, 11, 0.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 7px; }
.brand b { display: block; font-size: 17px; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.bar-actions { display: flex; gap: 4px; }
.icon { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon:hover { background: rgba(255, 255, 255, 0.08); }
.icon svg { width: 23px; height: 23px; fill: #fff; }
.updated { margin: 10px 2px 8px; color: var(--muted); font-size: 12.5px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.stat b { display: block; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { overflow-wrap: anywhere; }
.stat span { display: block; margin-top: 2px; font-weight: 600; }
.stat small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.stat--big { grid-column: 1 / -1; background: linear-gradient(135deg, #5a0a0d, #1d0405); border-color: rgba(229, 9, 20, 0.35); }
.stat--big b { font-size: 44px; }
.stat--sides { grid-column: 1 / -1; }
.sides { display: grid; gap: 6px; margin-top: 8px; }
.sides p { display: flex; align-items: center; gap: 8px; margin: 0; }
.sides b { margin-left: auto; font-size: 18px; display: inline; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--groom { background: #4ea1ff; }
.dot--bride { background: #ff5fa2; }
.dot--both { background: var(--gold); }
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 30px; }
  .stat--big { grid-column: span 2; }
  .stat--sides { grid-column: span 5; }
  .sides { grid-template-columns: repeat(3, 1fr); }
}

.tools { margin: 18px 0 10px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; height: 36px; padding: 0 14px; border: 1px solid #555; border-radius: 999px; background: transparent; cursor: pointer; font-size: 14px; white-space: nowrap; }
.tab.on { background: #fff; color: #000; border-color: #fff; font-weight: 700; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.filters input { grid-column: 1 / -1; }
.filters select, .filters input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #444; border-radius: 8px; background: #1f1f1f; font-size: 15px; outline: none; }
.filters input:focus, .filters select:focus { border-color: #fff; }
@media (min-width: 720px) { .filters { grid-template-columns: 200px 200px 1fr; } .filters input { grid-column: auto; } }

.list { display: grid; gap: 10px; }
@media (min-width: 720px) { .list { grid-template-columns: 1fr 1fr; } }
.card { padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.card--no { opacity: 0.85; }
.card-top { display: flex; justify-content: space-between; gap: 10px; }
.card h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.meta { margin: 2px 0 0; font-size: 13.5px; color: #cfcfcf; }
.yes { color: var(--green); font-weight: 700; }
.no { color: #ff8a8a; font-weight: 700; }
.time { margin: 0; flex: none; text-align: right; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tag { padding: 1px 7px; border-radius: 99px; background: #333; color: #ddd; font-size: 11px; }
.evs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ev { padding: 3px 9px; border-radius: 99px; font-size: 12.5px; color: #777; border: 1px dashed #444; }
.ev.on { color: #fff; background: rgba(229, 9, 20, 0.85); border: 1px solid transparent; }
.msg { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid var(--gold); color: #e6e6e6; font-style: italic; overflow-wrap: anywhere; white-space: pre-wrap; }
.flag { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: #3d2a00; color: #ffd27a; font-size: 13px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 0; border-radius: 99px; background: #2a2a2a; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.chip--wa { background: #1f6f43; }
.chip--del { margin-left: auto; background: transparent; color: #ff8a8a; border: 1px solid #5a2a2a; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); }

.wishes { margin-top: 26px; }
.wishes h2 { margin: 0 0 10px; font-size: 19px; }
#wishes { display: grid; gap: 10px; }
@media (min-width: 720px) { #wishes { grid-template-columns: 1fr 1fr 1fr; } }
blockquote { margin: 0; padding: 14px; border-radius: 12px; background: linear-gradient(160deg, #2a1607, #171717); border: 1px solid rgba(240, 212, 154, 0.15); }
blockquote p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
cite { color: var(--gold); font-style: normal; font-size: 13px; }
.foot { margin: 26px 0 0; text-align: center; color: #666; font-size: 12px; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.65); }
.modal-card { width: min(100%, 380px); padding: 20px; border-radius: 12px; background: #222; }
.modal-card p { margin: 0 0 16px; }
.modal-row { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; transform: translate(-50%, 12px); padding: 10px 16px; border-radius: 8px; background: #fff; color: #000; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
