:root {
  --navy: #12263a;
  --navy-2: #193a50;
  --teal: #007c78;
  --teal-dark: #006763;
  --mint: #dff3ed;
  --cream: #f6f4ef;
  --paper: #ffffff;
  --ink: #17232e;
  --muted: #687782;
  --line: #dfe5e7;
  --warning: #9a5b00;
  --warning-bg: #fff2d8;
  --danger: #9e3e3e;
  --success: #167052;
  --shadow: 0 20px 60px rgba(14, 35, 49, .14);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(0,124,120,.28);
  outline-offset: 2px;
}

.prototype-bar {
  min-height: 36px;
  padding: 8px 22px;
  background: var(--warning-bg);
  color: #6f4809;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-bottom: 1px solid #ecd39e;
}
.prototype-bar strong { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

.app-shell[hidden], .access-gate[hidden] { display: none !important; }
.access-gate {
  min-height: calc(100vh - 36px);
  padding: 48px 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(168,225,211,.34), transparent 33%),
    radial-gradient(circle at 88% 82%, rgba(18,38,58,.09), transparent 35%),
    var(--cream);
}
.access-card {
  width: min(100%, 520px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.access-brand { display: flex; align-items: center; gap: 12px; color: var(--navy); margin-bottom: 34px; }
.access-brand b, .access-brand small { display: block; }
.access-brand b { font-family: Newsreader, serif; font-size: 22px; line-height: 1; }
.access-brand small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.access-card h1 { margin: 5px 0 12px; font-family: Newsreader, serif; font-size: clamp(32px, 7vw, 43px); letter-spacing: -.025em; }
.access-card .access-intro { color: var(--muted); line-height: 1.6; margin: 0 0 22px; }
.access-card .field input { background: #fff; }
.access-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0; }
.loading-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 6px rgba(0,124,120,.12); }
.access-result { border-radius: 13px; padding: 17px 18px; margin: 20px 0; line-height: 1.55; }
.access-result.denied { background: #fff0ee; border: 1px solid #efcbc5; color: #74372f; }
.access-result.error { background: var(--warning-bg); border: 1px solid #ecd39e; color: #6f4809; }
.access-result strong { display: block; margin-bottom: 4px; color: inherit; }
.access-help { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }

.app-shell { min-height: calc(100vh - 36px); display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 36px);
  position: sticky;
  top: 0;
  height: calc(100vh - 36px);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; padding: 0 8px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--navy); background: #a8e1d3; font-weight: 800; letter-spacing: -.05em;
}
.brand b, .brand small { display: block; }
.brand b { font-family: Newsreader, serif; font-size: 21px; line-height: 1; }
.brand small { color: #adc0cc; font-size: 10px; margin-top: 3px; letter-spacing: .02em; }
.event-switcher { margin: 31px 8px 22px; }
.event-switcher label { display: block; color: #91aab9; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 7px; }
.event-switcher select { width: 100%; background: #203d51; color: #fff; border: 1px solid #335268; border-radius: 9px; padding: 10px; }
.archived-toggle { width: 100%; margin-top: 8px; padding: 4px 2px; border: 0; background: transparent; color: #9bc8c1; text-align: left; font-size: 11px; font-weight: 600; }
.archived-toggle:hover { color: #fff; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  width: 100%; border: 0; color: #c4d1d9; background: transparent; text-align: left;
  padding: 10px 11px; border-radius: 9px; display: flex; align-items: center; gap: 11px;
}
.nav-item span { color: #82bdb4; width: 18px; text-align: center; }
.nav-item:hover, .nav-item.is-active { background: #244458; color: #fff; }
.sidebar-footer { margin-top: auto; padding: 20px 8px 0; border-top: 1px solid #2d485b; }
.sidebar-footer p { color: #8298a6; font-size: 10px; line-height: 1.45; margin: 9px 2px 0; }
.button-preview { width: 100%; }

.main-content { min-width: 0; }
.topbar {
  height: 88px; padding: 18px 34px; background: rgba(246,244,239,.95); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 8;
  backdrop-filter: blur(12px);
}
.topbar h1 { font-family: Newsreader, serif; margin: 1px 0 0; font-size: 29px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.save-state { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.save-state span { width: 7px; height: 7px; border-radius: 50%; background: #56a87f; }
.save-state.is-saving span { background: #d89b38; }
.staff-role-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.read-only-notice {
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid #c7deda;
  border-radius: 12px;
  background: #edf8f5;
  color: #285c56;
  font-size: 12px;
  line-height: 1.5;
}
.permission-disabled,
[aria-disabled="true"].permission-disabled {
  opacity: .48;
  cursor: not-allowed;
}
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #e0e8e8; display: grid; place-items: center; font-weight: 700; color: var(--navy); font-size: 12px; }
.icon-button { border: 0; background: transparent; padding: 7px; display: none; }
.view-container { padding: 30px 34px 60px; max-width: 1500px; margin: 0 auto; }

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 1px rgba(20,30,40,.02); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-header h2, .card-header h3, .card h2, .card h3 { margin: 0; }
.card h2 { font-family: Newsreader, serif; font-size: 24px; }
.card h3 { font-size: 15px; }
.card p { color: var(--muted); line-height: 1.55; }
.metric { position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -25px; top: -25px; width: 80px; height: 80px; border-radius: 50%; background: var(--mint); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-family: Newsreader, serif; font-size: 36px; margin: 9px 0 4px; }
.metric-note { color: var(--muted); font-size: 11px; }
.metric-note.up { color: var(--success); }
.section-gap { margin-top: 20px; }
.progress-track { height: 8px; background: #edf0ef; border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: inherit; }
.progress-labels { margin-top: 8px; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.mini-bars { display: grid; gap: 12px; margin-top: 18px; }
.mini-bar-row { display: grid; grid-template-columns: 110px 1fr 30px; gap: 12px; align-items: center; font-size: 11px; }
.mini-bar { height: 7px; background: #edf1f1; border-radius: 10px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: #79bcb0; border-radius: inherit; }
.analytics-heading { align-items: center; }
.analytics-summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.analytics-summary span { min-width: 78px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 9px; text-align: center; text-transform: uppercase; letter-spacing: .04em; background: #fbfcfb; }
.analytics-summary b { display: block; color: var(--navy); font-family: Newsreader, serif; font-size: 19px; line-height: 1.05; text-transform: none; letter-spacing: 0; }
.trend-chart-wrap { width: 100%; }
.trend-chart { display: block; width: 100%; height: auto; overflow: visible; }
.trend-grid line { stroke: #e7eceb; stroke-width: 1; }
.trend-grid text, .trend-axis-labels text { fill: var(--muted); font-size: 10px; font-family: Inter, sans-serif; }
.trend-area { fill: rgba(0, 124, 120, .09); }
.trend-line { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-markers circle { fill: #fff; stroke: var(--teal); stroke-width: 2; }
.trend-bars rect { fill: #9edbd0; }
.chart-legend { display: flex; gap: 18px; align-items: center; justify-content: flex-end; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 16px; }
.legend-line { height: 3px; border-radius: 3px; background: var(--teal); }
.legend-bar { height: 8px; border-radius: 2px; background: #9edbd0; }
.analytics-breakdown { display: grid; gap: 18px; }
.analytics-breakdown > div { padding-top: 16px; border-top: 1px solid #edf0f1; }
.analytics-breakdown > div:first-child { padding-top: 0; border-top: 0; }
.analytics-breakdown h3 { margin-bottom: 11px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.compact-bars { margin-top: 0; gap: 9px; }
.compact-bars .mini-bar-row { grid-template-columns: minmax(95px, 1.4fr) minmax(55px, 1fr) 25px; gap: 8px; }
.analytics-empty { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.analytics-empty span { font-size: 30px; color: var(--teal); }
.analytics-empty h3 { margin: 8px 0 0; color: var(--navy); }
.analytics-empty p, .analytics-empty-copy { margin: 5px 0 0; font-size: 11px; color: var(--muted); }

.button { border: 1px solid transparent; background: var(--teal); color: #fff; padding: 10px 15px; border-radius: 9px; font-weight: 600; font-size: 12px; }
.button:hover { background: var(--teal-dark); }
.button.secondary { color: var(--navy); background: #fff; border-color: #cfdadd; }
.button.secondary:hover { background: #f5f8f7; }
.button.ghost { background: transparent; color: var(--teal); border-color: transparent; }
.button.danger { background: #fff; color: var(--danger); border-color: #e3c8c8; }
.button.small { padding: 7px 10px; font-size: 11px; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.confirmed, .status.ready { color: #126848; background: #dff3e9; }
.status.awaiting, .status.todo { color: #8b590e; background: #fff0d2; }
.status.invited { color: #4f6380; background: #e9edf4; }
.status.cancelled, .status.blocked { color: #994343; background: #f8e3e3; }
.status.connected { color: #126848; background: #dff3e9; }
.status.simulated { color: #755389; background: #efe6f4; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search input { min-width: 230px; padding-left: 32px; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 8px; color: var(--muted); }
.directory-result-count { margin: -5px 0 12px; color: var(--muted); font-size: 11px; }
.duplicate-rule { margin-bottom: 14px; }
.table-subline { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.directory-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.possible-match-list { display: grid; gap: 9px; }
.possible-match-list article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.possible-match-list strong, .possible-match-list span { display: block; }
.possible-match-list span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 11px 10px; border-bottom: 1px solid var(--line); }
td { padding: 14px 10px; border-bottom: 1px solid #edf0f1; vertical-align: middle; }
tbody tr:hover { background: #fbfcfb; }
.person { display: flex; gap: 10px; align-items: center; }
.person-initials { width: 31px; height: 31px; border-radius: 50%; background: var(--mint); color: var(--teal-dark); display: grid; place-items: center; font-weight: 700; font-size: 10px; }
.person b, .person small { display: block; }
.person small { color: var(--muted); margin-top: 2px; }
.link-button { border: 0; background: transparent; color: var(--teal); padding: 0; font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label, fieldset legend { color: #34444e; font-size: 11px; font-weight: 700; }
.field small { color: var(--muted); font-size: 10px; line-height: 1.45; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cad5d9; border-radius: 8px; padding: 10px 11px; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--teal); }
fieldset { border: 0; padding: 0; margin: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { border: 1px solid #d4dddf; border-radius: 9px; padding: 9px 11px; display: flex; align-items: center; gap: 7px; font-size: 12px; }
.export-filter-choice { align-self: end; min-height: 41px; }
.export-field-groups { display: grid; gap: 17px; }
.export-field-groups fieldset { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafcfb; }
.export-field-groups legend { padding: 0 6px; color: var(--navy); font-size: 12px; font-weight: 800; }
.export-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.export-field-grid .choice { background: #fff; }
.phone-group { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr); gap: 8px; }
.inline-callout { padding: 13px 15px; border-radius: 10px; background: #eef7f5; color: #285850; font-size: 12px; line-height: 1.5; border: 1px solid #d6ebe6; }
.edit-guide { margin-bottom: 20px; box-shadow: inset 4px 0 0 var(--teal); }
.warning-callout { background: var(--warning-bg); color: #684819; border-color: #ebd4a7; }
.danger-callout { background: #f9eaea; color: #7e3939; border-color: #ebcccc; }
.social-event-list { display: grid; gap: 14px; }
.social-event-card { border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: #fbfcfb; }
.social-event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.social-event-heading h3 { margin-top: 7px; }
.card-header.compact { align-items: end; }
.category-table { min-width: 1050px; }
.category-table td { min-width: 108px; }
.category-table td:first-child { min-width: 190px; }
.logo-upload { display: grid; gap: 12px; }
.logo-preview { min-height: 92px; border: 1px dashed #c6d2d6; border-radius: 11px; background: #f8faf9; display: grid; place-items: center; padding: 14px; color: var(--muted); font-size: 11px; text-align: center; }
.logo-preview img { display: block; max-width: 100%; max-height: 90px; object-fit: contain; }
.danger-text { color: var(--danger); }
.terms-box { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; border: 1px solid #d9dfe1; background: #fbfcfb; border-radius: 11px; padding: 15px; font-size: 12px; line-height: 1.55; }
.terms-box input { margin-top: 2px; }
.event-choice-list { display: grid; gap: 12px; }
.event-choice { border: 1px solid var(--line); border-radius: 11px; padding: 15px; background: #fff; }
.event-choice h4 { margin: 0 0 4px; font-size: 14px; }
.event-choice p { margin: 0 0 12px; font-size: 11px; color: var(--muted); }
.tab-row { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.is-active { color: var(--teal); border-color: var(--teal); font-weight: 700; }
.communication-heading { margin-bottom: 18px; align-items: center; }
.communication-heading h2 { margin: 0; font-family: Newsreader, serif; font-size: 26px; }
.communication-heading p { margin: 5px 0 0; color: var(--muted); }
.automation-master { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.automation-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.automation-rule { display: grid; grid-template-columns: 40px minmax(210px, 1.3fr) minmax(180px, 1fr) minmax(165px, .9fr) minmax(155px, .85fr) 184px; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.automation-rule:last-child { border-bottom: 0; }
.automation-rule.is-disabled { background: #f7f8f8; opacity: .68; }
.automation-copy strong, .automation-copy small { display: block; }
.automation-copy small { color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 4px; }
.automation-settings { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.automation-time-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.automation-time-pair span { color: var(--muted); font-size: 11px; }
.automation-summary span, .automation-summary strong { display: block; }
.automation-summary span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.automation-summary strong { font-size: 11px; line-height: 1.45; }
.automation-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.button.small { padding: 8px 9px; font-size: 10px; }
.automation-preview-list { display: grid; gap: 9px; margin-top: 15px; }
.automation-preview-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.automation-preview-item span { color: var(--muted); font-size: 11px; }
.field.compact { gap: 4px; }
.field.compact input, .field.compact select { padding: 8px 9px; font-size: 11px; }
.staff-alert { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.email-connection-grid { gap: 12px; }
.connection-fact { border: 1px solid var(--line); background: #f8faf9; border-radius: 11px; padding: 14px; }
.connection-fact span, .connection-fact strong { display: block; }
.connection-fact span { color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.connection-fact strong { font-size: 13px; }
.merge-library { display: grid; gap: 10px; max-height: 610px; overflow: auto; padding-right: 4px; }
.merge-library details { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.merge-library summary { cursor: pointer; padding: 11px 12px; font-size: 11px; font-weight: 800; color: var(--navy); }
.merge-group { display: grid; gap: 6px; padding: 0 9px 10px; }
.merge-token { border: 1px solid #d5dfe1; background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 9px; display: grid; gap: 3px; text-align: left; }
.merge-token:hover { border-color: #8bbdb5; background: #f3f9f7; }
.merge-token code { color: var(--teal-dark); font-size: 10px; overflow-wrap: anywhere; }
.merge-token small { color: var(--muted); font-size: 9px; }
.invitation-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.invitation-summary > div { border: 1px solid var(--line); background: #f8faf9; border-radius: 11px; padding: 14px; }
.invitation-summary strong, .invitation-summary span { display: block; }
.invitation-summary strong { font-family: Newsreader, serif; font-size: 26px; }
.invitation-summary span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.recipient-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.recipient-list div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 11px; }
.recipient-list div:last-child { border-bottom: 0; }
.recipient-list span { color: var(--muted); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 21px 0; }

.question-list { display: grid; gap: 10px; }
.question-row { border: 1px solid var(--line); border-radius: 11px; padding: 13px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 11px; background: #fff; }
.question-row .handle { color: #a1aeb3; cursor: grab; }
.question-row b, .question-row small { display: block; }
.question-row small { color: var(--muted); margin-top: 3px; }
.tag { display: inline-flex; margin-left: 7px; background: #edf2f2; color: #52636d; border-radius: 5px; padding: 2px 5px; font-size: 9px; font-weight: 600; }
.tag.required { background: #f9e4e4; color: #8f4444; }
.toggle { position: relative; width: 38px; height: 21px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #cbd5d8; border-radius: 20px; transition: .2s; }
.toggle span::after { content: ""; width: 15px; height: 15px; background: #fff; position: absolute; top: 3px; left: 3px; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--teal); }
.toggle input:checked + span::after { transform: translateX(17px); }

.integration-list { display: grid; gap: 10px; }
.integration { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.integration-icon { width: 40px; height: 40px; border-radius: 10px; background: #eef3f3; display: grid; place-items: center; font-weight: 800; color: var(--navy); }
.integration h3, .integration p { margin: 0; }
.integration p { font-size: 11px; margin-top: 3px; }
.database-connection-card { margin-bottom: 20px; border-color: #b9dcd4; box-shadow: inset 4px 0 0 var(--teal); }
.database-connection-card .card-header { margin-bottom: 8px; }
.database-connection-card .card-header p { margin: 6px 0 0; }
.database-connection-card > p { margin: 8px 0; }
.copy-field { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #cad5d9; background: #f8faf9; border-radius: 8px; }
.copy-field code { flex: 1; overflow-wrap: anywhere; color: var(--teal-dark); }
.checklist { display: grid; gap: 0; }
.check-item { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 24px 1fr auto; gap: 11px; align-items: start; }
.check-item:last-child { border-bottom: 0; }
.check-dot { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #e5f4ee; color: var(--success); font-weight: 700; font-size: 11px; }
.check-dot.todo { background: #fff0d4; color: var(--warning); }
.check-item b, .check-item small { display: block; }
.check-item small { color: var(--muted); margin-top: 4px; line-height: 1.45; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(8,24,36,.68); backdrop-filter: blur(3px); }
.modal { position: fixed; z-index: 31; background: #fff; box-shadow: var(--shadow); overflow: auto; }
.registration-modal { inset: 3vh 3vw; border-radius: 18px; }
body[data-delegate-access="true"] .registration-modal { inset: 36px 0 0; border-radius: 0; }
body[data-delegate-access="true"] .registration-modal .modal-close { display: none; }
body[data-delegate-access="true"] .modal-backdrop { background: var(--cream); backdrop-filter: none; }
.small-modal { width: min(600px, calc(100vw - 30px)); max-height: 88vh; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 17px; padding: 27px; }
.small-modal.wide-modal { width: min(1120px, calc(100vw - 30px)); }
.modal-close { position: absolute; z-index: 4; right: 17px; top: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #38505e; background: rgba(255,255,255,.85); font-size: 24px; line-height: 1; }
body.modal-open { overflow: hidden; }
.code-editor { min-height: 330px; padding: 16px; border-color: #273f50; background: #102333; color: #e7f2f3; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; tab-size: 2; white-space: pre; overflow: auto; }
.code-editor:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,140,132,.15); }
.email-preview-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.email-preview-meta > div { min-width: 0; padding: 12px 14px; background: #f8faf9; }
.email-preview-meta small, .email-preview-meta strong { display: block; }
.email-preview-meta small { margin-bottom: 4px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.email-preview-meta strong { overflow-wrap: anywhere; font-size: 12px; }
.email-preview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .9fr); gap: 22px; align-items: start; }
.email-preview-label { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.email-preview-frame { display: block; width: 100%; height: 570px; border: 1px solid #c9d4d8; border-radius: 10px; background: #eef2f3; }
.mobile-email-shell { width: min(100%, 390px); margin: 0 auto; padding: 10px; border-radius: 22px; background: #172c3d; box-shadow: 0 12px 30px rgba(13,35,50,.16); }
.email-preview-frame.mobile { height: 550px; border: 0; border-radius: 13px; background: #fff; }
.registration-layout { min-height: 100%; display: grid; grid-template-columns: 40% 60%; }
.registration-hero { background: var(--event-primary, var(--navy)); color: #fff; padding: 56px 50px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.registration-hero::after { content: ""; position: absolute; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -220px; bottom: -170px; box-shadow: 0 0 0 80px rgba(255,255,255,.03), 0 0 0 160px rgba(255,255,255,.02); }
.event-wordmark { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #b6d6d0; }
.event-logo { display: block; max-width: 230px; max-height: 110px; object-fit: contain; object-position: left center; margin-bottom: 22px; background: rgba(255,255,255,.94); border-radius: 10px; padding: 10px; }
.registration-hero h2 { font-family: Newsreader, serif; font-size: clamp(40px, 5vw, 68px); margin: auto 0 18px; max-width: 500px; line-height: .98; }
.registration-hero p { color: #d1dee4; max-width: 470px; line-height: 1.65; }
.event-meta { display: flex; gap: 24px; margin-top: 25px; font-size: 12px; }
.event-meta span { display: block; color: #a9bdc8; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.registration-panel { padding: 48px 56px; overflow: auto; }
.registration-panel-inner { max-width: 690px; margin: 0 auto; }
.registration-panel h1 { font-family: Newsreader, serif; font-size: 34px; margin: 0 0 8px; }
.registration-panel > div > p { color: var(--muted); line-height: 1.6; }
.steps { display: flex; align-items: center; gap: 5px; margin: 24px 0 30px; }
.step { display: flex; align-items: center; gap: 6px; color: #9aa6ac; font-size: 10px; white-space: nowrap; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #ccd5d8; display: grid; place-items: center; font-style: normal; }
.step.is-active { color: var(--teal); font-weight: 700; }
.step.is-active i, .step.is-done i { color: #fff; background: var(--event-accent, var(--teal)); border-color: var(--event-accent, var(--teal)); }
.step-line { flex: 1; height: 1px; min-width: 10px; background: #dfe5e7; }
.registration-form h3 { font-family: Newsreader, serif; font-size: 24px; margin: 0 0 6px; }
.registration-form .intro { color: var(--muted); font-size: 12px; margin: 0 0 21px; }
.form-actions { margin-top: 27px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-summary { background: #f4f8f7; border-radius: 12px; padding: 17px; }
.price-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #dbe7e4; font-size: 12px; }
.price-row:last-child { border-bottom: 0; font-weight: 800; font-size: 15px; }
.success-screen { text-align: center; padding: 55px 20px; }
.success-mark { width: 65px; height: 65px; border-radius: 50%; background: var(--mint); color: var(--success); display: grid; place-items: center; margin: 0 auto 22px; font-size: 30px; }
.success-mark.error-mark { background: #fbe9e6; color: var(--danger); }
.success-screen h3 { font-size: 32px; }
.muted { color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
[hidden] { display: none !important; }

@media (max-width: 1050px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .automation-rule { grid-template-columns: 40px 1fr 1fr; }
  .automation-copy { grid-column: span 2; }
  .automation-row-actions { grid-column: 2 / -1; }
  .registration-layout { grid-template-columns: 34% 66%; }
  .registration-hero { padding: 45px 30px; }
  .registration-panel { padding: 45px 35px; }
  .email-preview-grid { grid-template-columns: 1fr; }
  .mobile-email-shell { margin-left: 0; }
}
@media (max-width: 780px) {
  .prototype-bar { text-align: center; flex-direction: column; gap: 2px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; width: 260px; height: 100vh; transform: translateX(-105%); transition: .25s; box-shadow: var(--shadow); z-index: 20; }
  .sidebar.open { transform: translateX(0); }
  .icon-button { display: block; }
  .topbar { padding: 16px 20px; }
  .view-container { padding: 22px 17px 50px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .registration-modal { inset: 0; border-radius: 0; }
  body[data-delegate-access="true"] .registration-modal { inset: 54px 0 0; }
  .registration-layout { display: block; }
  .registration-hero { min-height: 290px; padding: 35px 24px; }
  .registration-hero h2 { margin: 75px 0 10px; font-size: 42px; }
  .registration-panel { padding: 35px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .phone-group { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .steps .step span { display: none; }
  .invitation-summary { grid-template-columns: 1fr; }
  .recipient-list div { display: grid; gap: 3px; }
  .automation-rule { grid-template-columns: 36px 1fr; }
  .automation-rule .automation-copy, .automation-rule .automation-summary, .automation-rule .automation-row-actions { grid-column: 2 / -1; }
  .automation-time-pair { grid-template-columns: 1fr; }
  .small-modal.wide-modal { width: calc(100vw - 20px); padding: 22px 18px; }
  .email-preview-meta { grid-template-columns: 1fr; }
  .email-preview-frame { height: 500px; }
  .export-field-grid { grid-template-columns: 1fr; }
  .analytics-heading { display: block; }
  .analytics-summary { justify-content: flex-start; margin-top: 14px; }
  .analytics-summary span { flex: 1; }
  .trend-chart { min-width: 620px; }
  .trend-chart-wrap { overflow-x: auto; padding-bottom: 6px; }
}
@media (max-width: 500px) {
  .grid-4 { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 24px; }
  .save-state { display: none; }
  .event-meta { flex-direction: column; gap: 9px; }
  .toolbar-left, .toolbar-right, .toolbar .button, .search, .search input { width: 100%; }
}
