/* Shaadi RSVP design system.
   Tokens first, then base elements, components, the app shell and screen-specific pieces.
   The guest invitation page (rsvp.html) loads this file too and overrides the theme tokens. */

:root {
  /* surfaces */
  --bg: #f7f4ef;
  --card: #ffffff;
  --subtle: #faf8f4;
  --sunken: #f2ede5;
  /* text */
  --ink: #1d1418;
  --ink-2: #3f3337;
  --muted: #716569;
  --faint: #a1979a;
  /* lines */
  --line: #ebe4da;
  --line-strong: #dad1c5;
  /* brand: sindoor wine with antique gold */
  --brand: #7a1f3d;
  --brand-hover: #641831;
  --brand-ink: #ffffff;
  --brand-soft: #f7ecef;
  --brand-line: #e9cdd6;
  --gold: #a8844c;
  --gold-ink: #8a6a35;
  --gold-soft: #f6efe2;
  --gold-bright: #e6c78b;
  /* feedback */
  --good: #1d7a4a;
  --good-soft: #e8f4ed;
  --warn: #8f5b00;
  --warn-soft: #fdf4de;
  --warn-line: #f0d9a8;
  --bad: #b3261e;
  --bad-soft: #fbeae8;
  --info: #1d5aa6;
  --info-soft: #eef5fd;
  --info-line: #c9dcf3;
  --wa: #1a7f4b;
  --wa-hover: #146a3e;
  --wa-soft: #eef7f1;
  /* RSVP status series (validated adjacent order: yes, maybe, pending, no) */
  --s-yes: #2a78d6;
  --s-maybe: #eda100;
  --s-pending: #b5b3ab;
  --s-no: #eb6834;
  /* sidebar */
  --side-bg: #1c1216;
  --side-ink: rgba(255, 255, 255, .66);
  --side-ink-strong: #ffffff;
  --side-line: rgba(255, 255, 255, .08);
  /* shape and depth */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(29, 20, 24, .04), 0 1px 1px rgba(29, 20, 24, .02);
  --shadow-md: 0 2px 4px rgba(29, 20, 24, .04), 0 10px 28px rgba(29, 20, 24, .07);
  --shadow-lg: 0 28px 70px rgba(29, 20, 24, .22), 0 2px 8px rgba(29, 20, 24, .08);
  --ring: 0 0 0 3px rgba(122, 31, 61, .14);
  /* type */
  --serif: 'Cormorant Garamond', 'Cormorant', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --display: var(--serif);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Gujarati', sans-serif;
  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.55 var(--sans); color: var(--ink); background: var(--bg);
  font-feature-settings: 'cv11', 'ss01', 'ss03'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 .45em; letter-spacing: -.011em; color: var(--ink); }
