/* ============================================================
   Postmark — Design System (rsvp tracker)
   Ink-on-cream · cinnabar seal · postmark blue · Fraunces + Inter
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: light dark;

  /* Brand — cinnabar wax seal (single accent color across the app) */
  --brand-50:  #fcefe9;
  --brand-100: #f6d3c5;
  --brand-500: #c84a31;
  --brand-600: #a83a25;
  --brand-700: #8a2e1c;

  /* Postmark blue — reserved for logo cancellation rings */
  --postmark:  #2a3550;

  /* Legacy alias — older CSS rules reference --accent / --accent-soft / --accent-strong.
     Point them at the cinnabar brand so the whole app stays in palette. */
  --accent:        var(--brand-500);
  --accent-strong: var(--brand-600);
  --accent-soft:   rgba(200,74,49,0.10);

  /* Semantic */
  --success-500: #4a7c59;
  --warning-500: #b8862b;
  --danger-500:  #a83a25;
  --danger-600:  #8a2e1c;

  /* Neutrals — warm cream + ink (light) */
  --bg:           #faf7f2;
  --surface:      #ffffff;
  --surface-2:    #f3ede1;
  --border:       #e6dfd0;
  --border-strong:#cfc6b1;
  --text:         #1a1a1a;
  --text-muted:   #6b6357;
  --text-subtle:  #8d8675;

  /* Type — Fraunces for display, Inter for UI/body, system mono */
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Scale */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10:2.5rem;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  /* Shadows — warm ink instead of pure black */
  --shadow-sm: 0 1px 2px rgba(40,30,15,0.04);
  --shadow-md: 0 2px 6px rgba(40,30,15,0.06), 0 1px 2px rgba(40,30,15,0.04);
  --shadow-lg: 0 8px 24px rgba(40,30,15,0.08), 0 2px 6px rgba(40,30,15,0.05);

  /* Motion */
  --t-fast: 120ms ease;
  --t-base: 160ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #14110d;
    --surface:      #1c1814;
    --surface-2:    #2a241d;
    --border:       #2a241d;
    --border-strong:#3d352a;
    --text:         #faf7f2;
    --text-muted:   #b8ad96;
    --text-subtle:  #847b66;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.35);
  }
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4) var(--sp-10);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin-top: 0;
  letter-spacing: -0.015em;
  font-weight: 600;
}
h1 { font-size: var(--fs-3xl); margin-bottom: var(--sp-2); }
h2 { font-size: var(--fs-2xl); margin: var(--sp-6) 0 var(--sp-3); }
h3 { font-size: var(--fs-lg);  }

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: var(--r-sm);
  color: var(--text);
  display: inline;
  white-space: nowrap;
}

/* When code/strong appears directly inside a label, keep it flowing as text */
form label > code,
form label > strong,
form label > em,
form label > a { align-self: flex-start; }
form label {
  display: block;
}
form label > input,
form label > textarea,
form label > select { margin-top: var(--sp-2); display: block; }

::selection { background: var(--brand-100); color: var(--brand-700); }
@media (prefers-color-scheme: dark) {
  ::selection { background: var(--brand-700); color: white; }
}

/* ---------- 3. Layout ---------- */
header {
  padding: var(--sp-3) 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
}
header a { color: var(--text); font-size: var(--fs-lg); }
header a:hover { text-decoration: none; color: var(--brand-600); }

main { display: flex; flex-direction: column; gap: var(--sp-4); }

.row {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4); flex-wrap: wrap;
}

.muted    { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- 4. Card / Panel ---------- */
/* Sections get a card; headings sit on the page background ABOVE the card. */
.card,
main > details,
main > form,
main > .tally-wrap,
main > table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
}

main > table { padding: 0; overflow: hidden; }
main > .tally-wrap { padding: var(--sp-6); }

main > details      { padding: 0; }
main > details > summary {
  padding: var(--sp-4) var(--sp-6);
}
main > details[open] > summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}
main > details > :not(summary) {
  padding-left: var(--sp-6); padding-right: var(--sp-6);
}
main > details > :last-child { padding-bottom: var(--sp-6); }
main > details > form { padding-bottom: var(--sp-6) !important; }

