:root {
  --bg: #f6efe7;
  --surface: #fffdf9;
  --surface-soft: #f3e7d8;
  --ink: #38251f;
  --muted: #77665d;
  --line: #dfccb7;
  --gold: #c28a2c;
  --gold-dark: #8f5d17;
  --cocoa: #4b2d25;
  --cocoa-deep: #291713;
  --champagne: #ead2a7;
  --green: #2f7064;
  --green-soft: #e5f2ed;
  --red: #a84c50;
  --red-soft: #f8e8e6;
  --blue: #496e81;
  --blue-soft: #e7f0f4;
  --amber-soft: #fff2d6;
  --shadow: 0 16px 38px rgba(72, 43, 31, 0.10);
  --radius: 8px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

/* Mirian Convites: identidade champagne e cacau, inspirada nas artes da marca. */
.sidebar {
  width: 264px;
  padding: 24px 18px 20px;
  border-right: 1px solid rgba(234, 210, 167, .28);
  background: var(--cocoa-deep);
  box-shadow: 8px 0 28px rgba(41, 23, 19, .14);
}
.brand { gap: 11px; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-color: rgba(234, 210, 167, .72);
  background: var(--gold);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .12);
  color: #fffaf1;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 21px;
  font-weight: 700;
}
.brand-copy { display: grid; min-width: 0; line-height: 1.05; }
.brand-copy strong { overflow: hidden; font-family: var(--serif); font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { margin-top: 4px; color: rgba(255, 255, 255, .58); font-family: var(--sans); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.brand-center .brand-copy small { color: var(--muted); }
.sidebar-portrait {
  position: relative;
  overflow: hidden;
  height: 190px;
  margin: 24px 0 22px;
  border: 1px solid rgba(234, 210, 167, .38);
  border-radius: 8px;
  background: #ead6b6;
}
.sidebar-portrait::after { position: absolute; inset: auto 0 0; height: 48%; background: linear-gradient(transparent, rgba(41, 23, 19, .72)); content: ""; }
.sidebar-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 57% 23%; }
.sidebar nav { gap: 7px; margin-top: 0; }
.sidebar nav a { min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; color: rgba(255, 250, 241, .72); font-weight: 600; }
.sidebar nav a span { color: var(--champagne); font-size: 18px; }
.sidebar nav a:hover, .sidebar nav a.active { border-color: rgba(234, 210, 167, .18); background: rgba(255, 255, 255, .08); color: #fffaf1; }
.sidebar-signature { position: absolute; bottom: 20px; left: 30px; color: rgba(234, 210, 167, .42); font-family: var(--serif); }
.app-shell { width: calc(100% - 264px); margin-left: 264px; padding: 38px clamp(24px, 4vw, 62px) 80px; }

.page-header { align-items: center; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-header > div { position: relative; padding-left: 16px; }
.page-header > div::before { position: absolute; top: 2px; bottom: 3px; left: 0; width: 3px; border-radius: 3px; background: var(--gold); content: ""; }
.page-header h1 { margin-bottom: 6px; color: var(--cocoa); }
.eyebrow { color: var(--gold-dark); letter-spacing: .08em; }
.back-link { padding-left: 0; }

.button { border-radius: 7px; box-shadow: 0 4px 10px rgba(72, 43, 31, .06); }
.button-primary { border-color: var(--gold); background: var(--gold); color: #fff; }
.button-primary:hover { border-color: var(--cocoa); background: var(--cocoa); }
.button-secondary { border-color: #d6bea3; background: #fffdf9; color: var(--cocoa); }
.button-secondary:hover, .button-ghost:hover { border-color: var(--gold); background: #fff8eb; color: var(--gold-dark); }
.icon-button { border-color: #d8c5b0; border-radius: 7px; background: #fffdf9; color: var(--cocoa); }

.metric-grid { gap: 12px; }
.metric { position: relative; overflow: hidden; min-height: 132px; padding: 20px; border-color: var(--line); border-top: 0; border-left: 4px solid var(--gold); background: var(--surface); box-shadow: 0 8px 20px rgba(72, 43, 31, .06); }
.metric:nth-child(2) { border-left-color: var(--blue); }
.metric:nth-child(3) { border-left-color: var(--green); }
.metric:nth-child(4) { border-left-color: #a96551; }
.metric strong { color: var(--cocoa); font-size: 34px; }
.metric::after { position: absolute; top: 13px; right: 15px; width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 50%; color: rgba(194, 138, 44, .24); content: ""; }
.metric:nth-child(2)::after { color: rgba(73, 110, 129, .22); }
.metric:nth-child(3)::after { color: rgba(47, 112, 100, .22); }
.metric:nth-child(4)::after { color: rgba(169, 101, 81, .22); }

.section-block, .form-section { border-color: var(--line); background: var(--surface); box-shadow: 0 9px 24px rgba(72, 43, 31, .055); }
.section-heading { padding-bottom: 15px; border-bottom: 1px solid #eadbc9; }
.section-heading h2 { color: var(--cocoa); }
.event-list { gap: 8px; }
.event-row { min-height: 106px; padding: 12px; border: 1px solid transparent; border-top-color: transparent; border-radius: 7px; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.event-row:first-child { border-top: 1px solid transparent; }
.event-row:hover { border-color: #e5d3bd; background: #fbf5ec; transform: translateX(2px); }
.event-row img { width: 88px; height: 78px; border: 1px solid #ead7bd; }
.event-title-line h3 { color: var(--cocoa); }
.event-summary strong { color: var(--cocoa); }

.badge { border-radius: 999px; }
.badge-neutral { background: #f3e7d8; color: #74533e; }
.badge-pending { background: var(--amber-soft); color: #7b5a20; }
.badge-confirmed { background: var(--green-soft); color: var(--green); }

input, select, textarea { border-color: #d8c5b0; border-radius: 6px; background: #fffefa; }
input:hover, select:hover, textarea:hover { border-color: #ba966c; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 138, 44, .12); outline: 0; }
.toggle-row input { background: #c9b7a8; }
.toggle-row input:checked { background: var(--gold-dark); }
.sub-settings { border-left-color: var(--gold); background: #faf2e7; }
.tabs { gap: 6px; }
.tabs a { border: 1px solid transparent; border-radius: 6px; }
.tabs a:hover { background: #f8efe4; }
.tabs a.active { border-color: #dfc29c; background: #fff5e5; color: var(--cocoa); }
.menu-popover { border-color: var(--line); background: #fffdf9; }
.menu-popover a:hover { background: #f7ecdf; }
th { border-bottom-color: #c9aa83; color: #71584c; }
tbody tr:hover { background: #fcf6ee; }
.secure-link { border: 1px solid #ead09f; border-radius: 7px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 980px; margin: 0 auto; }
.choice-card { display: grid; min-height: 280px; align-content: start; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 9px 24px rgba(72, 43, 31, .055); transition: border-color .18s ease, transform .18s ease; }
.choice-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.choice-card .choice-icon { display: grid; width: 46px; height: 46px; margin-bottom: 34px; place-items: center; border-radius: 50%; background: #f1dfc4; color: var(--gold-dark); font-size: 22px; }
.choice-card strong { align-self: end; color: var(--gold-dark); }

.scanner-panel { border: 1px solid #77564a; background: var(--cocoa-deep); box-shadow: var(--shadow); }
.scanner-frame { background: #180d0b; }
.scanner-guide { border-color: var(--champagne); }

.auth-page { background: #f3e8d9; }
.auth-page::before { position: fixed; inset: 0 0 0 44%; background: #ead7bb url("images/mirian-mascot-v2.png") center 28% / cover no-repeat; content: ""; }
.auth-page::after { position: fixed; inset: 0 0 0 44%; background: linear-gradient(90deg, rgba(246, 239, 231, .92), rgba(246, 239, 231, .08) 28%, rgba(41, 23, 19, .10)); content: ""; }
.auth-page .standalone-shell { position: relative; z-index: 1; place-items: center start; padding: 40px 7vw; background: transparent; }
.auth-panel { width: min(440px, 42vw); padding: 38px; border-color: #d7bea0; background: rgba(255, 253, 249, .97); box-shadow: 0 24px 70px rgba(72, 43, 31, .18); }
.auth-panel .brand-center { justify-content: flex-start; }
.auth-copy { text-align: left; }
.brand-center { color: var(--cocoa); }

.public-page { background: #f5ede3; }
.cover-overlay { background: rgba(255, 250, 242, .24); }
.rsvp-panel { border: 1px solid var(--line); background: #fffdf9; }
.search-message { border-left: 3px solid var(--gold); background: #f8eee1; }
.search-results > a, .people-checklist label { background: #fffefa; }
.search-results > a:hover, .people-checklist label:hover { background: #fbf2e6; }
.success-icon { background: var(--green); }
.invite-card { background-color: #f6ecde; color: var(--cocoa); }
.invite-card-inner { background: linear-gradient(rgba(255, 252, 246, .80), rgba(255, 249, 239, .74)); }
.invite-person { border-top-color: rgba(75, 45, 37, .25); }

@media (max-width: 1120px) {
  .sidebar { width: 238px; }
  .app-shell { width: calc(100% - 238px); margin-left: 238px; }
  .sidebar-portrait { height: 166px; }
}

@media (max-width: 820px) {
  .sidebar { width: min(284px, 86vw); }
  .mobile-bar { border-bottom: 1px solid rgba(234, 210, 167, .25); background: var(--cocoa-deep); box-shadow: 0 6px 18px rgba(41, 23, 19, .16); }
  .mobile-bar .brand-copy small { display: none; }
  .mobile-bar .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .app-shell { width: 100%; margin-left: 0; padding-top: 26px; }
  .auth-page::before, .auth-page::after { display: none; }
  .auth-page .standalone-shell { place-items: center; padding: 24px; background: #f3e8d9; }
  .auth-panel { width: min(440px, 100%); }
}

@media (max-width: 560px) {
  .page-header > div { padding-left: 12px; }
  .metric { padding: 15px; }
  .metric strong { font-size: 29px; }
  .event-row { padding: 10px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 230px; padding: 22px; }
  .auth-panel { padding: 28px 22px; }
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; letter-spacing: 0; }
body.dialog-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(181, 139, 69, .35); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 500; line-height: 1.12; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); }
h2 { margin-bottom: 6px; font-size: 25px; }
h3 { margin-bottom: 4px; font-size: 19px; }
p { color: var(--muted); }
code { padding: 2px 5px; background: var(--surface-soft); border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 230px; padding: 26px 18px; background: #193a30; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.brand-mark { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; color: #fff; font-family: var(--serif); font-size: 13px; }
.brand-center { justify-content: center; color: var(--ink); }
.brand-center .brand-mark { border-color: var(--gold); background: var(--gold); }
.sidebar nav { display: grid; gap: 5px; margin-top: 42px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 6px; color: rgba(255,255,255,.83); }
.sidebar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar nav span { width: 20px; text-align: center; }
.mobile-bar { display: none; }
.app-shell { width: calc(100% - 230px); min-height: 100vh; margin-left: 230px; padding: 42px clamp(24px, 4vw, 64px) 80px; }
.standalone-shell { min-height: 100vh; }
.auth-page .standalone-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: linear-gradient(120deg, #f7f5f0 0 55%, #edf2ed 55%); }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 auto 30px; max-width: 1400px; }
.page-header p { margin-bottom: 0; }
.eyebrow { margin-bottom: 7px; color: var(--gold-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.back-link:hover, .text-link:hover { color: var(--gold-dark); }
.header-actions, .button-row, .row-actions, .modal-actions { display: flex; align-items: center; gap: 9px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 700; line-height: 1.2; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-primary { border-color: var(--gold); background: var(--gold); color: #fff; }
.button-primary:hover { border-color: var(--gold-dark); background: var(--gold-dark); }
.button-secondary { border-color: #c8ccc7; background: #fff; color: var(--ink); }
.button-secondary:hover, .button-ghost:hover { border-color: var(--gold); color: var(--gold-dark); }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-danger { border-color: var(--red); background: var(--red); color: #fff; }
.button-wide { width: 100%; }
.icon-button { display: inline-grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; font-size: 18px; }
.icon-button:hover { border-color: var(--gold); color: var(--gold-dark); }
.icon-button.danger, .text-danger { color: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1400px; margin: 0 auto 28px; }
.metric-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 16px rgba(25,43,35,.04); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 7px 0 3px; font-family: var(--serif); font-size: 31px; font-weight: 500; }
.metric small { font-size: 12px; line-height: 1.35; }

.section-block, .form-section { max-width: 1400px; margin: 0 auto 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 18px rgba(25,43,35,.04); }
.section-block.narrow, .form-section.narrow { max-width: 720px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading p { margin-bottom: 0; }
.section-heading.centered { justify-content: center; text-align: center; }
.section-heading.centered > div { max-width: 600px; }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: 88px minmax(220px, 1fr) minmax(220px, .65fr) auto; align-items: center; gap: 18px; min-height: 112px; padding: 14px 0; border-top: 1px solid var(--line); }
.event-row:first-child { border-top: 0; }
.event-row img { width: 88px; height: 76px; object-fit: cover; border-radius: 6px; }
.event-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.event-title-line h3, .event-main p { margin-bottom: 0; }
.event-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 13px; }
.event-summary span { display: grid; }
.event-summary strong { color: var(--ink); font-size: 16px; }

.badge { display: inline-flex; width: fit-content; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-confirmed { background: var(--green-soft); color: var(--green); }
.badge-pending, .badge-neutral { background: #eeefed; color: #616a66; }
.badge-declined { background: var(--red-soft); color: var(--red); }

.empty-state { max-width: 620px; margin: 48px auto; padding: 24px; text-align: center; }
.empty-state.compact { margin: 10px auto; padding: 15px; }
.empty-state p { margin-bottom: 22px; }
.state-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 16px; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }

.form-stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
label, fieldset, .question-field { display: grid; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 700; }
label small, .field-help { color: var(--muted); font-size: 12px; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd0cc; border-radius: 5px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #aeb6b1; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; }
.check-row, .option-row { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.check-row input, .option-row input, .toggle-row input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--gold-dark); }
.settings-layout { padding-bottom: 68px; }
.cover-editor { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 22px; }
.cover-editor > img { width: 100%; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover; }
.color-input { display: grid; grid-template-columns: 44px 1fr; gap: 8px; }
.color-input input[type=color] { padding: 3px; }
.toggle-list { display: grid; }
.toggle-row { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); font-weight: 400; }
.toggle-row input { width: 42px; height: 24px; appearance: none; border: 0; border-radius: 20px; background: #bfc5c1; cursor: pointer; }
.toggle-row input::after { display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: #fff; content: ""; transition: transform .18s; }
.toggle-row input:checked { background: var(--green); }
.toggle-row input:checked::after { transform: translateX(18px); }
.sub-settings { margin-top: 18px; padding: 18px; border-left: 3px solid var(--gold); background: var(--surface-soft); }
.sticky-actions { position: sticky; bottom: 14px; z-index: 9; display: flex; justify-content: flex-end; gap: 9px; max-width: 1400px; margin: 0 auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-inline { display: flex; min-width: 250px; align-items: center; gap: 7px; }
.search-inline input { min-width: 0; }
.tabs { display: flex; min-width: 0; gap: 3px; overflow-x: auto; }
.tabs a { white-space: nowrap; padding: 8px 11px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; }
.tabs a.active { border-color: var(--gold); color: var(--ink); font-weight: 700; }
.menu { position: relative; margin-left: auto; }
.menu-popover { position: absolute; top: calc(100% + 5px); right: 0; z-index: 5; display: none; min-width: 170px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.menu.open .menu-popover { display: grid; }
.menu-popover a { padding: 8px 10px; border-radius: 4px; }
.menu-popover a:hover { background: var(--surface-soft); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; border-bottom: 2px solid #ccd1cd; color: #4e5b55; font-size: 12px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td small { display: block; color: var(--muted); }
.danger-zone { margin-top: 18px; text-align: right; }
.split-sections { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); gap: 22px; max-width: 1400px; margin: 0 auto; }
.split-sections .section-block { width: 100%; margin: 0; }
.question-list { margin-bottom: 18px; }
.question-list > div { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.question-list > div > span { flex: 1; }
.question-list small { color: var(--muted); }
.compact-form { margin-top: 18px; }
.action-list { display: grid; }
.action-list > a, .action-link { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.action-list span { display: grid; }
.action-list small { color: var(--muted); }
.secure-link { display: grid; gap: 8px; margin-top: 18px; padding: 14px; background: var(--amber-soft); }

dialog { width: min(650px, calc(100% - 28px)); max-height: 90vh; padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 24px 80px rgba(20,35,29,.25); }
dialog::backdrop { background: rgba(16,30,24,.55); }
.modal-card { padding: 24px; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-actions { justify-content: flex-end; margin-top: 22px; }
.file-drop { min-height: 220px; place-items: center; padding: 30px; border: 1px dashed #9ca8a1; background: var(--surface-soft); cursor: pointer; text-align: center; }
.file-drop input { max-width: 320px; }
.import-drop form { display: grid; gap: 18px; }

.flash { max-width: 1400px; margin: 0 auto 18px; padding: 12px 15px; border-left: 4px solid; border-radius: 4px; }
.flash-success { border-color: var(--green); background: var(--green-soft); color: #194d3a; }
.flash-error { border-color: var(--red); background: var(--red-soft); color: #783535; }
.flash-info { border-color: #6b7d8b; background: #eef2f4; color: #44545f; }
.flash-warning { border-color: #b4852f; background: var(--amber-soft); color: #71561f; }

.auth-panel { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.auth-copy { margin: 34px 0 26px; text-align: center; }
.auth-copy p:last-child { margin-bottom: 0; }

.public-page { background: #f3f0e9; }
.event-public { min-height: 100vh; color: var(--ink); }
.event-cover { position: relative; height: clamp(300px, 54vh, 640px); overflow: hidden; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; background: rgba(255,255,255,.15); text-align: center; }
.cover-overlay h1 { max-width: 900px; font-size: clamp(38px, 7vw, 78px); text-shadow: 0 1px 8px rgba(255,255,255,.95); }
.cover-overlay time { color: var(--secondary); font-family: var(--serif); font-size: 20px; font-weight: 700; }
.rsvp-panel { width: min(720px, calc(100% - 28px)); margin: -40px auto 50px; padding: 30px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); position: relative; z-index: 2; }
.welcome-copy { margin: 0 auto 28px; color: var(--ink); font-family: var(--serif); font-size: 19px; text-align: center; }
.form-intro { margin-bottom: 22px; text-align: center; }
.public-search { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.search-message { margin-top: 18px; padding: 16px; background: var(--surface-soft); text-align: center; }
.search-message p { margin: 3px 0 0; }
.search-results { display: grid; gap: 8px; margin-top: 20px; }
.search-results > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; }
.search-results > a:hover { border-color: var(--primary); }
.search-results span { display: grid; }
.search-results small { color: var(--muted); }
.privacy-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented-three { grid-template-columns: repeat(3, 1fr); }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; min-height: 46px; place-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.segmented input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, white); color: var(--secondary); }
.people-checklist { display: grid; gap: 8px; }
.people-checklist label { display: flex; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; }
.people-checklist input { width: 20px; min-height: 20px; accent-color: var(--primary); }
.people-checklist span { display: grid; }
.people-checklist small { color: var(--muted); }
.question-field { padding-top: 16px; border-top: 1px solid var(--line); }

.success-shell, .host-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 42px 0 70px; }
.success-shell { width: min(720px, calc(100% - 28px)); text-align: center; }
.success-heading { margin-bottom: 28px; text-align: center; }
.success-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 30px; }
.invite-carousel { position: relative; width: min(360px, 100%); aspect-ratio: 9/16; margin: 20px auto; }
.invite-card { position: absolute; inset: 0; display: none; overflow: hidden; border-radius: var(--radius); background-color: #f7f3eb; background-position: center; background-size: cover; box-shadow: var(--shadow); color: #203a31; }
.invite-card.active { display: block; }
.invite-card-inner { position: absolute; inset: 0; padding: 11% 8%; background: linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.7)); }
.invite-card p { margin-bottom: 8px; color: var(--gold-dark); font-weight: 700; text-transform: uppercase; }
.invite-card h3 { font-size: 30px; }
.invite-card time { display: block; font-family: var(--serif); }
.qr-code { position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1; padding: 7px; background: #fff; }
.qr-code canvas, .qr-code img { width: 100% !important; height: 100% !important; display: block; }
.invite-person { position: absolute; right: 7%; bottom: 8%; left: 7%; display: grid; padding-top: 14px; border-top: 1px solid rgba(32,58,49,.25); }
.invite-person strong { font-family: var(--serif); font-size: 20px; }
.carousel-actions { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 14px; }
.review-link { margin: 28px 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.review-link > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.review-link .text-link { display: inline-block; margin-top: 14px; color: var(--gold-dark); }

.checkin-layout { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr); gap: 22px; max-width: 1400px; margin: 0 auto; }
.scanner-panel { padding: 24px; border-radius: var(--radius); background: #193a30; color: #fff; }
.scanner-panel h2, .scanner-panel p, .scanner-panel label { color: #fff; }
.scanner-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; margin-bottom: 14px; border-radius: 6px; background: #0d201a; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame > p { position: absolute; right: 18px; bottom: 12px; left: 18px; margin: 0; text-align: center; }
.scanner-guide { position: absolute; inset: 18%; border: 2px solid rgba(255,255,255,.75); }
.manual-token { display: grid; gap: 8px; margin-top: 16px; }
.checkin-list { display: grid; }
.checkin-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checkin-list article > div:first-child { display: grid; }
.checkin-list small { color: var(--muted); }
.arrival { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; }
.scan-result { max-width: 1400px; margin: 0 auto 18px; padding: 18px; border-radius: var(--radius); text-align: center; }
.scan-result span { display: block; }
.scan-success { background: var(--green-soft); color: var(--green); }
.scan-already { background: var(--amber-soft); color: #725822; }
.scan-invalid, .scan-cancelled, .scan-other_event { background: var(--red-soft); color: var(--red); }

@media (max-width: 1120px) {
  .metric-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .event-row { grid-template-columns: 74px 1fr auto; }
  .event-row img { width: 74px; height: 68px; }
  .event-summary { grid-column: 2; }
  .row-actions { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-bar { position: sticky; top: 0; z-index: 18; display: flex; height: 64px; align-items: center; justify-content: space-between; padding: 10px 16px; background: #193a30; color: #fff; }
  .mobile-bar .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .app-shell { width: 100%; margin: 0; padding: 26px 16px 70px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-sections, .checkin-layout, .cover-editor { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-inline { width: 100%; }
  .menu { margin-left: 0; }
  .event-cover { height: 430px; }
  .rsvp-panel { margin-top: -28px; padding: 24px 18px; }
}

@media (max-width: 560px) {
  h1 { font-size: 32px; }
  .metric-grid, .metric-grid-6 { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; padding: 14px; }
  .metric strong { font-size: 27px; }
  .section-block, .form-section { padding: 18px 14px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .event-row { grid-template-columns: 60px 1fr; }
  .event-row img { width: 60px; height: 60px; }
  .event-summary, .event-row .row-actions { grid-column: 1 / -1; grid-row: auto; }
  .event-row .row-actions { justify-content: flex-end; }
  .button-row { align-items: stretch; flex-direction: column; }
  .button-row .button { width: 100%; }
  .public-search, .review-link > div { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: 1fr; }
  .sticky-actions { right: 8px; bottom: 8px; left: 8px; }
  .sticky-actions .button { flex: 1; }
  .checkin-list article { align-items: stretch; flex-direction: column; }
  .arrival { align-items: flex-start; flex-direction: column; }
  .auth-panel { padding: 26px 20px; }
}

/* Final cascade for the branded shell. Kept after the responsive base rules. */
.sidebar { width: 264px; padding: 24px 18px 20px; background: var(--cocoa-deep); }
.brand { gap: 11px; }
.brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-color: rgba(234, 210, 167, .72); background: var(--gold); color: #fffaf1; font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 21px; font-weight: 700; }
.brand-center .brand-mark { border-color: var(--gold); background: var(--gold); }
.sidebar nav { gap: 7px; margin-top: 0; }
.sidebar nav a { min-height: 44px; padding: 10px 12px; border: 1px solid transparent; color: rgba(255, 250, 241, .72); font-weight: 600; }
.sidebar nav a:hover, .sidebar nav a.active { border-color: rgba(234, 210, 167, .18); background: rgba(255, 255, 255, .08); color: #fffaf1; }
.app-shell { width: calc(100% - 264px); margin-left: 264px; padding: 38px clamp(24px, 4vw, 62px) 80px; }
.page-header { align-items: center; margin-bottom: 28px; padding-bottom: 22px; }
.button { border-radius: 7px; }
.metric-grid { gap: 12px; }
.metric { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-top: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); box-shadow: 0 8px 20px rgba(72, 43, 31, .06); }
.metric:nth-child(2) { border-left-color: var(--blue); }
.metric:nth-child(3) { border-left-color: var(--green); }
.metric:nth-child(4) { border-left-color: #a96551; }
.metric strong { font-size: 34px; }
.section-block, .form-section { border-color: var(--line); background: var(--surface); box-shadow: 0 9px 24px rgba(72, 43, 31, .055); }
.event-list { gap: 8px; }
.event-row { min-height: 106px; padding: 12px; border: 1px solid transparent; border-radius: 7px; }
.event-row:first-child { border-top: 1px solid transparent; }
.event-row img { width: 88px; height: 78px; }
input, select, textarea { border-color: #d8c5b0; border-radius: 6px; background: #fffefa; }
.toggle-row input { background: #c9b7a8; }
.toggle-row input:checked { background: var(--gold-dark); }
.sub-settings { background: #faf2e7; }
.tabs { gap: 6px; }
.scanner-panel { background: var(--cocoa-deep); }
.public-page { background: #f5ede3; }
.cover-overlay { background: rgba(255, 250, 242, .24); }
.invite-card { background-color: #f6ecde; color: var(--cocoa); }
.invite-card-inner { background: linear-gradient(rgba(255, 252, 246, .80), rgba(255, 249, 239, .74)); }
.auth-page .standalone-shell { position: relative; z-index: 1; place-items: center start; padding: 40px 7vw; background: transparent; }
.auth-panel { width: min(440px, 42vw); padding: 38px; border-color: #d7bea0; background: rgba(255, 253, 249, .97); box-shadow: 0 24px 70px rgba(72, 43, 31, .18); }

@media (max-width: 1120px) {
  .sidebar { width: 238px; }
  .app-shell { width: calc(100% - 238px); margin-left: 238px; }
}

@media (max-width: 820px) {
  .sidebar { width: min(284px, 86vw); }
  .mobile-bar { background: var(--cocoa-deep); }
  .app-shell { width: 100%; margin-left: 0; padding: 26px 16px 70px; }
  .auth-page .standalone-shell { place-items: center; padding: 24px; background: #f3e8d9; }
  .auth-panel { width: min(440px, 100%); }
}

@media (max-width: 560px) {
  .metric { min-height: 112px; padding: 15px; }
  .metric strong { font-size: 29px; }
  .event-row { padding: 10px; }
  .event-row img { width: 60px; height: 60px; }
  .auth-panel { padding: 28px 22px; }
}