h1 { font-variant-numeric: lining-nums; font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
h2 { font-size: 16px; letter-spacing: -.012em; }
h3 { font-size: 14.5px; }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--subtle); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
::selection { background: rgba(122, 31, 61, .16); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.display { font-family: var(--display); }

/* ---------- icons ---------- */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
button .ic, .btn .ic { width: 16px; height: 16px; margin-left: -2px; }
button.sm .ic, .btn.sm .ic { width: 15px; height: 15px; }
.icon-btn { padding: 0 !important; width: 32px; justify-content: center; }
.icon-btn .ic { margin: 0; }
.pill .ic { width: 12px; height: 12px; }
.warn-text { color: var(--warn); display: inline-flex; gap: 6px; align-items: flex-start; }
.warn-text .ic { margin-top: 1px; }
.ev-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
.ev-ic .ic { width: 18px; height: 18px; }
.with-ic { display: flex; align-items: center; gap: 10px; }
.empty-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: inset 0 0 0 1px rgba(168, 132, 76, .25); }
.empty-ic .ic { width: 26px; height: 26px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 500; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; white-space: nowrap; box-shadow: 0 1px 1px rgba(29, 20, 24, .04);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
button:hover, .btn:hover { border-color: #c8bdb0; background: var(--subtle); color: var(--ink); }
button:active, .btn:active { transform: translateY(.5px); }
button.primary, .btn.primary {
  background: linear-gradient(180deg, #8a2647, var(--brand)); border-color: var(--brand-hover); color: var(--brand-ink);
  box-shadow: 0 1px 2px rgba(122, 31, 61, .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
button.wa, .btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
button.wa:hover, .btn.wa:hover { background: var(--wa-hover); border-color: var(--wa-hover); color: #fff; }
button.wa-outline, .btn.wa-outline { color: var(--wa); border-color: #bfdccb; background: var(--wa-soft); }
button.wa-outline:hover, .btn.wa-outline:hover { background: #e2f1e7; border-color: #9fcbb1; color: var(--wa-hover); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: rgba(29, 20, 24, .05); }
button.danger { color: var(--bad); }
button.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger-solid:hover { background: #962019; border-color: #962019; color: #fff; }
button.ghost.danger:hover { background: var(--bad-soft); }
button.sm, .btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  height: 38px; padding: 0 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23716569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input[type=file] { height: auto; padding: 8px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #c8bdb0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); flex: none; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 9px; align-items: center; cursor: pointer; }
details > summary { cursor: pointer; }
details > summary:hover { color: var(--ink); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; background: var(--subtle); }
.card.info { border-color: var(--info-line); background: var(--info-soft); }
.card.notice { border-color: var(--warn-line); background: #fffaf0; }
.card.wa-card { border-color: #cfe6d7; background: var(--wa-soft); }
.card.danger-zone { border-color: #f1d0cc; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
label.pill { height: auto; }
.pill.yes { background: #e7f0fb; color: #1d5aa6; }
.pill.no { background: #fdefe7; color: #a8431a; }
.pill.maybe { background: #fdf3dc; color: #855800; }
.pill.pending { background: #f1eee9; color: #5f5a54; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* event cards: the title link covers the whole card, buttons stay clickable on top */
.event-card { position: relative; padding: 0; overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.event-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card a.stretch { color: inherit; text-decoration: none; }
.event-card a.stretch::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.event-card button { position: relative; z-index: 1; }
.event-card .ec-cover { position: relative; height: 118px; padding: 18px 20px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; background: var(--ec-bg, linear-gradient(150deg, #7a1f3d, #3c0f20)); overflow: hidden; }
.event-card .ec-cover::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.09'%3E%3Ccircle cx='60' cy='60' r='58'/%3E%3Ccircle cx='60' cy='60' r='40'/%3E%3Cpath d='M60 2v116M2 60h116M19 19l82 82M101 19L19 101'/%3E%3C/g%3E%3C/svg%3E") right -30px top -30px / 180px no-repeat; }
.event-card .ec-names { font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1.1; position: relative; }
.event-card .ec-names i { color: var(--gold-bright); font-style: italic; font-weight: 500; }
.event-card .ec-when { font-size: 12.5px; color: rgba(255, 255, 255, .8); position: relative; margin-top: 4px; }
.event-card .ec-tag { position: absolute; top: 14px; left: 20px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-bright); }
.event-card .ec-del { position: absolute; top: 10px; right: 10px; color: rgba(255, 255, 255, .75); }
.event-card .ec-del:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.event-card .ec-body { padding: 16px 20px 18px; }
.progress { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--brand)); }
.new-card { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 210px; color: var(--muted); cursor: pointer; width: 100%; height: auto; border-radius: var(--radius); }
.new-card:hover { border-color: var(--brand); color: var(--brand); background: rgba(255, 255, 255, .6); }
.new-card .ic { width: 22px; height: 22px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px 14px;
  background: radial-gradient(120% 50% at 0% 0%, rgba(122, 31, 61, .35), transparent 60%), var(--side-bg); color: var(--side-ink);
}
.side a { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-family: var(--display); font-size: 22px; font-weight: 600; color: #fff !important; letter-spacing: .005em; }
.brand .logo-mark { color: var(--brand); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.side-label { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .38); padding: 14px 10px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--side-ink); transition: background .15s, color .15s; position: relative; }
.nav a .ic { width: 17px; height: 17px; opacity: .85; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-bright); }
.nav a.active .ic { color: var(--gold-bright); opacity: 1; }
.nav .count { margin-left: auto; background: rgba(230, 199, 139, .16); color: var(--gold-bright); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 19px; }
.side-event { margin: 6px 2px 4px; padding: 14px 14px 12px; border-radius: 12px; background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid var(--side-line); }
.side-event .inv { font-size: 11.5px; color: var(--gold-bright); opacity: .9; margin-bottom: 4px; }
.side-event .nm { font-family: var(--display); font-size: 22px; font-weight: 600; color: #fff; line-height: 1.15; }
.side-event .nm i { color: var(--gold-bright); font-weight: 500; }
.side-event .dt { font-size: 12px; margin-top: 4px; }
.side-event .countdown-chip { display: inline-flex; margin-top: 10px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: rgba(230, 199, 139, .14); color: var(--gold-bright); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--side-line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg, var(--gold-bright), var(--gold)); color: #3a2410; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.side-foot .who { min-width: 0; flex: 1; font-size: 12.5px; line-height: 1.3; }
.side-foot .who b { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot button { background: transparent; border-color: transparent; color: var(--side-ink); box-shadow: none; }
.side-foot button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.content { min-width: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 34px 40px 90px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 4px 0 0; }
.page-head p { margin: 8px 0 0; max-width: 640px; }
.crumbs { font-size: 12.5px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

/* legacy top tabs, kept for any screen that still uses them */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- stat tiles ---------- */
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tile .label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.tile .label .ic { width: 15px; height: 15px; color: var(--gold); }
.tile .value { font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tile.hero { background: radial-gradient(120% 120% at 100% 0%, rgba(230, 199, 139, .22), transparent 50%), linear-gradient(150deg, #7f2242, #3b0e1f); color: #fff; border: none; box-shadow: 0 10px 30px rgba(122, 31, 61, .25); }
.tile.hero::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 150px; height: 150px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23e6c78b' stroke-opacity='.35'%3E%3Ccircle cx='50' cy='50' r='48'/%3E%3Ccircle cx='50' cy='50' r='34'/%3E%3Ccircle cx='50' cy='50' r='20'/%3E%3Cpath d='M50 2C58 26 74 42 98 50 74 58 58 74 50 98 42 74 26 58 2 50 26 42 42 26 50 2z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.tile.hero .label { color: var(--gold-bright); }
.tile.hero .sub { color: rgba(255, 255, 255, .78); }
.tile.hero .label .ic { color: var(--gold-bright); }

/* ---------- RSVP status bar ---------- */
.sbar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--sunken); }
.sbar > div { height: 100%; min-width: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.fnrow { padding: 16px 0; border-top: 1px solid var(--line); }
.fnrow:first-child { border-top: none; }
.fnrow .nums { font-variant-numeric: tabular-nums; }
.big { font-size: 24px; font-weight: 600; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--subtle); font-weight: 600; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fcfaf7; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fn-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.guest-name { font-weight: 600; color: var(--ink); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.toolbar input, .toolbar select { height: 34px; }
.search { position: relative; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; pointer-events: none; }
.search input { padding-left: 34px; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(29, 20, 24, .45); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px; z-index: 50; overflow-y: auto; animation: fade .18s ease; }
.modal { background: var(--card); border-radius: 18px; max-width: 680px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg); animation: pop .24s var(--ease); }
.modal h2 { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.005em; }
.modal.wide { max-width: 920px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500; z-index: 100; opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.msg-preview { white-space: pre-wrap; background: #eef7f0; border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid #d3eadb; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-family: var(--display); font-size: 26px; }
.empty p { max-width: 520px; margin-left: auto; margin-right: auto; }
.error { color: var(--bad); font-weight: 500; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--sunken), #f8f4ee, var(--sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- auth / landing ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth .pitch {
  position: relative; overflow: hidden; color: #fff; padding: 56px 72px; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(90% 60% at 0% 0%, rgba(160, 52, 92, .55) 0%, transparent 60%), radial-gradient(70% 50% at 100% 100%, rgba(230, 199, 139, .16), transparent 60%), linear-gradient(160deg, #3d0f22, #170a10);
}
.auth .pitch::after { content: ''; position: absolute; right: -180px; top: 50%; width: 520px; height: 520px; transform: translateY(-50%); opacity: .5; pointer-events: none; animation: spin 120s linear infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -100 200 200'%3E%3Cg fill='none' stroke='%23e6c78b' stroke-opacity='.35' stroke-width='.6'%3E%3Ccircle r='98'/%3E%3Ccircle r='80'/%3E%3Ccircle r='56'/%3E%3Ccircle r='30'/%3E%3Cg id='p'%3E%3Cpath d='M0-98C10-80 10-62 0-56-10-62-10-80 0-98z'/%3E%3Cpath d='M0-80C16-60 14-40 0-30-14-40-16-60 0-80z'/%3E%3C/g%3E%3Cuse href='%23p' transform='rotate(30)'/%3E%3Cuse href='%23p' transform='rotate(60)'/%3E%3Cuse href='%23p' transform='rotate(90)'/%3E%3Cuse href='%23p' transform='rotate(120)'/%3E%3Cuse href='%23p' transform='rotate(150)'/%3E%3Cuse href='%23p' transform='rotate(180)'/%3E%3Cuse href='%23p' transform='rotate(210)'/%3E%3Cuse href='%23p' transform='rotate(240)'/%3E%3Cuse href='%23p' transform='rotate(270)'/%3E%3Cuse href='%23p' transform='rotate(300)'/%3E%3Cuse href='%23p' transform='rotate(330)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }
.pitch > * { position: relative; z-index: 1; }
.pitch-brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 26px; font-weight: 600; margin-bottom: 48px; }
.pitch-brand .logo-mark { color: var(--brand); }
.auth .pitch h1 { color: #fff; font-size: 54px; line-height: 1.04; max-width: 560px; font-weight: 600; }
.auth .pitch h1 em { color: var(--gold-bright); font-weight: 500; }
.auth .pitch > p { font-size: 16.5px; color: rgba(255, 255, 255, .78); max-width: 520px; line-height: 1.65; }
.features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; max-width: 540px; }
.features li { display: flex; gap: 14px; align-items: center; color: rgba(255, 255, 255, .86); }
.features .ic { width: 36px; height: 36px; padding: 9px; border-radius: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(230, 199, 139, .25); color: var(--gold-bright); }
.auth .form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth .form .card { width: 100%; max-width: 410px; padding: 34px; box-shadow: var(--shadow-md); }
.auth .form h2 { font-family: var(--display); font-size: 32px; font-weight: 600; margin-bottom: 2px; }
.auth .form button.primary { height: 42px; font-size: 14.5px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .pitch { padding: 36px 24px; } .auth .pitch h1 { font-size: 36px; } .pitch-brand { margin-bottom: 26px; } .auth .pitch::after { width: 340px; height: 340px; right: -140px; } }

.trad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.trad-grid label { border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 13.5px; line-height: 1.3; transition: border-color .15s, background .15s; background: #fff; }
.trad-grid label:hover { border-color: #c8bdb0; }
.trad-grid label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.trad-grid label input[name=eventType] { position: absolute; opacity: 0; pointer-events: none; }
.trad-grid label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.trad-grid label .ev-ic { width: 30px; height: 30px; background: var(--subtle); color: var(--ink-2); }
.trad-grid label:has(input:checked) .ev-ic { background: #fff; color: var(--brand); }

.fn-editor { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: var(--shadow); }
.fn-editor + .fn-editor { margin-top: 10px; }

/* ---------- invitation designer ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.theme-opt { display: flex; flex-direction: column; gap: 7px; cursor: pointer; text-align: center; position: relative; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt .swatch { height: 92px; border-radius: 12px; display: flex; align-items: center; justify-content: center; outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .15s, transform .2s var(--ease), box-shadow .2s; position: relative; overflow: hidden; }
.theme-opt:hover .swatch { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-opt:has(input:checked) .swatch { outline-color: var(--ink); }
.theme-opt:has(input:checked) .small { font-weight: 600; }
.swatch .sw-names { font-family: var(--display); font-size: 19px; font-weight: 600; padding: 0 8px; line-height: 1.2; position: relative; }
.swatch.didone .sw-names { font-family: 'Didot', 'Bodoni 72', 'Bodoni MT', Georgia, serif; font-size: 17px; }
.swatch.sans .sw-names { font-family: 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif; font-size: 16px; }
.swatch.names-caps .sw-names { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 500; }
.swatch.names-light .sw-names { font-weight: 300; }
.swatch .sw-motif { position: absolute; inset: 0; opacity: .9; }
.swatch .sw-motif img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; display: block; }
.swatch .sw-names { align-self: flex-start; margin-top: 14px; }
.theme-opt:not(.signature) .swatch .sw-names, .sw-script { align-self: center; margin-top: 0; }
.swatch .sw-badge { position: absolute; top: 6px; right: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; border-radius: 99px; background: rgba(0, 0, 0, .35); color: #fff; }
.theme-opt.signature .swatch { height: 132px; }
.theme-opt .rec { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 2; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--gold-bright); color: #3a2410; white-space: nowrap; }
.theme-opt:focus-within .swatch, .theme-opt:has(input:focus-visible) .swatch { outline-color: var(--brand); }
.cover-prev { width: 150px; height: 100px; border-radius: 12px; background: var(--sunken) center/cover; display: flex; align-items: center; justify-content: center; flex: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.gallery-grid .thumb { aspect-ratio: 1; border-radius: 10px; background: var(--sunken) center/cover; position: relative; }
.gallery-grid .thumb button { position: absolute; top: 4px; right: 4px; height: 24px; width: 24px; padding: 0; justify-content: center; border-radius: 7px; background: rgba(255, 255, 255, .92); }
.gallery-grid .thumb button .ic { margin: 0; width: 13px; height: 13px; }
label.btn { cursor: pointer; }
#qrbox svg { width: 100%; height: 100%; display: block; }

/* designer: theme picker beside a live phone preview */
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
.preview-col { position: sticky; top: 24px; }
.phone { width: 300px; height: 626px; margin: 0 auto; border-radius: 44px; padding: 10px; background: linear-gradient(160deg, #2b1d22, #120b0e); box-shadow: 0 30px 60px rgba(29, 20, 24, .28), inset 0 0 0 1px rgba(255, 255, 255, .08); position: relative; }
.phone::before { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 86px; height: 22px; border-radius: 99px; background: #0b0709; z-index: 2; }
.phone iframe { width: 390px; height: 844px; border: 0; border-radius: 46px; transform: scale(.7179); transform-origin: 0 0; background: #1c1216; display: block; }
.sig-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 14px; padding-top: 8px; }
.sw-script { font-family: 'Great Vibes', var(--display) !important; font-size: 26px !important; font-weight: 400 !important; text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.swatch .sw-badge { display: inline-flex; align-items: center; gap: 3px; backdrop-filter: blur(4px); }
.swatch .sw-badge .ic { width: 9px; height: 9px; fill: currentColor; }
/* rec badge sits at the top-left so it never covers the Animated badge */
.theme-opt .rec { left: 8px; transform: none; }
.video-cta { margin-top: 16px; padding: 16px; }
.fav-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: linear-gradient(135deg, #eef3f8, #fbf7f0); }
.video-stage { background: #0d0809; border-radius: 16px; display: flex; justify-content: center; padding: 14px; }
.video-stage canvas { height: min(62vh, 560px); aspect-ratio: 9 / 16; border-radius: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); background: #000; }
@media (max-width: 1180px) { .design-grid { grid-template-columns: 1fr; } .preview-col { position: static; order: -1; } }

/* ---------- check-in ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; height: 36px; }
.stepper button { border: none; border-radius: 0; height: 100%; padding: 0 13px; font-size: 18px; line-height: 1; box-shadow: none; }
.stepper span { min-width: 36px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 14px; overflow: visible; }
  .brand { padding: 0; font-size: 19px; }
  .side-label, .side-event { display: none; }
  .nav { flex-direction: row; overflow-x: auto; order: 3; width: 100%; min-width: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; height: 32px; }
  .nav a.active::before { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .side-foot .who { display: none; }
  main { padding: 22px 16px 80px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .card { padding: 18px 16px; }
  h1 { font-size: 28px; }
  .page-head { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .side, .tabs, button, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card, .tile { box-shadow: none; }
}

/* guest list: list or who's invited switch, and the invite grid */
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--subtle); gap: 2px; }
.seg-toggle button { border: 0; background: transparent; box-shadow: none; }
.seg-toggle button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.igrid th.igrid-fn { text-align: center; min-width: 120px; color: var(--ink-2); }
.igrid .igrid-date { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.igrid td.igrid-cell { text-align: center; }
.igrid input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; }
.igrid .igrid-all { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; cursor: pointer; }
.igrid .igrid-all input { width: 15px; height: 15px; }
.igrid tbody tr:hover td { background: var(--subtle); }
.igrid tfoot td { background: var(--subtle); border-bottom: 0; }
.igrid td:first-child, .igrid th:first-child { position: sticky; left: 0; background: var(--card); z-index: 2; }
.igrid thead th:first-child, .igrid tfoot td:first-child { background: var(--subtle); }
.igrid td:first-child { min-width: 210px; }
.igrid td:first-child .guest-name { white-space: nowrap; }
.igrid td, .igrid th { padding: 9px 12px; }
.igrid th.igrid-fn { min-width: 104px; }
@media (max-width: 640px) { .igrid td:first-child { min-width: 150px; } .igrid td:first-child .guest-name { white-space: normal; } }