/* Form submit buttons sit at the bottom right of their card */
main > form > button[type=submit],
main > details > form > button[type=submit] {
  align-self: flex-start;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 0.5rem 0.95rem;
  font: inherit; font-size: var(--fs-sm); font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.btn:hover  { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.btn.primary {
  color: white;
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.btn.primary:hover  { background: var(--brand-700); border-color: var(--brand-700); }

.btn.danger {
  color: var(--danger-500);
  border-color: var(--danger-500);
  background: transparent;
}
.btn.danger:hover { background: var(--danger-500); color: white; }

.btn.big { font-size: var(--fs-xl); padding: 0.9rem 2rem; margin: var(--sp-2); }

.btn.btn-sm {
  font-size: var(--fs-xs);
  padding: 0.3rem 0.55rem;
  gap: 0.25rem;
}
.btn.copied {
  background: var(--success-500) !important;
  border-color: var(--success-500) !important;
  color: white !important;
}

/* Accent — non-primary action that should still stand out (e.g. "Preview email").
   Soft cinnabar so it lives in the brand palette without competing with .primary (ink). */
.btn.accent {
  color: var(--brand-700);
  background: var(--brand-50);
  border-color: var(--brand-100);
}
.btn.accent:hover {
  background: var(--brand-100);
  border-color: var(--brand-500);
  color: var(--brand-700);
}

/* Side-by-side action buttons inside a column-layout form (`form { flex-direction: column }`). */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.copy-cell {
  white-space: nowrap;
  display: flex;
  gap: var(--sp-1);
  flex-wrap: nowrap;
}

/* Live update indicator next to the Recipients heading. */
.live-dot {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
  user-select: none;
}
.live-dot.ok    { background: rgba(34,197,94,0.15); color: #16a34a; }
.live-dot.stale { background: rgba(234,179,8,0.15);  color: #b45309; }
.live-dot.off   { background: rgba(239,68,68,0.15);  color: #b91c1c; }

/* Flash a table cell when its value just changed (live poll diff). */
@keyframes cell-flash {
  0%   { background: rgba(37,99,235,0.28); }
  100% { background: transparent; }
}
td.cell-flash { animation: cell-flash 1.4s ease-out; }

/* Pulse a tally count when its number ticks. */
@keyframes count-flash {
  0%   { color: var(--brand-500); transform: scale(1.25); }
  100% { color: inherit; transform: scale(1); }
}
.tally-count.count-flash { animation: count-flash 0.8s ease-out; display: inline-block; }

/* Keep relative-time cells, name cells, and choice cells on a single line.
   Exact time is in the hover tooltip via the time[title] attribute. */
main > table td:has(time.ts),
main > table td time.ts {
  white-space: nowrap;
}
main > table th:nth-child(2),
main > table td:nth-child(2) {
  white-space: nowrap;
}
main > table th:nth-child(5),
main > table td:nth-child(5) {
  white-space: nowrap;
}

button.ph {
  font-size: var(--fs-xs); padding: 0.3rem 0.6rem; margin: 0.15rem;
  background: var(--surface-2); border-color: var(--border);
  box-shadow: none;
}
button.ph:hover { background: var(--border); }

/* ---------- 6. Forms ---------- */
form { display: flex; flex-direction: column; gap: var(--sp-4); }
form label {
  display: block;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text);
  margin: 0;
}
form label > input,
form label > textarea,
form label > select { margin-top: var(--sp-2); display: block; }
form input[type=text],
form input:not([type]),
form input[type=password],
form input[type=email],
form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit; font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
form input:focus, form textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
form textarea { font-family: var(--font-mono); font-size: var(--fs-sm); resize: vertical; }
form .check { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); }
form .check input { width: auto; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  margin: var(--sp-4) 0;
  background: var(--surface-2);
}
legend {
  padding: 0 var(--sp-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- 7. Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: var(--fs-sm);
}
th {
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
}
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- 8. Tally + Pie ---------- */
.tally-wrap {
  display: flex; gap: var(--sp-6); align-items: center; flex-wrap: wrap;
}
.tally {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: var(--sp-2);
  min-width: 14rem; flex: 1;
}
.tally li {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.tally li strong { font-weight: 600; }
.tally-label { font-weight: 600; flex: 1; }
.tally-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  min-width: 2rem; text-align: center;
  font-size: var(--fs-xs);
}
.swatch {
  display: inline-block; width: 0.9rem; height: 0.9rem;
  border-radius: var(--r-sm); flex: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.pie {
  width: 180px; height: 180px;
  border-radius: 50%;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border);
  flex: none;
}
.pie.empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-size: var(--fs-2xl);
  box-shadow: 0 0 0 1px var(--border);
}

/* ---------- 9. Public response pages ---------- */
.thanks {
  text-align: center; padding: var(--sp-10) var(--sp-4);
  max-width: 36rem; margin: 0 auto;
}
.big-choice {
  font-size: 3rem; font-weight: 700;
  margin: var(--sp-4) 0;
  color: var(--brand-600);
}
.choice-buttons { margin: var(--sp-6) 0; display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

.links a {
  display: inline-block; margin-right: var(--sp-2);
  font-size: var(--fs-sm);
}

/* ---------- 10. Email preview / meta ---------- */
.email-preview {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  background: #ffffff;
  color: #111;
  margin: var(--sp-4) 0;
  box-shadow: var(--shadow-md);
}
.email-preview a { color: var(--brand-600); }

table.meta th { width: 8rem; font-size: var(--fs-sm); }
table.meta input {
  width: 100%; padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--fs-sm);
}

/* ---------- 11. Collapsibles ---------- */
details.email-template-section > summary,
main > details > summary {
  cursor: pointer; list-style: none;
  user-select: none;
  font-weight: 600;
  display: flex; align-items: center; gap: var(--sp-2);
  color: var(--text);
}
details > summary::-webkit-details-marker,
details > summary::marker { display: none; }
details > summary h2 {
  display: inline-block; margin: 0 !important;
  font-size: var(--fs-xl); font-weight: 600;
}
details > summary::before {
  content: "▸";
  display: inline-block;
  color: var(--text-muted);
  transition: transform var(--t-base);
  width: 1rem; text-align: center;
}
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover::before { color: var(--text); }

/* ---------- 12. Utilities ---------- */
hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

@media (max-width: 640px) {
  body { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
  h1 { font-size: var(--fs-2xl); }
  .pie { width: 140px; height: 140px; }
  main > details > summary,
  .card, main > form, main > .tally-wrap { padding: var(--sp-4); }
  th, td { padding: var(--sp-2) var(--sp-3); }
}

/* Tally filter (click a tally row to filter the table by that choice) */
.tally-item { cursor: pointer; transition: background 120ms ease, transform 80ms ease; outline: none; }
.tally-item:hover { background: var(--surface-2, rgba(0,0,0,0.04)); }
.tally-item:focus-visible { box-shadow: 0 0 0 2px var(--accent, #2563eb); border-radius: 6px; }
.tally-item.active { background: var(--accent-soft, rgba(37,99,235,0.12)); font-weight: 600; }
.tally-item.active .tally-count { color: var(--accent, #2563eb); }
.tally-clear[hidden] { display: none !important; }
.tally-clear {
  display: inline-block;
  margin-left: var(--sp-2, 8px);
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-soft, rgba(37,99,235,0.12));
  color: var(--accent, #2563eb);
  border-radius: 999px;
  cursor: pointer;
  vertical-align: middle;
  user-select: none;
}
.tally-clear:hover { background: var(--accent, #2563eb); color: #fff; }
tr.row-hidden { display: none; }

/* ---- header / user nav ---- */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3, 12px) var(--sp-4, 16px); border-bottom: 1px solid var(--border, #e5e7eb); background: var(--surface, #fff); }
.brand-link { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.brand-mark { display: inline-flex; line-height: 0; color: var(--text); }
.brand-wordmark { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1; color: var(--text); transform: translateY(0.45em); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.015em; line-height: 1; }
.brand-subtitle { font-family: var(--font-sans, var(--font-display)); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.01em; text-transform: uppercase; color: var(--postmark, #2a3550); margin-top: 0.3em; line-height: 1; }
.site-header { overflow: visible; }
.site-header.public { justify-content: flex-start; }
.site-nav { display: flex; align-items: center; gap: var(--sp-3, 12px); }
.site-nav a { color: var(--accent, #2563eb); text-decoration: none; font-weight: 500; }
.site-nav a:hover { text-decoration: underline; }
.user-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--surface-2, rgba(0,0,0,0.04)); border-radius: 999px; font-size: 0.875rem; color: var(--text, #111); }
.badge { font-size: 0.7rem; font-weight: 600; padding: 1px 6px; background: var(--accent, #2563eb); color: #fff; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.inline-form { display: inline; margin: 0; }
.btn-link { background: none; border: none; color: var(--accent, #2563eb); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.btn-link:hover { color: var(--accent-strong, #1d4ed8); }

/* ---- login ---- */
.login-wrap { max-width: 360px; margin: 4rem auto; padding: var(--sp-4, 16px); background: var(--surface, #fff); border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.login-wrap h1 { margin-top: 0; }
.error { color: #b91c1c; background: #fee2e2; padding: 8px 12px; border-radius: 6px; margin-bottom: 16px; }

/* ---- users page ---- */
.success-card { background: #f0fdf4; border: 1px solid #86efac; padding: var(--sp-3, 12px) var(--sp-4, 16px); border-radius: 8px; margin: 16px 0; }
.success-card h2 { margin-top: 0; color: #166534; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 600; color: #555; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.kv code { background: rgba(0,0,0,0.05); padding: 2px 8px; border-radius: 4px; font-size: 0.95em; }
.actions { white-space: nowrap; }
.actions form + form { margin-left: 6px; }
.btn.danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.btn.danger:hover { background: #fecaca; }

/* ---- per-campaign host bar ---- */
.host-bar { display: flex; align-items: center; gap: var(--sp-2, 8px); margin: 0 0 var(--sp-3, 12px); padding: 8px 12px; background: var(--surface-2, rgba(0,0,0,0.04)); border-radius: 8px; font-size: 0.9rem; flex-wrap: wrap; }
.host-edit { display: inline; }
.host-edit summary { list-style: none; cursor: pointer; }
.host-edit summary::-webkit-details-marker { display: none; }
.host-form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; padding: 8px; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 6px; min-width: 280px; }
.host-form select[multiple] { min-width: 260px; padding: 4px 8px; }
.host-form select { padding: 4px 8px; }

/* Account / password change */
.stacked-form { display: flex; flex-direction: column; gap: 12px; }
.stacked-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.stacked-form input[type="password"] { padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; font-size: 1rem; }
.flash { padding: 10px 12px; border-radius: 6px; margin: 0 0 12px; font-size: 0.95rem; }
.flash.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Pending invitations */
.user-pill.pending { opacity: 0.7; border: 1px dashed var(--border, #d1d5db); }
.badge.pending { background: #fef3c7; color: #92400e; }
.invites-block { border: 1px solid #fde68a; background: #fffbeb; border-radius: 8px; padding: 12px 16px; }
.invites-block table { background: transparent; }

/* Onboarding gate */
.onboarding-body { background: #f3f4f6; }
.onboarding-wrap { display:flex; align-items:flex-start; justify-content:center; min-height:80vh; padding:3rem 1rem; }
.onboarding-card { background:#fff; padding:2rem 2rem; border-radius:12px; border:1px solid #e5e7eb; max-width:440px; width:100%; box-shadow:0 1px 3px rgba(0,0,0,0.05); }
.onboarding-card h1 { margin-top:0; }

/* ---------- Email preview modal ---------- */
dialog.preview-modal {
  width: min(880px, 96vw);
  height: min(86vh, 900px);
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  overflow: hidden;
  background: #fff;
}
dialog.preview-modal::backdrop {
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(2px);
}
.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.preview-modal #preview-email-frame,
.preview-modal #preview-thanks-frame {
  display: block;
  width: 100%;
  height: calc(100% - 49px);
  border: 0;
  background: #fff;
}

/* Invite link display: code on the left, copy button on the right */
.invite-link-flash { display: flex; flex-direction: column; gap: 8px; }
.invite-link-help { font-size: 0.9em; }
.invite-link-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.invite-link-code {
  flex: 1 1 320px;
  min-width: 0;
  background: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  display: flex;
  align-items: center;
}
.invite-link-row .btn { flex: 0 0 auto; white-space: nowrap; }
.btn.accent.copied {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
