/* =====================================================
   BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.011em; }
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.display { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.02em; }
[data-theme="neochurch"] .page-head h1.display { font-size: 36px; }
p  { margin: 0; }
a, button { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; flex-shrink: 0; }
::selection { background: var(--accent-soft); color: var(--text); }
.muted { color: var(--text-3); }
.ta-c { text-align: center; }

/* =====================================================
   APP SHELL
   ===================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: var(--sp-4) var(--sp-3);
  gap: var(--sp-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.brand:hover { background: var(--surface-2); }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  background: #000;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.brand-mark svg { width: 24px; height: 27px; }
.brand-text { flex: 1; min-width: 0; }
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub  { font-size: 11px; color: var(--text-3); }
.brand-switch {
  width: 24px; height: 24px;
  border-radius: var(--r-1);
  color: var(--text-3);
  display: grid; place-items: center;
}
.brand-switch:hover { background: var(--line); color: var(--text); }
.brand-switch svg { width: 12px; height: 12px; }

.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--text-3);
  font-size: 13px;
  text-align: left;
  transition: all var(--dur-1) var(--ease);
}
.search-trigger:hover {
  border-color: var(--line-strong);
  color: var(--text-2);
}
.search-trigger svg { width: 14px; height: 14px; }
.search-trigger span { flex: 1; }
.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow-y: auto;
  margin: 0 calc(var(--sp-3) * -1);
  padding: 0 var(--sp-3);
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--sp-2) var(--sp-3) 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 7px var(--sp-3);
  border-radius: var(--r-2);
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-item svg { width: 16px; height: 16px; color: var(--text-3); transition: color var(--dur-1) var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.nav-item.active svg { color: var(--accent); }
.nav-item span:first-of-type { flex: 1; }
.nav-count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count { background: var(--accent-soft); color: var(--accent); }

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.build-version {
  font-size: 10.5px;
  color: var(--text-3);
  text-align: center;
  padding: 0;
  letter-spacing: 0.03em;
  user-select: none;
}
.theme-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--dur-1) var(--ease);
}
.theme-pill:hover { border-color: var(--line-strong); color: var(--text); }
.theme-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
.theme-name { flex: 1; text-align: left; }
.theme-pill svg { width: 12px; height: 12px; color: var(--text-3); }

.topbar-profile-wrap { position: relative; }
.topbar-profile-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-2) 5px 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: left;
  transition: all var(--dur-1) var(--ease);
  cursor: pointer;
  max-width: 200px;
}
.topbar-profile-pill:hover { border-color: var(--line-strong); background: var(--surface-3); }
.topbar-profile-pill .avatar { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-mail { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  display: inline-grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: white;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
/* (Photo-override rule below the data-color rules, see end of avatar block) */
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar[data-color="violet"]  { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.avatar[data-color="indigo"]  { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.avatar[data-color="emerald"] { background: linear-gradient(135deg, #6ee7b7, #059669); }
.avatar[data-color="amber"]   { background: linear-gradient(135deg, #fcd34d, #d97706); }
.avatar[data-color="rose"]    { background: linear-gradient(135deg, #fda4af, #e11d48); }
.avatar[data-color="cyan"]    { background: linear-gradient(135deg, #67e8f9, #0891b2); }
.avatar[data-color="pink"]    { background: linear-gradient(135deg, #f9a8d4, #db2777); }
.avatar[data-color="sky"]     { background: linear-gradient(135deg, #7dd3fc, #0284c7); }
.avatar[data-color="slate"]   { background: linear-gradient(135deg, #94a3b8, #475569); }

/* Photo override — declared last so it beats every data-color rule on equal specificity */
.avatar[data-photo] {
  background-image: var(--photo) !important;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
  text-indent: -9999px;
}

/* =====================================================
   MAIN
   ===================================================== */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
}
.crumb { color: var(--text-3); }
.crumb.current { color: var(--text); font-weight: 500; }
.crumb-sep { color: var(--text-3); opacity: .5; }
.topbar-spacer { flex: 1; }
.topbar-divider { width: 1px; height: 18px; background: var(--line); margin: 0 var(--sp-1); }

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  color: var(--text-2);
  position: relative;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.theme-toggle {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-2);
  color: var(--text-2);
  position: relative;
  transition: background var(--dur-1) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .sun { display: block; }
.theme-toggle .moon { display: none; }
[data-theme="eclipse"] .theme-toggle .sun,
[data-theme="midnight"] .theme-toggle .sun { display: none; }
[data-theme="eclipse"] .theme-toggle .moon,
[data-theme="midnight"] .theme-toggle .moon { display: block; }

.page-wrap {
  padding: var(--sp-7) var(--sp-7) var(--sp-9);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page { display: flex; flex-direction: column; gap: var(--sp-6); animation: fadeUp var(--dur-3) var(--ease); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.page-head h1 { font-size: 28px; letter-spacing: -0.025em; }
.page-sub {
  color: var(--text-3);
  margin-top: var(--sp-1);
  font-size: 14px;
}
.page-actions { display: flex; gap: var(--sp-2); align-items: center; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--sp-3);
  height: 34px;
  border-radius: var(--r-2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--dur-1) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-sm { height: 28px; padding: 0 var(--sp-2); font-size: 12.5px; border-radius: var(--r-1); }
.btn-block { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { filter: brightness(0.95); transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-ring); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }

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

.btn-link {
  background: transparent;
  color: var(--accent);
  padding: 0;
  height: auto;
}
.btn-link:hover { text-decoration: underline; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.card.no-pad { padding: 0; }
.card.danger { border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.card-title { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* Person detail cards: tighter head + less padding */
.pd-col-main .card, .pd-col-side .card { padding: var(--sp-4); }
.pd-col-main .card-head, .pd-col-side .card-head { margin-bottom: var(--sp-3); }

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* =====================================================
   STATS
   ===================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.stat-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.stat-unit { font-size: 14px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.stat-trend {
  margin-top: var(--sp-3);
  height: 30px;
  color: var(--accent);
}
.spark { width: 100%; height: 100%; }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-1);
  letter-spacing: -0.005em;
}
.badge-pos { color: var(--pos); background: var(--pos-soft); }
.badge-neg { color: var(--neg); background: var(--neg-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }

/* =====================================================
   CHART
   ===================================================== */
.chart { height: 220px; width: 100%; }
.chart-svg { width: 100%; height: 100%; }
.grid-lines line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }

/* =====================================================
   ROLE LIST
   ===================================================== */
.roleslist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.roleslist li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  font-size: 13px;
}
.roleslist .dot { width: 8px; height: 8px; border-radius: 50%; }
.roleslist b { font-variant-numeric: tabular-nums; font-weight: 600; }
.roleslist .bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: block;
}
.roleslist .bar i { display: block; height: 100%; border-radius: 999px; }

/* =====================================================
   TIMELINE
   ===================================================== */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.timeline-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--sp-3);
  align-items: start;
  font-size: 13px;
}
.timeline-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.timeline-icon svg { width: 14px; height: 14px; }
.timeline-body { min-width: 0; }
.timeline-body strong { font-weight: 600; }
.timeline-body .ti-meta { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.timeline-time { color: var(--text-3); font-size: 12px; white-space: nowrap; }

.timeline-lg { gap: var(--sp-5); }
.timeline-lg .timeline-item {
  padding: var(--sp-4);
  border-radius: var(--r-2);
  background: var(--surface);
  border: 1px solid var(--line);
}

/* =====================================================
   QUICK ACTIONS
   ===================================================== */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.quick-item {
  --qa-tint: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-align: left;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.quick-item::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--qa-tint) 14%, transparent), transparent 55%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.quick-item:hover {
  border-color: color-mix(in srgb, var(--qa-tint) 60%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--qa-tint) 50%, transparent);
}

/* Role account cards */
.role-account-card {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface-2);
  transition: box-shadow var(--dur-1);
}
.role-account-card:hover {
  box-shadow: 0 4px 20px -6px color-mix(in srgb, var(--ra-color) 30%, transparent);
}
.role-account-top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.role-account-label {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
}
.role-account-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}
.role-account-creds {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-3);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.role-account-email {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-account-pw { color: var(--text-2); }
.role-account-pw code {
  font-family: var(--font-mono, monospace);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
.role-account-btn {
  width: 100%;
  justify-content: center;
  font-size: 13px;
  padding: 7px 12px;
}

/* Clean data rules */
.clean-rule {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.clean-rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
}
/* typeahead dropdown used in link-families */
.typeahead-list {
  position: absolute;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  margin: 2px 0 0;
  padding: 4px 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.typeahead-list li {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-1);
}
.typeahead-list li:hover { background: var(--surface-2); }
.typeahead-list li .ta-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.quick-item:hover::after { opacity: 1; }
.quick-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--qa-tint) 16%, var(--surface-2));
  display: grid; place-items: center;
  color: var(--qa-tint);
  flex-shrink: 0;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.quick-icon svg { width: 28px; height: 28px; }
.quick-item:hover .quick-icon {
  background: color-mix(in srgb, var(--qa-tint) 28%, var(--surface-2));
  transform: scale(1.04);
}
.quick-item > div { min-width: 0; }
.quick-item strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.quick-item small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .quick { grid-template-columns: 1fr; }
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.input-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  flex: 1;
  max-width: 360px;
  transition: all var(--dur-1) var(--ease);
}
.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.input-group svg { width: 14px; height: 14px; color: var(--text-3); }
.input-group input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  min-width: 0;
}
.input-group input::placeholder { color: var(--text-3); }
.input-group kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
}

.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-spacer { flex: 1; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--sp-3);
  height: 30px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all var(--dur-1) var(--ease);
}
.chip:hover { border-color: var(--line-strong); }
.chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.chip-count {
  font-size: 11px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-3);
}
.chip.active .chip-count { background: rgba(255,255,255,.18); color: inherit; }

/* Toolbar dropdown (e.g. People & Access status filter) — sized to match chips */
.toolbar-select {
  height: 30px;
  padding: 0 28px 0 var(--sp-3);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color-scheme: dark;
  transition: all var(--dur-1) var(--ease);
}
.toolbar-select:hover { border-color: var(--line-strong); }
.toolbar-select:focus { outline: none; border-color: var(--accent); }

/* =====================================================
   TABLE
   ===================================================== */
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - var(--topbar-h) - 220px); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table thead th.sortable { cursor: pointer; }
.table thead th.sortable:hover { color: var(--text); }
.sort-ic { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.table thead th.sortable:hover .sort-ic,
.table thead th.sortable.active .sort-ic { opacity: 1; }
.table thead th.sortable.desc .sort-ic { transform: rotate(180deg); }
.th-check { width: 36px; vertical-align: middle; }
.th-actions { width: 32px; }
.table tbody td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--dur-1) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.selected { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: 0; }

.cell-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
/* Give the photo / avatar more room in table user cells. */
.cell-user .avatar,
.cell-user > img,
.cell-user .av {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cell-user-meta { min-width: 0; }
.cell-user-name { font-weight: 500; font-size: 13.5px; }
.cell-user-mail { font-size: 12px; color: var(--text-3); }

/* ── People group tabs ───────────────────────────────────────── */
.people-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 0;
  padding: 0 2px;
}
.people-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  white-space: nowrap;
}
.people-tab:hover { color: var(--text); }
.people-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.people-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  transition: background var(--dur-1), color var(--dur-1);
}
.people-tab.active .people-tab-count {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

.leader-role-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}

/* Role-specific colour overrides for leader-role-badge */
.leader-role-badge.status-super       { background: rgba(239,68,68,.15);  color: #ef4444; }
.leader-role-badge.status-site_admin  { background: rgba(249,115,22,.15); color: #f97316; }
.leader-role-badge.status-staff       { background: rgba(139,92,246,.15); color: #8b5cf6; }
.leader-role-badge.status-leader      { background: rgba(59,130,246,.15); color: #3b82f6; }
.leader-role-badge.status-volunteer   { background: rgba(16,185,129,.15); color: #10b981; }
.leader-role-badge.status-member      { background: rgba(107,114,128,.15); color: #6b7280; }
.leader-role-badge.status-visitor     { background: rgba(156,163,175,.15); color: #9ca3af; }

/* "No login" inline badge in cell-user-name */
.ua-no-login {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Enable login button (the + icon in users table) */
.row-imp.ua-enable-login {
  color: var(--accent);
  opacity: 0.7;
}
.row-imp.ua-enable-login:hover { opacity: 1; }

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.role-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.role-Admin::before    { background: var(--accent); }
.role-Manager::before  { background: #60a5fa; }
.role-Member::before   { background: #34d399; }
.role-Guest::before    { background: #fbbf24; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-active    { background: var(--pos-soft); color: var(--pos); }
.status-active::before { background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 25%, transparent); }
.status-invited   { background: var(--warn-soft); color: var(--warn); }
.status-invited::before { background: var(--warn); }
.status-suspended { background: var(--neg-soft); color: var(--neg); }
.status-suspended::before { background: var(--neg); }

.row-action {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--r-1);
  color: var(--text-3);
}
.row-action:hover { background: var(--surface); color: var(--text); }

/* checkbox */
input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  background: var(--surface);
  transition: all var(--dur-1) var(--ease);
  vertical-align: middle;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 2px;
  width: 5px; height: 9px;
  border: solid var(--text-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.empty {
  padding: var(--sp-9) var(--sp-6);
  text-align: center;
  color: var(--text-3);
}
.empty-ic {
  width: 48px; height: 48px;
  margin: 0 auto var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  display: grid; place-items: center;
}
.empty-ic svg { width: 22px; height: 22px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 12.5px;
}
.pager { display: flex; align-items: center; gap: var(--sp-2); }

/* ── Bulk action bar ─────────────────────────────────────────── */
.bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.bulk-bar:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.bulk-bar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding-right: var(--sp-3);
  border-right: 1px solid var(--line);
}
.bulk-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bulk-bar-label {
  font-size: 12px;
  color: var(--text-3);
  margin-right: 2px;
}
.bulk-bar-danger { color: var(--danger, #ef4444) !important; }
.bulk-bar-clear {
  margin-left: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--text-3);
  transition: background var(--dur-1);
}
.bulk-bar-clear:hover { background: var(--surface-2); color: var(--text); }

/* ── Audit log filter bar ── */
.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--sp-4);
}
/* Expandable audit rows */
.audit-row { cursor: pointer; }
.audit-row:hover td { background: color-mix(in srgb, var(--text) 4%, transparent); }
.audit-row.is-open td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.audit-dur { margin-left: 8px; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.audit-detail > td { background: var(--surface-2); padding: var(--sp-3) var(--sp-4) !important; border-top: 0; }
.audit-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 20px; margin-bottom: 10px; }
.audit-kv { display: flex; gap: 8px; font-size: 12px; min-width: 0; }
.audit-kv-k { flex: 0 0 84px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; padding-top: 1px; }
.audit-kv-v { color: var(--text); word-break: break-word; min-width: 0; }
.audit-block { margin-top: 8px; }
.audit-block .audit-kv-k { display: block; margin-bottom: 4px; }
.audit-pre {
  margin: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; color: var(--text-2);
}

/* =====================================================
   TEAMS
   ===================================================== */
.teamgrid,
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: var(--sp-4);
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-1) var(--ease);
  cursor: pointer;
  overflow: hidden;
}
.team-banner {
  margin: calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5)) 0;
  height: 140px;
  overflow: hidden;
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.team-banner img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.team-card:hover .team-banner img { transform: scale(1.04); }
.team-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.team-head { display: flex; align-items: center; gap: var(--sp-3); }
.team-emoji {
  width: 40px; height: 40px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 20px;
}
.team-name { font-weight: 600; font-size: 14.5px; }
.team-meta { color: var(--text-3); font-size: 12.5px; }
.team-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

/* Pro list-style team cards */
.team-card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-4);
  align-items: stretch;
  padding: var(--sp-4);
}
.team-card-row .team-row-main {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--sp-4);
  align-items: start;
  min-width: 0;
}
.team-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--r-2);
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.team-thumb-emoji {
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
}
.team-row-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.team-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.team-row-desc {
  font-size: 12.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.team-leaders { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.team-leader-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  max-width: 100%;
}
.team-leader-chip.is-primary {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}
.team-leader-chip img,
.team-leader-chip .team-leader-initials {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 600; color: var(--text-2);
  flex-shrink: 0;
}
.team-leader-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.team-leader-badge {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
}
.team-row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
  flex-shrink: 0;
}
/* Campus allocation control on a team card */
.team-campus {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 8px 0 10px;
  height: 30px;
  border: 1px solid var(--line, #25252a);
  border-radius: 999px;
  background: var(--surface-2, #1d1d20);
  color: var(--text-2, #b8b9bf);
}
.team-campus svg { width: 13px; height: 13px; flex-shrink: 0; }
.team-campus-select {
  appearance: none; -webkit-appearance: none;
  border: none; background: transparent;
  color: var(--text, #f4f4f5);
  font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 0 2px; max-width: 160px;
  cursor: pointer; outline: none;
}
.team-campus-select option { color: #111; }
.team-unallocated .team-campus {
  border-color: color-mix(in srgb, var(--accent, #FFCC00) 50%, var(--line));
  background: color-mix(in srgb, var(--accent, #FFCC00) 10%, transparent);
  color: var(--accent, #FFCC00);
}
.team-badge-unalloc {
  display: inline-block; margin-left: 8px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent, #FFCC00);
  background: color-mix(in srgb, var(--accent, #FFCC00) 14%, transparent);
  vertical-align: middle;
}
@media (max-width: 720px) {
  .team-card-row { grid-template-columns: 1fr; }
  .team-card-row .team-row-main { grid-template-columns: 56px 1fr; }
  .team-thumb { width: 56px; height: 56px; }
  .team-row-actions { flex-direction: row; }
}
.avatar-stack { display: flex; }
.avatar-stack .avatar {
  width: 24px; height: 24px;
  font-size: 9.5px;
  border: 2px solid var(--surface);
  margin-left: -8px;
}
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more {
  width: 24px; height: 24px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  margin-left: -8px;
  border: 2px solid var(--surface);
}

/* =====================================================
   PERMISSIONS TABLE
   ===================================================== */
.perm-table tbody td { padding: var(--sp-3) var(--sp-4); }
.perm-cell-row { display: flex; flex-direction: column; }
.perm-name { font-weight: 500; font-size: 13.5px; }
.perm-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.perm-mark {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--r-1);
  margin: 0 auto;
}
.perm-mark.on { background: var(--pos-soft); color: var(--pos); }
.perm-mark.off { color: var(--text-3); opacity: .4; }
.perm-mark svg { width: 13px; height: 13px; }

/* =====================================================
   BILLING
   ===================================================== */
.plan-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.plan-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.plan-price { display: flex; align-items: baseline; gap: 4px; margin: var(--sp-3) 0; }
.plan-price span { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
.plan-price small { color: var(--text-3); font-size: 13px; }
.usage { display: flex; flex-direction: column; gap: var(--sp-4); }
.usage-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  align-items: center;
  gap: var(--sp-3);
  font-size: 13px;
}
.usage-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
.usage-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.usage-row .bar i { display: block; height: 100%; border-radius: 999px; }

/* =====================================================
   INTEGRATIONS
   ===================================================== */
.integrations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.intg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.intg-head { display: flex; align-items: center; gap: var(--sp-3); }
.intg-logo {
  width: 40px; height: 40px;
  border-radius: var(--r-2);
  display: grid; place-items: center;
  font-size: 18px;
  color: white;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.intg-logo svg { width: 100%; height: 100%; display: block; }
.intg-name { font-weight: 600; font-size: 14px; }
.intg-tag { font-size: 11.5px; color: var(--text-3); }
.intg-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.5; flex: 1; }
.intg-foot { display: flex; align-items: center; justify-content: space-between; }

/* ── Elvanto setup page ─────────────────────────────────── */
.elv-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--sp-5);
  align-items: start;
  margin-bottom: var(--sp-5);
}
@media (max-width: 860px) { .elv-layout { grid-template-columns: 1fr; } }

.elv-panel { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.elv-panel-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin: 0; }

.elv-fields { display: flex; flex-direction: column; gap: var(--sp-3); }
.elv-label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.elv-required { color: #dc2626; }
.elv-hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.elv-input { /* uses existing .elv-input */ }

.elv-conn-status { font-size: 13px; min-height: 20px; }
.elv-conn-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.elv-status-ok  { color: #4ade80; font-size: 13px; }
.elv-status-err { color: #f87171; font-size: 13px; }

.elv-sync-note { font-size: 12.5px; line-height: 1.5; margin: 0; }
.elv-sync-locked {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-3);
  padding: 12px; border-radius: var(--r-2);
  background: var(--surface-2); border: 1px dashed var(--line);
  margin-bottom: var(--sp-2);
}

.elv-section {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.elv-section + .elv-section { margin-top: var(--sp-3); }

.elv-section-head { display: flex; align-items: center; gap: 12px; }
.elv-section-icon {
  width: 38px; height: 38px; border-radius: var(--r-2);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.elv-section-name { font-size: 14px; font-weight: 600; }
.elv-section-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.elv-result { font-size: 13px; min-height: 20px; }

.elv-section-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Field mapping table */
.elv-mapping { padding: var(--sp-5); }
.elv-mapping .elv-panel-title { margin-bottom: var(--sp-4); }
.elv-map-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.elv-map-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 6px 12px; border-bottom: 1px solid var(--line); }
.elv-map-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); font-family: var(--font-mono, monospace); font-size: 12px; }
.elv-map-table td:nth-child(3) { font-family: inherit; color: var(--text-3); }
.elv-map-table tr:last-child td { border-bottom: none; }
.elv-map-table tr:hover td { background: var(--surface-2); }

/* Event landing-page builder */
.eb-page { padding: 0; }
.eb-topbar {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.eb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eb-title input { background: transparent; border: 0; outline: 0; font-size: 17px; font-weight: 600; color: var(--text); padding: 0; }
.eb-title input:focus { outline: 1px dashed var(--line); outline-offset: 4px; }
.eb-title small { color: var(--text-3); font-size: 11.5px; }
.eb-actions { display: flex; align-items: center; gap: 8px; }
.eb-shell {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 0;
  height: calc(100vh - 64px);
}
@media (max-width: 1100px) { .eb-shell { grid-template-columns: 220px 1fr 280px; } }
.eb-palette, .eb-settings {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: var(--sp-4);
  overflow-y: auto;
}
.eb-settings { border-right: 0; border-left: 1px solid var(--line); }
.eb-panel-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-3); text-transform: uppercase;
  margin-bottom: 10px;
}
.eb-block-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eb-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 12px;
  cursor: grab;
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.eb-pill:hover { border-color: var(--accent); transform: translateY(-1px); }
.eb-pill:active { cursor: grabbing; }
.eb-pill-ic { font-size: 16px; }

.eb-theme { display: flex; flex-direction: column; gap: 8px; }
.eb-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.eb-field > span { color: var(--text-3); font-size: 11px; }
/* Match all text-like inputs (bare <input> has no type attr; also email/date/
   time/number/etc.) — not just input[type="text"] — so none fall back to the
   browser's white default. Excludes color/checkbox/radio/range which style themselves. */
.eb-field input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.eb-field textarea, .eb-field select {
  padding: 7px 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  border-radius: 6px; font-size: 12.5px; font-family: inherit; outline: 0;
}
.eb-field input:focus, .eb-field textarea:focus, .eb-field select:focus { border-color: var(--accent); }
.eb-field input[type="color"] { height: 30px; width: 60px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 2px; cursor: pointer; }
.eb-field-toggle { flex-direction: row; align-items: center; justify-content: space-between; }

/* Canvas */
.eb-canvas {
  --eb-bg: #0a0a0a;
  --eb-text: #ffffff;
  --eb-accent: #FFCC00;
  background: var(--eb-bg);
  color: var(--eb-text);
  overflow-y: auto;
  padding: 28px;
}
.eb-canvas[data-font="modern"]     { font-family: 'Inter', system-ui, sans-serif; }
.eb-canvas[data-font="classic"]    { font-family: 'Playfair Display', Georgia, serif; }
.eb-canvas[data-font="editorial"]  { font-family: Georgia, serif; }
.eb-canvas-empty {
  display: grid; place-items: center;
  height: 100%;
  min-height: 200px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 12px;
}

.eb-block {
  position: relative;
  margin-bottom: 12px;
  border: 2px solid transparent;
  border-radius: 10px;
  transition: border-color var(--dur-1) var(--ease);
}
.eb-block:hover { border-color: rgba(255,255,255,0.15); }
.eb-block.is-selected { border-color: var(--eb-accent); }
.eb-block.is-drop-before::before,
.eb-block.is-drop-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--eb-accent); border-radius: 2px;
}
.eb-block.is-drop-before::before { top: -6px; }
.eb-block.is-drop-after::after   { bottom: -6px; }
.eb-block-handle {
  position: absolute; top: 8px; left: -28px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.7);
  border-radius: 4px;
  display: grid; place-items: center;
  cursor: grab; font-size: 10px;
  opacity: 0; transition: opacity var(--dur-1) var(--ease);
}
.eb-block:hover .eb-block-handle,
.eb-block.is-selected .eb-block-handle { opacity: 1; }
.eb-block-tools {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity var(--dur-1) var(--ease);
  z-index: 3;
}
.eb-block:hover .eb-block-tools,
.eb-block.is-selected .eb-block-tools { opacity: 1; }
.eb-block-tools button {
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: 0; border-radius: 4px;
  font-size: 12px; cursor: pointer;
}
.eb-block-tools button:hover { background: var(--eb-accent); color: #000; }

/* Block renders */
.eb-r-hero {
  position: relative;
  padding: 90px 40px;
  background-size: cover; background-position: center;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  min-height: 280px;
}
.eb-r-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--eb-accent); }
.eb-r-title   { font-size: 48px; line-height: 1; font-weight: 800; margin: 0; }
.eb-canvas[data-font="classic"] .eb-r-title { font-weight: 700; letter-spacing: -0.02em; }
.eb-r-sub     { font-size: 16px; opacity: 0.8; margin: 0; max-width: 60ch; }
.eb-r-cta {
  margin-top: 8px;
  padding: 12px 28px;
  background: var(--eb-accent); color: #000;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer;
}
.eb-r-text { padding: 24px 40px; font-size: 16px; line-height: 1.65; }
.eb-r-text p { margin: 0 0 0.9em; }
.eb-r-image { padding: 12px 40px; }
.eb-r-image img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 10px; display: block; }
.eb-r-image figcaption { font-size: 12px; opacity: 0.5; text-align: center; margin-top: 6px; }
.eb-r-image-empty { padding: 32px; border: 2px dashed rgba(255,255,255,0.15); border-radius: 10px; text-align: center; opacity: 0.5; font-size: 13px; }
.eb-r-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 12px 40px; }
.eb-r-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.eb-r-schedule { padding: 24px 40px; }
.eb-r-schedule h2 { font-size: 28px; margin: 0 0 14px; }
.eb-r-schedule ol { list-style: none; padding: 0; margin: 0; }
.eb-r-schedule li {
  display: grid; grid-template-columns: 100px 1fr; gap: 14px;
  padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.08);
}
.eb-r-schedule li:first-child { border-top: 0; }
.eb-r-when { color: var(--eb-accent); font-weight: 700; font-size: 13px; }
.eb-r-schedule p { margin: 4px 0 0; opacity: 0.7; font-size: 13px; }
.eb-r-speakers { padding: 24px 40px; }
.eb-r-speakers h2 { font-size: 28px; margin: 0 0 14px; }
.eb-r-speakers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.eb-r-speakers article { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 14px; border-radius: 10px; }
.eb-r-speakers img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 10px; }
.eb-r-speakers h3 { font-size: 15px; margin: 0; }
.eb-r-speakers article p { margin: 4px 0 0; font-size: 12.5px; opacity: 0.7; line-height: 1.5; }
.eb-r-cta-block { padding: 60px 40px; text-align: center; }
.eb-r-cta-block h2 { font-size: 36px; margin: 0 0 8px; }
.eb-r-cta-block p { font-size: 16px; opacity: 0.8; margin: 0 0 18px; }
.eb-r-video { padding: 12px 40px; }
.eb-r-video-frame { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 10px; overflow: hidden; }
.eb-r-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.eb-r-video figcaption { font-size: 12px; opacity: 0.5; margin-top: 6px; text-align: center; }
.eb-r-faq { padding: 24px 40px; }
.eb-r-faq h2 { font-size: 28px; margin: 0 0 14px; }
.eb-r-faq dl { margin: 0; }
.eb-r-faq dt { font-weight: 700; font-size: 15px; margin-top: 12px; }
.eb-r-faq dd { margin: 4px 0 0; opacity: 0.75; font-size: 14px; line-height: 1.55; }
.eb-r-location { padding: 24px 40px; }
.eb-r-location h2 { font-size: 28px; margin: 0 0 8px; }
.eb-r-addr { font-size: 14px; opacity: 0.7; margin: 0 0 12px; }
.eb-r-map { border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.eb-r-map iframe { width: 100%; height: 320px; border: 0; filter: invert(0.92) hue-rotate(180deg) saturate(0.6); }
.eb-r-divider { padding: 24px 40px; }
.eb-r-divider hr { border: 0; border-top: 1px solid rgba(255,255,255,0.15); margin: 0; }

.eb-canvas.eb-preview .eb-block-handle,
.eb-canvas.eb-preview .eb-block-tools { display: none !important; }
.eb-canvas.eb-preview .eb-block { border-color: transparent !important; }

/* Settings panel */
.eb-settings-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: var(--sp-5); }
.eb-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.eb-settings-body { display: flex; flex-direction: column; gap: 10px; }
.eb-list-row { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.eb-list-row-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-3); }
.eb-list-row-head button { background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 2px 6px; font-size: 11px; }
.eb-list-row-head button:hover { color: var(--text); }
.eb-list-edit > button { width: 100%; margin-top: 6px; }
.eb-gallery-edit { display: flex; flex-direction: column; gap: 6px; }
.eb-gallery-row { display: flex; gap: 4px; align-items: center; }
.eb-gallery-row img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; }
.eb-gallery-row input[type="text"] { flex: 1; padding: 4px 6px; font-size: 11px; }
.eb-gallery-row button { background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 2px 6px; }

/* Roster slot status badge + task card */
.slot-status {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  margin-left: 6px;
  flex-shrink: 0;
}
.slot-status.is-ok   { background: rgba(16,185,129,0.18); color: #10b981; }
.slot-status.is-no   { background: rgba(239,68,68,0.18); color: #ef4444; }
.slot-status.is-wait { background: rgba(245,158,11,0.18); color: #f59e0b; }
.task-card.roster-task .task-card-icon { color: var(--accent); }

/* Pastoral command center */
.pc-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pc-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.pc-hero h1 { margin: 0 0 4px; }

.pc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (max-width: 900px) { .pc-stats { grid-template-columns: repeat(2, 1fr); } }
.pc-stat {
  --c: var(--accent);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: var(--r-3);
  padding: var(--sp-4);
}
.pc-stat-value { font-size: 32px; font-weight: 700; line-height: 1; color: var(--text); margin-bottom: 4px; }
.pc-stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.pc-stat-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.pc-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 1000px) { .pc-grid { grid-template-columns: 1fr; } }
.pc-main, .pc-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.pc-card { padding: 0; overflow: hidden; }
.pc-card .card-head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }

/* Case rows (urgent) */
.pc-case-list, .pc-reach-list, .pc-note-list, .pc-moments, .pc-mini-list {
  list-style: none; padding: 0; margin: 0;
}
.pc-case-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.pc-case-list li:last-child { border-bottom: 0; }
.pc-case-list li:hover { background: var(--surface-2); }
.pc-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.pc-avatar-initials {
  display: grid; place-items: center;
  font-weight: 700; color: var(--text-2);
}
.pc-case-name, .pc-r-name, .pc-mom-name, .pc-mini-name { font-weight: 600; font-size: 14px; }
.pc-case-meta, .pc-r-meta, .pc-mom-meta, .pc-mini-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pc-case-age.is-urgent { color: #ef4444; font-weight: 600; }
.pc-case-msg {
  margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-case-status {
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; align-self: center;
}
.pc-case-status.status-new          { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.pc-case-status.status-in-progress  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.pc-case-status.status-scheduled    { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.pc-case-status.status-completed,
.pc-case-status.status-closed       { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* Reach-out rows */
.pc-reach-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.pc-reach-list li:last-child { border-bottom: 0; }
.pc-reach-list li:hover { background: var(--surface-2); }
.pc-r-actions { display: flex; align-items: center; gap: 6px; }
.pc-r-link {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  text-decoration: none;
  font-size: 13px;
}
.pc-r-link:hover { background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }

/* Note list */
.pc-note-list li {
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.pc-note-list li:last-child { border-bottom: 0; }
.pc-note-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pc-note-who { font-weight: 600; font-size: 13.5px; }
.pc-note-meta { font-size: 11.5px; color: var(--text-3); }
.pc-note-text { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.55; white-space: pre-wrap; }

/* Moments (birthdays / anniversaries) */
.pc-moments li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.pc-moments li:last-child { border-bottom: 0; }
.pc-moments li:hover { background: var(--surface-2); cursor: pointer; }

/* Mini case list */
.pc-mini-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.pc-mini-list li:last-child { border-bottom: 0; }
.pc-mini-status { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.pc-mini-status.status-new          { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.pc-mini-status.status-in-progress  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.pc-mini-status.status-scheduled    { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Confidential callout */
.pc-callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: var(--sp-4) !important;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line)) !important;
}
.pc-callout svg { color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.pc-callout strong { display: block; font-size: 13px; margin-bottom: 2px; }
.pc-callout p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* Get Involved admin page */
.gi-shell {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: var(--sp-4);
  align-items: start;
}
.gi-shell .gi-palette[hidden], .gi-shell .gi-settings[hidden] { display: none; }
.gi-shell:has(.gi-palette[hidden]):has(.gi-settings[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .gi-shell { grid-template-columns: 200px 1fr 260px; } }
@media (max-width: 900px)  { .gi-shell { grid-template-columns: 1fr; } }
.gi-palette, .gi-settings {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.gi-canvas {
  --gi-accent: #FFCC00;
  display: flex; flex-direction: column;
  gap: var(--sp-4);
}
.gi-empty {
  padding: var(--sp-7);
  border: 2px dashed var(--line);
  border-radius: var(--r-3);
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}
.gi-empty-inline { color: var(--text-3); font-size: 13px; padding: var(--sp-3); }

.gi-view-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.gi-view-modal[hidden] { display: none; }
.gi-view-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
.gi-view-modal-card {
  position: relative;
  width: min(1200px, 92vw);
  height: min(86vh, 920px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.gi-view-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.gi-view-modal-sub { margin-left: 8px; font-size: 12px; font-family: var(--font-mono, monospace); }
.gi-view-modal-tools { display: flex; gap: 6px; align-items: center; }
.gi-view-modal-frame {
  flex: 1;
  width: 100%; border: 0; background: var(--surface);
}
body.gi-view-modal-open { overflow: hidden; }
.gi-block {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--r-3);
  transition: border-color var(--dur-1) var(--ease);
}
.gi-block:hover { border-color: rgba(255,255,255,0.06); }
.gi-block.is-selected { border-color: var(--gi-accent); }
.gi-block.is-drop-before::before,
.gi-block.is-drop-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--gi-accent); border-radius: 2px;
}
.gi-block.is-drop-before::before { top: -6px; }
.gi-block.is-drop-after::after   { bottom: -6px; }
.gi-block .eb-block-tools { z-index: 4; }

/* Widget styles */
.gi-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
}
.gi-h { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.gi-sub { margin: 0 0 var(--sp-4); color: var(--text-3); font-size: 13.5px; }
.gi-section-foot { margin-top: var(--sp-3); }
.gi-link { color: var(--gi-accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.gi-link:hover { text-decoration: underline; }

/* Hero */
.gi-hero {
  position: relative;
  padding: 120px 40px 64px;
  border-radius: var(--r-3);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gi-accent) 35%, transparent), color-mix(in srgb, var(--gi-accent) 8%, transparent));
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.gi-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gi-accent); }
.gi-hero-title { font-size: 36px; line-height: 1.05; margin: 0; font-weight: 700; }
.gi-hero-sub { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.gi-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 11px 22px;
  background: var(--gi-accent);
  color: #111;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none;
}

/* Next steps */
.gi-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.gi-step {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.gi-step:hover { border-color: var(--gi-accent); transform: translateY(-1px); }
.gi-step-ic { font-size: 24px; }
.gi-step-ic.gi-step-img {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.gi-step-ic.gi-step-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gi-step:hover .gi-step-ic.gi-step-img img { transform: scale(1.05); transition: transform .25s ease; }
.gi-step strong { display: block; font-size: 14px; }
.gi-step small  { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.gi-step svg { margin-left: auto; color: var(--text-3); }

/* Service times */
.gi-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.gi-svc {
  display: grid; grid-template-columns: 50px 1fr; align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  position: relative;
}
.gi-svc-day { font-size: 10.5px; font-weight: 700; color: var(--gi-accent); text-transform: uppercase; letter-spacing: 0.06em; grid-row: 1; }
.gi-svc-date { font-size: 28px; font-weight: 700; grid-row: 2; line-height: 1; }
.gi-svc > div:last-child { grid-row: 1 / 3; grid-column: 2; }
.gi-svc strong { display: block; font-size: 13.5px; }
.gi-svc small  { display: block; font-size: 11.5px; color: var(--text-3); }

/* Cards (groups) */
.gi-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gi-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.gi-card-photo { width: 100%; height: 120px; object-fit: cover; }
.gi-card-photo-empty { display: grid; place-items: center; background: var(--surface); color: var(--text-3); font-size: 28px; }
.gi-card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.gi-card-body strong { font-size: 13.5px; }
.gi-card-body small { color: var(--text-3); font-size: 11.5px; }
.gi-card-body p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Events list */
.gi-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.gi-event {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: inherit; text-decoration: none;
  transition: border-color var(--dur-1) var(--ease);
}
.gi-event:hover { border-color: var(--gi-accent); }
.gi-event-photo { width: 56px; height: 56px; border-radius: 10px; background-size: cover; background-position: center; flex-shrink: 0; }
.gi-event-body strong { display: block; font-size: 13.5px; }
.gi-event-body small  { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Forms */
.gi-forms { display: flex; flex-wrap: wrap; gap: 8px; }
.gi-form {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: inherit; text-decoration: none;
  font-size: 13px;
}
.gi-form:hover { border-color: var(--gi-accent); }

/* Give CTA */
.gi-give { text-align: center; }
.gi-give h3 { font-size: 26px; }

/* Pastor message */
.gi-pastor {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--sp-4);
  align-items: center;
}
.gi-pastor img, .gi-pastor-empty {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 36px;
  color: var(--text-3);
}
.gi-pastor-msg { margin: 0 0 6px; font-style: italic; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.gi-pastor strong { font-size: 13.5px; }
.gi-pastor small { color: var(--text-3); font-size: 12px; margin-left: 6px; }

.gi-rich { font-size: 14px; line-height: 1.65; }
.gi-rich h1, .gi-rich h2, .gi-rich h3 { margin: 0 0 8px; }
.gi-rich p { margin: 0 0 0.9em; }
.gi-img img { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--r-2); }
.gi-img figcaption { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 6px; }
.gi-div hr { border: 0; border-top: 1px solid var(--line); }

/* Hero alignment & button style variants */
.gi-hero--left  { text-align: left; align-items: flex-start; }
.gi-hero--center { text-align: center; align-items: center; }
.gi-cta--outline { background: transparent; border: 2px solid var(--gi-accent); color: var(--gi-accent); box-shadow: none; }
.gi-cta--outline:hover { background: var(--gi-accent); color: #000; }
.gi-cta--ghost { background: transparent; border: none; color: var(--gi-accent); box-shadow: none; padding: 6px 0; text-decoration: underline; }
.gi-cta--sm { padding: 7px 16px; font-size: 12.5px; }

/* Give CTA background variants */
.gi-give--accent { background: var(--gi-accent); color: #000; border-radius: var(--r-3); padding: var(--sp-6); }
.gi-give--accent .gi-sub { color: rgba(0,0,0,.65); }
.gi-give--dark { background: #1a1a1a; color: #fff; border-radius: var(--r-3); padding: var(--sp-6); }
.gi-give--dark .gi-sub { color: rgba(255,255,255,.65); }

/* Next-steps list layout */
.gi-steps--list { grid-template-columns: 1fr; }

/* Groups list layout */
.gi-list-cards { display: flex; flex-direction: column; gap: 8px; }
.gi-card--list { display: flex; flex-direction: row; border-radius: var(--r-2); border: 1px solid var(--line); overflow: hidden; }
.gi-card--list .gi-card-body { padding: 12px 14px; }
.gi-card-leader { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* Countdown widget */
.gi-countdown {
  display: flex; gap: 12px; justify-content: center;
  margin: var(--sp-4) 0 var(--sp-2);
}
.gi-countdown-unit {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: 14px 10px 10px;
}
.gi-countdown-n {
  font-size: 36px; font-weight: 700; line-height: 1;
  color: var(--gi-accent);
  font-variant-numeric: tabular-nums;
}
.gi-countdown-unit small { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }

/* Social links widget */
.gi-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--sp-3); }
.gi-social-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--text-1);
  font-size: 13.5px; font-weight: 500;
  transition: border-color .15s, transform .15s;
}
.gi-social-link:hover { border-color: var(--gi-accent); transform: translateY(-1px); }
.gi-social-ic { font-size: 18px; line-height: 1; }

/* Testimonial widget */
.gi-testimonial { display: flex; flex-direction: column; gap: var(--sp-4); }
.gi-testimonial-quote { position: relative; padding: var(--sp-4) var(--sp-4) var(--sp-4) 40px; }
.gi-testimonial-mark {
  position: absolute; top: -6px; left: 0;
  font-size: 72px; line-height: 1; color: var(--gi-accent);
  font-family: Georgia, serif; pointer-events: none;
}
.gi-testimonial-quote p {
  margin: 0; font-size: 17px; line-height: 1.6;
  font-style: italic; color: var(--text-1);
}
.gi-testimonial-author {
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--sp-2);
}
.gi-testimonial-author img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.gi-testimonial-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gi-accent); color: #000; font-size: 18px; font-weight: 700;
}
.gi-testimonial-author strong { display: block; font-size: 14px; }
.gi-testimonial-author small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Stat banner widget */
.gi-stats {
  display: flex; gap: 0; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); overflow: hidden;
}
.gi-stat {
  flex: 1 1 120px; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: var(--sp-5) var(--sp-4);
  border-right: 1px solid var(--line);
}
.gi-stat:last-child { border-right: none; }
.gi-stat-val { font-size: 32px; font-weight: 700; color: var(--gi-accent); line-height: 1; }
.gi-stat small { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); }

/* Announcement widget */
.gi-announcement {
  display: flex; align-items: flex-start; gap: 14px;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-3); border: 1px solid transparent;
}
.gi-announcement--accent  { background: rgba(var(--gi-accent-rgb,255,204,0),.12); border-color: var(--gi-accent); }
.gi-announcement--warning { background: rgba(234,179,8,.12); border-color: #ca8a04; }
.gi-announcement--success { background: rgba(34,197,94,.10); border-color: #16a34a; }
.gi-announcement--info    { background: rgba(59,130,246,.10); border-color: #2563eb; }
.gi-announcement--neutral { background: var(--surface); border-color: var(--line); }
.gi-announcement-icon { font-size: 24px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.gi-announcement-body { flex: 1; }
.gi-announcement-body strong { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 2px; }
.gi-announcement-body p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Contact info widget */
.gi-contact { display: flex; flex-direction: column; gap: 10px; margin-top: var(--sp-3); }
.gi-contact-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--text-2); line-height: 1.45;
}
.gi-contact-row span { font-size: 17px; flex-shrink: 0; }
.gi-contact-row a { color: var(--gi-accent); text-decoration: none; }
.gi-contact-row a:hover { text-decoration: underline; }
.gi-contact-hours {
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
}
.gi-contact-hours strong { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: var(--sp-2); }
.gi-contact-hour-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.gi-contact-hour-row:last-child { border-bottom: none; }
.gi-contact-hour-row span:last-child { color: var(--text-3); white-space: nowrap; }

/* Serve / Teams widget */
.gi-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: var(--sp-3); }
.gi-team-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.gi-team-icon { font-size: 24px; flex-shrink: 0; }
.gi-team-card strong { display: block; font-size: 13px; font-weight: 700; }
.gi-team-card small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Prayer CTA icon */
.gi-give-icon { font-size: 36px; margin-bottom: 8px; }

.gi-campus-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.gi-campus-tab { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-3); transition: all .12s; font-family: inherit; }
.gi-campus-tab:hover { background: var(--surface-2); color: var(--text); }
.gi-campus-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }
.gi-campus-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-right: 2px; }
.gi-chooser-cards { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); max-width: 410px; }
.gi-chooser-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.gi-chooser-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.1); }

/* Pages / Widgets library */
.lib-section { margin-bottom: var(--sp-7, 36px); }
.lib-section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.lib-section-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.lib-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.lib-card { width: 288px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; transition: border-color .15s; }
.lib-card:hover { border-color: var(--accent); }
.lib-card-thumb { position: relative; width: 288px; height: 162px; overflow: hidden; background: #f2f2f2; }
.lib-thumb-frame { position: absolute; top: 0; left: 0; width: 1440px; height: 810px; border: 0; pointer-events: none; transform: scale(0.2); transform-origin: top left; }
.lib-card-body { padding: 12px 14px; }
.lib-card-name { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card-actions { display: flex; gap: 6px; }
.lib-card-btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; color: var(--text-2); text-decoration: none; transition: background .12s; }
.lib-card-btn:hover { background: var(--line); }
.lib-card-btn.danger:hover { background: rgba(248,113,113,.15); color: #f87171; }
.lib-card-btn.is-landing { background: rgba(255,204,0,.16); border-color: rgba(255,204,0,.5); color: #ffcc00; }
.lib-card { position: relative; }
.lib-card.is-landing-card { border-color: rgba(255,204,0,.55); }
/* Flag banner spanning the thumbnail — marks the page members land on (the Get-Involved page). */
.lib-card-landing-badge { position: absolute; top: 12px; left: 0; right: 0; z-index: 2; background: rgba(255,204,0,.95); color: #000; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; padding: 5px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.lib-card-new { width: 288px; height: 208px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line); border-radius: var(--r-3); cursor: pointer; color: var(--text-3); background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; transition: all .12s; }
.lib-card-new:hover { border-color: var(--accent); color: var(--accent); }
.lib-card-new .lib-new-plus { font-size: 28px; font-weight: 300; line-height: 1; }
.lib-empty-hint { color: var(--text-3); font-size: 13px; padding: 20px 0; }

/* YouTube widget */
.gi-yt-wrap {
  position: relative; height: 0; overflow: hidden;
  border-radius: var(--r-3);
  background: #000;
  box-shadow: 0 4px 24px rgba(0,0,0,.18);
}
.gi-yt-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; border-radius: var(--r-3);
}
.gi-yt-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px;
  background: var(--bg); border: 2px dashed var(--line); border-radius: var(--r-3);
  color: var(--text-3); text-align: center; font-size: 13px;
}
.gi-yt-placeholder svg { opacity: .4; }
.gi-yt-caption { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 8px; }

/* Editor-mode YouTube thumbnail (replaces iframe in the drag-and-drop canvas) */
.sp-yt-thumb {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.sp-yt-play {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; padding-left: 3px;
  backdrop-filter: blur(4px);
}
.sp-yt-label {
  font-size: 11px; color: rgba(255,255,255,.75); background: rgba(0,0,0,.5);
  padding: 3px 8px; border-radius: 4px; backdrop-filter: blur(4px);
}
.gi-yt-preview-thumb {
  position: relative; margin: 0 0 10px;
  border-radius: var(--r-2); overflow: hidden;
  border: 1px solid var(--line);
}
.gi-yt-preview-thumb img { width: 100%; display: block; }
.gi-yt-preview-id {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 10px; font-family: var(--font-mono); color: #fff;
  background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 3px;
}

/* Sunday Robot splash */
.sr-splash {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, #1a1330 0%, #0a0610 70%);
  z-index: 9999;
  display: grid; place-items: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.45s ease;
  overflow: hidden;
}
.sr-splash.is-in  { opacity: 1; }
.sr-splash.is-out { opacity: 0; pointer-events: none; }
.sr-splash::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(2px 2px at 12% 22%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(2px 2px at 80% 70%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 35% 80%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1px 1px at 25% 55%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 40%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 50% 90%, rgba(255,255,255,0.5), transparent 60%);
  animation: sr-twinkle 3.6s ease-in-out infinite;
}
@keyframes sr-twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.sr-skip {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 2;
}
.sr-skip:hover { background: rgba(255,255,255,0.15); color: #fff; }

.sr-stage {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 28px;
  z-index: 1;
}

/* Robot */
.sr-robot { width: 200px; height: 232px; overflow: visible; }
.sr-splash.is-in .sr-robot { animation: sr-rise 0.7s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes sr-rise {
  0% { transform: translateY(40px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.sr-sun { fill: #FFCC00; opacity: 0; transform-origin: center; }
.sr-splash.is-in .sr-sun { animation: sr-sun-rise 1.4s 0.4s ease-out both; }
@keyframes sr-sun-rise {
  0% { opacity: 0; transform: scale(0.4); }
  60% { opacity: 0.16; }
  100% { opacity: 0.12; transform: scale(1); }
}
.sr-rays line { stroke: #FFCC00; stroke-width: 3; stroke-linecap: round; opacity: 0; transform-origin: 120px 140px; }
.sr-splash.is-in .sr-rays { animation: sr-rays 4s 0.8s linear infinite; }
@keyframes sr-rays { to { transform: rotate(360deg); transform-origin: 120px 140px; } }
.sr-splash.is-in .sr-rays line { animation: sr-ray-fade 1s 0.5s ease both; }
@keyframes sr-ray-fade {
  to { opacity: 0.7; }
}

.sr-head { fill: #2a2240; stroke: #FFCC00; stroke-width: 3; }
.sr-head-shine { fill: rgba(255,255,255,0.25); }
.sr-neck, .sr-body { fill: #2a2240; stroke: #FFCC00; stroke-width: 3; }
.sr-antenna { stroke: #FFCC00; stroke-width: 3; stroke-linecap: round; }
.sr-antenna-bulb { fill: #FFCC00; }
.sr-antenna-glow { fill: #FFCC00; opacity: 0.3; transform-origin: 120px 14px; }
.sr-splash.is-in .sr-antenna-glow { animation: sr-pulse 1.2s 0.8s ease-in-out infinite; }
@keyframes sr-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.6); opacity: 0; }
}

.sr-eye { fill: #FFCC00; transform-origin: center; }
.sr-splash.is-in .sr-eye { animation: sr-blink 4s 1.3s ease-in-out infinite; }
@keyframes sr-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%, 97% { transform: scaleY(0.08); }
}
.sr-smile { fill: none; stroke: #FFCC00; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
.sr-splash.is-in .sr-smile { animation: sr-smile 0.6s 1.1s ease-out forwards; }
@keyframes sr-smile { to { stroke-dashoffset: 0; } }

.sr-heart { fill: #FFCC00; opacity: 0.18; }
.sr-heart-icon { fill: #FFCC00; }
.sr-splash.is-in .sr-heart-icon { transform-origin: 120px 213px; animation: sr-heartbeat 1s 1.5s ease-in-out infinite; }
@keyframes sr-heartbeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.18); }
  40% { transform: scale(1); }
}

.sr-arm { fill: #FFCC00; transform-box: fill-box; }
.sr-arm-l { transform-origin: top center; }
.sr-arm-r { transform-origin: top center; }
.sr-splash.is-in .sr-arm-l { animation: sr-wave-l 1s 0.9s ease-in-out; }
.sr-splash.is-in .sr-arm-r { animation: sr-wave-r 1s 0.9s ease-in-out; }
@keyframes sr-wave-l { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-20deg); } }
@keyframes sr-wave-r { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(20deg); } }

/* Wordmark */
.sr-wordmark {
  display: flex; flex-direction: column;
  align-items: center;
  line-height: 0.85;
  letter-spacing: 0.12em;
}
.sr-word {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  color: #fff;
  font-size: 56px;
  opacity: 0;
  transform: translateY(20px);
}
.sr-splash.is-in .sr-sunday { animation: sr-word 0.7s 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.sr-splash.is-in .sr-robot-w {
  background: linear-gradient(180deg, #FFCC00, #ff9a00);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: sr-word 0.7s 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes sr-word { to { opacity: 1; transform: translateY(0); } }

.sr-tagline {
  font-family: 'Inter', system-ui, sans-serif;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
}
.sr-splash.is-in .sr-tagline { animation: sr-fade 0.6s 1.4s ease forwards; }
@keyframes sr-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sr-splash, .sr-splash *, .sr-splash *::before {
    animation-duration: 0.2s !important;
    animation-iteration-count: 1 !important;
  }
}

/* Leadership / Org Chart */
/* ── Org Chart ────────────────────────────────────────────── */

/* Clear-all button */
.org-clear-btn {
  color: var(--error, #e55);
  border-color: color-mix(in srgb, var(--error, #e55) 30%, transparent);
  gap: 6px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 6px;
}
.org-clear-btn:hover {
  background: color-mix(in srgb, var(--error, #e55) 10%, transparent);
  border-color: var(--error, #e55);
}

/* Campus tab selector */
.org-campus-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.org-campus-tab {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1);
  white-space: nowrap;
}
.org-campus-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}
.org-campus-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

/* Search add bar — sits below the canvas */
.org-add-wrap {
  position: relative;
  margin-top: 12px;
  margin-bottom: var(--sp-4);
  max-width: 600px;
}
.org-add-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0 14px;
  transition: border-color var(--dur-1);
}
.org-add-input-row:focus-within { border-color: var(--accent); }
.org-add-icon { color: var(--text-3); flex-shrink: 0; }
.org-add-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.org-add-input::placeholder { color: var(--text-3); }

.org-add-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  list-style: none;
  margin: 0; padding: 4px 0;
}
.org-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13.5px;
  transition: background var(--dur-1);
}
.org-result-item:hover { background: var(--surface-2); }
.org-result-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.org-result-name { flex: 1; font-weight: 500; }
.org-result-site { font-size: 11.5px; }

/* Inline title row */
.org-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-2);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
  max-width: 600px;
}
.org-title-label { font-size: 13.5px; white-space: nowrap; }

/* Root drop zone */
.org-root-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: var(--r-2);
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: var(--sp-4);
  transition: border-color var(--dur-1), background var(--dur-1);
}
.org-root-drop.drag-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

/* Canvas */
.org-canvas {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-6);
  overflow: auto;
  min-height: 400px;
}
.org-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  color: var(--text-2);
  text-align: center;
}
.org-empty-state p { margin: 0; font-size: 15px; }

/* Tree layout */
.org-tree {
  display: flex;
  justify-content: center;        /* fallback */
  justify-content: safe center;   /* when content > canvas, start from left so scroll works */
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-2);
  min-width: max-content;         /* prevents the flex container from compressing its children */
}
.org-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 12px;
}

/* Cards */
.org-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 10px 10px 10px 6px;
  cursor: grab;
  min-width: 200px;
  max-width: 260px;
  position: relative;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1), opacity var(--dur-1);
  user-select: none;
}
.org-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.org-card.is-dragging { opacity: .4; cursor: grabbing; }
.org-card.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: scale(1.02);
}
/* when dragging, pulse the connector lines to hint at hierarchy */
.org-children::before,
.org-children > .org-node::before,
.org-children > .org-node::after {
  transition: opacity 0.2s;
}
.org-canvas.drag-in-progress .org-children::before,
.org-canvas.drag-in-progress .org-children > .org-node::before,
.org-canvas.drag-in-progress .org-children > .org-node::after {
  opacity: 0.9;
}

.org-card-drag-handle {
  color: var(--text-3);
  padding: 4px 5px;
  flex-shrink: 0;
  cursor: grab;
  opacity: .5;
  transition: opacity var(--dur-1), color var(--dur-1);
  border-radius: 4px;
}
.org-card-drag-handle:hover {
  opacity: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.org-card-drag-handle:active { cursor: grabbing; }

.org-card .org-initials {
  border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.org-card-body { min-width: 0; flex: 1; }
.org-card-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-card-role {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  outline: none;
  border-radius: 3px;
  padding: 0 2px;
  cursor: text;
  min-height: 1em;
  transition: background var(--dur-1);
}
.org-card-role:focus { background: var(--surface); color: var(--text); box-shadow: 0 0 0 2px var(--accent); }
.org-role-placeholder { color: var(--text-3); opacity: .5; font-style: italic; pointer-events: none; }
.org-card-loc { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

/* Card action button group — stacked column, right side of card */
.org-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-1);
}
.org-card:hover .org-card-actions { opacity: 1; }

/* Co-leader pod */
.org-pod {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--accent);
  border-radius: var(--r-2);
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
  position: relative;
}
.org-pod > .org-card {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
}
.org-pod > .org-card:first-child {
  border-right: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.org-pod-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  flex-shrink: 0;
  color: var(--accent);
}
.org-pod-unlink {
  font-size: 11px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 5px;
  opacity: 0;
  transition: opacity var(--dur-1), color var(--dur-1), border-color var(--dur-1);
  white-space: nowrap;
}
.org-pod:hover .org-pod-unlink { opacity: 1; }
.org-pod-unlink:hover { color: var(--error, #e55); border-color: var(--error, #e55); }

/* Shared base for all three action buttons */
.org-card-connect,
.org-card-link,
.org-card-remove {
  display: grid;
  place-items: center;        /* centres the SVG both axes */
  width: 22px;
  height: 22px;
  padding: 0;                 /* no padding so circle is the exact boundary */
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: background var(--dur-1), border-color var(--dur-1),
              color var(--dur-1), box-shadow var(--dur-1);
}
/* Block display removes inline baseline gap inside the button */
.org-card-connect svg,
.org-card-link svg,
.org-card-remove svg {
  display: block;
  pointer-events: none;
}
/* Remove button is in the actions column — not absolute any more */
.org-card-remove {
  position: static;
  top: unset; right: unset;
  width: 22px; height: 22px;
  border: 1.5px solid var(--line);
  opacity: 1;                 /* visibility controlled by .org-card-actions */
}

/* Connect (+) colours */
.org-card-connect:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.org-card.connect-selected .org-card-connect {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  animation: org-pulse 1.2s ease-in-out infinite;
}
@keyframes org-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
  50%       { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 12%, transparent); }
}
.org-card.connect-available { opacity: 0.65; }
.org-card.connect-available:hover { opacity: 1; }

/* Link (🔗) colours */
.org-card-link:hover {
  background: color-mix(in srgb, #8855ff 12%, transparent);
  border-color: #8855ff;
  color: #8855ff;
}
.org-card.link-selected .org-card-link {
  background: #8855ff;
  border-color: #8855ff;
  color: #fff;
  animation: org-pulse 1.2s ease-in-out infinite;
}
.org-card.link-available { opacity: 0.65; }
.org-card.link-available:hover { opacity: 1; }

/* Remove (×) colours */
.org-card-remove:hover {
  background: color-mix(in srgb, var(--error, #e55) 12%, transparent);
  border-color: var(--error, #e55);
  color: var(--error, #e55);
}

/* Hint banner colour variant for link mode */
.org-link-hint {
  border-color: color-mix(in srgb, #8855ff 50%, transparent) !important;
  background: color-mix(in srgb, #8855ff 8%, var(--surface-2)) !important;
}
.org-link-hint strong { color: #8855ff !important; }

/* Hint banner shown when a card is selected as the "from" */
.org-connect-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--r-2);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 14px;
}
.org-connect-hint strong { color: var(--accent); }
.org-connect-hint em { color: var(--text-2); font-style: normal; }
.org-hint-cancel {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}
.org-hint-cancel:hover { color: var(--text); background: var(--surface); }


/* Tree connectors */
.org-children {
  display: flex;
  justify-content: center;
  gap: 0;                   /* gap handled by padding on each .org-node */
  flex-wrap: nowrap;
  position: relative;
  padding-top: 36px;
  margin-top: 0;
}

/* vertical stem from parent card down to the horizontal bar */
.org-children::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 2px; height: 18px;
  background: var(--accent);
  opacity: 0.5;
  transform: translateX(-50%);
}

/* vertical drop from horizontal bar down into each child card */
.org-children > .org-node::before {
  content: '';
  position: absolute;
  top: -18px; left: 50%;
  width: 2px; height: 18px;
  background: var(--accent);
  opacity: 0.5;
  transform: translateX(-50%);
}

/* horizontal bar segment on each sibling node */
.org-children > .org-node:not(:only-child)::after {
  content: '';
  position: absolute;
  top: -18px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.5;
}
/* trim bar to start/end at each child's midpoint */
.org-children > .org-node:first-child::after  { left: 50%; }
.org-children > .org-node:last-child::after   { right: 50%; }

/* Sites & rooms — first-class campus page */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
}
.sites-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.sites-card:hover { border-color: var(--line-strong); }
.sites-card.is-inactive { opacity: 0.65; }
.sites-card.is-dragging { opacity: 0.4; transform: scale(0.98); }
.sites-drag {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.4);
  border: 0; border-radius: 6px;
  color: rgba(255,255,255,0.7);
  display: grid; place-items: center;
  cursor: grab;
}
.sites-drag:active { cursor: grabbing; }
.sites-photo-wrap {
  position: relative;
  height: 160px;
  background: var(--surface-2);
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.sites-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.sites-photo-empty {
  display: grid; place-items: center;
  color: var(--text-3);
  font-size: 32px;
}
.sites-pastors {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  z-index: 3;
}
.sites-pastor {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: var(--surface-2);
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
  overflow: visible;
  margin-left: -16px;
  transition: transform var(--dur-1) var(--ease), z-index 0s var(--dur-1) linear;
  cursor: default;
  display: grid; place-items: center;
}
.sites-pastor:first-child { margin-left: 0; }
.sites-pastor::before {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, color-mix(in srgb, var(--accent) 80%, transparent), color-mix(in srgb, var(--accent) 0%, transparent) 75%);
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
  z-index: -1;
}
.sites-pastor-img {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}
.sites-pastor-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.sites-pastor-initials {
  font-weight: 700; font-size: 18px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.sites-pastor:hover {
  transform: translateY(-4px) scale(1.05);
  z-index: 10;
  transition: transform var(--dur-1) var(--ease), z-index 0s linear;
}
.sites-pastor:hover::before { opacity: 1; }
.sites-pastor-tag {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 4px);
  background: rgba(15, 15, 15, 0.95);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 11;
}
.sites-pastor-tag::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 15, 15, 0.95);
}
.sites-pastor-tag strong { font-weight: 600; font-size: 12px; }
.sites-pastor-tag span { color: rgba(255,255,255,0.6); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.sites-pastor:hover .sites-pastor-tag {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sites-pastor-more {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

/* Editor — multi-pastor list */
.se-pastor-list { display: flex; flex-direction: column; gap: 8px; }
.se-pastor-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.se-pastor-photo {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.se-pastor-photo img { width: 100%; height: 100%; object-fit: cover; }
.se-pastor-empty {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  color: var(--text-3);
  font-size: 22px;
}
.se-pastor-overlay {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.45);
  color: #fff;
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--dur-1) var(--ease);
}
.se-pastor-photo:hover .se-pastor-overlay { opacity: 1; }
.se-pastor-fields { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.se-pastor-fields .elv-input { font-size: 12.5px; }
.sites-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sites-photo-wrap:has(.sites-pastors) + .sites-body { padding-top: 40px; }
.sites-head { display: flex; align-items: flex-start; gap: 10px; padding-right: 60px; }
.sites-name { margin: 0; font-size: 16px; font-weight: 600; }
.sites-address { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.sites-desc { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.sites-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sites-stats > div {
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em;
}
.sites-stats strong { font-size: 18px; color: var(--text); font-weight: 600; margin-bottom: 1px; }
.sites-rooms { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.sites-rooms li {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0;
  font-size: 12.5px;
}
.sites-room-name { font-weight: 500; }
.sites-room-meta { color: var(--text-3); font-size: 11.5px; }
.sites-svc-chip {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--line);
}
.sites-map {
  position: relative;
  border-radius: var(--r-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.sites-map iframe {
  width: 100%; height: 140px; border: 0; display: block;
  background: var(--surface-2);
}
.sites-map-link {
  position: absolute;
  bottom: 6px; right: 6px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.sites-map:hover .sites-map-link { opacity: 1; }
.sites-map-pending {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  height: 100px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.sites-foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }

/* Site editor modal */
.site-editor-card {
  max-width: 720px;
  max-height: 88vh;
  display: flex; flex-direction: column;
}
.site-editor-tabs {
  display: flex; gap: 4px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--line);
}
.site-editor-tabs .seg-item {
  background: transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 14px;
  color: var(--text-3);
  font-weight: 500;
}
.site-editor-tabs .seg-item.active { color: var(--text); border-bottom-color: var(--accent); background: transparent; }
.se-label { display: block; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; font-weight: 600; }
.se-photo-frame {
  width: 100%; height: 110px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  overflow: hidden;
  display: grid; place-items: center;
}
.se-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.se-photo-empty { color: var(--text-3); font-size: 12px; }
.se-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.se-row > span { color: var(--text-3); font-size: 12px; }
.site-rooms-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: var(--sp-4);
}
.site-room-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.sites-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px;
}
.sites-svc-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.sites-svc-opt:hover { background: var(--surface-2); }

.kob-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.6);
  background: linear-gradient(180deg, #10b981, #059669);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 0 0 rgba(16, 185, 129, 0.55),
    0 0 10px rgba(16, 185, 129, 0.5),
    0 2px 8px -2px rgba(16, 185, 129, 0.3);
  animation: kob-glow 2.4s ease-in-out infinite;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.kob-indicator:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 18px rgba(16, 185, 129, 0.75),
    0 6px 18px -4px rgba(16, 185, 129, 0.55);
}
.kob-indicator-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
@keyframes kob-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5),  0 0 0 0 rgba(16, 185, 129, 0.45), 0 4px 12px -2px rgba(16, 185, 129, 0.3); }
  50%      { box-shadow: 0 0 22px rgba(16, 185, 129, 0.85), 0 0 0 6px rgba(16, 185, 129, 0),   0 4px 12px -2px rgba(16, 185, 129, 0.45); }
}
/* Uppercase caps sit optically ~1px high in the tight pill (font ascent/descent
   asymmetry) — nudge down so the text centres on the pill and aligns with the dot. */
.kob-indicator-label { line-height: 1; position: relative; top: 1px; }
@media (max-width: 720px) { .kob-indicator-label { display: none; } }

/* KOB — AI chat */
.kob-shell { padding: 0; overflow: hidden; }
.kob-messages {
  height: 460px;
  overflow-y: auto;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface));
}
.kob-msg { display: flex; align-items: flex-start; gap: 10px; }
.kob-msg-user { justify-content: flex-end; }
.kob-msg-user .kob-bubble {
  background: var(--accent);
  color: var(--text-on-accent, #111);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px; max-width: 75%;
  font-size: 13.5px; font-weight: 500; line-height: 1.55;
}
.kob-msg-bot .kob-bubble {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px 18px 18px 18px;
  padding: 10px 16px; max-width: 80%;
  font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.kob-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: grid; place-items: center;
  font-size: 9px; font-weight: 800; color: #fff; letter-spacing: 0.05em;
}
.streaming-cursor::after {
  content: '▋'; animation: kob-blink 0.7s step-end infinite;
  color: var(--accent); font-size: 0.8em; margin-left: 2px;
}
@keyframes kob-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.kob-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--sp-5) var(--sp-3); }
.kob-pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px; padding: 5px 12px;
  border-radius: 999px; cursor: pointer;
  transition: all var(--dur-1) var(--ease);
}
.kob-pill:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-color: var(--accent); color: var(--text); }

.kob-composer {
  display: flex; gap: 8px; align-items: flex-end;
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.kob-composer textarea {
  flex: 1; resize: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px; line-height: 1.5;
  font-family: inherit; outline: none;
  min-height: 42px; max-height: 160px;
}
.kob-composer textarea:focus { border-color: var(--accent); }
.kob-composer #kob-send { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; flex-shrink: 0; }

/* Person Detail — first-class profile page */
.pd-hero {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-6) var(--sp-7);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 60%);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.pd-hero-photo {
  width: 104px; height: 104px;
  min-width: 104px;
  flex: 0 0 104px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: visible;
  background: var(--surface-2);
  border: 2.5px solid var(--accent);
  display: grid; place-items: center;
  position: relative;
}
.pd-hero-photo img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; border-radius: 50%; }
.pd-hero-photo .avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 34px; font-weight: 600; }
.pd-photo-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--surface);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 3;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.pd-photo-edit:hover { background: var(--accent); color: #000; transform: scale(1.05); }
.pd-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.pd-drop:hover, .pd-drop.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.pd-drop svg { color: var(--text-3); }
.pd-drop small { color: var(--text-3); font-size: 11.5px; }
.pd-hero-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pd-hero-eyebrow { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); opacity: .7; }
.pd-hero-body h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.pd-hero-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pd-tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
}
.pd-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line);
  font-size: 12px;
  text-decoration: none;
  transition: all var(--dur-1) var(--ease);
}
.pd-chip:hover { border-color: var(--accent); color: var(--text); }
.pd-chip svg { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-3); }
/* Access-level tick-box rows (person profile). */
.pd-role-opt:hover:not([aria-checked="true"]) { background: var(--surface-2) !important; }
.pd-role-opt:disabled { opacity: .55; cursor: default; }
.pd-hero-actions { display: flex; gap: 6px; align-self: center; flex-shrink: 0; }
@media (max-width: 720px) {
  .pd-hero { grid-template-columns: 1fr; text-align: center; }
  .pd-hero-photo { justify-self: center; }
  .pd-hero-tags, .pd-hero-chips { justify-content: center; }
}

.pd-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin: 0 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-3) var(--r-3);
  overflow: hidden;
  background: var(--surface);
}
.pd-stats .stat {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 22px;
  box-shadow: none;
  background: transparent;
}
.pd-stats .stat:last-child { border-right: 0; }
.pd-stats .stat-head { margin-bottom: 3px; }
.pd-stats .stat-label { font-size: 11px; }
.pd-stats .stat-value { font-size: 22px !important; font-weight: 600; margin-top: 3px; letter-spacing: -0.02em; }
@media (max-width: 900px) { .pd-stats { grid-template-columns: repeat(3, 1fr); border-radius: 0 0 var(--r-3) var(--r-3); }
  .pd-stats .stat:nth-child(3) { border-right: 0; }
  .pd-stats .stat:nth-child(4), .pd-stats .stat:nth-child(5), .pd-stats .stat:nth-child(6) { border-top: 1px solid var(--line); } }
@media (max-width: 540px) { .pd-stats { grid-template-columns: repeat(2, 1fr); }
  .pd-stats .stat:nth-child(2n) { border-right: 0; }
  .pd-stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

.pd-cols {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 980px) { .pd-cols { grid-template-columns: 1fr; } }
/* Main content spreads across into a responsive card grid instead of one long
   stacked column; cards keep their natural height and start-align. */
.pd-col-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
  align-items: start;
  align-content: start;
}
.pd-col-side { display: flex; flex-direction: column; gap: var(--sp-4); }
/* Full-width cards within the main grid (notes/pastoral need the room). */
#pd-pastoral-card { grid-column: 1 / -1; }
/* A touch more breathing room inside every profile card. */
.pd-col-main > .card, .pd-col-side > .card { padding: var(--sp-5); }

.pd-kv {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 4px 0 8px;
}
.pd-kv-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.pd-kv-row:last-child { border-bottom: 0; }
.pd-kv-row dt { color: var(--text-3); font-size: 12px; font-weight: 500; }
.pd-kv-row dd { color: var(--text); font-size: 13px; word-break: break-word; }
.pd-kv-row dd.empty { color: var(--text-3); }
.pd-kv-row dd a { color: var(--accent); text-decoration: none; }
.pd-kv-row dd a:hover { text-decoration: underline; }

.pd-empty {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
  font-style: italic;
}

.pd-map {
  margin: 0 var(--sp-5) var(--sp-4);
  position: relative;
  border-radius: var(--r-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.pd-map iframe { width: 100%; height: 180px; border: 0; display: block; filter: invert(0.92) hue-rotate(180deg) saturate(0.6); }
.pd-map-link { position: absolute; bottom: 8px; right: 8px; background: var(--surface); color: var(--text-2); font-size: 11.5px; padding: 4px 10px; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); }
.pd-map-loading { height: 180px; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; }
.pd-map-notfound { padding: 16px; font-size: 13px; }

.pd-family, .pd-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pd-family li, .pd-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.pd-family li:last-child, .pd-list li:last-child { border-bottom: 0; }
.pd-family li:hover { background: var(--surface-2); }
.pd-family img, .pd-family .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pd-family-body { display: flex; flex-direction: column; min-width: 0; }
.pd-family-name { font-weight: 500; font-size: 13.5px; }
.pd-family-rel { font-size: 11.5px; color: var(--text-3); }
.pd-list-name { flex: 1; font-size: 13.5px; min-width: 0; }
.pd-list-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.pd-group-result-item:hover { background: var(--surface-2); }
.pd-group-remove:hover { color: var(--danger, #ef4444) !important; background: var(--surface-2) !important; }

/* RBAC: roles, permission groups, users */
.rbac-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--sp-4); }
@media (max-width: 900px) { .rbac-layout { grid-template-columns: 1fr; } }
.rbac-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); display: flex; flex-direction: column; max-height: 75vh; }
.rbac-side-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.rbac-side-head h3 { margin: 0; font-size: 14px; }
.rbac-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; }
.rbac-list-item { display: flex; gap: 10px; align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--dur-1) var(--ease); }
.rbac-list-item:hover { background: var(--surface-2); }
.rbac-list-item.is-active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.rbac-list-item:last-child { border-bottom: 0; }
.rbac-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rbac-li-name { font-weight: 500; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.rbac-li-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.rbac-pill { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-3); font-weight: 500; }
.rbac-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-4); min-height: 360px; }
.rbac-empty { color: var(--text-3); font-size: 13px; padding: var(--sp-5); text-align: center; }
.rbac-detail-head { display: flex; gap: var(--sp-3); align-items: flex-start; padding-bottom: var(--sp-3); margin-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.rbac-title-input { display: block; width: 100%; font-size: 18px; font-weight: 600; background: transparent; border: 0; outline: 0; color: var(--text); padding: 0; margin-bottom: 4px; }
.rbac-title-input:focus { outline: 1px dashed var(--line); outline-offset: 4px; }
.rbac-desc-input { display: block; width: 100%; font-size: 12.5px; background: transparent; border: 0; outline: 0; color: var(--text-2); padding: 0; }
.rbac-banner { padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); color: var(--text-2); font-size: 12.5px; margin-bottom: var(--sp-3); }
.rbac-perm-pane { display: flex; flex-direction: column; gap: var(--sp-3); }
.rbac-cat { border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-3); margin: 0; }
.rbac-cat legend { display: flex; gap: 10px; align-items: center; padding: 0 6px; font-size: 12px; color: var(--text-2); }
.rbac-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.rbac-perm-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.rbac-perm-row:hover { background: var(--surface-2); }
.rbac-perm-row.is-on { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.rbac-perm-row input[type=checkbox] { margin-top: 2px; }
.rbac-perm-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.rbac-perm-text strong { font-size: 13px; font-weight: 500; }
.rbac-perm-text small { font-size: 11.5px; color: var(--text-3); }
.rbac-perm-text code { font-size: 10.5px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }

.rbac-user-list { list-style: none; padding: 0; margin: 0; }
.rbac-user-row { display: grid; grid-template-columns: 32px 1.5fr 160px 2fr auto auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.rbac-user-row:last-child { border-bottom: 0; }
.rbac-user-role { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font-size: 12.5px; }
.rbac-user-groups { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.rbac-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px; cursor: pointer; border: 1px solid transparent; }
.rbac-chip input { display: none; }
.rbac-chip.is-on { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.rbac-user-status { font-size: 11.5px; min-width: 70px; text-align: right; }
@media (max-width: 900px) {
  .rbac-user-row { grid-template-columns: 32px 1fr; gap: 8px; }
  .rbac-user-row .rbac-user-role,
  .rbac-user-row .rbac-user-groups,
  .rbac-user-row > button,
  .rbac-user-row .rbac-user-status { grid-column: 1 / -1; }
}

/* Kids Church */
/* ============================================================
   Kids Kiosk — drop-off / pick-up experience
   ============================================================ */
.kk-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3); margin-bottom: var(--sp-4);
}
@media (max-width: 820px) { .kk-stats { grid-template-columns: 1fr 1fr; } }
.kk-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  min-height: 70px;
}
.kk-stat-num { font-size: 26px; font-weight: 700; font-family: var(--font-display, inherit); line-height: 1; }
.kk-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.kk-stat-mode { padding: 8px 10px; }
.kk-mode-seg { width: 100%; }

.kk-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 1080px) { .kk-shell { grid-template-columns: 1fr; } }

.kk-search-pane { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.kk-search-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 18px;
}
.kk-search-label {
  display: block;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: color-mix(in srgb, var(--accent) 75%, var(--text-2));
  margin-bottom: 8px;
}
.kk-search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 12px 14px;
  color: var(--text-3);
}
.kk-search-box input {
  flex: 1; font: inherit; font-size: 17px; font-weight: 500;
  background: transparent; border: 0; color: var(--text); outline: none;
}
.kk-results {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 420px; overflow-y: auto;
}
.kk-result, .kk-family-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.kk-result-empty { color: var(--text-3); justify-content: center; cursor: default; font-size: 13px; }
.kk-result:hover { border-color: var(--accent); transform: translateY(-1px); }
.kk-result.is-in-cart { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.kk-result.is-in { opacity: 0.65; cursor: default; }
.kk-result.is-in:hover { transform: none; }
.kk-result-info { flex: 1; min-width: 0; }
.kk-result-name { font-size: 14.5px; font-weight: 600; }
.kk-result-meta { font-size: 11.5px; color: var(--text-3); }
.kk-result-allergy { color: #facc15; font-weight: 600; }
.kk-status-in { font-size: 10.5px !important; }
.kk-add-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 18px; font-weight: 700; color: var(--accent);
  cursor: pointer; transition: transform 120ms ease;
}
.kk-add-btn:hover { transform: scale(1.08); }
.is-in-cart .kk-add-btn { background: var(--accent); color: #0b0c0e; border-color: var(--accent); }

.kk-family-head {
  background: var(--surface-2); cursor: default;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: 6px 12px;
  display: flex; justify-content: space-between;
}
.kk-family-head:hover { transform: none; border-color: var(--line); }
.kk-family-name { font-weight: 700; }
.kk-fam-add {
  background: transparent; border: 1px dashed var(--accent); color: var(--accent);
  border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.kk-fam-add:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Family cart sidebar */
.kk-cart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
  position: sticky; top: 72px;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.kk-cart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700; font-size: 15px;
}
.kk-cart-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.kk-cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.kk-cart-item-info { flex: 1; min-width: 0; }
.kk-cart-item-name { font-size: 13.5px; font-weight: 600; }
.kk-cart-item-meta { font-size: 11px; color: var(--text-3); }
.kk-cart-item-allergy { font-size: 11px; color: #facc15; margin-top: 2px; }
.kk-warn { color: #f87171; }
.kk-cart-rm {
  background: transparent; border: 0; color: var(--text-3); cursor: pointer;
  padding: 4px;
}
.kk-cart-rm:hover { color: #f87171; }
.kk-cart-fields { display: flex; flex-direction: column; gap: 8px; }
.kk-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.kk-field input {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 9px 11px;
  font: inherit; font-size: 14px; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.kk-field input:focus { outline: none; border-color: var(--accent); }
.kk-cart-go {
  margin-top: 4px;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  background: var(--accent); color: #0b0c0e; border: 0;
  border-radius: var(--r-pill); padding: 12px 18px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.kk-cart-go:hover { transform: translateY(-1px); filter: brightness(1.05); }
.kk-cart-go.is-loading { opacity: 0.6; pointer-events: none; }
.kk-cart-empty {
  text-align: center; padding: 24px 8px; color: var(--text-3);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.kk-cart-empty svg { opacity: 0.4; }
.kk-cart-empty p { margin: 0; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.kk-cart-empty small { font-size: 11.5px; }

/* Room board */
.kk-section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.kk-section-head strong { font-size: 13.5px; }
.kk-rooms-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.kk-room-empty { color: var(--text-3); font-size: 13px; padding: 20px; text-align: center; }
.kk-room {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 14px;
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.kk-room::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--rm-tint, var(--accent));
}
.kk-room-head { display: flex; justify-content: space-between; align-items: flex-start; }
.kk-room-head strong { font-size: 14px; display: block; }
.kk-room-head small { font-size: 11px; color: var(--text-3); }
.kk-room-occ {
  font-size: 14px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--rm-tint, var(--accent)) 18%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--rm-tint, var(--accent)) 30%, transparent);
}
.kk-room-bar {
  height: 6px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.kk-room-bar span {
  display: block; height: 100%;
  background: var(--rm-tint, var(--accent));
  transition: width 240ms ease;
}
.kk-room[data-tone="warn"] .kk-room-bar span { background: #f59e0b; }
.kk-room[data-tone="full"] .kk-room-bar span { background: #ef4444; }
.kk-room-kids { display: flex; flex-wrap: wrap; gap: -6px; min-height: 26px; }
.kk-room-kids > * { margin-left: -6px; border: 2px solid var(--surface); }
.kk-room-more {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); border: 2px solid var(--surface);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  margin-left: -6px;
}

/* Activity feed */
.kk-feed-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; }
.kk-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.kk-feed-empty { font-size: 13px; padding: 12px; text-align: center; }
.kk-feed-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.kk-feed-info { flex: 1; min-width: 0; }
.kk-feed-info strong { display: block; font-size: 13px; }
.kk-feed-info small { font-size: 11px; }

/* Pickup pad */
.kk-pickup-shell { justify-content: center; }
.kk-pickup-card {
  grid-column: 1 / -1; max-width: 480px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.kk-pickup-card header { text-align: center; }
.kk-pickup-card header strong { font-size: 18px; display: block; }
.kk-pickup-digits {
  display: flex; gap: 10px; justify-content: center;
  font-family: var(--font-mono, ui-monospace, monospace);
}
.kk-pickup-digits span {
  width: 56px; height: 72px; border-radius: 12px;
  background: var(--surface-2); border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 30px; font-weight: 700; color: var(--text);
  transition: border-color 120ms ease, background 120ms ease;
}
.kk-pickup-digits span.is-filled { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.kk-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.kk-pad button {
  height: 56px; font-size: 22px; font-weight: 700; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); color: var(--text); font-family: var(--font-mono, inherit);
  transition: transform 120ms ease, border-color 120ms ease;
}
.kk-pad button:hover { border-color: var(--accent); transform: translateY(-1px); }
.kk-pad-fn { font-size: 13px !important; font-family: var(--font-sans, inherit) !important; color: var(--text-2) !important; }
.kk-pickup-status { text-align: center; font-size: 14px; min-height: 20px; }
.kk-pickup-ok  { color: #22c55e; font-weight: 700; }
.kk-pickup-err { color: #f87171; font-weight: 600; }
.kk-pickup-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kk-pickup-results li { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); }
.kk-pickup-results li small { display: block; font-size: 11px; }

/* Success splash */
.kk-splash {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  animation: kkSplashIn 220ms ease;
}
.kk-splash[hidden] { display: none; }
@keyframes kkSplashIn { from { opacity: 0; } to { opacity: 1; } }
.kk-splash-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 24px;
  width: min(440px, 92vw);
  text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  overflow: hidden;
}
.kk-splash-confetti {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.kk-splash-confetti span {
  position: absolute; top: -8px;
  width: 8px; height: 14px; border-radius: 2px;
  animation: kkConfetti 1.8s linear forwards;
}
@keyframes kkConfetti {
  to { transform: translateY(520px) rotate(720deg); opacity: 0; }
}
.kk-splash-tick {
  width: 64px; height: 64px; border-radius: 50%;
  background: #22c55e; color: #0b0c0e;
  display: grid; place-items: center;
  animation: kkPop 360ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes kkPop { from { transform: scale(0); } to { transform: scale(1); } }
.kk-splash-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin: 0; }
.kk-splash-card h3 { margin: 0; font-size: 22px; font-weight: 700; }
.kk-splash-sub { margin: 0; color: var(--text-3); font-size: 13px; }
.kk-splash-code-wrap { margin-top: 4px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.kk-splash-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 44px; font-weight: 800; letter-spacing: 0.16em;
  color: var(--accent);
}
.kk-splash-kids {
  list-style: none; padding: 0; margin: 4px 0;
  display: flex; flex-direction: column; gap: 6px; width: 100%;
}
.kk-splash-kids li {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 8px 10px;
}
.kk-splash-kids strong { display: block; font-size: 13.5px; }
.kk-splash-kids small { display: block; font-size: 11px; }

.kc-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}
.kc-room-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kc-room-photo {
  position: relative;
  margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) 0;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--r-3) var(--r-3) 0 0;
  display: flex; align-items: center; justify-content: center;
}
.kc-room-photo-fallback {
  font-size: 48px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.kc-child-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.kc-child-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.kc-child-row:last-child { border-bottom: 0; }
.kc-child-row:hover { background: var(--surface-2); }

/* ── Kids reports ─────────────────────────────────────────── */
.kc-reports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.kc-report-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-4); }
.kc-report-card h4 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 var(--sp-3); }
.kc-bracket-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kc-bracket-row:last-child { border-bottom: 0; }
.kc-bracket-bar { height: 6px; border-radius: 3px; background: var(--accent); margin-top: 3px; transition: width .3s; }
.kc-attendance-chart { display: flex; align-items: flex-end; gap: 2px; height: 60px; }
.kc-att-bar { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .75; min-height: 2px; }
.kc-att-bar:hover { opacity: 1; }

/* ── Generic modal overlay ────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); padding: var(--sp-4); }
.modal-overlay[hidden] { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: 0 20px 60px rgba(0,0,0,0.35); display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }
.modal-close { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: none; border: none; cursor: pointer; color: var(--text-3); }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { overflow-y: auto; flex: 1; }

/* ── New family modal ─────────────────────────────────────── */
.kc-nf-step { display: flex; flex-direction: column; gap: var(--sp-3); }
.kc-nf-step-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 2px; }
.kc-nf-child-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-3); margin-bottom: var(--sp-2); position: relative; }
.kc-nf-remove-child { position: absolute; top: var(--sp-2); right: var(--sp-2); background: none; border: none; cursor: pointer; color: var(--text-3); padding: 2px; }
.kc-nf-remove-child:hover { color: #ef4444; }

/* ── Print labels ─────────────────────────────────────────── */
/* Screen: hidden */
#kk-print-area { display: none; }

@media print {
  /* Hide everything on screen */
  body > *:not(#kk-print-area) { display: none !important; }
  #kk-print-area {
    display: block !important;
    width: 100%;
  }
  .kk-label-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    padding: 10mm;
  }
  .kk-label {
    border: 2px solid #000;
    border-radius: 4mm;
    padding: 5mm 6mm;
    page-break-inside: avoid;
    font-family: Arial, sans-serif;
    color: #000;
    background: #fff;
    min-height: 55mm;
    display: flex;
    flex-direction: column;
    gap: 3mm;
  }
  .kk-label-church { font-size: 8pt; color: #666; text-transform: uppercase; letter-spacing: .06em; }
  .kk-label-name { font-size: 22pt; font-weight: 900; line-height: 1.1; }
  .kk-label-room { font-size: 11pt; font-weight: 700; padding: 2mm 4mm; border-radius: 3mm; color: #fff; display: inline-block; }
  .kk-label-allergy { background: #ef4444; color: #fff; font-size: 10pt; font-weight: 800; padding: 2mm 4mm; border-radius: 3mm; letter-spacing: .03em; }
  .kk-label-code-wrap { border: 2px solid #000; border-radius: 3mm; padding: 2mm 5mm; text-align: center; margin-top: auto; }
  .kk-label-code-label { font-size: 7pt; text-transform: uppercase; letter-spacing: .1em; color: #555; }
  .kk-label-code { font-size: 30pt; font-weight: 900; letter-spacing: 6px; line-height: 1; }
  .kk-label-footer { font-size: 8pt; color: #555; margin-top: 2mm; }

  /* Pickup pass — full page when printing from pickup screen */
  .kk-pickup-pass { page-break-before: always; }
  .kk-pickup-pass-code { font-size: 72pt; font-weight: 900; text-align: center; letter-spacing: 12px; }
}

.elv-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.elv-input:focus { outline: none; border-color: var(--accent); }

/* =====================================================
   SETTINGS
   ===================================================== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-7);
  align-items: start;
}
@media (max-width: 880px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row !important; overflow-x: auto; }
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-5));
}
.settings-tab {
  text-align: left;
  padding: 7px var(--sp-3);
  border-radius: var(--r-2);
  font-size: 13.5px;
  color: var(--text-2);
  transition: all var(--dur-1) var(--ease);
  white-space: nowrap;
}
.settings-tab:hover { background: var(--surface-2); color: var(--text); }
.settings-tab.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: var(--shadow-sm); }

.settings-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.settings-pane { display: none; flex-direction: column; gap: var(--sp-4); animation: fadeUp var(--dur-2) var(--ease); }
.settings-pane.active { display: flex; }

/* =====================================================
   FORMS
   ===================================================== */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field.row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.field.row:last-child { border-bottom: 0; padding-bottom: 0; }
.field.row > span:first-child { font-size: 13px; color: var(--text); font-weight: 500; }
/* Standalone boolean checkbox: checkbox on the left, label text on the right */
.fp-check-row { flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: var(--sp-2) 0; }
.fp-check-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: 15px; height: 15px; cursor: pointer; }
.fp-check-row > span { font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="password"],
.field input[type="search"],
.field input[type="url"],
.field input[type="date"],
.field input[type="time"],
.field input[type="datetime-local"],
.field select,
.field textarea,
.input-prefix input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px var(--sp-3);
  font-size: 13.5px;
  color: var(--text);
  outline: 0;
  transition: all var(--dur-1) var(--ease);
  width: 100%;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }

/* Modal form fields (.form-field / .form-label / .form-input) — used by the
   user-edit, invite and set-password dialogs. These classes had no styles, so
   inputs were falling back to the browser's default white boxes; match the
   app's dark input styling here. */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.form-input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px var(--sp-3);
  font-size: 13.5px;
  color: var(--text);
  outline: 0;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--dur-1) var(--ease);
}
.form-input::placeholder { color: var(--text-3); opacity: .7; }
.form-input:focus { border-color: var(--accent); }
select.form-input { color-scheme: dark; cursor: pointer; }
/* Stop Chrome autofill from forcing a white background on dark inputs */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--text);
}

/* Single-select role tick-box list (user-edit dialog). Mirrors the profile
   Access-level control; per-role accent colours are set inline by the renderer. */
.role-ticks { display: flex; flex-direction: column; gap: 3px; }
.role-tick {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 9px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.role-tick:hover:not(.is-on) { background: var(--surface-2); }
.role-tick-box {
  flex: none; width: 19px; height: 19px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line);
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.role-tick-main { flex: 1; min-width: 0; }
.role-tick-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.role-tick.is-on .role-tick-name { color: var(--text); }
.role-tick-desc { display: block; font-size: 11px; color: var(--text-3); line-height: 1.35; margin-top: 1px; }
.role-tick-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }

/* Date inputs — prevent browser from injecting white text-edit background */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark;
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
  background: transparent;
  color: inherit;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  background: transparent;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.input-prefix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
/* ── Combobox (typeahead) ──────────────────────────────────── */
.combobox {
  position: relative;
  width: 100%;
}
.combobox input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px var(--sp-3);
  font-size: 13.5px;
  color: var(--text);
  outline: 0;
  transition: all var(--dur-1) var(--ease);
  font-family: inherit;
  box-sizing: border-box;
}
.combobox input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.combobox-list {
  position: fixed;
  z-index: 9999;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  margin: 0; padding: var(--sp-1) 0;
}
.combobox-list li {
  padding: 8px var(--sp-3);
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text);
  transition: background var(--dur-1);
}
.combobox-list li:hover,
.combobox-list li[aria-selected="true"] { background: var(--surface-3); }
.combobox-list li .cb-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.combobox-list li .cb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.combobox-list li.cb-clear { color: var(--text-3); font-style: italic; }
/* ─────────────────────────────────────────────────────────── */

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.input-prefix {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  transition: all var(--dur-1) var(--ease);
  overflow: hidden;
}
.input-prefix i {
  font-style: normal;
  color: var(--text-3);
  font-size: 13.5px;
  padding: 0 var(--sp-1) 0 var(--sp-3);
}
.input-prefix input { border: 0 !important; box-shadow: none !important; padding-left: 0; }

/* switch */
.switch {
  display: inline-block;
  position: relative;
  width: 36px;
  height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}
.switch i::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform var(--dur-2) var(--ease);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::before { transform: translateX(16px); }

/* segmented */
.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-2);
  border-radius: var(--r-2);
  gap: 1px;
}
.seg-item {
  padding: 4px var(--sp-3);
  border-radius: calc(var(--r-2) - 2px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  transition: all var(--dur-1) var(--ease);
}
.seg-item:hover { color: var(--text); }
.seg-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* =====================================================
   SKIN PICKER
   ===================================================== */
.skinpicker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.skin {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-3);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all var(--dur-1) var(--ease);
}
.skin:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.skin.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.skin.active::after {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.skin-preview {
  height: 84px;
  border-radius: var(--r-1);
  overflow: hidden;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0;
  border: 1px solid;
  margin-bottom: var(--sp-3);
}
.skin-preview-side { padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; }
.skin-preview-side i {
  display: block;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  opacity: .15;
}
.skin-preview-side i.dot { width: 6px; height: 6px; border-radius: 50%; opacity: 1; }
.skin-preview-body { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.skin-preview-body i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: .2;
}
.skin-preview-body i.bar { height: 18px; opacity: .1; border-radius: 4px; }
.skin-name { font-size: 13px; font-weight: 600; }
.skin-desc { font-size: 11.5px; color: var(--text-3); }

/* accent swatches */
.accent-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--c, linear-gradient(135deg, var(--accent), var(--accent-2)));
  cursor: pointer;
  position: relative;
  transition: transform var(--dur-1) var(--ease);
  border: 0;
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 1px var(--line);
}
.swatch:hover { transform: scale(1.1); }
.swatch.active {
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--c, var(--accent));
}
.swatch[data-accent="default"] { background: linear-gradient(135deg, #818cf8, #6366f1); }
.swatch-custom {
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--surface-2);
}
.swatch-custom svg { width: 14px; height: 14px; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* =====================================================
   MODAL
   ===================================================== */
.dlg-shade {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: var(--sp-4);
  animation: shade var(--dur-2) var(--ease);
}
@keyframes shade { from { opacity: 0; } to { opacity: 1; } }
.dlg {
  width: 100%;
  max-width: 520px;
  max-height: min(calc(100vh - 96px), 90vh);
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  overflow: hidden;            /* keep rounded corners; body scrolls inside */
  display: flex;
  flex-direction: column;
  animation: pop var(--dur-3) var(--ease);
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-3) var(--r-3) 0 0;
  overflow: hidden;
  flex-shrink: 0;
}
.dlg-head h2 { font-size: 16px; font-weight: 600; }
.dlg-body {
  padding: var(--sp-5);
  overflow-y: auto;            /* scrolls when content exceeds the dialog */
  flex: 1 1 auto;
  min-height: 0;                /* allow shrinking inside flex parent */
}
.dlg-wide { max-width: 720px; }
.ep-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.ep-section { display: flex; flex-direction: column; gap: var(--sp-2); }
.ep-section + .ep-section { padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.ep-section-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 4px;
}
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-3) var(--r-3);
  overflow: hidden;
  flex-shrink: 0;
}

/* =====================================================
   COMMAND PALETTE
   ===================================================== */
.cmdk-shade { align-items: flex-start; padding-top: 12vh; }
.cmdk {
  width: 100%;
  max-width: 560px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop var(--dur-3) var(--ease);
}
.cmdk-input {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.cmdk-input svg { width: 18px; height: 18px; color: var(--text-3); }
.cmdk-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}
.cmdk-input kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
}
.cmdk-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
}
.cmdk-group-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
}
.cmdk-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-1);
  cursor: pointer;
  font-size: 13.5px;
}
.cmdk-row.selected { background: var(--accent-soft); }
.cmdk-row svg { width: 16px; height: 16px; color: var(--text-3); }
.cmdk-row.selected svg { color: var(--accent); }
.cmdk-row span { flex: 1; }
.cmdk-row small { font-size: 11.5px; color: var(--text-3); }
.cmdk-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text-3);
}
.cmdk-foot kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-right: 4px;
}

/* =====================================================
   TOASTS
   ===================================================== */
.toasts {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 200;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 280px;
  max-width: 380px;
  font-size: 13px;
  animation: toastIn var(--dur-3) var(--ease);
}
.toast.out { animation: toastOut var(--dur-2) var(--ease) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px); }
}
.toast-ic {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.toast.success .toast-ic { background: var(--pos-soft); color: var(--pos); }
.toast.info .toast-ic    { background: var(--accent-soft); color: var(--accent); }
.toast.warn .toast-ic    { background: var(--warn-soft); color: var(--warn); }
.toast.error .toast-ic   { background: var(--neg-soft); color: var(--neg); }
.toast-body { flex: 1; }
.toast-body strong { display: block; font-weight: 600; font-size: 13px; }
.toast-body small { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .page-wrap { padding: var(--sp-5); }
}

/* =====================================================
   NEO CHURCH — additions
   ===================================================== */

/* badge neutral variant */
.badge-neutral { color: var(--text-3); background: var(--surface-2); }

/* scope + role pills in sidebar */
.scope-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  text-align: left;
  width: 100%;
  transition: all var(--dur-1) var(--ease);
}
.scope-pill:hover { border-color: var(--line-strong); }
.scope-pill > svg:first-child { width: 18px; height: 18px; color: var(--accent); }
.scope-pill > svg:last-child  { width: 12px; height: 12px; color: var(--text-3); }
.scope-meta { flex: 1; min-width: 0; }
.scope-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.scope-name  { font-size: 13px; font-weight: 600; }

.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 var(--sp-2);
}
.role-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--dur-1) var(--ease);
}
.role-pill:hover { border-color: var(--line-strong); }
.role-pill svg { width: 10px; height: 10px; color: var(--text-3); }
.role-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.role-dot.role-super       { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .15); }
.role-dot.role-site_admin  { background: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, .15); }
.role-dot.role-leader      { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .15); }
.role-dot.role-volunteer   { background: #60a5fa; box-shadow: 0 0 0 3px rgba(96, 165, 250, .15); }
.role-dot.role-member      { background: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, .15); }

/* popmenu (scope + role) */
.popmenu {
  position: fixed;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  min-width: 240px;
  padding: var(--sp-2);
  animation: pop var(--dur-2) var(--ease);
}
.popmenu-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: var(--sp-2) var(--sp-3);
}
.popmenu ul { list-style: none; padding: 0; margin: 0; }
.popmenu li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-1);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
}
.popmenu li small {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 1px;
}
.popmenu li > div { flex: 1; min-width: 0; }
.popmenu li:hover { background: var(--surface-2); }
.popmenu li.active { background: var(--accent-soft); color: var(--accent); }
.popmenu li.active small { color: var(--accent); opacity: .7; }

/* service list (dashboard) */
.service-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.service-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2);
  border-radius: var(--r-2);
  transition: background var(--dur-1) var(--ease);
}
.service-row:hover { background: var(--surface-2); }
.service-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--r-2);
  padding: 6px 4px;
  text-transform: uppercase;
}
.service-date b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.service-date span { font-size: 10px; color: var(--text-3); font-weight: 600; letter-spacing: 0.05em; }
.service-meta-title { font-weight: 600; font-size: 13.5px; }
.service-meta-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.service-status {
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
}
.service-status.Planned    { background: var(--warn-soft); color: var(--warn); }
.service-status.Published  { background: var(--accent-soft); color: var(--accent); }
.service-status.Completed  { background: var(--pos-soft); color: var(--pos); }
.service-status.Cancelled  { background: var(--neg-soft); color: var(--neg); }
.service-status.Draft      { background: var(--surface-2); color: var(--text-3); }

/* gap list */
.gap-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.gap-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-2);
}
.gap-list li:hover { background: var(--surface-2); }
.gap-ic {
  width: 32px; height: 32px;
  border-radius: var(--r-2);
  background: var(--warn-soft);
  color: var(--warn);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.gap-ic svg { width: 16px; height: 16px; }
.gap-body { flex: 1; min-width: 0; }
.gap-name { font-weight: 600; font-size: 13.5px; }
.gap-meta { font-size: 12px; color: var(--text-3); }

/* people list */
.people-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.people-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-2);
}
.people-list li:hover { background: var(--surface-2); }
.people-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.people-meta { font-size: 12px; color: var(--text-3); }

/* care list */
.care-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.care-list li { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2); border-radius: var(--r-2); }
.care-list li:hover { background: var(--surface-2); }
.care-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-1);
  flex-shrink: 0;
  margin-top: 2px;
}
.care-tag.Prayer    { background: rgba(167, 139, 250, .15); color: #a78bfa; }
.care-tag.Hospital  { background: rgba(248, 113, 113, .15); color: #f87171; }
.care-tag.Meal      { background: rgba(251, 191, 36, .15); color: #fbbf24; }
.care-tag.Visit     { background: rgba(96, 165, 250, .15); color: #60a5fa; }
.care-tag.Other     { background: var(--surface-2); color: var(--text-3); }
.care-text { flex: 1; min-width: 0; font-size: 13px; }
.care-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* status pills */
.status-Member   { background: var(--accent-soft); color: var(--accent); padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; }
.status-Regular  { background: rgba(52, 211, 153, .14); color: #34d399; padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; }
.status-Visitor  { background: rgba(96, 165, 250, .14); color: #60a5fa; padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; }
.status-Inactive,
.status-Archived { background: var(--surface-2); color: var(--text-3); padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; }

/* tags row inside people table */
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

/* family grid */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.family-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.family-name { font-weight: 600; font-size: 15px; font-family: var(--font-display, var(--font-sans)); }
.family-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; margin-bottom: var(--sp-3); }
.family-members { display: flex; flex-direction: column; gap: 6px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.family-member { display: flex; align-items: center; gap: var(--sp-2); font-size: 13px; }
.family-relation { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* group grid */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}
.group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-1) var(--ease);
  cursor: pointer;
  overflow: hidden;
}
.group-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.group-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* Scheduled Tasks (automations) */
.automations-list { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 760px; }
.auto-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.auto-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.auto-card-title { font-weight: 600; font-size: 15px; }
.auto-card-desc { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.auto-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.auto-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); border-top: 1px solid var(--line); padding-top: var(--sp-3); }

/* Message templates */
.mt-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); }
.mt-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: var(--sp-2) var(--sp-4); font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.mt-tab:hover { color: var(--text); }
.mt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.mt-grid { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 760px; }
.mt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.mt-card-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.mt-card-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-2); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.mt-card-info { flex: 1; min-width: 0; }
.mt-card-name { font-weight: 600; font-size: 15px; }
.mt-card-desc { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.mt-card-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }
.mt-card-subject { font-size: 13px; font-weight: 500; color: var(--text-2); border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.mt-card-body { font-size: 13px; color: var(--text-2); white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r-2); padding: var(--sp-3); font-family: inherit; line-height: 1.6; }
.mt-tokens { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.mt-tokens-label { font-size: 12px; color: var(--text-3); margin-bottom: var(--sp-2); }
.mt-token-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mt-token-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 3px 10px; font-size: 12px; font-family: monospace; cursor: pointer; color: var(--text-2); transition: background .12s, color .12s; }
.mt-token-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-danger-ghost { color: var(--color-danger, #f87171); }
.btn-danger-ghost:hover { background: rgba(248,113,113,.1); }

/* ── Template Editor ─────────────────────────────────────── */
.tpe-bar { display:flex; align-items:center; gap:var(--sp-3); padding:var(--sp-3) var(--sp-5); border-bottom:1px solid var(--line); background:var(--surface); position:sticky; top:0; z-index:10; }
.tpe-name-input { flex:1; min-width:0; border:none; background:transparent; font-size:17px; font-weight:600; color:var(--text); padding:var(--sp-1) var(--sp-2); border-radius:var(--r-1); }
.tpe-name-input:focus { outline:none; background:var(--surface-2); }
.tpe-name-input::placeholder { color:var(--text-3); font-weight:400; }
.tpe-bar-right { display:flex; align-items:center; gap:var(--sp-2); flex-shrink:0; }
.tpe-type-sel { padding:6px 10px; border:1px solid var(--line); border-radius:var(--r-2); background:var(--surface); color:var(--text); font-size:13px; }

/* Starter gallery */
.tpe-starters { padding:var(--sp-6) var(--sp-6); max-width:880px; }
.tpe-starters-head { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:var(--sp-5); gap:var(--sp-4); }
.tpe-type-toggle { display:flex; border:1px solid var(--line); border-radius:var(--r-2); overflow:hidden; flex-shrink:0; }
.tpe-type-btn { padding:6px 16px; background:none; border:none; cursor:pointer; font-size:13px; font-weight:500; color:var(--text-2); transition:background .12s,color .12s; }
.tpe-type-btn.active { background:var(--accent); color:#fff; }
.tpe-starters-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:var(--sp-3); }
.tpe-starter-card { background:var(--surface); border:2px solid var(--line); border-radius:var(--r-3); padding:var(--sp-4); cursor:pointer; transition:border-color .15s,box-shadow .15s; display:flex; flex-direction:column; gap:var(--sp-2); }
.tpe-starter-card:hover { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent); }
.tpe-starter-name { font-weight:600; font-size:14px; }
.tpe-starter-sub { font-size:11px; color:var(--text-3); font-style:italic; }
.tpe-starter-prev { font-size:12px; color:var(--text-2); line-height:1.5; flex:1; }

/* Email editor layout */
.tpe-layout { display:flex; gap:var(--sp-4); padding:var(--sp-4) var(--sp-5); align-items:flex-start; }
.tpe-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.tpe-sidebar { width:200px; flex-shrink:0; position:sticky; top:60px; }

/* Subject row */
.tpe-subject-row { display:flex; align-items:center; gap:var(--sp-3); border:1px solid var(--line); border-radius:var(--r-2) var(--r-2) 0 0; padding:var(--sp-2) var(--sp-3); background:var(--surface-2); border-bottom:none; }
.tpe-subject-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); white-space:nowrap; }
.tpe-subject-input { flex:1; border:none; background:transparent; font-size:14px; color:var(--text); padding:0; }
.tpe-subject-input:focus { outline:none; }

/* Editor tabs */
.tpe-editor-tabs { display:flex; border:1px solid var(--line); border-bottom:none; border-radius:0; overflow:hidden; }
.tpe-tab { display:inline-flex; align-items:center; gap:5px; background:var(--surface-2); border:none; border-right:1px solid var(--line); padding:8px 14px; font-size:13px; font-weight:500; color:var(--text-2); cursor:pointer; transition:background .12s,color .12s; }
.tpe-tab:last-child { border-right:none; }
.tpe-tab:hover { color:var(--text); background:var(--surface); }
.tpe-tab.active { background:var(--surface); color:var(--accent); box-shadow:inset 0 -2px 0 var(--accent); }

/* Toolbar */
.tpe-toolbar { display:flex; align-items:center; gap:2px; flex-wrap:wrap; padding:6px 8px; background:var(--surface); border:1px solid var(--line); border-bottom:none; }
.tpe-tb-group { display:flex; gap:1px; }
.tpe-tb-sep { width:1px; height:20px; background:var(--line); margin:0 4px; align-self:center; }
.tpe-tool { min-width:28px; height:28px; padding:0 4px; border:none; background:none; border-radius:var(--r-1); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; color:var(--text-2); transition:background .1s,color .1s; }
.tpe-tool:hover { background:var(--surface-2); color:var(--text); }

/* Panes */
.tpe-pane { display:flex; flex-direction:column; }
.tpe-editor { min-height:360px; padding:var(--sp-4) var(--sp-5); border:1px solid var(--line); border-radius:0 0 var(--r-2) var(--r-2); font-size:15px; line-height:1.7; color:var(--text); background:var(--surface); outline:none; }
.tpe-editor:focus { border-color:var(--accent); }
.tpe-editor h1,.tpe-editor h2,.tpe-editor h3 { margin:.8em 0 .3em; line-height:1.3; }
.tpe-editor p { margin:0 0 .8em; }
.tpe-editor p:last-child { margin-bottom:0; }
.tpe-editor ul,.tpe-editor ol { padding-left:1.6em; margin:.5em 0; }
.tpe-editor li { margin:.2em 0; }
.tpe-editor a { color:var(--accent); }
.tpe-editor blockquote { border-left:3px solid var(--line); padding:.5em 1em; color:var(--text-2); margin:.8em 0; }
.tpe-html-ta { width:100%; min-height:360px; padding:var(--sp-4); border:1px solid var(--line); border-radius:0 0 var(--r-2) var(--r-2); font-family:'SFMono-Regular',Consolas,'Liberation Mono',monospace; font-size:13px; line-height:1.6; color:var(--text); background:var(--surface); resize:vertical; box-sizing:border-box; }
.tpe-html-ta:focus { outline:none; border-color:var(--accent); }
.tpe-preview-frame { width:100%; height:460px; border:none; border:1px solid var(--line); border-top:none; border-radius:0 0 var(--r-2) var(--r-2); display:block; background:#fff; }

/* Sidebar */
.tpe-sidebar-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); margin-bottom:4px; }
.tpe-sidebar-hint { font-size:11px; color:var(--text-3); margin-bottom:var(--sp-3); }
.tpe-var-group { margin-bottom:var(--sp-3); }
.tpe-var-group-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); margin-bottom:4px; }
.tpe-var-chip { display:block; width:100%; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-1); padding:4px 8px; font-size:11px; font-family:monospace; color:var(--text-2); cursor:pointer; margin-bottom:3px; transition:background .1s,color .1s,border-color .1s; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tpe-var-chip:hover { background:var(--accent); color:#fff; border-color:var(--accent); }

/* SMS editor */
.tpe-sms-layout { display:flex; gap:var(--sp-6); padding:var(--sp-5); align-items:flex-start; }
.tpe-sms-main { flex:1; min-width:0; }
.tpe-sms-ta { width:100%; min-height:160px; padding:var(--sp-4); border:1px solid var(--line); border-radius:var(--r-2); font-family:inherit; font-size:15px; line-height:1.6; color:var(--text); background:var(--surface); resize:vertical; box-sizing:border-box; }
.tpe-sms-ta:focus { outline:none; border-color:var(--accent); }
.tpe-sms-meta { display:flex; gap:var(--sp-3); margin-top:var(--sp-2); font-size:12px; color:var(--text-3); }
.tpe-sms-meta span { background:var(--surface-2); border:1px solid var(--line); border-radius:9999px; padding:2px 10px; }

/* Phone mockup */
.tpe-phone-wrap { display:flex; justify-content:center; padding-top:var(--sp-2); flex-shrink:0; }
.tpe-phone { width:220px; background:#111; border-radius:32px; padding:10px; box-shadow:0 24px 48px rgba(0,0,0,.3),0 0 0 1px rgba(255,255,255,.08) inset; display:flex; flex-direction:column; gap:6px; }
.tpe-phone-notch { height:24px; background:#000; border-radius:12px; margin:0 40px; }
.tpe-phone-screen { background:#f2f2f7; border-radius:20px; overflow:hidden; display:flex; flex-direction:column; min-height:340px; }
.tpe-phone-header { background:#fff; padding:10px 14px 8px; text-align:center; font-size:12px; font-weight:600; color:#1c1c1e; border-bottom:0.5px solid #c6c6c8; }
.tpe-phone-body { flex:1; padding:12px 10px; display:flex; flex-direction:column; justify-content:flex-end; gap:6px; }
.tpe-phone-bubble { background:#e5e5ea; color:#1c1c1e; border-radius:16px 16px 4px 16px; padding:8px 11px; font-size:12px; line-height:1.5; max-width:85%; word-break:break-word; white-space:pre-wrap; align-self:flex-start; }
.tpe-phone-home-bar { height:20px; display:flex; align-items:center; justify-content:center; }
.tpe-phone-home-bar::after { content:''; display:block; width:60px; height:4px; background:rgba(255,255,255,.2); border-radius:2px; }

/* Volunteer onboarding */
.vol-stage-filter { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.status-pill.status-danger { background: rgba(248,113,113,.15); color: #f87171; }
.vol-section { border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-4); margin: var(--sp-2) 0; }
.vol-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.vol-section-head h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 0; }
.vol-portal-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.vol-portal-link:hover { text-decoration: underline; }
.vol-compliance-banner { padding: var(--sp-3); border-radius: var(--r-2); font-size: 13px; margin-bottom: var(--sp-2); }
.vol-compliance-banner.ok { background: rgba(52,211,153,.12); color: #34d399; }
.vol-compliance-banner.warn { background: rgba(245,181,10,.12); color: #f5b50a; }

/* Editable team name on the manage page */
#td-name-input:hover { border-bottom-color: var(--line) !important; }
#td-name-input:focus { border-bottom-color: var(--accent) !important; }
.group-card-photo {
  margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) 0;
  height: 140px;
  overflow: hidden;
}
.group-card-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: top; display: block;
  transition: transform 0.3s ease;
}
.group-card:hover .group-card-photo img { transform: scale(1.03); }
.group-card-head { display: flex; align-items: flex-start; gap: var(--sp-3); justify-content: space-between; }

/* Leader search dropdown (group dialog) */
.g-leader-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 300;
  margin-top: 4px; max-height: 220px; overflow-y: auto;
  background: var(--surface, #1a1a1a); border: 1px solid var(--line, #2a2a2a);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); padding: 4px;
}
.g-leader-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.g-leader-opt:hover, .g-leader-opt.active { background: var(--bg-2, rgba(255,255,255,0.06)); }
.g-leader-opt .g-leader-opt-name { font-size: 13px; font-weight: 500; }
.g-leader-opt .g-leader-opt-meta { font-size: 11px; color: var(--text-2); margin-left: auto; }
.g-leader-empty { padding: 10px; font-size: 12px; color: var(--text-2); text-align: center; }
.group-name { font-weight: 600; font-size: 15px; font-family: var(--font-display, var(--font-sans)); letter-spacing: -0.01em; }
.group-cat {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: 600;
}
.group-meta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 12.5px;
  color: var(--text-2);
}
.group-meta-row span { display: flex; align-items: center; gap: 4px; }
.group-meta-row svg { width: 13px; height: 13px; color: var(--text-3); }
.group-leader { display: flex; align-items: center; gap: var(--sp-2); font-size: 12.5px; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.group-leader-label { color: var(--text-3); margin-right: auto; }
.group-leader-thumb { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* ── Team manage ──────────────────────────────────────────────── */
.td-person-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-2);
  background: var(--surface-2); font-size: 13px;
}
.td-person-name { flex: 1; font-weight: 500; }
.td-remove-btn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-3); border-radius: var(--r-1);
  display: flex; align-items: center;
}
.td-remove-btn:hover { background: var(--surface-3); color: #ef4444; }
.td-search-wrap { position: relative; }
.td-search-wrap .input-group { max-width: none; width: 100%; }
.td-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: var(--shadow-lg);
  z-index: 50; list-style: none; padding: 4px; margin: 0; max-height: 220px; overflow-y: auto;
}
.td-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-1); cursor: pointer; font-size: 13px;
}
.td-result-item:hover { background: var(--surface-2); }
.cc-target-card { transition: border-color .12s, box-shadow .12s; }
.cc-target-card:hover { border-color: var(--accent, #E0A500) !important; box-shadow: var(--shadow-lg); }
.td-no-results { padding: 10px 12px; font-size: 13px; color: var(--text-3); cursor: default; }

/* Volunteer onboarding workflow steps */
.td-workflow-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.td-workflow-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; background: var(--surface-2); border-radius: var(--r-2);
}
.td-step-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: #000; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0; margin-top: 1px;
}
.td-step-title { font-weight: 600; font-size: 13px; }
.td-step-desc  { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* service grid */
.service-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* ── Service card ───────────────────────────────────────── */
.svc-dash-list { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ── Dashboard: engagement summary + config ─────────────────── */
.btn-icon-only { padding: 8px; }
.dash-eng-wrap { margin-bottom: var(--sp-5); }
.dash-eng-wrap[hidden] { display: none; }
.dash-eng-head { margin: 0 2px var(--sp-3); }
.dash-eng-title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.dash-eng-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3); }
.eng-tile {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: 14px 16px; overflow: hidden;
}
.eng-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--eng-tone, var(--accent)); }
.eng-tile[data-tone="gold"]   { --eng-tone: #f5b400; }
.eng-tile[data-tone="blue"]   { --eng-tone: #0ea5e9; }
.eng-tile[data-tone="green"]  { --eng-tone: #22c55e; }
.eng-tile[data-tone="violet"] { --eng-tone: #8b5cf6; }
.eng-tile[data-tone="teal"]   { --eng-tone: #14b8a6; }
.eng-tile[data-tone="rose"]   { --eng-tone: #f43f5e; }
.eng-tile-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.eng-tile-label { font-size: 13px; font-weight: 600; margin-top: 4px; }
.eng-tile-sub { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }

.dash-cfg-grouphead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.dash-cfg-list { display: flex; flex-direction: column; gap: 2px; }
.dash-cfg-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 8px 10px; border-radius: var(--r-2); }
.dash-cfg-row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.dash-cfg-name { font-size: 13.5px; }
.dash-cfg-name small { color: var(--text-3); }
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-3) var(--sp-4);
  display: grid;
  grid-template-columns: 54px 66px 76px 1fr auto;
  gap: 0 var(--sp-3);
  align-items: center;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Date square */
.svc-cal {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 54px; height: 58px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  flex-shrink: 0;
  gap: 2px;
}
.svc-cal-day { font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.svc-cal-month { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }

/* Day / time box */
.svc-when {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 66px; height: 58px;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  flex-shrink: 0;
  gap: 4px;
}
.svc-when-dow  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); }
.svc-when-time { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }

/* Preacher block */
.svc-preacher-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; flex-shrink: 0; width: 76px;
}
.svc-preacher-block--empty { visibility: hidden; }
.svc-preacher-block-name {
  font-size: 10.5px; font-weight: 500; color: var(--text-2);
  line-height: 1.25; text-align: center;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  max-width: 76px;
}

/* Body */
.svc-body { min-width: 0; }
.svc-name {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3; color: var(--text);
}
.svc-series { font-weight: 400; color: var(--text-3); font-size: 13.5px; }

.svc-sub-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 3px 14px; margin-top: 6px;
}
.svc-sub-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.svc-sub-name  { font-weight: 500; }
.svc-sub-muted { color: var(--text-3); }
.svc-sub-loc   { color: var(--text-3); font-size: 12px; }
.svc-sub-loc svg { flex-shrink: 0; opacity: 0.65; }

/* Avatar (shared with service detail) */
.svc-preacher-avatar {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1.5px solid var(--line);
}
.svc-preacher-avatar.svc-preacher-avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg);
  font-size: 7px; font-weight: 700; letter-spacing: 0;
}
.svc-preacher-avatar--lg { width: 36px !important; height: 36px !important; font-size: 12px !important; }

/* Roster summary row */
.svc-roster-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin-top: 9px;
}
.svc-team-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-pill, 999px);
  font-size: 11px; font-weight: 500; border: 1px solid;
  white-space: nowrap;
}
.svc-team-pill--full    { background: rgba(74,222,128,.08);  border-color: rgba(74,222,128,.25);  color: #4ade80; }
.svc-team-pill--partial { background: rgba(251,191,36,.08);  border-color: rgba(251,191,36,.25);  color: #fbbf24; }
.svc-team-pill--empty   { background: rgba(148,163,184,.06); border-color: rgba(148,163,184,.18); color: var(--text-3); }
.svc-team-pill-count    { font-weight: 700; opacity: .85; }

/* Right meta column */
.svc-meta-right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: var(--sp-2); padding-top: 3px; flex-shrink: 0;
}
.svc-attend {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px; font-size: 11px; color: var(--text-3);
}
.svc-attend b { color: var(--text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.svc-promo-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: var(--text-3);
  text-decoration: none; white-space: nowrap;
  opacity: 0; transition: opacity .15s;
}
.service-card:hover .svc-promo-link { opacity: 1; }
.svc-promo-link:hover { color: var(--accent); }

/* Keep old chip classes for service detail view */
.svc-team-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: var(--sp-2); }
.svc-team-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-pill, 999px);
  font-size: 11px; font-weight: 500; border: 1px solid;
  white-space: nowrap;
}
.svc-team-chip--full    { background: rgba(74,222,128,.1);  border-color: rgba(74,222,128,.3);  color: #4ade80; }
.svc-team-chip--partial { background: rgba(251,191,36,.1);  border-color: rgba(251,191,36,.3);  color: #fbbf24; }
.svc-team-chip--empty   { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.2); color: var(--text-3); }
.svc-team-chip-count { font-weight: 700; opacity: .9; }

/* event grid */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--dur-1) var(--ease);
}
.event-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.event-banner {
  height: 140px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: var(--text-on-accent);
  font-size: 36px;
  position: relative;
  background-size: cover;
  background-position: center;
}
.event-banner.has-photo {
  background-color: transparent;
}
/* Subtle gradient overlay on photo so text below pops if we ever overlay it */
.event-banner.has-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.25), transparent 60%);
  pointer-events: none;
}
.event-banner-emoji { font-size: 44px; }
.event-card { overflow: hidden; transition: transform var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.event-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.event-card:hover .event-banner.has-photo { filter: brightness(1.05); }
.event-body { padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: 6px; }
.event-title { font-weight: 600; font-size: 15px; font-family: var(--font-display, var(--font-sans)); letter-spacing: -0.01em; }
.event-meta { font-size: 12.5px; color: var(--text-3); }
.event-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.event-cap-bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.event-cap-bar i { display: block; height: 100%; transition: width .3s ease; }
.event-cap-label { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.event-status-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: var(--r-pill, 999px);
  border: 1px solid transparent;
}
.event-status-badge.published, .event-status-badge.confirmed {
  background: rgba(74,222,128,.15); color: #4ade80; border-color: rgba(74,222,128,.3);
}
.event-status-badge.waitlist {
  background: rgba(251,146,60,.15); color: #fb923c; border-color: rgba(251,146,60,.3);
}
.event-status-badge.cancelled {
  background: rgba(248,113,113,.15); color: #f87171; border-color: rgba(248,113,113,.3);
}
.event-status-badge.draft {
  background: rgba(203,213,225,.12); color: #cbd5e1; border-color: rgba(203,213,225,.2);
}
/* When inside the event banner, float it top-right */
.event-banner .event-status-badge {
  position: absolute; top: 10px; right: 10px;
  backdrop-filter: blur(6px);
}

/* calendar grid */
/* ── Calendar toolbar ─────────────────────────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cal-nav-group { display: flex; align-items: center; gap: 4px; }
.cal-label { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }

/* ── Month view ───────────────────────────────────────────────── */
.cal-month { display: flex; flex-direction: column; }
.cal-month-row { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-month-header { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-month-hcell {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); padding: 8px 10px; text-align: center;
}
.cal-month-cell {
  min-height: 100px; padding: 6px 8px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background 0.1s;
}
.cal-month-cell:hover { background: var(--surface-3); }
.cal-month-cell:nth-child(7n) { border-right: 0; }
.cal-month-cell.other-month { opacity: 0.4; }
.cal-month-cell.today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.cal-day-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-size: 12.5px;
  font-weight: 500; color: var(--text-2); margin-bottom: 4px;
}
.cal-day-num.today {
  background: var(--accent); color: #000; font-weight: 700;
}

/* ── Chips (month chips + all-day) ────────────────────────────── */
.cal-chip {
  display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 3px;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; line-height: 1.5;
}
.cal-chip-cal     { background: rgba(234,179,8,.15);  color: #ca8a04; }
.cal-chip-event   { background: rgba(139,92,246,.15); color: #a78bfa; }
.cal-chip-service { background: rgba(59,130,246,.15); color: #3b82f6; }
.cal-chip-task    { background: rgba(16,185,129,.15); color: #10b981; }
.cal-chip-block { display: block; margin-bottom: 3px; }
.cal-chip-time  { opacity: 0.6; font-size: 10.5px; }

/* Agenda (list) view — the default on mobile */
.cal-agenda { padding: var(--sp-3) var(--sp-4) var(--sp-5); }
.cal-agenda-empty { padding: var(--sp-6); text-align: center; color: var(--text-3); }
.cal-agenda-day { margin-top: var(--sp-4); }
.cal-agenda-day:first-child { margin-top: 0; }
.cal-agenda-date { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-2); }
.cal-agenda-day.is-today .cal-agenda-date { color: var(--accent); }
.cal-agenda-row { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 4px; cursor: pointer; border-radius: var(--r-2); }
.cal-agenda-row:hover { background: var(--surface-2, rgba(127,127,127,.08)); }
.cal-agenda-time { flex: 0 0 66px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cal-agenda-body { flex: 1; min-width: 0; }
.cal-agenda-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-agenda-sub { font-size: 12px; color: var(--text-3); }
.cal-agenda-badge { flex: 0 0 auto; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.cal-agenda-task .cal-agenda-title { font-weight: 500; }

/* Calendar responsiveness — let the header wrap and the grid scroll on phones */
@media (max-width: 760px) {
  .page[data-page="calendar"] .page-actions { flex-wrap: wrap; gap: var(--sp-2); }
  .page[data-page="calendar"] #cal-view-seg { overflow-x: auto; }
  #cal-container { overflow-x: auto; }
  .cal-agenda-time { flex-basis: 54px; }
}
.cal-chip-more  { font-size: 11px; color: var(--text-3); padding: 0 4px; cursor: pointer; }

/* ── Week / Day view ──────────────────────────────────────────── */
.cal-week-wrap { display: flex; flex-direction: column; }
.cal-week-head {
  display: flex; background: var(--surface-2);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
}
.cal-week-gutter { width: 52px; flex-shrink: 0; border-right: 1px solid var(--line); }
.cal-week-col-head {
  flex: 1; text-align: center; padding: 10px 4px; border-right: 1px solid var(--line);
}
.cal-week-col-head:last-child { border-right: 0; }
.cal-week-col-head.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cal-wd { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.cal-dn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; font-size: 15px; font-weight: 600;
  color: var(--text); margin-top: 2px;
}
.cal-dn.today { background: var(--accent); color: #000; }

/* All-day row */
.cal-allday-row {
  display: flex; border-bottom: 1px solid var(--line);
  background: var(--surface-2); min-height: 28px;
}
.cal-allday-label { font-size: 10px; color: var(--text-3); padding: 4px 4px 0; text-align: right; line-height: 1; }
.cal-allday-cell  { flex: 1; padding: 3px 4px; border-right: 1px solid var(--line); }
.cal-allday-cell:last-child { border-right: 0; }

/* Scrollable time body */
.cal-time-body {
  overflow-y: auto; overflow-x: hidden;
  max-height: calc(100vh - 280px);
  min-height: 400px;
}
.cal-time-inner {
  display: flex; position: relative;
}
.cal-time-labels { width: 52px; flex-shrink: 0; position: relative; }
.cal-time-label {
  position: absolute; right: 8px; font-size: 10.5px; color: var(--text-3);
  transform: translateY(-50%); white-space: nowrap;
}

/* Day columns */
.cal-day-col {
  flex: 1; position: relative; border-right: 1px solid var(--line); cursor: pointer;
}
.cal-day-col:last-child { border-right: 0; }
.cal-hour-line {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px solid var(--line); pointer-events: none;
}

/* Event blocks in week/day */
.cal-evt-block {
  position: absolute; left: 2px; right: 2px; border-radius: 4px;
  padding: 3px 6px; overflow: hidden; cursor: pointer;
  font-size: 11.5px; line-height: 1.3; z-index: 1;
  transition: filter 0.1s;
}
.cal-evt-block:hover { filter: brightness(1.15); }
.cal-evt-cal     { background: rgba(234,179,8,.2);  border-left: 3px solid #ca8a04; color: var(--text); }
.cal-evt-event   { background: rgba(139,92,246,.2); border-left: 3px solid #a78bfa; color: var(--text); }
.cal-evt-service { background: rgba(59,130,246,.2); border-left: 3px solid #3b82f6; color: var(--text); }
.cal-evt-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evt-sub   { display: block; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Current time line */
.cal-now-line {
  position: absolute; left: 52px; right: 0; height: 2px;
  background: #ef4444; z-index: 3; pointer-events: none;
}
.cal-now-line::before {
  content: ''; position: absolute; left: -5px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: #ef4444;
}

/* Legacy grid (keep for any remaining refs) */
.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  border-radius: var(--r-3);
  overflow: hidden;
}
.cal-head { font-size: 11px; padding: var(--sp-2); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-time { font-size: 10.5px; padding: 4px 8px; color: var(--text-3); border-right: 1px solid var(--line); }
.cal-cell { min-height: 64px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.cal-cell:nth-child(8n) { border-right: 0; }
.cal-evt {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-1);
  padding: 4px 6px;
  font-size: 11.5px;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.3;
}
.cal-evt b { display: block; font-weight: 600; font-size: 11px; }
.cal-evt small { font-size: 10.5px; color: var(--text-3); }
.cal-evt.kids { background: rgba(96, 165, 250, .14); border-left-color: #60a5fa; }
.cal-evt.youth { background: rgba(167, 139, 250, .14); border-left-color: #a78bfa; }

/* check-in */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neg);
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--neg-soft);
}
.live-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--neg);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.85); }
}
.checkin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.checkin-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-2);
}
.checkin-list li:hover { background: var(--surface-2); }
.checkin-type {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text-3);
}
.checkin-type.Adult { background: var(--accent-soft); color: var(--accent); }
.checkin-type.Kid   { background: rgba(96, 165, 250, .14); color: #60a5fa; }
.checkin-type.Vol   { background: rgba(52, 211, 153, .14); color: #34d399; }
.checkin-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-1) var(--ease);
}
.form-card:hover { border-color: var(--accent); }
.form-card-head { display: flex; align-items: center; gap: var(--sp-3); }
.form-ic {
  width: 36px; height: 36px;
  border-radius: var(--r-2);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.form-name { font-weight: 600; font-size: 14.5px; font-family: var(--font-display, var(--font-sans)); }
.form-meta-row { display: flex; gap: var(--sp-4); font-size: 12.5px; color: var(--text-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.form-meta-row b { color: var(--text); font-variant-numeric: tabular-nums; }

/* kanban */
.care-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-4);
  align-items: start;
}
/* Prayer page: board on top, team panel full-width along the bottom. */
.prayer-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.prayer-team-panel { position: static; top: auto; }
.prayer-team-panel .care-leaders-list {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  max-height: none;
  padding: var(--sp-3);
}
.prayer-team-panel .prayer-whole-team-chip { margin: 0 var(--sp-1) 0 0; }
.care-leaders-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  position: sticky;
  top: var(--sp-4);
}
.care-leaders-header {
  padding: var(--sp-3) var(--sp-4);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
}
.care-leaders-list {
  display: flex;
  flex-direction: column;
  padding: var(--sp-2);
  gap: var(--sp-1);
  max-height: 70vh;
  overflow-y: auto;
}
.leader-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-2);
  cursor: grab;
  font-size: 12.5px;
  font-weight: 500;
  user-select: none;
  transition: background var(--dur-1);
}
.leader-chip:hover { background: var(--surface-2); }
.leader-chip.dragging { opacity: 0.4; cursor: grabbing; }
.prayer-whole-team-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) var(--sp-3) var(--sp-2);
  background: #ef4444;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 6px rgba(239,68,68,.35);
  transition: opacity .15s, transform .15s, box-shadow .15s;
}
.prayer-whole-team-chip:hover { opacity: .92; box-shadow: 0 4px 10px rgba(239,68,68,.45); transform: translateY(-1px); }
.prayer-whole-team-chip.dragging { opacity: .4; cursor: grabbing; transform: none; }
.leader-chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.kanban-card.leader-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-tint));
}
.kanban-card-leader {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 4px;
}
.kanban-card-leader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.kanban-count {
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}
.kanban-card {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-3);
  font-size: 12.5px;
  cursor: grab;
  transition: all var(--dur-1) var(--ease);
}
.kanban-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
.kanban-col.drop-target { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: var(--accent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-card-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 4px; }
.kanban-card-title { font-weight: 600; font-size: 13px; }
.kanban-card-text { color: var(--text-2); font-size: 12px; line-height: 1.5; margin: 4px 0 8px; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }

/* people flows */
.flow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.flow-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-4); }
.flow-name { font-weight: 600; font-size: 16px; font-family: var(--font-display, var(--font-sans)); }
.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-3);
}
.flow-step {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-3);
}
.flow-step-name { font-weight: 600; font-size: 13px; }
.flow-step-count { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-family: var(--font-display, var(--font-sans)); margin-top: 4px; }
.flow-step-people { font-size: 11px; color: var(--text-3); }

/* sites list */
.site-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.site-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
}
.site-card-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.site-card-photo-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, var(--bg)) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
}
.site-card-photo-placeholder svg { width: 40px; height: 40px; }
.site-card-body { padding: var(--sp-5); }
.site-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); gap: var(--sp-3); }
.site-name { font-size: 18px; font-weight: 600; font-family: var(--font-display, var(--font-sans)); }
.site-desc { font-size: 12.5px; color: var(--text-3); }
.site-rooms { display: flex; gap: var(--sp-2); flex-wrap: wrap; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.site-room {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  font-size: 12px;
}
.site-room svg { width: 12px; height: 12px; color: var(--text-3); }
.site-room small { color: var(--text-3); }

/* ── booking status badges ── */
.booking-status { display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:var(--r-pill);font-size:11.5px;font-weight:600;text-transform:capitalize; }
.booking-status.pending   { background:color-mix(in srgb,#f59e0b 15%,transparent);color:#d97706; }
.booking-status.approved  { background:color-mix(in srgb,#10b981 15%,transparent);color:#059669; }
.booking-status.rejected  { background:color-mix(in srgb,#ef4444 15%,transparent);color:#dc2626; }
.booking-status.cancelled { background:color-mix(in srgb,#6b7280 15%,transparent);color:#6b7280; }

/* ── task card ── */
.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.task-card.booking-task { border-left: 3px solid var(--accent); }
.task-card-icon { width:36px;height:36px;border-radius:var(--r-2);background:color-mix(in srgb,var(--accent) 12%,transparent);display:flex;align-items:center;justify-content:center;color:var(--accent);flex-shrink:0; }
.task-card-icon svg { width:18px;height:18px; }
.task-card-body { flex:1;min-width:0; }
.task-card-title { font-size:14px;font-weight:600;margin-bottom:4px; }
.task-card-meta  { font-size:12px;color:var(--text-3);display:flex;flex-wrap:wrap;gap:10px; }
.task-card-actions { display:flex;gap:var(--sp-2);flex-shrink:0;align-items:flex-start; }

/* ── booking detail kv ── */
.bd-kv { display:grid;grid-template-columns:120px 1fr;gap:var(--sp-2) var(--sp-3);font-size:13px;margin-bottom:var(--sp-4); }
.bd-kv dt { color:var(--text-3);font-weight:500; }
.bd-kv dd { font-weight:500; }

/* ── site / room edit dialog ── */
.site-rooms-edit { display: flex; flex-direction: column; gap: var(--sp-2); }
.room-edit-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: border-color var(--dur-1);
}
.room-edit-card:hover { border-color: var(--accent); }
.room-edit-card-thumb {
  width: 52px;
  height: 40px;
  border-radius: var(--r-1);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  overflow: hidden;
}
.room-edit-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.room-edit-card-info { flex: 1; min-width: 0; }
.room-edit-card-name { font-size: 13px; font-weight: 600; }
.room-edit-card-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.room-svc-chip { font-size: 11px; padding: 2px 7px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 500; }
.room-svc-chip.inactive { background: var(--surface-2); color: var(--text-3); }
.room-edit-card-arrow { color: var(--text-3); flex-shrink: 0; }

.room-photo-thumb {
  width: 96px;
  height: 72px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
  overflow: hidden;
}

.svc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.svc-btn {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-1);
  user-select: none;
}
.svc-btn.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

/* callout */
.callout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  font-size: 13px;
}
.callout svg { width: 20px; height: 20px; color: var(--warn); flex-shrink: 0; margin-top: 1px; }
.callout strong { display: block; font-weight: 600; margin-bottom: 2px; }
.callout p { color: var(--text-2); }

/* notes + access logs */
.note-list, .log-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.note-list li {
  padding: var(--sp-3);
  border-radius: var(--r-2);
  background: var(--bg-tint);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.note-list .note-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.note-list .note-person { font-weight: 600; font-size: 13px; }
.note-list .note-author { color: var(--text-3); font-size: 11.5px; }
.note-list .note-text { color: var(--text-2); line-height: 1.5; }
.log-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  font-size: 12.5px;
  padding: var(--sp-2);
  border-radius: var(--r-1);
}
.log-list li:hover { background: var(--surface-2); }
.log-action { color: var(--text); }
.log-action b { font-weight: 600; }
.log-meta { font-size: 11.5px; color: var(--text-3); }

/* music stand */
.setlist { list-style: none; padding: 0; margin: 0; counter-reset: i; display: flex; flex-direction: column; gap: var(--sp-2); }
.setlist li {
  counter-increment: i;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--bg-tint);
  cursor: pointer;
}
.setlist li.active { border-color: var(--accent); background: var(--accent-soft); }
.setlist li::before {
  content: counter(i);
  font-family: var(--font-mono);
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}
.setlist li.active::before { color: var(--accent); }
.setlist-title { font-weight: 600; font-size: 13.5px; }
.setlist-meta { font-size: 11.5px; color: var(--text-3); }

/* ── Service set list (with key picker + preview) ────────────── */
.sd-setlist { list-style: none; padding: 0; margin: 0; }
.sd-setlist-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line);
}
.sd-setlist-row:last-child { border-bottom: none; }
.sd-setlist-num { font-size: 11px; color: var(--text-3); min-width: 18px; text-align: right; }
.sd-setlist-body { flex: 1; min-width: 0; }
.sd-setlist-key-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); border-radius: var(--r-1);
  padding: 2px 4px; transition: background .12s;
}
.sd-setlist-key-btn:hover { background: var(--surface-2); }
.sd-setlist-preview-btn { flex-shrink: 0; }

/* ── Key picker popup ────────────────────────────────────────── */
.song-key-picker {
  position: absolute; z-index: 300;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: 0 8px 24px rgba(0,0,0,.22);
  padding: var(--sp-3); min-width: 280px; max-width: 340px;
}
.song-key-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2); font-size: 13px; font-weight: 600;
}
.song-key-picker-close { background:none;border:none;cursor:pointer;font-size:18px;color:var(--text-3);line-height:1;padding:0; }
.song-key-picker-loading { font-size:12px; color:var(--text-3); text-align:center; padding:var(--sp-2) 0; }
.song-key-picker-section { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); margin:var(--sp-2) 0 4px; }
.song-key-picker-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.song-key-pill {
  padding: 3px 8px; border-radius: var(--r-pill); border: 1.5px solid var(--line);
  background: var(--surface); font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--text-2); transition: background .1s, border-color .1s;
}
.song-key-pill:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.song-key-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.song-key-pill.named { border-color: var(--accent); color: var(--accent); }

/* ── Song preview modal chord chart ─────────────────────────── */
.spm-key-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.spm-key-pill {
  padding: 2px 7px; border-radius: var(--r-pill); border: 1.5px solid var(--line);
  background: var(--surface); font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--text-2); transition: background .1s;
}
.spm-key-pill:hover { background: var(--surface-2); border-color: var(--accent); }
.spm-key-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Song archive + campus badges ───────────────────────────── */
.song-archived-badge {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 1px 5px; border-radius: var(--r-pill);
  background: rgba(239,68,68,.12); color: #ef4444; margin-left: 6px; vertical-align: middle;
}
.song-campus-badge {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.song-campus-badge.shared { background: var(--surface-2); color: var(--text-3); }
.song-row-archived td { opacity: .5; }

/* ── Song row context menu ───────────────────────────────────── */
.song-ctx-menu {
  position: absolute; z-index: 200;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: 0 8px 24px rgba(0,0,0,.22);
  padding: 4px; min-width: 130px;
}
.song-ctx-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 7px 10px; border-radius: var(--r-1); font: inherit; font-size: 13px;
  color: var(--text-2); cursor: pointer;
}
.song-ctx-item:hover { background: var(--surface-2); color: var(--text); }

/* ── Team Chat ───────────────────────────────────────────────── */
.sd-chat-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
}
.sd-chat-item:last-child { border-bottom: none; }
.sd-chat-item:hover { background: var(--surface-2); }
.sd-chat-area-icon { font-size: 20px; flex-shrink: 0; }
.sd-chat-item-body { flex: 1; min-width: 0; }
.sd-chat-item-name { font-weight: 600; font-size: 14px; }
.sd-chat-item-members { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* New chat modal */
.ncm-area-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ncm-area-btn {
  padding: 5px 10px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; font-size: 12px; cursor: pointer; transition: background .1s, border-color .1s;
}
.ncm-area-btn:hover, .ncm-area-btn.active { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ncm-participants { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.ncm-participant { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.ncm-participant input { flex-shrink: 0; }

/* Chat thread */
.sct-header {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line);
}
.sct-title { font-weight: 600; font-size: 14px; }
.sct-messages {
  flex: 1; min-height: 180px; max-height: 340px; overflow-y: auto;
  padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2);
}
.sct-empty { text-align: center; font-size: 13px; color: var(--text-3); padding: var(--sp-4); }
.sct-input-row {
  display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--line);
}
.sct-input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3);
  font: inherit; font-size: 13px; color: var(--text);
}
.sct-input:focus { outline: none; border-color: var(--accent); }
.sct-bubble-row {
  display: flex; align-items: flex-end; gap: var(--sp-2);
}
.sct-bubble-row.mine { flex-direction: row-reverse; }
.sct-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.sct-avatar-initials {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sct-bubble {
  max-width: 75%; background: var(--surface-2); border-radius: 12px 12px 12px 4px;
  padding: var(--sp-2) var(--sp-3); font-size: 13px;
}
.sct-bubble-row.mine .sct-bubble { background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; }
.sct-author { font-size: 11px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
.sct-bubble-row.mine .sct-author { color: rgba(255,255,255,.7); }
.sct-text { word-break: break-word; }
.sct-time { font-size: 10px; color: var(--text-3); margin-top: 3px; text-align: right; }
.sct-bubble-row.mine .sct-time { color: rgba(255,255,255,.6); }
.sct-media { position: relative; margin-top: var(--sp-2); border-radius: 8px; overflow: hidden; cursor: pointer; }
.sct-yt-thumb { width: 100%; display: block; border-radius: 8px; }
.sct-yt-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); font-size: 32px; color: #fff;
  transition: background .15s;
}
.sct-yt-play:hover { background: rgba(0,0,0,.55); }
.sct-link {
  display: block; margin-top: var(--sp-1); font-size: 11px; word-break: break-all;
  color: var(--accent); text-decoration: underline;
}
.setlist-key {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px var(--sp-2);
  background: var(--accent-soft);
  border-radius: var(--r-1);
}
.chordchart pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
}
.chordchart pre::first-line { color: var(--text-3); }

/* ============================================================
   Placeholder — consolidated admin hub
   ============================================================ */
.ph-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.ph-search {
  display: flex; align-items: center; gap: 9px; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 15px; min-width: 240px; transition: border-color .15s, box-shadow .15s;
}
.ph-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.ph-search svg { color: var(--text-3); flex: 0 0 auto; }
.ph-search input { border: 0; background: transparent; outline: none; color: var(--text); font: inherit; font-size: 14px; width: 100%; }
.ph-search input::placeholder { color: var(--text-3); }
.ph-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.ph-band { margin-bottom: var(--sp-6); }
.ph-band:first-child { margin-top: var(--sp-5); }
.ph-band[hidden] { display: none; }
.ph-band-head { display: flex; align-items: center; gap: var(--sp-3); margin: 0 2px var(--sp-3); }
.ph-band-eyebrow { font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.ph-band-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.ph-band-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.ph-band-count { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.ph-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.ph-tile {
  position: relative; text-align: left; cursor: pointer; padding: 0; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
  opacity: 0; transform: translateY(10px);
}
.ph-tile.in { opacity: 1; transform: none; }
.ph-tile[hidden] { display: none; }
.ph-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -20px rgba(0,0,0,.4); border-color: color-mix(in srgb, var(--text) 10%, var(--line)); }
.ph-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ph-img { position: relative; height: 118px; overflow: hidden; background: linear-gradient(135deg, var(--pa), var(--pb)); display: block; }
.ph-img::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(130% 95% at 16% -5%, rgba(255,255,255,.30), transparent 55%),
    linear-gradient(180deg, transparent 48%, rgba(0,0,0,.30));
}
.ph-illus { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.ph-illus svg { width: 78px; height: 78px; opacity: .97; filter: drop-shadow(0 6px 14px rgba(0,0,0,.32)); transition: transform .25s cubic-bezier(.2,.7,.3,1); }
.ph-tile:hover .ph-illus svg { transform: scale(1.025); }
.ph-arrow {
  position: absolute; top: 11px; right: 11px; z-index: 2; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.24); backdrop-filter: blur(4px);
  opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s;
}
.ph-tile:hover .ph-arrow { opacity: 1; transform: none; }

.ph-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ph-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.ph-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.45; flex: 1; }
.ph-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.ph-chip {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.ph-chip.live { color: #35c76a; border-color: color-mix(in srgb, #34c759 45%, var(--line)); }
.ph-chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34c759; }

.ph-empty { display: none; text-align: center; color: var(--text-3); padding: 56px 0; font-size: 14px; }
.ph-empty.show { display: block; }

@media (prefers-reduced-motion: reduce) {
  .ph-tile { transition: none; opacity: 1; transform: none; }
  .ph-tile:hover { transform: none; }
}
@media (max-width: 560px) { .ph-search { min-width: 0; width: 100%; } }

/* ============================================================
   Music Stand — worship team workspace
   ============================================================ */
.ms-head .page-actions { gap: var(--sp-2); }
.ms-presence { display: inline-flex; gap: -4px; align-items: center; margin-right: var(--sp-2); }
.ms-presence-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  margin-left: -6px;
  border: 2px solid var(--surface);
  background: var(--surface-2); color: var(--text-2);
  opacity: 0.45;
  position: relative;
}
.ms-presence-dot.is-live { opacity: 1; }
.ms-presence-dot.is-live::after {
  content: '';
  position: absolute; right: -2px; bottom: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--surface);
}

/* Color tints reused from `.avatar[data-color]` if present, otherwise neutral. */
.ms-presence-dot[data-color],
.ms-thread-avatar[data-color],
.ms-idea-avatar[data-color] {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  color: var(--text);
}

/* ── Set finder ─────────────────────────────────────────────── */
.ms-finder { margin-bottom: var(--sp-4); }
.ms-finder-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-3); padding: 6px 6px 6px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ms-finder-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ms-finder-icon { color: var(--text-3); flex: 0 0 auto; }
.ms-finder-bar:focus-within .ms-finder-icon { color: var(--accent); }
.ms-finder-input {
  flex: 1; min-width: 0; border: none; background: transparent; color: inherit;
  font-size: 16px; font-weight: 500; padding: 8px 4px; outline: none;
}
.ms-finder-input::placeholder { color: var(--text-3); font-weight: 400; }
.ms-finder-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ms-finder-kbd {
  flex: 0 0 auto; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
  color: var(--text-3); background: var(--surface-2, color-mix(in srgb, var(--text) 6%, transparent));
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; line-height: 1.4;
}
.ms-finder-bar:focus-within .ms-finder-kbd { opacity: .4; }
.ms-finder-cta { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.ms-finder-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-2); margin-top: var(--sp-3);
  max-height: 46vh; overflow-y: auto; padding: 2px;
}
.ms-set-card {
  display: flex; align-items: stretch; gap: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 12px 12px 12px 0; overflow: hidden;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.ms-set-card:hover { transform: translateY(-1px); }
.ms-set-card.is-cursor {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.ms-set-card.is-active { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.ms-set-card-dot { flex: 0 0 4px; width: 4px; border-radius: 4px; background: var(--accent); margin: 2px 0 2px 4px; }
.ms-set-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ms-set-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ms-set-card-name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-set-card-count {
  flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--text-2);
  background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 999px; padding: 1px 9px;
}
.ms-set-card-songs { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-set-card-foot { display: flex; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.ms-set-card-team { font-weight: 600; color: color-mix(in srgb, var(--accent) 70%, var(--text-2)); }
.ms-set-card-when::before { content: '·'; margin-right: 8px; color: var(--text-3); }
.ms-set-card-go { flex: 0 0 auto; align-self: center; color: var(--text-3); opacity: 0; transition: opacity .12s, transform .12s; margin-right: 4px; }
.ms-set-card:hover .ms-set-card-go, .ms-set-card.is-cursor .ms-set-card-go { opacity: 1; transform: translateX(2px); }
.ms-set-create { border-style: dashed; }
.ms-set-create-dot {
  width: 26px; flex-basis: 26px; border-radius: 8px; margin: auto 0 auto 12px;
  display: grid; place-items: center; font-size: 18px; font-weight: 400; line-height: 1;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.ms-finder-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 40px 20px; color: var(--text-2);
}
.ms-finder-empty-art { font-size: 34px; opacity: .8; }
.ms-finder-empty strong { font-size: 15px; }
.ms-finder-empty span { font-size: 13px; }

/* ── Allocate-to-service search ─────────────────────────────── */
.ms-alloc-search { position: relative; display: flex; align-items: center; }
.ms-alloc-search-icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.ms-alloc-search-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ms-alloc-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ms-alloc-search-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.ms-alloc-search:focus-within .ms-alloc-search-icon { color: var(--accent); }
.ms-alloc-list {
  margin-top: var(--sp-2); display: flex; flex-direction: column; gap: 3px;
  max-height: 44vh; overflow-y: auto; padding: 2px;
}
.ms-alloc-empty { padding: 16px 4px; font-size: 13px; text-align: center; }
.ms-alloc-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 9px 11px;
  transition: background .1s, border-color .1s;
}
.ms-alloc-row.is-cursor { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ms-alloc-row.is-selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ms-alloc-row-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-alloc-row-when { flex: 0 0 auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ms-alloc-row-tick { flex: 0 0 auto; color: var(--accent); }

/* ── Active-set bar ─────────────────────────────────────────── */
.ms-active-bar {
  display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-3); padding: 10px 12px;
}
.ms-active-change {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  transition: border-color .12s, color .12s;
}
.ms-active-change:hover { color: var(--text); border-color: var(--accent); }
.ms-active-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ms-active-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-active-info strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-active-info small { font-size: 12px; }
.ms-active-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* Gentle reveal when a set loads below */
@keyframes msReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ms-reveal { animation: msReveal .28s cubic-bezier(.2,.7,.3,1) both; }

@media (max-width: 640px) {
  .ms-finder-cta .btn span, .ms-finder-kbd { display: none; }
  .ms-finder-results { grid-template-columns: 1fr; }
  .ms-active-change span { display: none; }
}
.ms-cat-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface);
}
.ms-cat-row.is-open { border-color: var(--brand, var(--accent, #FFCC00)); }
.ms-cat-row.is-added { opacity: .55; }
.ms-cat-main { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.ms-cat-info { min-width: 0; }
.ms-cat-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ms-cat-row .ms-cat-meta { font-size: 12px; color: var(--text-3); }
.ms-cat-arr { display: flex; flex-direction: column; gap: 10px; }
.ms-arr-loading, .ms-arr-empty { font-size: 12px; padding: 4px 2px; }
.ms-arr-block { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2, var(--surface)); overflow: hidden; }
.ms-arr-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.ms-arr-head strong { font-size: 13px; }
.ms-arr-key, .ms-arr-bpm { font-size: 11px; color: var(--text-3); margin-left: 6px; }
.ms-arr-text {
  margin: 0; padding: 10px; max-height: 260px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: var(--text-1);
}
.ms-set-remove {
  border: none; background: transparent; color: var(--text-3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px; opacity: 0; transition: opacity .12s, color .12s;
}
.ms-set-item:hover .ms-set-remove { opacity: 1; }
.ms-set-remove:hover { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); }

/* MultiTracks — stems + player */
.ms-tracks { margin: var(--sp-4) 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); padding: var(--sp-3) var(--sp-4); }
.ms-tracks-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ms-tracks-actions { display: flex; gap: var(--sp-2); align-items: center; }
.ms-transport { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3); }
.ms-tp-play { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent); color: #1a1a1a; display: grid; place-items: center; cursor: pointer; }
.ms-tp-play:hover { filter: brightness(1.08); }
.ms-tp-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 92px; }
.ms-tp-seek { flex: 1; min-width: 60px; }
.ms-tp-master { display: flex; align-items: center; gap: 6px; color: var(--text-3); flex: 0 0 120px; }
.ms-tp-master input { flex: 1; }
.ms-strips { display: flex; flex-direction: column; gap: var(--sp-2); }
.ms-strip { border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px 10px; background: var(--bg, transparent); transition: opacity .12s; }
.ms-strip.is-dim { opacity: .5; }
.ms-strip-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ms-strip-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-strip-part { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.ms-strip-btn { width: 26px; height: 24px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text-3); font-size: 12px; font-weight: 700; cursor: pointer; }
.ms-strip-btn.is-on   { background: color-mix(in srgb, var(--neg) 20%, transparent); color: #f87171; border-color: transparent; }
.ms-strip-btn.is-solo { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--text); border-color: transparent; }
.ms-strip-del:hover { color: var(--neg); }
.ms-strip-faders { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; }
.ms-strip-vol, .ms-strip-pan { width: 100%; }
@media (max-width: 760px) { .ms-strip-faders { grid-template-columns: 1fr 64px; } .ms-tp-master { flex-basis: 84px; } }

/* Phase 2 — seek markers, tools, sections, storage */
.ms-seek-wrap { position: relative; flex: 1; min-width: 60px; display: flex; align-items: center; }
.ms-seek-wrap .ms-tp-seek { width: 100%; }
.ms-seek-marks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.ms-seek-mark { position: absolute; top: -6px; width: 2px; height: 12px; background: var(--accent); transform: translateX(-1px); border-radius: 1px; opacity: .8; }
.ms-tp-tools { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.ms-tools-spacer { flex: 1; }
.ms-chip-toggle { font-size: 12px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; }
.ms-chip-toggle.is-on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); border-color: transparent; }
.ms-sections { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--sp-3); }
.ms-sec-hint { font-size: 12px; color: var(--text-3); }
.ms-sec-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.ms-sec-chip.is-looping { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ms-sec-chip button { border: none; background: transparent; color: var(--text-2); cursor: pointer; font-size: 12px; padding: 4px 8px; }
.ms-sec-chip .ms-sec-jump { font-weight: 600; color: var(--text); }
.ms-sec-chip .ms-sec-loop:hover { color: var(--accent); }
.ms-sec-chip .ms-sec-del:hover { color: var(--neg); }
.ms-storage { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ms-storage.is-full { color: var(--neg); }

/* Phase 3 — setlist transport, waveform, per-key set */
.ms-tp-step { background: none; border: none; color: var(--text-2); cursor: pointer; padding: 4px; display: grid; place-items: center; border-radius: 6px; }
.ms-tp-step:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.ms-tp-step:disabled { opacity: .3; cursor: default; }
.ms-seek-wrap { min-height: 34px; }
.ms-wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ms-seek-wrap .ms-tp-seek { position: relative; z-index: 1; background: transparent; }
.ms-seek-wrap .ms-seek-marks { z-index: 2; }
.ms-keyset-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.ms-keyset { font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
.ms-playlist-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.ms-playlist-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-4); align-items: center;
}
.ms-playlist-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.ms-playlist-eyebrow {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--accent) 75%, var(--text-2));
}
.ms-playlist-head strong { font-size: 15px; font-weight: 700; }
.ms-playlist-head small { font-size: 11.5px; }
.ms-playlist-tools { display: flex; gap: 6px; align-items: center; min-width: 360px; }
.ms-playlist-tools .elv-input { flex: 1; min-width: 0; }
.ms-playlist-embed iframe {
  width: 100%;
  height: 152px;
  border-radius: 12px;
  border: 0;
  background: #121212;
}

.ms-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 1180px) { .ms-shell { grid-template-columns: 260px minmax(0,1fr); } .ms-discuss-col { grid-column: 1 / -1; } }
@media (max-width: 820px)  { .ms-shell { grid-template-columns: 1fr; } }

.ms-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--sp-3);
  display: flex; flex-direction: column;
  min-height: 200px;
}
.ms-col-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-2); padding: 2px 4px 8px;
}
.ms-col-head strong { font-size: 13.5px; }
.ms-col-head small { display: block; font-size: 11px; color: var(--text-3); }
.ms-icon-btn {
  background: var(--surface-2); border: 1px solid var(--line);
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-2);
}
.ms-icon-btn:hover { border-color: var(--accent); color: var(--text); }
.ms-icon-btn.is-on { background: var(--accent); border-color: var(--accent); color: #0b0c0e; }

/* Set list */
.ms-setlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ms-set-item {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.ms-set-item.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.ms-set-item.is-dragging { opacity: 0.45; }
.ms-set-item.is-drop { box-shadow: 0 -2px 0 0 var(--accent); }
.ms-set-num { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: center; }
.ms-set-info { min-width: 0; }
.ms-set-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-set-meta  { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-set-side { display: flex; align-items: center; gap: 6px; }
.ms-set-key {
  font-size: 11px; font-weight: 700; color: var(--text);
  padding: 2px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.ms-set-spotify { color: #1db954; font-weight: 800; }
.ms-set-count { font-size: 10.5px; color: var(--text-3); }

/* Team ideas feed under set list */
.ms-ideas-wrap { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px dashed var(--line); }
.ms-ideas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.ms-idea {
  display: flex; gap: 8px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.ms-idea-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  flex-shrink: 0;
}
.ms-idea header { display: flex; gap: 8px; align-items: baseline; }
.ms-idea header strong { font-size: 12.5px; }
.ms-idea header small { font-size: 10.5px; }
.ms-idea p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.ms-ideas-compose { display: flex; gap: 6px; margin-top: 8px; }
.ms-ideas-compose input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 8px 10px;
  color: var(--text); font: inherit; font-size: 12.5px;
}
.ms-ideas-compose input:focus { outline: none; border-color: var(--accent); }

/* Song detail */
.ms-song-col { gap: var(--sp-3); }
.ms-song-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.ms-song-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.1; }
.ms-song-meta { margin: 4px 0 0; font-size: 12.5px; }
.ms-song-controls { display: flex; gap: 8px; align-items: end; }
.ms-control { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.ms-control select, .ms-control input {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; color: var(--text); font: inherit; font-size: 13px;
  width: 70px;
}
.ms-control select:focus, .ms-control input:focus { outline: none; border-color: var(--accent); }
.ms-met-btn { align-self: flex-end; }

.ms-song-spotify { display: flex; flex-direction: column; gap: 8px; }
.ms-song-spotify-row { display: flex; gap: 6px; align-items: center; }
.ms-song-spotify-row .elv-input { flex: 1; }
.ms-song-spotify-embed iframe {
  width: 100%; height: 80px; border: 0; border-radius: 12px; background: #121212;
}

.ms-chords {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0;
  padding: var(--sp-4);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, var(--surface-2)), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--text);
  min-height: 220px;
}
.ms-song-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ms-tag {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2);
}
.ms-tag-add { cursor: pointer; color: var(--accent); border-style: dashed; }

/* Discussion */
.ms-discuss-col { gap: var(--sp-3); }
.ms-thread { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; }
.ms-thread-empty { color: var(--text-3); font-size: 12.5px; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-2); }
.ms-thread-item { display: flex; gap: 8px; align-items: flex-start; }
.ms-thread-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ms-thread-body { flex: 1; min-width: 0; }
.ms-thread-body header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.ms-thread-body header strong { font-size: 12.5px; }
.ms-thread-body header small { font-size: 10.5px; }
.ms-thread-body p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); word-wrap: break-word; }
.ms-thread-item.is-mine .ms-thread-body p { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 10px; border-radius: 10px; }
.ms-thread-reacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.ms-react-badge {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; cursor: pointer;
}
.ms-react-badge:hover { border-color: var(--accent); }
.ms-react-add {
  background: transparent; border: 1px dashed var(--line);
  border-radius: 999px; padding: 0 6px; font-size: 11px; cursor: pointer; color: var(--text-3);
}
.ms-react-add:hover { color: var(--accent); border-color: var(--accent); }

.ms-compose { display: flex; flex-direction: column; gap: 6px; }
.ms-compose textarea {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 8px 10px;
  font: inherit; font-size: 13px; color: var(--text); resize: vertical;
  min-height: 48px;
}
.ms-compose textarea:focus { outline: none; border-color: var(--accent); }
.ms-compose-foot { display: flex; justify-content: space-between; align-items: center; }
.ms-reactions-bar { display: flex; gap: 4px; }
.ms-react {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px; font-size: 14px; cursor: pointer;
  line-height: 1;
}
.ms-react:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-select {
  appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* knowledge base list (AI page) */
.kb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.kb-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-2);
  background: var(--bg-tint);
  border: 1px solid var(--line);
}
.kb-ic {
  width: 36px; height: 36px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kb-list strong { display: block; font-weight: 600; font-size: 13.5px; }
.kb-list small { display: block; font-size: 11.5px; color: var(--text-3); }
.kb-list > li > div { flex: 1; min-width: 0; }

/* =====================================================
   KIDS CHECK-IN
   ===================================================== */
.kiosk-launch {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3);
  background: linear-gradient(120deg, rgba(255,204,0,0.1), rgba(109,107,255,0.1));
  border: 1px solid var(--line); border-radius: var(--r-3);
}
.kiosk-launch strong { font-size: 14px; }
.kiosk-launch p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.kiosk-launch .btn { flex-shrink: 0; gap: 6px; }

.kids-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 880px) { .kids-layout { grid-template-columns: 1fr; } }

.kids-search-card .input-group { max-width: none; height: 44px; }
.kids-search-card .input-group input { font-size: 15px; }

.kids-results {
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
}
.kids-results li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.kids-results li:hover { background: var(--surface-2); }
.kids-results li.active { background: var(--accent-soft); }
.kids-results .meta { font-size: 11.5px; color: var(--text-3); }

.kids-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.kids-badge {
  background: white;
  color: black;
  border-radius: var(--r-3);
  padding: var(--sp-7);
  min-height: 460px;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
}
.kids-badge-empty {
  margin: auto;
  text-align: center;
  color: #999;
}
.kids-badge-empty svg { width: 56px; height: 56px; margin-bottom: var(--sp-3); }

.kb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-4);
  border-bottom: 2px dashed #ddd;
}
.kb-brand { display: flex; align-items: center; gap: var(--sp-2); }
.kb-brand-mark { width: 24px; height: 24px; border-radius: var(--r-1); background: #000; display:grid; place-items:center; }
.kb-brand-mark svg { width: 15px; height: 17px; }
.kb-brand-name { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #000; }
.kb-service { font-size: 11px; color: #555; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

.kb-name {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: var(--sp-5);
  color: #000;
}
.kb-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}
.kb-meta-item .label { font-size: 10px; color: #888; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.kb-meta-item .val   { font-size: 16px; font-weight: 600; margin-top: 2px; color: #000; }

.kb-parents {
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px dashed #e5e7eb;
}
.kb-parents .label { font-size: 10px; color: #888; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.kb-parents .val   { font-size: 14px; font-weight: 600; margin-top: 2px; color: #000; }

.kids-parents { color: var(--text-3); }

.kb-allergy {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--r-2);
  color: #c2410c;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.kb-allergy svg { width: 18px; height: 18px; flex-shrink: 0; }

.kb-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 2px dashed #ddd;
  align-items: center;
}
.kb-pickup-label { font-size: 10px; color: #888; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.kb-pickup-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-top: var(--sp-1);
  color: #000;
}
.kb-qr {
  width: 130px; height: 130px;
  background: white;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  padding: 6px;
  border: 1px solid #eee;
  border-radius: 4px;
}
.kb-qr i { background: #000; }
.kb-qr i.off { background: transparent; }

.kids-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}

/* live pulse badge */
.live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--neg-soft);
  color: var(--neg);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  animation: livePulse 2s ease-in-out infinite;
}
.live-pulse::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--neg);
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* check-in segmented mode */
[data-checkin-pane] { animation: fadeUp var(--dur-2) var(--ease); }

/* ─── Event create/edit dialog photo upload ─────────────────── */
.ev-photo-stage { display: flex; flex-direction: column; gap: var(--sp-2); }
.ev-photo-frame {
  position: relative;
  height: 200px;
  border-radius: var(--r-3);
  border: 2px dashed var(--line);
  background: var(--bg-tint);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: all var(--dur-1) var(--ease);
  cursor: pointer;
}
.ev-photo-frame:hover { border-color: var(--accent); background: var(--surface-2); }
.ev-photo-frame.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}
.ev-photo-frame.has-photo { border-style: solid; border-color: var(--accent); }
.ev-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-photo-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  color: var(--text-3); font-size: 13px;
}
.ev-photo-empty svg { width: 36px; height: 36px; }
.ev-photo-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }

/* ─── Print: kids badge ──────────────────────────────────────── */
@media print {
  body { background: white !important; }
  /* hide everything except the badge */
  .sidebar, .topbar, .page-head, .kids-search-card, .kids-actions,
  .toasts, [data-checkin-pane="dashboard"], [data-checkin-pane="adult"],
  [data-checkin-pane="checkout"], #checkin-mode, .nav,
  .page:not([data-page="checkin"]) { display: none !important; }
  .app { display: block; }
  .main, .page-wrap, .page, [data-checkin-pane="kids"], .kids-layout { display: block !important; padding: 0 !important; margin: 0 !important; }
  .kids-badge {
    box-shadow: none !important;
    border: 2px solid #000 !important;
    page-break-after: always;
    max-width: 4in;
    margin: 0 auto;
  }
  .kb-qr i { background: #000 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .kb-allergy {
    background: white !important;
    border: 2px solid #c2410c !important;
    color: #c2410c !important;
  }
}

/* =====================================================
   MY PROFILE — photo widget + 2-col layout
   ===================================================== */
.mp-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 880px) { .mp-layout { grid-template-columns: 1fr; } }

.mp-photo-card {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-4));
}
.mp-details { display: flex; flex-direction: column; gap: var(--sp-4); }

.photo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
.photo-frame {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border: 3px solid var(--line);
  transition: border-color var(--dur-1) var(--ease);
}
.photo-frame:hover { border-color: var(--line-strong); }
.photo-frame img,
.photo-frame video,
.photo-frame canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-frame .avatar {
  width: 100%; height: 100%;
  font-size: 64px;
  border-radius: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text-on-accent);
}
.photo-frame.has-image { border-color: var(--accent); }
.photo-frame.camera-on { border-color: var(--neg); animation: cameraPulse 2s ease-in-out infinite; }
@keyframes cameraPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--neg-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

.photo-actions, .photo-cam-actions, .photo-preview-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── AI summary on pastoral notes ───────────────────────── */
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 18%, transparent));
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-1) var(--ease);
}
.ai-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.ai-btn svg { width: 11px; height: 11px; }
.ai-summary {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-2) var(--r-2) 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.ai-summary .ai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.ai-summary.loading { opacity: 0.55; }

/* =====================================================
   DETAIL PAGES (service / person / group)
   ===================================================== */
.detail-back {
  margin-bottom: var(--sp-3);
}
.detail-back .btn { padding-left: var(--sp-1); }
.detail-back .btn svg { width: 14px; height: 14px; }

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.sd-hero-left { flex: 1; min-width: 0; }
.detail-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-3);
}
.sd-meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--text-2);
}
.sd-meta-item svg { color: var(--accent); flex-shrink: 0; opacity: .8; }
.detail-hero-actions {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: var(--sp-2); flex-shrink: 0;
}
.sd-hero-btns { display: flex; gap: var(--sp-1); align-items: center; }

/* Controls bar: preacher + time in one horizontal strip */
.sd-controls-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  margin-bottom: var(--sp-5);
  overflow: hidden;
}
.sd-control-group {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  flex: 1; min-width: 0;
}
.sd-controls-divider {
  width: 1px; align-self: stretch;
  background: var(--line); flex-shrink: 0;
}
.sd-control-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3); white-space: nowrap; flex-shrink: 0;
}
.sd-time-inputs { display: flex; align-items: center; gap: 6px; }

.sd-planning-notice {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: var(--r-2);
  font-size: 13px; color: var(--text-2);
}
.sd-planning-notice svg { color: #fbbf24; flex-shrink: 0; }


/* Preacher picker: label now comes from .sd-control-label */
.sd-preacher-display { position: relative; }
.sd-preacher-btn {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 5px 10px;
  cursor: pointer; font-size: 13px; color: var(--text);
  transition: border-color .15s;
}
.sd-preacher-btn:hover { border-color: var(--accent); }
.sd-preacher-avatar { display: flex; align-items: center; }
.sd-preacher-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }

/* Preacher picker modal */
.preacher-picker-dlg { max-width: 400px; padding: 0; overflow: hidden; }
.preacher-picker-tabs { display: flex; border-bottom: 1px solid var(--line); }
.preacher-tab {
  flex: 1; padding: var(--sp-2) var(--sp-3);
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.preacher-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.preacher-tab-panel { padding: var(--sp-2) 0; }
.preacher-search-wrap {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line);
  color: var(--text-3);
}
.preacher-search-wrap input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13px; color: var(--text);
}
.preacher-results { list-style: none; margin: 0; padding: var(--sp-1) 0; max-height: 220px; overflow-y: auto; }
.preacher-result-item {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); cursor: pointer;
  transition: background .1s;
}
.preacher-result-item:hover { background: var(--hover-bg, rgba(255,255,255,.06)); }
.preacher-result-item.is-active { background: rgba(var(--accent-rgb, 255,204,0),.08); }
.preacher-result-name { flex: 1; font-size: 13px; }
.preacher-check { color: var(--accent); }
.preacher-no-results { padding: var(--sp-3); font-size: 12px; color: var(--text-3); text-align: center; }
.preacher-guest-btn {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; padding: var(--sp-3) var(--sp-3);
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--text-2); text-align: left;
  transition: background .12s;
}
.preacher-guest-btn:hover { background: var(--hover-bg, rgba(255,255,255,.06)); }
.preacher-picker-foot { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line); }
.preacher-clear-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-3); padding: 0;
  transition: color .12s;
}
.preacher-clear-btn:hover { color: #f87171; }

/* Itinerant modal — drag-and-drop photo zone */
.itinerant-dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: var(--sp-4);
  overflow: hidden;
}
.itinerant-dropzone:hover,
.itinerant-dropzone.is-drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
}
.itinerant-dropzone.is-drag-over { border-style: solid; }
.itinerant-dropzone-inner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--sp-2);
  padding: var(--sp-5);
  color: var(--text-3); text-align: center;
  min-height: 130px;
}
.itinerant-dropzone-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.itinerant-dropzone-or    { font-size: 11px; color: var(--text-3); }
.itinerant-dropzone.has-photo .itinerant-dropzone-inner {
  padding: 0; min-height: 180px; position: relative;
}
.itinerant-dropzone-img {
  width: 100%; height: 180px; object-fit: cover; display: block;
}
.itinerant-dropzone-change {
  position: absolute; bottom: var(--sp-2); right: var(--sp-2);
  background: rgba(0,0,0,.55) !important; color: #fff !important;
  border-color: transparent !important; backdrop-filter: blur(4px);
}
.itinerant-dropzone.is-uploading .itinerant-dropzone-inner { min-height: 130px; }

.sd-time-input {
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  padding: 3px 7px;
  width: 108px;
  transition: border-color .15s;
}
.sd-time-input:focus { outline: none; border-color: var(--accent); }
.sd-time-sep { font-size: 13px; color: var(--text-3); }

/* ─── Service detail layout ─────────────────────────── */
.sd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.5fr);
  gap: var(--sp-5);
  align-items: start;
  margin-bottom: var(--sp-4);
}
@media (max-width: 1180px) {
  .sd-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .sd-middle  { grid-column: 2; }
}
@media (max-width: 880px) {
  .sd-layout { grid-template-columns: 1fr; }
  .sd-people-panel { position: relative; top: 0; max-height: none; }
}

.sd-middle { display: flex; flex-direction: column; gap: var(--sp-5); }

/* All three tiles: no padding — header + content manage their own spacing */
.sd-people-panel,
.sd-roster-card,
.sd-middle .card {
  padding: 0;
  overflow: hidden;
}

/* Shared tile header */
.sd-people-panel .card-head,
.sd-roster-card  .card-head,
.sd-middle .card .card-head {
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-3) var(--r-3) 0 0;
  flex-shrink: 0;
}

/* People panel — sticky left sidebar */
.sd-people-panel {
  position: sticky;
  top: calc(var(--topbar-h) + var(--sp-4));
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - var(--sp-7));
}
.sd-people-head { margin-bottom: 0; }
.sd-people-filter-row {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
}
.sd-people-filter-row .chip { font-size: 11.5px; padding: 0 8px; height: 24px; }
.sd-people-search { height: 36px; padding: 0 var(--sp-4); max-width: none; border-radius: 0; border-left: none; border-right: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sd-people-search input { font-size: 13px; }
.sd-people-search svg { width: 12px; height: 12px; }
.sd-people-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-3) var(--sp-4);
}
.sd-people-list::-webkit-scrollbar { width: 6px; }
.sd-people-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.sd-person {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-2);
  border-radius: var(--r-2);
  background: var(--bg-tint);
  border: 1px solid var(--line);
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: all var(--dur-1) var(--ease);
}
.sd-person:hover { border-color: var(--accent); background: var(--surface-2); }
.sd-person:active { cursor: grabbing; }
.sd-person .avatar { width: 22px; height: 22px; font-size: 10px; flex-shrink: 0; }
.sd-person .sd-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sd-person .sd-person-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-1);
  flex-shrink: 0;
}
.sd-person .sd-person-tag.assigned { background: var(--accent-soft); color: var(--accent); }
.sd-person .sd-person-tag.conflict { background: var(--neg-soft); color: var(--neg); }
.sd-person.conflict { opacity: 0.7; }
.sd-person.assigned { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.sd-people-foot {
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
  padding: var(--sp-2) var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* Roster dept header is now clickable */
.roster-dept-head {
  cursor: pointer;
}
/* Only the active dept is fully visible; others collapse to just their header */
.roster-dept { display: none; }
.roster-dept.active { display: block; }
.roster-dept.active .roster-dept-head {
  background: var(--accent-soft);
  color: var(--accent);
}

.plan-list {
  list-style: none;
  padding: var(--sp-4) var(--sp-4) 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.plan-list::before {
  content: "";
  position: absolute;
  left: 12px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--line), var(--line) 70%, transparent);
}
.plan-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2);
  border-radius: var(--r-2);
  position: relative;
  transition: background var(--dur-1) var(--ease);
}
.plan-row:hover { background: var(--surface-2); }
.plan-row::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  z-index: 1;
}
.plan-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
  padding-left: 16px;
}
.plan-title { font-weight: 500; font-size: 13.5px; }
.plan-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.plan-dur   { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.plan-total {
  margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3) 0 var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
  display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-3);
}
.plan-target { font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill, 999px); border: 1px solid var(--line); }
.plan-target.over  { color: #f87171; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.plan-target.under { color: var(--text-3); }
.plan-target.ok    { color: #4ade80; border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.08); }
.plan-saved-flag { color: #4ade80; font-size: 11px; opacity: 0; transition: opacity .3s; min-width: 60px; text-align: right; }

/* ─── Plan template modal body ─── */
.plan-tpl-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-8) var(--sp-4); color: var(--text-3); text-align: center;
}
.plan-tpl-empty-state p { margin: 0; font-size: 13px; }
.plan-tpl-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.plan-tpl-row:last-child { border-bottom: none; }
.plan-tpl-row-info { flex: 1; min-width: 0; }
.plan-tpl-row-name { font-size: 14px; font-weight: 500; }
.plan-tpl-row-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.plan-tpl-row-items { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.plan-tpl-row-actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.plan-tpl-row-del { color: var(--text-3); }
.plan-tpl-row-del:hover { color: #f87171; }

/* ─── Template detail view ─── */
.plan-tpl-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.plan-tpl-detail-meta { font-size: 12px; color: var(--text-3); }
.plan-tpl-preview-list {
  list-style: none; margin: 0; padding: 0;
}
.plan-tpl-preview-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.plan-tpl-preview-row:last-child { border-bottom: none; }
.plan-tpl-preview-num { font-size: 11px; color: var(--text-3); min-width: 16px; text-align: right; }
.plan-tpl-preview-icon { color: var(--text-3); display: flex; flex-shrink: 0; }
.plan-tpl-preview-body { flex: 1; min-width: 0; }
.plan-tpl-preview-title { font-size: 13px; display: block; }
.plan-tpl-preview-sub { font-size: 11px; color: var(--text-3); display: block; margin-top: 1px; }
.plan-tpl-preview-dur { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* ─── Editable plan rows ─── */
.plan-editable .plan-row.plan-edit {
  grid-template-columns: 18px 56px 1fr 84px 24px;
  gap: var(--sp-2);
  align-items: start;
  padding: var(--sp-2) var(--sp-2);
}
.plan-editable .plan-row.plan-edit:hover { background: var(--surface-2); }
.plan-editable .plan-row.plan-edit::before { top: 22px; }
.plan-drag {
  cursor: grab; user-select: none; color: var(--text-3); font-size: 14px;
  display: flex; align-items: center; justify-content: center; height: 32px;
  opacity: 0; transition: opacity .12s;
}
.plan-editable .plan-row.plan-edit:hover .plan-drag { opacity: 1; }
.plan-editable .plan-row.plan-edit .plan-time { padding-top: 8px; padding-left: 12px; }
.plan-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-kind { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.plan-kind-ic { display: inline-flex; color: var(--accent); }
.plan-kind-lbl { color: var(--text-3); }
.plan-song-link { color: var(--accent); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 4px; font-size: 11px; }
.plan-song-link:hover { text-decoration: underline; }
.plan-title-in {
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 3px 6px; margin: 2px -6px 0; font-size: 13.5px; font-weight: 500;
  color: var(--text); width: 100%; font-family: inherit;
}
.plan-sub-in {
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 6px; margin: 0 -6px; font-size: 11.5px; color: var(--text-3); width: 100%;
  font-family: inherit;
}
.plan-title-in:hover, .plan-sub-in:hover { background: var(--surface-3, var(--surface-2)); }
.plan-title-in:focus, .plan-sub-in:focus, .plan-dur-in:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.plan-dur-wrap { display: flex; align-items: center; gap: 4px; padding-top: 4px; justify-self: end; }
.plan-dur-in {
  width: 50px; background: transparent; border: 1px solid var(--line); border-radius: 4px;
  padding: 4px 6px; text-align: right; font-size: 12px; color: var(--text);
  font-variant-numeric: tabular-nums; font-family: inherit;
}
.plan-dur-unit { font-size: 11px; color: var(--text-3); }
.plan-del {
  background: transparent; border: none; cursor: pointer; color: var(--text-3);
  padding: 6px; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; opacity: 0; transition: opacity .12s, background .12s, color .12s;
  align-self: start; margin-top: 4px;
}
.plan-editable .plan-row.plan-edit:hover .plan-del { opacity: 1; }
.plan-del:hover { background: rgba(248,113,113,.12); color: #f87171; }
.plan-dragging { opacity: .35; }
.plan-drop-over { box-shadow: 0 -2px 0 var(--accent) inset; }

/* Add-item row */
.plan-add-row { padding: var(--sp-2) 0 0 0; position: relative; }
.plan-add-row::before { display: none; }
.plan-add-wrap { display: inline-block; position: relative; margin-left: 32px; }
.plan-add-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  padding: 6px; min-width: 200px; display: flex; flex-direction: column; gap: 2px;
}
.plan-add-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: transparent; border: none; color: var(--text);
  font-size: 13px; cursor: pointer; border-radius: 4px; text-align: left;
  font-family: inherit;
}
.plan-add-opt:hover { background: var(--surface-2); color: var(--accent); }
.plan-add-opt svg { color: var(--accent); flex-shrink: 0; }

/* ── Form style picker (builder settings) ───────────────────── */
.fbs-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fbs-style {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 8px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-2); color: var(--text-2);
  font: inherit; font-size: 12px; font-weight: 600; transition: border-color .12s, color .12s;
}
.fbs-style:hover { color: var(--text); border-color: var(--line-2, var(--line)); }
.fbs-style.active { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fbs-sw { width: 100%; height: 34px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.fbs-sw-classic { background: linear-gradient(160deg, #fff 55%, #eef0f4 55%); }
.fbs-sw-minimal { background: #fff; box-shadow: inset 0 -2px 0 #d0d3da; }
.fbs-sw-bold    { background: linear-gradient(#ffcc00 0 5px, #fff 5px); }
.fbs-sw-elegant { background: #fffdf9; box-shadow: inset 0 0 0 1px #e6ddcb; }
.fbs-sw-dark    { background: linear-gradient(160deg, #17181c 55%, #0e0f12 55%); border-color: #2a2c31; }

/* Live style switcher in the builder Preview pane */
.fb-preview-stylebar { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.fb-preview-stylebar-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.fb-preview-styles { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-pstyle { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.fb-pstyle:hover { color: var(--text); border-color: var(--line-2, var(--line)); }
.fb-pstyle.active { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--text); }

/* Preview reflects the chosen public style (mirrors form.html variants) */
.fb-preview-scroll:has(.fb-preview-card[data-form-style="dark"]) { background: #0e0f12; }
.fb-preview-scroll:has(.fb-preview-card[data-form-style="elegant"]) { background: #f6f1e8; }

.fb-preview-card[data-form-style="minimal"] { background: transparent; border: 0; box-shadow: none; padding: 8px 0; }
.fb-preview-card[data-form-style="minimal"] .fb-preview-form-title { text-align: left; }
.fb-preview-card[data-form-style="minimal"] .fb-preview-field input,
.fb-preview-card[data-form-style="minimal"] .fb-preview-field textarea,
.fb-preview-card[data-form-style="minimal"] .fb-preview-field select {
  border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0; background: transparent; padding-left: 0; padding-right: 0;
}

.fb-preview-card[data-form-style="bold"] { border: 0; border-top: 5px solid var(--accent); border-radius: 22px; box-shadow: 0 24px 64px -28px rgba(0,0,0,.4); }
.fb-preview-card[data-form-style="bold"] .fb-preview-form-title { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.fb-preview-card[data-form-style="bold"] .fb-preview-field input,
.fb-preview-card[data-form-style="bold"] .fb-preview-field textarea,
.fb-preview-card[data-form-style="bold"] .fb-preview-field select { border-radius: 12px; }
.fb-preview-card[data-form-style="bold"] .fb-preview-submit .btn-primary { border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }

.fb-preview-card[data-form-style="elegant"] { background: #fffdf9; border: 1px solid #e6ddcb; box-shadow: none; color: #2b2a26; }
.fb-preview-card[data-form-style="elegant"] .fb-preview-form-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 38px; color: #2b2a26; }
.fb-preview-card[data-form-style="elegant"] .fb-preview-field-label { color: #6b6559; }
.fb-preview-card[data-form-style="elegant"] .fb-preview-field input,
.fb-preview-card[data-form-style="elegant"] .fb-preview-field textarea,
.fb-preview-card[data-form-style="elegant"] .fb-preview-field select { background: #fff; border: 1px solid #1a1a1a; color: #2b2a26; }

.fb-preview-card[data-form-style="dark"] { background: #17181c; border: 1px solid #2a2c31; color: #f3f4f6; }
.fb-preview-card[data-form-style="dark"] .fb-preview-form-title { color: #f3f4f6; }
.fb-preview-card[data-form-style="dark"] .fb-preview-form-desc,
.fb-preview-card[data-form-style="dark"] .fb-preview-field-label { color: #b6b8c0; }
.fb-preview-card[data-form-style="dark"] .fb-preview-field input,
.fb-preview-card[data-form-style="dark"] .fb-preview-field textarea,
.fb-preview-card[data-form-style="dark"] .fb-preview-field select { background: #0e0f12; border-color: #2a2c31; color: #f3f4f6; }

/* ── Schedule (admin per-person lookup) ─────────────────────── */
.sched-search { position: relative; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; min-width: 280px; }
.sched-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.sched-search svg { color: var(--text-3); flex: 0 0 auto; }
.sched-input { border: 0; background: transparent; outline: none; color: var(--text); font: inherit; font-size: 14px; width: 100%; }
.sched-search .giving-typeahead { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; z-index: 30; }
.sched-empty { padding: 40px 0; text-align: center; font-size: 14px; }
.sched-person-card { display: flex; align-items: center; gap: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.sched-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.sched-avatar-i { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); color: var(--text); font-weight: 700; }
.sched-person-card strong { font-size: 16px; }
.sched-tallies { margin-left: auto; display: flex; gap: var(--sp-4); }
.sched-tallies span { font-size: 12px; color: var(--text-3); }
.sched-tallies b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }
.sched-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 820px) { .sched-cols { grid-template-columns: 1fr; } }
.sched-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); margin-bottom: var(--sp-4); overflow: hidden; }
.sched-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sched-sec-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.sched-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sched-list { list-style: none; margin: 0; padding: 0; }
.sched-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: var(--sp-3); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.sched-row:last-child { border-bottom: 0; }
.sched-row-date { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sched-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sched-row-main strong { font-size: 13.5px; }
.sched-row-main .muted { font-size: 11.5px; }
.sched-pill { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; }
.sched-pill.is-ok { color: #35c76a; background: color-mix(in srgb, #34c759 16%, transparent); }
.sched-pill.is-no { color: #f87171; background: color-mix(in srgb, #ef4444 16%, transparent); }
.sched-pill.is-wait { color: #d19a2e; background: color-mix(in srgb, #f59e0b 16%, transparent); }

/* Worship-set songs listed down the row */
.plan-songlist { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.plan-song-line { display: flex; gap: 7px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.plan-song-n { flex: 0 0 auto; min-width: 14px; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Plan card header = button to open the full editor */
.plan-head-open { display: block; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; border-radius: var(--r-2); }
.plan-head-open:hover .card-title { color: var(--accent); }

/* Full plan editor modal */
.planed-row { display: grid; grid-template-columns: 30px 58px 1fr 74px 28px; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.planed-move { display: flex; flex-direction: column; gap: 2px; }
.planed-mv { width: 24px; height: 16px; line-height: 1; font-size: 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text-3); cursor: pointer; padding: 0; }
.planed-mv:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.planed-mv:disabled { opacity: .3; cursor: default; }
.planed-grip { color: var(--text-3); font-size: 13px; line-height: 1; cursor: grab; }
.planed-row { cursor: grab; }
.planed-row:active { cursor: grabbing; }
.planed-row input, .planed-row textarea, .planed-row select, .planed-row button { cursor: auto; }
.planed-dragging { opacity: .45; }
.planed-drop { box-shadow: inset 0 2px 0 var(--accent); }
.planed-row .plan-del { opacity: 1; align-self: center; margin-top: 0; }
.planed-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-3); }
.planed-actions .plan-add-wrap { position: relative; }
.planed-actions .plan-add-menu { top: 100%; bottom: auto; margin-top: 6px; margin-bottom: 0; max-height: 300px; overflow-y: auto; }
.plan-add-sep { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.planed-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
.ws-picker-list { display: flex; flex-direction: column; gap: 6px; }
.ws-picker-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; font: inherit; color: inherit; }
.ws-picker-opt:hover { border-color: var(--accent); }
.ws-picker-opt svg { color: var(--accent); flex: 0 0 auto; }

/* Song picker rows */
.song-pick-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px; background: transparent; border: none;
  border-radius: var(--r-1); cursor: pointer; color: var(--text); text-align: left;
  font-family: inherit;
}
.song-pick-row:hover { background: var(--surface-2); }
.song-pick-row + .song-pick-row { border-top: 1px solid var(--line); border-radius: 0; }

.setlist-detail li {
  background: var(--bg-tint);
  cursor: default;
}
.setlist-detail li:hover { background: var(--surface-2); }

/* ─── Roster ─────────────────────────────────────────── */
.roster {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
}
#sd-roster-autofill.is-busy { opacity: .6; pointer-events: none; }
/* Roster header: let the controls wrap under the title in a narrow column
   instead of crushing the title into one-word-per-line. */
.sd-roster-card .card-head { flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sd-roster-card .card-head > div:first-child { flex: 1 1 160px; min-width: 0; }
.sd-roster-card .card-head > div:last-child { flex: 0 0 auto; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.roster-gap { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.roster-gap span { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; white-space: nowrap; }
.roster-gap input { width: 44px; padding: 4px 6px; font-size: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: inherit; }
.roster-conflicts {
  margin: 0 var(--sp-4); padding: 10px 12px; border-radius: var(--r-2);
  background: color-mix(in srgb, var(--neg, #ef4444) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--neg, #ef4444) 40%, var(--line));
}
.roster-conflicts-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--neg, #ef4444); }
.roster-conflicts-list { margin: 6px 0 0; padding: 0 0 0 2px; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.roster-conflicts-list li { font-size: 12px; color: var(--text-2); }
.rc-issue { color: var(--neg, #ef4444); font-weight: 600; }

/* ── Giving: pledges, batches, statements ───────────────────── */
.giving-typeahead { position: relative; }
.giving-typeahead, .giving-typeahead[hidden] { display: block; }
.giving-typeahead[hidden] { display: none; }
.giving-typeahead { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); max-height: 220px; overflow-y: auto; margin-top: 4px; }
.giving-ta-opt { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.giving-ta-opt:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.giving-ta-opt small { color: var(--text-3); }
.giving-ta-empty { padding: 8px 10px; font-size: 13px; color: var(--text-3); }

.pledge-row { display: flex; flex-direction: column; gap: 5px; }
.pledge-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.pledge-del { color: var(--text-3); }
.pledge-del:hover { color: var(--neg); }
.pledge-bar { height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.pledge-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.pledge-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pledge-done { color: #22c55e; font-weight: 700; }

.batch-row { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 11px; font: inherit; color: inherit; }
.batch-row:hover { border-color: var(--accent); }
.batch-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.batch-closed { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.batch-var--ok { color: #22c55e; font-weight: 600; }
.batch-var--off { color: #f59e0b; font-weight: 600; }
.batch-summary { display: flex; gap: var(--sp-4); padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-2); }
.batch-summary > div { display: flex; flex-direction: column; }
.batch-summary .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.batch-summary b { font-size: 17px; font-variant-numeric: tabular-nums; }
.batch-addrow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; position: relative; }
.batch-addrow .giving-typeahead { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; }
.batch-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.batch-entries li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.batch-entries li > span:first-child { flex: 1; }
.batch-entry-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.batch-entry-del { color: var(--text-3); }
.batch-entry-del:hover { color: var(--neg); }
.roster-progress {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.roster-progress.full { background: var(--pos-soft); color: var(--pos); }

.roster-dept {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.roster-dept-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.roster-dept-head .dept-count { color: var(--text-3); font-weight: 500; }
.roster-positions {
  display: flex;
  flex-direction: column;
}
.roster-slot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-3);
  border-top: 1px solid var(--line);
  min-height: 44px;
  transition: background var(--dur-1) var(--ease);
}
.roster-slot:first-child { border-top: 0; }
.roster-slot.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.roster-slot.slot-targeted { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.roster-slot.drop-conflict { background: var(--neg-soft); box-shadow: inset 0 0 0 1px var(--neg); }
/* ── Availability ─────────────────────────────────────────── */
.ep-avail-section { border-top: 1px solid var(--border-soft); margin-top: var(--sp-4); padding-top: var(--sp-4); }
.ep-avail-hint { font-size: 12.5px; color: var(--text-3); margin: 0 0 var(--sp-3); }
.ep-avail-toggle { display: flex; gap: 8px; }
.ep-avail-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 18px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--border); background: transparent;
  color: var(--text-2); transition: background .12s, border-color .12s, color .12s;
}
.ep-avail-btn.active.ep-avail-btn--ok  { background: var(--pos-soft); border-color: var(--pos); color: var(--pos); }
.ep-avail-btn.active.ep-avail-btn--off { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
.ep-avail-field-hint { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

.sd-person.unavailable { opacity: .42; cursor: default; filter: grayscale(.25); }
.sd-person.unavailable[draggable=false] { cursor: not-allowed; }
.sd-person-tag.unavail { background: var(--neg-soft); color: var(--neg); }
.br-person--unavail { opacity: .42; cursor: not-allowed; filter: grayscale(.25); }
.br-person-tag--unavail { background: var(--neg-soft); color: var(--neg); }

.pd-avail-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 13px; background: var(--neg-soft); border-radius: 8px;
  font-size: 13px; color: var(--neg); margin-bottom: 10px; line-height: 1.45;
}
.pd-avail-notice svg { flex-shrink: 0; margin-top: 1px; }

.avail-tip {
  position: fixed; z-index: 10000;
  background: var(--surface); border: 1.5px solid var(--neg);
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  max-width: 230px; pointer-events: none;
}
.avail-tip[hidden] { display: none; }
.avail-tip-header {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--neg);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.avail-tip-reason { margin: 0; font-size: 13px; color: var(--text-1); line-height: 1.45; }
.avail-tip-until  { margin: 5px 0 0; font-size: 12px; color: var(--text-3); font-style: italic; }

.roster-slot.drop-rejected { opacity: .45; cursor: not-allowed; }
.br-slot.br-slot--rejected { opacity: .4; cursor: not-allowed; }

.slot-name { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: var(--sp-2); }
.slot-name .slot-key {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  width: 92px;
  flex-shrink: 0;
}
.slot-assigned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
  cursor: grab;
  user-select: none;
}
.slot-assigned[draggable]:active { cursor: grabbing; }
/* Whole-service response summary on the Assign tab. */
.roster-status-summary { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; }
.rss-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.rss-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.rss-pill.accepted { background: var(--pos-soft); color: var(--pos); }
.rss-pill.accepted::before { background: var(--pos); }
.rss-pill.pending  { background: var(--warn-soft, rgba(245,158,11,0.16)); color: var(--warn, #f59e0b); }
.rss-pill.pending::before { background: var(--warn, #f59e0b); }
.rss-pill.declined { background: var(--neg-soft); color: var(--neg); }
.rss-pill.declined::before { background: var(--neg); }
/* Accepted → green bubble; declined → red bubble. */
.slot-assigned.is-confirmed { background: rgba(16,185,129,0.18); box-shadow: inset 0 0 0 1px rgba(16,185,129,0.55); }
.slot-assigned.is-declined  { background: rgba(239,68,68,0.15);  box-shadow: inset 0 0 0 1px rgba(239,68,68,0.45); }
.slot-assigned .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.slot-assigned .slot-x {
  margin-left: 2px;
  width: 14px; height: 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.slot-assigned:hover .slot-x { opacity: 1; }
.slot-assigned .slot-x:hover { background: var(--neg-soft); color: var(--neg); }
.slot-assigned .slot-x svg { width: 10px; height: 10px; }

.slot-empty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  font-size: 12px;
  font-style: italic;
}

/* ─── People drawer ──────────────────────────────────── */
.people-drawer { margin-top: var(--sp-3); }
.people-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  margin: 0 -4px;
}
.person-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  font-size: 12px;
  cursor: grab;
  user-select: none;
  transition: all var(--dur-1) var(--ease);
}
.person-pill:hover { border-color: var(--accent); background: var(--surface-2); }
.person-pill:active { cursor: grabbing; }
.person-pill .avatar { width: 22px; height: 22px; font-size: 10px; }
.person-pill.conflict {
  border-color: var(--neg-soft);
  color: var(--text-3);
  opacity: 0.5;
}
.person-pill.assigned {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}
.person-pill .pill-meta {
  font-size: 10px;
  color: var(--text-3);
  margin-left: 4px;
}

/* ─── Person detail ───────────────────────────────── */
.person-hero {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-6);
}
.person-hero .avatar.lg {
  width: 72px; height: 72px;
  font-size: 24px;
}
.person-hero-meta {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
  font-size: 13.5px;
  color: var(--text-2);
}
.person-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.person-hero-meta svg { width: 13px; height: 13px; color: var(--text-3); }

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-2) var(--sp-4);
  font-size: 13px;
  margin: 0;
}
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); }
.kv dd.empty { color: var(--text-3); font-style: italic; }

.kv-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.kv-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2);
  border-radius: var(--r-2);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur-1) var(--ease);
}
.kv-list li:hover { background: var(--surface-2); }
.kv-list .kv-name { font-weight: 500; flex: 1; }
.kv-list .kv-meta { color: var(--text-3); font-size: 11.5px; }

/* =====================================================
   ADMIN — impersonation banner + page polish
   ===================================================== */
.imp-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-5);
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-top: 2px solid #92400e;
  box-shadow: 0 -4px 24px rgba(0,0,0,.35);
  animation: impSlide var(--dur-3) var(--ease);
}
@keyframes impSlide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.imp-banner .imp-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}
.imp-banner .imp-text { flex: 1; }
.imp-banner .imp-text b { font-weight: 700; }
.imp-banner .imp-meta { opacity: 0.8; font-size: 12px; margin-left: var(--sp-2); }
.imp-banner .btn-ghost {
  background: rgba(0,0,0,.25);
  color: #fff;
  border-color: rgba(255,255,255,.3);
  display: flex; align-items: center; gap: 6px;
}
.imp-banner .btn-ghost:hover { background: rgba(0,0,0,.4); }

/* ── User console / spoof rows ──────────────────────────────── */
.spoof-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-1);
}
.spoof-row:last-child { border-bottom: none; }
.spoof-row:hover { background: var(--surface-2); }
.spoof-meta { flex: 1; min-width: 0; }
.spoof-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.spoof-sub  { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.spoof-sub .role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}
.btn-warn {
  background: #b45309;
  color: #fff;
  border-color: #92400e;
  display: flex; align-items: center; gap: 5px;
}
.btn-warn:hover { background: #92400e; }
/* ─────────────────────────────────────────────────────────── */

/* Impersonate quick action in tables */
.row-imp {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--r-1);
  color: var(--text-3);
  transition: all var(--dur-1) var(--ease);
}
.row-imp:hover { background: var(--accent-soft); color: var(--accent); }
.row-imp svg { width: 14px; height: 14px; }

/* misc */
@media (max-width: 980px) {
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .kanban { grid-template-columns: 1fr; }
  .service-card { grid-template-columns: 54px 66px 1fr; }
  .svc-preacher-block { display: none; }
  .svc-meta-right { display: none; }
  .person-hero { grid-template-columns: 1fr; text-align: center; }
}

/* ================================================================
   FORM BUILDER
   ================================================================ */

/* Full-height page (overrides default page padding/scroll) */
.page-full-height:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  overflow: hidden;
  padding: 0;
}

/* Top bar */
.fb-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  height: 52px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.fb-title-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.fb-title-input::placeholder { color: var(--text-3); }
.fb-topbar-right { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

/* Mode pills */
.fb-mode-pills { display: flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 2px; gap: 2px; }
.fb-mode-pill { background: none; border: none; color: var(--text-3); font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: var(--r-pill); cursor: pointer; transition: all .15s; }
.fb-mode-pill.active { background: var(--elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* Workspace grid */
.fb-workspace {
  display: grid;
  grid-template-columns: 176px 1fr 240px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Dark inputs inside props pane */
.fb-props-pane .input,
.fb-props-pane .fb-desc-input,
.fb-props-pane textarea {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.fb-props-pane .input:focus,
.fb-props-pane textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Palette */
.fb-palette {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: var(--sp-3);
  background: var(--surface);
}
.fb-palette-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: var(--sp-1) var(--sp-2);
  margin-bottom: 4px;
}
.fb-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px var(--sp-2);
  border-radius: var(--r-1);
  font-size: 13px;
  color: var(--text-2);
  cursor: grab;
  transition: background .12s, color .12s;
  user-select: none;
}
.fb-palette-item:hover { background: var(--surface-2); color: var(--text); }
.fb-palette-item.fb-dragging { opacity: .4; }

/* Canvas */
.fb-canvas-wrap { background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; }
.fb-canvas-scroll { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-3); }
.fb-form-meta { max-width: min(640px, 100%); margin: 0 auto var(--sp-3); }

/* Form cover photo widget */
.fb-photo-widget { margin-bottom: var(--sp-3); }
.fb-photo-dropzone {
  position: relative; width: 100%; height: 140px;
  border: 2px dashed var(--line); border-radius: var(--r-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.fb-photo-dropzone:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.fb-photo-dropzone.has-photo { border-style: solid; border-color: var(--line); }
.fb-photo-dropzone.fb-photo-drag-active {
  border-style: dashed; border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.fb-photo-dropzone.fb-photo-drag-active .fb-photo-placeholder { color: var(--accent); }
.fb-photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; pointer-events: none; }
.fb-photo-hint { font-size: 11px; color: var(--text-3); opacity: .7; }
.fb-photo-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-photo-remove {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: #fff; border: none;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: background .15s;
}
.fb-photo-remove:hover { background: rgba(0,0,0,.8); }

/* Seed photo picker panel (inside fb-photo-widget) */
.fb-photo-picker {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  padding: var(--sp-3);
  margin-top: 6px;
  z-index: 200;
}
.fb-photo-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.fb-photo-picker-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-1); transition: background .1s;
}
.fb-photo-picker-close:hover { background: var(--surface-2); color: var(--text); }
.fb-photo-seed-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  margin-bottom: var(--sp-2);
}
.fb-photo-seed-item {
  aspect-ratio: 16/9; background-size: cover; background-position: center;
  border: 2px solid transparent; border-radius: var(--r-1);
  cursor: pointer; position: relative; overflow: hidden;
  padding: 0; transition: border-color .12s, transform .12s;
}
.fb-photo-seed-item:hover { border-color: var(--accent); transform: scale(1.04); z-index: 1; }
.fb-photo-seed-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.fb-photo-seed-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55); color: #fff; font-size: 9px; font-weight: 600;
  padding: 2px 4px; text-align: center;
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.fb-photo-seed-item:hover .fb-photo-seed-label { opacity: 1; }
.fb-photo-picker-footer {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-2); margin-top: 2px;
}

/* Form card action buttons (Edit / Delete, appear on hover) */
.form-card-actions {
  position: absolute; bottom: var(--sp-3); right: var(--sp-3);
  display: flex; gap: 4px;
  opacity: 0; transition: opacity .15s;
  z-index: 2;
}
.form-card:hover .form-card-actions { opacity: 1; }
.form-card-act-btn {
  width: 28px; height: 28px; border-radius: var(--r-1);
  border: 1.5px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
  transition: background .12s, color .12s, border-color .12s;
}
.form-card-act-btn:hover { background: var(--surface-2); color: var(--text); }
.form-card-act-danger:hover { background: rgba(239,68,68,.1); color: #ef4444 !important; border-color: rgba(239,68,68,.3); }

/* Quick-edit modal cover section */
.fb-qe-cover-section {
  border: 2px dashed var(--line); border-radius: var(--r-2);
  overflow: hidden; position: relative;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .15s;
  margin-bottom: 4px; min-height: 64px;
}
.fb-qe-cover-section:hover { border-color: var(--accent); }
.fb-qe-cover-section.has-photo { border-style: solid; border-color: var(--line); min-height: unset; }
.fb-qe-cover-img { width: 100%; height: 140px; object-fit: cover; display: block; }
.fb-qe-cover-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.38);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity .15s;
}
.fb-qe-cover-section:hover .fb-qe-cover-overlay { opacity: 1; }

/* Form card cover photo */
.form-card-cover { width: 100%; height: 120px; object-fit: cover; border-radius: var(--r-2) var(--r-2) 0 0; display: block; margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) var(--sp-3); width: calc(100% + 2 * var(--sp-4)); }

.fb-form-desc-hint { font-size: 13px; color: var(--text-3); cursor: pointer; padding: 4px 0; }
.fb-form-desc-hint:hover { color: var(--accent); }
.fb-desc-input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }

.fb-canvas {
  max-width: min(640px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-3);
  padding: var(--sp-4);
  min-height: 340px;
  position: relative;
}
.fb-canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 300px;
  color: var(--text-3);
  text-align: center;
  font-size: 14px;
  pointer-events: none;
}
.fb-canvas-empty.fb-dz-over { opacity: .5; }

/* Drop zone strips between fields */
.fb-dz {
  height: 4px;
  border-radius: 2px;
  transition: height .12s, background .12s;
  margin: 2px 0;
}
.fb-dz.fb-dz-over {
  height: 28px;
  background: var(--accent);
  opacity: .25;
  border-radius: var(--r-1);
}

/* Field cards in canvas */
.fb-field-card {
  position: relative;
  background: var(--elevated);
  border: 1.5px solid transparent;
  border-radius: var(--r-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 40px;
  cursor: pointer;
  transition: border-color .15s;
  margin: 2px 0;
}
.fb-field-card:hover { border-color: var(--line); }
.fb-field-card.fb-field-selected { border-color: var(--accent); }
.fb-drag-handle {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 16px;
  cursor: grab;
  line-height: 1;
  user-select: none;
  opacity: 0;
  transition: opacity .15s;
}
.fb-field-card:hover .fb-drag-handle { opacity: 1; }
.fb-field-card.fb-card-dragging { opacity: .35; }

/* Field delete/dupe buttons */
.fb-field-acts {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}
.fb-field-card:hover .fb-field-acts,
.fb-field-card.fb-field-selected .fb-field-acts { display: flex; }
.fb-field-act-btn {
  background: var(--surface-2);
  border: none;
  border-radius: var(--r-1);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 14px;
  transition: background .12s;
}
.fb-field-act-btn:hover { background: var(--line); color: var(--text); }
.fb-field-act-btn.fb-act-del:hover { background: #ef4444; color: #fff; }

/* Field preview content */
.fb-preview-label { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.fb-preview-label .fb-req { color: var(--accent); margin-left: 2px; }
.fb-preview-help { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.fb-preview-heading-el { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.fb-preview-para-el { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.6; }
.fb-preview-input { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 7px 10px; color: var(--text-3); font: inherit; font-size: 13px; pointer-events: none; }
.fb-preview-textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 7px 10px; color: var(--text-3); font: inherit; font-size: 13px; resize: none; pointer-events: none; }
.fb-preview-select { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 7px 10px; color: var(--text-3); font: inherit; font-size: 13px; pointer-events: none; }
.fb-opt-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }

/* Props pane */
.fb-props-pane {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  background: var(--surface);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.fb-props-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  flex: 1;
  color: var(--text-3);
  text-align: center;
  font-size: 13px;
  min-height: 200px;
}

/* Prop groups */
.fb-prop-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--sp-3); }
.fb-prop-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.fb-prop-row { display: flex; align-items: center; justify-content: space-between; }
.fb-opt-edit-row { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; }
.fb-opt-del-btn { flex-shrink: 0; background: none; border: none; color: var(--text-3); font-size: 16px; cursor: pointer; width: 24px; height: 24px; border-radius: var(--r-1); display: flex; align-items: center; justify-content: center; }
.fb-opt-del-btn:hover:not(:disabled) { background: #ef4444; color: #fff; }
.fb-opt-del-btn:disabled { opacity: .3; cursor: default; }
.fb-prop-delete { width: 100%; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }

/* Toggle switch */
.fb-toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.fb-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.fb-toggle-track {
  width: 34px; height: 20px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-pill);
  position: relative; transition: background .2s;
  flex-shrink: 0;
}
.fb-toggle input:checked + .fb-toggle-track { background: var(--accent); border-color: var(--accent); }
.fb-toggle-track::after {
  content: ''; position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.fb-toggle input:checked + .fb-toggle-track::after { transform: translateX(14px); }

/* Logic badge on canvas cards */
.fb-logic-badge {
  display: inline-flex; align-items: center; gap: 3px;
  position: absolute; bottom: 6px; left: 38px;
  font-size: 10px; color: var(--accent); opacity: .75;
  pointer-events: none;
}

/* Logic condition builder */
.fb-lc-rule-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-lc-rule-head .input { height: 28px; padding: 0 6px; font-size: 12px; width: auto; }
.fb-lc-text { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.fb-lc-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; background: var(--bg-2, rgba(0,0,0,.06)); border-radius: var(--r-1); padding: 8px; }
.fb-lc-top { display: flex; gap: 4px; align-items: center; }
.fb-lc-top .fb-lc-field { flex: 1; min-width: 0; }
.fb-lc-bottom { display: flex; gap: 4px; align-items: center; }
.fb-lc-bottom .fb-lc-op { flex: 0 0 auto; }
.fb-lc-bottom .fb-lc-val { flex: 1; min-width: 0; }
.fb-lc-row .input { height: 28px; padding: 0 8px; font-size: 12px; }
.fb-lc-also-label { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; cursor: pointer; color: var(--text-1); }
.fb-lc-also-label input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); flex-shrink: 0; }

/* Tab field — canvas card */
.fb-tab-card { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.fb-tab-divider-el { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent); padding: 2px 0; }

/* Group field — canvas card */
.fb-group-card { border-style: dashed !important; }
.fb-group-preview-el { display: flex; flex-direction: column; gap: 6px; }
.fb-group-preview-header { display: flex; align-items: center; gap: 8px; }
.fb-group-preview-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.fb-group-repeat-badge { font-size: 11px; background: var(--bg-2,rgba(0,0,0,.07)); border-radius: 10px; padding: 2px 8px; color: var(--text-2); }
.fb-group-subfield-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fb-gf-chip { font-size: 11px; background: var(--accent); color: #fff; border-radius: 10px; padding: 2px 8px; }
.fb-group-empty-hint { font-size: 12px; color: var(--text-3); margin: 2px 0; }

/* Group props sub-field rows */
.fb-gf-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.fb-gf-type-pill { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-2,rgba(0,0,0,.07)); border-radius: 8px; padding: 2px 7px; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
.fb-gf-row .input { flex: 1; min-width: 0; height: 28px; padding: 0 8px; font-size: 12px; }
.fb-gf-opts-inp { width: 100% !important; flex-basis: 100%; }
.fb-gf-del { height: 28px; padding: 0 8px; flex-shrink: 0; }

/* Group instances — public form + preview */
.fp-group-wrap { border: 1px dashed var(--line); border-radius: var(--r-2); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.fp-group-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: var(--sp-3); text-transform: uppercase; letter-spacing: .04em; }
.fp-group-instance { padding: var(--sp-3) 0; }
.fp-group-instance + .fp-group-instance { border-top: 1px solid var(--line); }
.fp-group-instance-label { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: var(--sp-3); }
.fp-group-empty { font-size: 13px; color: var(--text-3); text-align: center; padding: var(--sp-4) 0; margin: 0; }

/* Tab nav — shared by builder preview + public form */
.fp-tabs { margin-bottom: var(--sp-4); }
.fp-tab-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.fp-tab-btn { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; border-radius: var(--r-1) var(--r-1) 0 0; transition: color .15s, border-color .15s; }
.fp-tab-btn:hover { color: var(--text-1); }
.fp-tab-btn.fp-tab-active { color: var(--accent); border-bottom-color: var(--accent); }
.fp-tab-pane.fp-tab-hidden { display: none; }

/* Preview pane */
.fb-preview-pane { flex: 1; background: var(--surface-2); overflow: hidden; }
.fb-preview-scroll { height: 100%; overflow-y: auto; padding: var(--sp-6) var(--sp-4); }
.fb-preview-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-3);
  padding: var(--sp-6);
  box-shadow: 0 2px 20px rgba(0,0,0,.1);
}
.fb-preview-form-title { font-size: 24px; font-weight: 700; margin: 0 0 var(--sp-2); }
.fb-preview-form-desc { font-size: 14px; color: var(--text-2); margin: 0 0 var(--sp-5); line-height: 1.6; }
.fb-preview-field { margin-bottom: var(--sp-4); }
.fb-preview-field-label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.fb-preview-field-label .req { color: var(--accent); }
.fb-preview-field-help { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.fb-preview-field input[type=text],
.fb-preview-field input[type=email],
.fb-preview-field input[type=tel],
.fb-preview-field input[type=number],
.fb-preview-field input[type=date],
.fb-preview-field textarea,
.fb-preview-field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 8px 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s;
}
.fb-preview-field input:focus,
.fb-preview-field textarea:focus,
.fb-preview-field select:focus {
  outline: none;
  border-color: var(--accent);
}
.fb-preview-field textarea { resize: vertical; min-height: 100px; }
.fb-preview-opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; cursor: pointer; }
.fb-preview-heading { font-size: 20px; font-weight: 700; margin: 0; padding-top: var(--sp-2); }
.fb-preview-para { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.65; }
.fb-preview-submit { margin-top: var(--sp-5); }

/* Published status badge on form card */
.form-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: var(--r-pill);
}
.form-status-badge.published { background: rgba(34,197,94,.15); color: #22c55e; }
.form-status-badge.draft { background: var(--surface-2); color: var(--text-3); }
.form-status-badge.closed { background: rgba(239,68,68,.1); color: #ef4444; }
.form-system-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(99,102,241,.12); color: #6366f1;
}

/* Form card clickable */
.form-card { cursor: pointer; transition: border-color .15s, opacity .15s, transform .15s; }
.form-card:hover { border-color: var(--accent) !important; }
.form-card.fc-dragging { opacity: .4; cursor: grabbing; }
.form-card.fc-drag-over { border-color: var(--accent) !important; transform: scale(1.02); box-shadow: 0 0 0 2px var(--accent); }

/* Copy link button on form card */
.form-copy-link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-radius: var(--r-1);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.form-copy-link-btn:hover { background: var(--surface-2); color: var(--accent); }

/* Three-dot menu button on form card */
.form-menu-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); border-radius: var(--r-1);
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.form-menu-btn:hover { background: var(--surface-2); color: var(--text); }

/* Context menu dropdown */
.form-ctx-menu {
  position: absolute;
  width: 160px;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  padding: 4px;
  z-index: 200;
}
.form-ctx-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 7px 10px; border-radius: var(--r-1);
  font: inherit; font-size: 13px;
  color: var(--text-2); cursor: pointer;
  text-align: left; transition: background .1s;
}
.form-ctx-item:hover { background: var(--surface-2); color: var(--text); }
.form-ctx-danger { color: #ef4444 !important; }
.form-ctx-danger:hover { background: rgba(239,68,68,.1) !important; color: #ef4444 !important; }
.form-ctx-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* Form builder — media fields */
.fb-media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: var(--sp-4);
  background: var(--surface-2); border: 2px dashed var(--line);
  border-radius: var(--r-2); color: var(--text-3); font-size: 13px;
  min-height: 80px;
}
.fb-video-wrap { border-radius: var(--r-2); overflow: hidden; background: #000; }
.fb-video-thumb { position: relative; cursor: pointer; border-radius: var(--r-2); overflow: hidden; }
.fb-video-thumb:hover .fb-video-play-btn { transform: translate(-50%, -50%) scale(1.1); }
.fb-video-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 40px; background: #ff0000; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .15s; pointer-events: none;
}
.fb-video-thumb:hover .fb-video-play-btn { background: #cc0000; }

/* Image upload in props */
.fb-img-upload-wrap { display: flex; gap: 6px; }
.fb-img-upload-wrap .input { flex: 1; min-width: 0; }
.fb-img-upload-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-1); cursor: pointer; color: var(--text-2);
  transition: background .12s, color .12s;
}
.fb-img-upload-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.fb-field-card.fb-img-drop-active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.fb-field-card.fb-img-drop-active .fb-media-placeholder { border-color: var(--accent); color: var(--accent); }
.fb-img-upload-wrap.fb-img-drop-active { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--r-1); }

/* View page modal */
.fb-view-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.fb-view-modal[hidden] { display: none; }
.fb-view-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.fb-view-modal-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); width: min(960px, 92vw); height: min(88vh, 900px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.fb-view-modal-header {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.fb-view-modal-title { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; }
.fb-view-modal-close {
  background: transparent; border: none; cursor: pointer; color: var(--text-2);
  padding: 4px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-1);
}
.fb-view-modal-close:hover { background: var(--surface-3); color: var(--text); }
.fb-view-modal-iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }

/* ── Prayer ⇄ form field-mapping rows ────────────────────────── */
.pcf-map-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; }
.pcf-map-row > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.pcf-map-row > select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px var(--sp-3);
  font-size: 13.5px;
  color: var(--text);
  outline: 0;
  font-family: inherit;
}
@media (max-width: 560px) { .pcf-map-row { grid-template-columns: 1fr; gap: 4px; } }

/* ── Event registrations modal tabs ─────────────────────────── */
.er-tab-bar { display: flex; gap: 0; }
.er-tab {
  background: none; border: none; padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.er-tab:hover { color: var(--text); }
.er-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Form settings modal tabs ────────────────────────────────── */
.fb-stabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding: var(--sp-3) 0 0;
}
.fb-stab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.fb-stab:hover { color: var(--text); }
.fb-stab.active { color: var(--accent); border-bottom-color: var(--accent); }
.fb-spane[hidden] { display: none; }

/* ── Get Connected page ──────────────────────────────────────── */
.gc-hero {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #000) 100%);
  padding: var(--sp-10) var(--sp-6) var(--sp-9);
  position: relative; overflow: hidden;
}
.gc-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.gc-hero-inner { max-width: 640px; position: relative; }
.gc-hero-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.7); margin-bottom: var(--sp-2);
}
.gc-hero-title {
  font-family: var(--font-display); font-size: clamp(28px, 5vw, 42px);
  font-weight: 700; color: #fff; line-height: 1.1; margin-bottom: var(--sp-3);
}
.gc-hero-sub { font-size: 15px; color: rgba(255,255,255,.8); max-width: 480px; line-height: 1.6; }

.gc-body { padding: var(--sp-7) var(--sp-6) var(--sp-10); max-width: 860px; display: flex; flex-direction: column; gap: var(--sp-9); }
.gc-section {}
.gc-section-head { margin-bottom: var(--sp-5); }
.gc-section-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.gc-section-sub { font-size: 14px; color: var(--text-3); }
.gc-see-all {
  display: inline-block; margin-top: var(--sp-2);
  font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none;
}
.gc-see-all:hover { text-decoration: underline; }

/* Next steps */
.gc-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.gc-step-card {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: var(--sp-4);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.gc-step-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); transform: translateY(-1px); }
.gc-step-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-2);
  display: grid; place-items: center;
}
.gc-step-body { flex: 1; min-width: 0; }
.gc-step-title { font-size: 13px; font-weight: 600; color: var(--text); }
.gc-step-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.gc-step-arrow { color: var(--text-3); flex-shrink: 0; }

/* Services grid */
.gc-services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.gc-service-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2);
}
.gc-service-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.gc-service-title { font-size: 15px; font-weight: 600; color: var(--text); }
.gc-service-meta { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 3px; }
.gc-service-meta span { display: flex; align-items: center; gap: 5px; }

/* Groups */
.gc-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.gc-group-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2);
  cursor: pointer; transition: border-color .15s, transform .1s;
}
.gc-group-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.gc-group-name { font-size: 14px; font-weight: 600; color: var(--text); }
.gc-group-meta { font-size: 12px; color: var(--text-3); }
.gc-group-tag {
  align-self: flex-start; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}

/* Events */
.gc-event-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.gc-event-row {
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5); cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.gc-event-row:hover { border-color: var(--accent); transform: translateX(2px); }
.gc-event-date {
  width: 48px; flex-shrink: 0; text-align: center;
  background: var(--accent-soft); border-radius: var(--r-2); padding: var(--sp-2) 0;
}
.gc-event-date-num { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1; }
.gc-event-date-mon { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.gc-event-info { flex: 1; min-width: 0; }
.gc-event-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-event-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Forms */
.gc-form-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.gc-form-link {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5); text-decoration: none; color: var(--text);
  transition: border-color .15s; min-width: 200px;
}
.gc-form-link:hover { border-color: var(--accent); }
.gc-form-link-icon {
  width: 36px; height: 36px; border-radius: var(--r-2); flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.gc-form-link-title { font-size: 14px; font-weight: 600; }
.gc-form-link-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* Contact */
.gc-contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.gc-contact-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3);
}
.gc-contact-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-soft); display: grid; place-items: center;
  font-size: 16px; font-weight: 700; color: var(--accent); overflow: hidden; flex-shrink: 0;
}
.gc-contact-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-contact-name { font-size: 14px; font-weight: 600; color: var(--text); }
.gc-contact-role { font-size: 12px; color: var(--text-3); }
.gc-contact-links { display: flex; flex-direction: column; gap: 4px; margin-top: var(--sp-1); }
.gc-contact-link {
  font-size: 12px; color: var(--accent); text-decoration: none; display: flex; align-items: center; gap: 5px;
}
.gc-contact-link:hover { text-decoration: underline; }

/* ── People Flows list ───────────────────────────────────────── */
.pf-pipeline {
  display: flex; gap: var(--sp-3); align-items: flex-end;
  padding: var(--sp-4) 0 var(--sp-2); overflow-x: auto;
  min-height: 80px;
}
.pf-pipeline-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 72px; flex: 1; max-width: 120px;
}
.pf-pipeline-bar {
  width: 100%; background: var(--accent); border-radius: var(--r-1) var(--r-1) 0 0;
  opacity: 0.8; transition: height .3s;
}
.pf-pipeline-label {
  font-size: 11px; color: var(--text-3); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.pf-pipeline-count { font-size: 12px; font-weight: 700; color: var(--text); }

/* ── Flow builder topbar ─────────────────────────────────────── */
.pf-topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-5); height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.pf-title-group { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-title-input {
  background: none; border: none; outline: none; padding: 0;
  font-size: 15px; font-weight: 600; color: var(--text);
  font-family: var(--font-sans); width: 100%;
}
.pf-title-input:focus { color: var(--accent); }
.pf-desc-input {
  background: none; border: none; outline: none; padding: 0;
  font-size: 12px; color: var(--text-3); font-family: var(--font-sans); width: 100%;
}
.pf-save-status { font-size: 12px; color: var(--text-3); min-width: 60px; text-align: right; }

/* ── Board ───────────────────────────────────────────────────── */
.pf-board-wrap { flex: 1; overflow-x: auto; overflow-y: hidden; padding: var(--sp-5); display: flex; }
.pf-board { display: flex; gap: var(--sp-4); align-items: flex-start; min-height: 100%; }

/* ── Column ──────────────────────────────────────────────────── */
.pf-col {
  width: 240px; flex-shrink: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-3);
  display: flex; flex-direction: column; gap: 0;
  max-height: calc(100vh - 140px);
}
.pf-col-head {
  display: flex; align-items: center; gap: 4px;
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line);
}
.pf-col-reorder { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.pf-reorder-btn {
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 14px; border: none; background: none;
  color: var(--text-3); cursor: pointer; border-radius: 2px; padding: 0;
}
.pf-reorder-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.pf-reorder-btn:disabled { opacity: 0.25; cursor: default; }
.pf-step-name-input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  font-size: 13px; font-weight: 600; color: var(--text); font-family: var(--font-sans);
  padding: 2px 4px; border-radius: var(--r-1);
}
.pf-step-name-input:focus { background: var(--surface-2); }
.pf-step-del-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; background: none;
  color: var(--text-3); cursor: pointer; border-radius: var(--r-1); flex-shrink: 0;
}
.pf-step-del-btn:hover { color: var(--neg); background: var(--neg-soft,#fee2e2); }
.pf-col-count { font-size: 11px; color: var(--text-3); padding: var(--sp-2) var(--sp-3) var(--sp-1); }
.pf-col-people {
  flex: 1; overflow-y: auto; padding: var(--sp-2) var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.pf-add-person-btn {
  margin: var(--sp-2) var(--sp-3) var(--sp-3); font-size: 12px;
  border: 1px dashed var(--line); justify-content: center; gap: 4px;
}
.pf-add-person-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Person card ─────────────────────────────────────────────── */
.pf-person-card {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 6px var(--sp-2); cursor: default;
  transition: border-color .12s;
}
.pf-person-card:hover { border-color: var(--accent); }
.pf-person-name { flex: 1; font-size: 12px; font-weight: 500; color: var(--text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-person-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; background: none;
  color: var(--text-3); cursor: pointer; border-radius: var(--r-1); flex-shrink: 0; opacity: 0;
  transition: opacity .12s;
}
.pf-person-card:hover .pf-person-menu-btn { opacity: 1; }
.pf-person-menu-btn:hover { color: var(--text); background: var(--surface); }

/* ── Add step column ─────────────────────────────────────────── */
.pf-add-col {
  background: none; border: 2px dashed var(--line); display: flex;
  align-items: center; justify-content: center; min-height: 120px;
  cursor: pointer; transition: border-color .15s;
}
.pf-add-col:hover { border-color: var(--accent); }
.pf-add-step-col-btn {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 13px; font-weight: 500; padding: var(--sp-5);
}
.pf-add-step-col-btn:hover { color: var(--accent); }

/* ── Add-person popover ──────────────────────────────────────── */
.pf-person-popover {
  position: absolute; z-index: 9990; width: 260px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); box-shadow: var(--shadow-lg,0 8px 32px rgba(0,0,0,.25));
  padding: var(--sp-2);
}
.pf-person-search { width: 100%; margin-bottom: var(--sp-2); }
.pf-person-results { max-height: 220px; overflow-y: auto; }
.pf-person-result {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2); border-radius: var(--r-2);
  cursor: pointer; font-size: 13px; color: var(--text);
}
.pf-person-result:hover { background: var(--surface-2); }

/* ── Person context menu ─────────────────────────────────────── */
/* ── Generic context / dropdown menu ────────────────────────── */
.ctx-menu {
  position: absolute;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  min-width: 180px;
  padding: 4px;
  overflow: hidden;
}
.ctx-menu-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding: 6px 10px 4px;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none;
  padding: 7px 10px;
  font-size: 13px; color: var(--text); cursor: pointer;
  border-radius: var(--r-1);
}
.ctx-menu button:hover { background: var(--surface-2); }
.ctx-menu .ctx-danger  { color: #ef4444 !important; }
.ctx-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }

.pf-person-ctx {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: var(--shadow-lg,0 8px 32px rgba(0,0,0,.25));
  min-width: 180px; padding: var(--sp-1); overflow: hidden;
}
.pf-ctx-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: var(--sp-2) var(--sp-3);
  font-size: 13px; color: var(--text); cursor: pointer; border-radius: var(--r-1);
}
.pf-ctx-item:hover { background: var(--surface-2); }
.pf-ctx-danger { color: var(--neg) !important; }
.pf-ctx-divider { height: 1px; background: var(--line); margin: var(--sp-1) 0; }

/* ── Status dots ─────────────────────────────────────────────── */
.pf-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.pf-status-notstarted { background: #94a3b8; }
.pf-status-inprogress { background: #3b82f6; }
.pf-status-pending    { background: #f59e0b; }
.pf-status-complete   { background: #22c55e; }

/* ── Due badge ───────────────────────────────────────────────── */
.pf-due-badge {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-3); flex-shrink: 0;
}
.pf-due-badge.overdue { background: #fee2e2; color: #ef4444; }

/* ── Quick complete button ───────────────────────────────────── */
.pf-complete-btn {
  opacity: 0; display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: 1px solid #22c55e; border-radius: 50%;
  background: none; color: #22c55e; cursor: pointer; flex-shrink: 0;
  transition: opacity .12s, background .12s;
}
.pf-person-card:hover .pf-complete-btn { opacity: 1; }
.pf-complete-btn:hover { background: #22c55e; color: #fff; }

/* ── Entry point badge ───────────────────────────────────────── */
.pf-entry-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .06em;
  background: var(--accent); color: #fff; border-radius: 3px;
  padding: 1px 5px; flex-shrink: 0;
}

/* ── Status filter row ───────────────────────────────────────── */
.pf-status-filter { display: flex; gap: 4px; padding: var(--sp-1) var(--sp-3) var(--sp-2); flex-wrap: wrap; }
.pf-sf-btn {
  font-size: 10.5px; padding: 2px 7px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-3); cursor: pointer; display: flex; align-items: center; gap: 3px;
  transition: background .1s, color .1s;
}
.pf-sf-btn:hover { background: var(--surface); color: var(--text); }
.pf-sf-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Instructions ────────────────────────────────────────────── */
.pf-col-instructions {
  font-size: 12px; color: var(--text-2); padding: var(--sp-2) var(--sp-3);
  background: var(--bg); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); line-height: 1.5;
}

/* ── Right detail panel ──────────────────────────────────────── */
.pf-detail-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 300px; background: var(--surface); border-left: 1px solid var(--line);
  z-index: 200; display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%); transition: transform .25s ease;
}
.pf-detail-panel:not([hidden]) { transform: translateX(0); }
.pf-board-wrap.panel-open { padding-right: 310px; }

.pf-dp-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.pf-dp-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pf-dp-step { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pf-dp-body {
  flex: 1; overflow-y: auto; padding: var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.pf-dp-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.pf-dp-move-list {
  display: flex; flex-direction: column; gap: var(--sp-1);
  border: 1px solid var(--line); border-radius: var(--r-2);
  padding: var(--sp-2); background: var(--surface-2);
}
.pf-dp-move-step-btn { justify-content: flex-start !important; }

/* ── Pastoral note person search ─────────────────────────────── */
.pnote-search-wrap { position: relative; }
.pnote-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1000;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  overflow: hidden; max-height: 280px; overflow-y: auto;
}
.pnote-result {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); cursor: pointer;
  transition: background .1s;
}
.pnote-result:hover { background: var(--surface-2); }
.pnote-result-empty { color: var(--text-3); font-size: 13px; cursor: default; }
.pnote-result-empty:hover { background: none; }
.pnote-result-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.pnote-result-initials {
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.pnote-result-name { font-size: 13px; font-weight: 500; color: var(--text); }
.pnote-result-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ============================================================
   REPORTS
   ============================================================ */
.reports-group { margin-bottom: var(--sp-5); }
.reports-group-label {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}
.reports-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
}
.report-card {
  display: flex; gap: var(--sp-3); padding: var(--sp-4); text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  cursor: pointer; transition: all var(--dur-1) var(--ease);
  color: inherit; font: inherit;
}
.report-card:hover {
  border-color: var(--line-strong); transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.report-card-ic {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-2);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.report-card-ic svg { width: 18px; height: 18px; }
.report-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.report-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.report-card-desc  { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.report-card-tag {
  display: inline-block; align-self: flex-start; margin-top: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
}

.report-toolbar {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.report-range-text { font-size: 12.5px; margin-left: auto; }
.report-loading {
  padding: var(--sp-6); text-align: center; color: var(--text-3); font-size: 13px;
}
.report-svg { width: 100%; height: auto; max-height: 360px; display: block; }
.report-legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3);
  font-size: 12px; color: var(--text-2);
}
.report-legend-vert { flex-direction: column; gap: var(--sp-2); }
.report-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.report-legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}
.report-pie-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: center;
}
@media (max-width: 720px) {
  .report-pie-wrap { grid-template-columns: 1fr; }
}

/* ── Custom Report Builder ────────────────────────────────────────── */
.report-card--custom { border: 1px dashed var(--accent); }
.report-card--custom .report-card-ic { background: var(--accent-soft); color: var(--accent); }

.cr-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-4);
  align-items: start; margin-bottom: var(--sp-4);
}
@media (max-width: 900px) { .cr-layout { grid-template-columns: 1fr; } }

.cr-section-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-bottom: var(--sp-2);
}
.cr-left {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-3); max-height: 540px; overflow-y: auto;
}
.cr-cols { display: flex; flex-direction: column; gap: 2px; }
.cr-col-group { margin-bottom: var(--sp-3); }
.cr-col-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); margin-bottom: 4px;
}
.cr-col-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer;
  padding: 3px 4px; border-radius: var(--r-1); color: var(--text-2);
}
.cr-col-item:hover { background: var(--surface-2); color: var(--text-1); }
.cr-col-item input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

.cr-right {
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: var(--sp-3);
}
.cr-filter-row {
  display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap;
  padding: var(--sp-2) 0; border-bottom: 1px solid var(--line);
}
.cr-filter-row:last-child { border-bottom: none; }
.cr-filter-field, .cr-filter-op, .cr-filter-val {
  font-size: 13px; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: var(--r-2); background: var(--surface-2); color: var(--text-1); outline: none;
}
.cr-filter-field { min-width: 130px; }
.cr-filter-op    { min-width: 130px; }
.cr-filter-val   { flex: 1; min-width: 120px; }
.cr-filter-field:focus, .cr-filter-op:focus, .cr-filter-val:focus { border-color: var(--accent); }
.cr-filter-rm { color: var(--text-3); flex-shrink: 0; }
.cr-filter-rm:hover { color: var(--neg); }

.cr-run-bar {
  display: flex; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
#cr-export:disabled { opacity: .4; cursor: not-allowed; }

#cr-results { margin-top: var(--sp-4); }
.cr-result-meta {
  font-size: 12.5px; color: var(--text-3); margin-bottom: var(--sp-2);
}
.cr-empty {
  padding: var(--sp-6); text-align: center; color: var(--text-3); font-size: 13px;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-3);
}
.cr-table td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   SONG DETAIL — chord chart, keyboard, transposer
   ============================================================ */
.song-detail-grid {
  display: grid; grid-template-columns: 360px 1fr; gap: var(--sp-4);
  align-items: start;
}
@media (max-width: 1100px) { .song-detail-grid { grid-template-columns: 1fr; } }

.song-detail-side { display: flex; flex-direction: column; }

.song-key-row {
  display: flex; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.song-current-key { display: flex; flex-direction: column; gap: 4px; }
.song-key-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.song-current-key .setlist-key {
  display: inline-block; font-size: 20px; font-weight: 700; padding: 4px 12px;
  min-width: 48px; text-align: center;
}

/* Piano */
.piano {
  position: relative; padding: var(--sp-4); user-select: none;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.piano-whites {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; height: 110px;
}
.piano-blacks {
  position: absolute; top: var(--sp-4); left: var(--sp-4); right: var(--sp-4);
  height: 70px; pointer-events: none;
}
.piano-key {
  position: relative; cursor: pointer; border: none;
  font: inherit; color: inherit; padding: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.piano-white {
  background: #fafafa; color: #1a1a1a; border-radius: 0 0 4px 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), inset 0 -2px 0 rgba(0,0,0,.06);
}
.piano-white:hover { background: #f0f0f0; }
.piano-white.active { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 1px 0 rgba(0,0,0,.15), inset 0 -2px 0 rgba(0,0,0,.15); }
.piano-white.original:not(.active)::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.piano-black {
  position: absolute; pointer-events: auto;
  width: calc((100% / 7) * 0.6); height: 100%;
  background: #1a1a1a; color: #f5f5f5; border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.4), inset 0 -2px 0 rgba(255,255,255,.06);
  font-size: 10px;
}
.piano-black:hover { background: #2a2a2a; }
.piano-black.active { background: var(--accent); color: var(--text-on-accent); }
.piano-black.original:not(.active)::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
/* Place black keys at the borders between adjacent white keys.
   White key width = 100/7%. Black width is ~0.6 of that.
   Black-key centers sit at the boundaries 1/7, 2/7, 4/7, 5/7, 6/7. */
.piano-black[data-note="C#"], .piano-black[data-note="Db"] { left: calc(100% / 7 * 1 - (100% / 7 * 0.3)); }
.piano-black[data-note="D#"], .piano-black[data-note="Eb"] { left: calc(100% / 7 * 2 - (100% / 7 * 0.3)); }
.piano-black[data-note="F#"], .piano-black[data-note="Gb"] { left: calc(100% / 7 * 4 - (100% / 7 * 0.3)); }
.piano-black[data-note="G#"], .piano-black[data-note="Ab"] { left: calc(100% / 7 * 5 - (100% / 7 * 0.3)); }
.piano-black[data-note="A#"], .piano-black[data-note="Bb"] { left: calc(100% / 7 * 6 - (100% / 7 * 0.3)); }

.piano-key-label { font-weight: 600; }

.song-key-actions {
  display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
}
.song-key-actions .btn { flex: 1; justify-content: center; }
.song-key-pref {
  padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
}

/* BPM card */
.song-bpm {
  padding: var(--sp-4); display: flex; align-items: center; justify-content: space-between;
}
.song-bpm-value { display: flex; align-items: baseline; gap: 6px; }
.song-bpm-value > span:first-child { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.song-bpm-unit { font-size: 13px; color: var(--text-3); font-weight: 500; }
.bpm-pulse {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); border: 2px solid var(--accent);
  cursor: pointer; padding: 0;
}
.bpm-pulse.pulsing { animation: bpm-pulse 1s ease-in-out infinite; }
@keyframes bpm-pulse {
  0%, 100% { transform: scale(1);   background: var(--accent-soft); }
  50%      { transform: scale(1.2); background: var(--accent); }
}
.song-bpm-meta { padding: 0 var(--sp-4) var(--sp-3); font-size: 12px; }

/* Chord chart */
.song-chart-card { min-height: 480px; }
/* Arrangement controls in the chord-chart card head */
.song-arr-controls { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.song-arr-select {
  font-size: 12.5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: inherit; max-width: 220px;
}
.song-arr-select:focus { outline: none; border-color: var(--accent); }
.song-arr-actions { display: inline-flex; align-items: center; gap: 6px; }
.song-arr-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-3); }
.song-arr-grid-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .song-arr-grid { grid-template-columns: 1fr 1fr; } }
.song-arr-chart {
  width: 100%; min-height: 300px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px; line-height: 1.7;
}
.song-chart {
  padding: var(--sp-4) var(--sp-5);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 14px; line-height: 1.2;
  overflow-x: auto;
}
.chord-section {
  margin: var(--sp-3) 0 var(--sp-2);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.chord-line { display: flex; flex-wrap: wrap; align-items: flex-end; min-height: 38px; }
.chord-line.empty { min-height: 14px; }
.chord-line.lyric-only {
  display: block;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 15px; color: var(--text-2);
  font-style: italic; padding: 4px 0;
}
.chord-pair { display: inline-flex; flex-direction: column; min-width: 4px; }
.chord-pair .chord {
  color: var(--accent); font-weight: 700; line-height: 1.2;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}
.chord-pair .lyric {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 15px; color: var(--text); white-space: pre; line-height: 1.5;
}
/* display modes */
.song-chart[data-display="lyrics"] .chord { display: none; }
.song-chart[data-display="lyrics"] .chord-pair { min-width: 0; }
.song-chart[data-display="chords"] .lyric { color: var(--text-3); font-style: italic; }

/* Word-by-word beat highlight */
.lyric-word { transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); border-radius: 3px; padding: 0 1px; }
.lyric-word.beat {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* BPM slider */
.song-bpm-slider { padding: 0 var(--sp-4) var(--sp-2); }
.song-bpm-slider input[type="range"] {
  width: 100%; height: 24px; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.song-bpm-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: var(--line); border-radius: 2px;
}
.song-bpm-slider input[type="range"]::-moz-range-track {
  height: 4px; background: var(--line); border-radius: 2px;
}
.song-bpm-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.song-bpm-slider input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.song-bpm-marks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-3); margin-top: 2px;
}

/* ============================================================
   FORM SYSTEM BADGE
   ============================================================ */
.form-system-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.form-system-badge svg { display: block; }
.form-card.is-system { border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }

#forms-filter-bar { margin-bottom: var(--sp-3); grid-column: 1 / -1; }

.form-ctx-item.form-ctx-disabled,
.form-ctx-item[disabled] {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}

/* ============================================================
   GROUP CHECK-IN — TAKE ATTENDANCE
   ============================================================ */
.gci-detail-head {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--line); border-radius: var(--r-3);
}

/* ── two-column layout ── */
.gci-detail-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.gci-main { flex: 1; min-width: 0; }

/* ── meeting list panel (left column) ── */
.gci-meetings-panel {
  width: 148px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.gci-meetings-panel-head {
  padding: 9px 14px 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
}
.gci-meetings-list {
  overflow-y: auto;
  max-height: 68vh;
}
.gci-meeting-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 9px 14px;
  padding-left: 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  gap: 1px;
  transition: background var(--dur-1);
}
.gci-meeting-item:last-child { border-bottom: none; }
.gci-meeting-item:hover { background: var(--surface-2); }
.gci-meeting-item.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left-color: var(--accent);
  padding-left: 11px;
}
.gci-meeting-dow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.gci-meeting-item.is-selected .gci-meeting-dow { color: var(--accent); }
.gci-meeting-day {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.gci-meeting-today-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 1px;
}
.gci-meeting-badge {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface-2));
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 7px;
}

@media (max-width: 640px) {
  .gci-detail-body { flex-direction: column; }
  .gci-meetings-panel { width: 100%; position: static; }
  .gci-meetings-list {
    max-height: 180px;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .gci-meeting-item {
    flex-shrink: 0;
    width: auto;
    min-width: 72px;
    border-bottom: none;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 9px 12px;
  }
  .gci-meeting-item.is-selected {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
    padding-left: 12px;
  }
}
.gci-progress-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.gci-progress-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-3);
}
.gci-progress-num {
  font-size: 36px; font-weight: 700; color: var(--accent);
  line-height: 1; display: inline-block; transition: transform .2s ease;
}
.gci-progress-num.bump { transform: scale(1.15); }
.gci-progress-label {
  font-size: 13px; color: var(--text-2); margin-top: 4px;
}
.gci-progress-actions { display: flex; gap: var(--sp-2); }
.gci-progress-bar {
  height: 8px; width: 100%;
  background: var(--bg); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
}
.gci-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, white) 100%);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.gci-toolbar {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.gci-toolbar input[type="search"] {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 10px 14px; color: var(--text);
  font-size: 14px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.gci-toolbar input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.gci-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
  margin: var(--sp-4) 0 var(--sp-3); padding-left: 4px;
}
.gci-roster {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gci-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-2); padding: var(--sp-4) var(--sp-3);
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-3); cursor: pointer;
  transition: transform .15s ease, border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.gci-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 12%, transparent);
}
.gci-card:active { transform: translateY(0); }
.gci-card.is-present {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)) 0%, var(--surface) 100%);
  border-color: var(--accent);
}
.gci-card.is-present .gci-card-check { opacity: 1; transform: scale(1); }
.gci-card-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 2px solid var(--line);
  font-size: 22px; font-weight: 600; color: var(--text);
  transition: border-color .15s;
}
.gci-card.is-present .gci-card-avatar { border-color: var(--accent); }
.gci-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gci-card-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  text-align: center; line-height: 1.25;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; width: 100%;
}
.gci-card-role {
  font-size: 10px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.gci-card-role.is-primary {
  background: var(--accent); color: #fff;
}
.gci-card-check {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.6);
  transition: opacity .15s ease, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.gci-card-check svg { width: 16px; height: 16px; }
.gci-card-time {
  font-size: 11px; color: var(--text-3);
}
.gci-card.is-present .gci-card-time { color: var(--accent); font-weight: 500; }
.gci-empty-roster {
  padding: var(--sp-5); text-align: center; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: var(--r-3);
}

/* ── Group schedule & calendar ─────────────────────────────────────────── */
.grp-day-picker {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
}
.grp-day-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--bg);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: background .13s, border-color .13s, color .13s;
  user-select: none;
}
.grp-day-btn:hover { border-color: var(--accent); color: var(--accent); }
.grp-day-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* Calendar wrapper */
.grp-cal-wrap {
  margin-top: 12px; border: 1px solid var(--line);
  border-radius: var(--r-3); overflow: hidden;
  background: var(--surface);
}
.grp-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.grp-cal-nav {
  display: flex; gap: 4px;
}
.grp-cal-nav button {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: background .13s;
}
.grp-cal-nav button:hover { background: var(--accent-soft); color: var(--accent); }
.grp-cal-title {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.grp-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.grp-cal-dh {
  padding: 6px 0; text-align: center;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--line);
}
.grp-cal-day {
  position: relative; min-height: 56px; padding: 4px 5px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  cursor: pointer; transition: background .12s;
  display: flex; flex-direction: column; gap: 2px;
}
.grp-cal-day:hover { background: var(--accent-soft); }
.grp-cal-empty {
  min-height: 56px; border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 50%, transparent);
}
/* Remove right border on last column items */
.grp-cal-grid > *:nth-child(7n) { border-right: none; }
.grp-cal-today .grp-cal-num {
  background: var(--accent); color: #fff;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.grp-cal-num {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.grp-cal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); align-self: flex-start;
  margin-left: 2px;
}
.grp-cal-has-meeting { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.grp-cal-has-meeting:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.grp-cal-cancelled {
  background: color-mix(in srgb, #ef4444 5%, var(--surface));
  text-decoration: line-through;
}
.grp-cal-cancelled:hover { background: color-mix(in srgb, #ef4444 10%, var(--surface)); }
.grp-cal-cancelled .grp-cal-dot { background: #ef4444; }
.grp-cal-override { background: color-mix(in srgb, #f59e0b 8%, var(--surface)); }
.grp-cal-override:hover { background: color-mix(in srgb, #f59e0b 14%, var(--surface)); }
.grp-cal-override .grp-cal-dot { background: #f59e0b; }
.grp-cal-extra,
.grp-cal-has-meeting.grp-cal-extra { background: color-mix(in srgb, #10b981 10%, var(--surface)); }
.grp-cal-extra:hover,
.grp-cal-has-meeting.grp-cal-extra:hover { background: color-mix(in srgb, #10b981 16%, var(--surface)); }
.grp-cal-extra .grp-cal-dot { background: #10b981; }
.grp-cal-x {
  font-size: 10px; color: #ef4444; font-weight: 700; line-height: 1;
}
.grp-cal-time {
  font-size: 10px; color: var(--text-3); line-height: 1;
}
.grp-cal-note {
  font-size: 10px; color: var(--text-2); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}

/* Occurrence popover */
.grp-occ-popover {
  position: fixed; z-index: 900;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-3); box-shadow: 0 8px 32px rgba(0,0,0,.14);
  padding: 14px 16px; width: 280px;
  display: none;
}
.grp-occ-popover.open { display: block; }
.grp-occ-date {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.grp-occ-foot {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.grp-occ-foot .btn-danger-outline {
  border: 1px solid #ef4444; color: #ef4444; background: transparent;
  padding: 5px 10px; border-radius: var(--r-2); font-size: 12px;
  cursor: pointer; transition: background .13s;
}
.grp-occ-foot .btn-danger-outline:hover { background: color-mix(in srgb, #ef4444 10%, transparent); }

/* Schedule section layout */
.grp-sched-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 540px) {
  .grp-sched-row { grid-template-columns: 1fr; }
}

/* Calendar legend */
.grp-cal-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 8px 12px; border-top: 1px solid var(--line);
  background: var(--bg);
}
.grp-cal-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-3);
}
.grp-cal-leg-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.grp-cal-leg-dot.recurring { background: var(--accent); }
.grp-cal-leg-dot.custom    { background: #10b981; }
.grp-cal-leg-dot.override  { background: #f59e0b; }
.grp-cal-leg-dot.cancelled { background: #ef4444; }

/* ── Custom meetings panel ──────────────────────────────────────────────── */
.grp-custom-section {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.grp-custom-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.grp-custom-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.grp-custom-form {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-3); padding: 12px;
  margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px;
}
.grp-custom-form-foot {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px;
}
.grp-custom-list {
  display: flex; flex-direction: column; gap: 6px;
}
.grp-custom-empty {
  font-size: 12px; color: var(--text-3); text-align: center;
  padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-2);
  margin: 0;
}
.grp-custom-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; background: color-mix(in srgb, #10b981 6%, var(--surface));
  border: 1px solid color-mix(in srgb, #10b981 20%, var(--line));
  border-radius: var(--r-2); transition: background .13s;
}
.grp-custom-item:hover { background: color-mix(in srgb, #10b981 10%, var(--surface)); }
.grp-custom-item.is-past { opacity: .65; }
.grp-custom-item-left {
  flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.grp-custom-item-date {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.grp-custom-item-time {
  font-size: 12px; color: var(--text-2);
}
.grp-custom-item-loc {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grp-custom-item-note {
  font-size: 12px; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grp-custom-item-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.grp-custom-item-edit,
.grp-custom-item-del {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-2);
  border: none; background: transparent; cursor: pointer;
  color: var(--text-3); transition: background .12s, color .12s;
  padding: 0;
}
.grp-custom-item-edit:hover { background: var(--accent-soft); color: var(--accent); }
.grp-custom-item-del:hover  { background: color-mix(in srgb, #ef4444 12%, transparent); color: #ef4444; }

/* Occurrence popover upgrades */
.grp-occ-popover-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.grp-occ-type-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
}
.grp-occ-type-badge.recurring {
  background: var(--accent-soft); color: var(--accent);
}
.grp-occ-type-badge.custom {
  background: color-mix(in srgb, #10b981 15%, transparent); color: #059669;
}
/* remove old border from date element since head wrapper now carries it */
.grp-occ-date { font-size: 13px; font-weight: 700; color: var(--text); margin: 0; padding: 0; border: none; }

/* ── Church Language settings ───────────────────────────────────────────── */
.lang-section {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
}
.lang-section:last-of-type { border-bottom: none; }
.lang-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 10px;
}
.lang-hint {
  font-size: 12px; color: var(--text-3); margin: -6px 0 10px;
}
.lang-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px;
}
@media (max-width: 640px) { .lang-grid { grid-template-columns: 1fr; } }
.lang-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 6px 10px;
  transition: border-color .13s;
}
.lang-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.lang-default {
  flex: 0 0 140px; font-size: 12px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-default em { font-style: normal; color: var(--text-3); font-weight: 400; }
.lang-input {
  flex: 1; border: none !important; background: transparent !important;
  padding: 0 !important; font-size: 13px; min-width: 0;
  box-shadow: none !important; outline: none;
}
.lang-input:focus { box-shadow: none !important; }

/* ── Group Types admin ───────────────────────────────────────────────────── */
.gt-list {
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px 0 12px;
}
.gt-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.gt-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.gt-drag-handle {
  cursor: grab; color: var(--text-3); flex-shrink: 0; padding: 0 2px;
  display: flex; align-items: center;
}
.gt-drag-handle:active { cursor: grabbing; }
.gt-drag-handle svg { display: block; }
.gt-color-input {
  width: 28px; height: 28px; border: 2px solid var(--line);
  border-radius: 50%; padding: 0; cursor: pointer;
  flex-shrink: 0; overflow: hidden; background: none;
}
.gt-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.gt-color-input::-webkit-color-swatch { border: none; border-radius: 50%; }
.gt-name-input {
  flex: 1; border: none !important; background: transparent !important;
  padding: 0 !important; font-size: 13px; font-weight: 500;
  box-shadow: none !important; min-width: 0;
}
.gt-name-input:focus { outline: none; box-shadow: none !important; }
.gt-row-actions {
  display: flex; gap: 4px; align-items: center; flex-shrink: 0;
}
.gt-save-btn {
  font-size: 11px; padding: 3px 8px; opacity: 0;
  transition: opacity .15s; pointer-events: none;
}
.gt-row.is-dirty .gt-save-btn { opacity: 1; pointer-events: auto; }
.gt-order-btn {
  width: 24px; height: 24px; border-radius: var(--r-1);
  border: 1px solid var(--line); background: var(--bg);
  color: var(--text-2); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.gt-order-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.gt-order-btn:disabled { opacity: .3; cursor: not-allowed; }
.gt-del-btn {
  width: 24px; height: 24px; border-radius: var(--r-1);
  border: none; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.gt-del-btn:hover { background: color-mix(in srgb, #ef4444 12%, transparent); color: #ef4444; }
.gt-add-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 4px; border-top: 1px solid var(--line);
  margin-top: 4px;
}
.gt-add-row .elv-input { flex: 1; }
.gt-cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; padding: 2px 8px 2px 6px;
  border-radius: 999px; color: #fff;
}
.gt-cat-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  opacity: .8;
}

/* ── Generic toggle switch (used in team-detail service roster card) ── */
.toggle-row {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.toggle-label { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative; width: 40px; height: 22px; border-radius: 11px;
  background: var(--line); border: 1.5px solid color-mix(in srgb, var(--line) 80%, transparent);
  transition: background .2s, border-color .2s; flex-shrink: 0;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.toggle-input:checked ~ .toggle-track {
  background: var(--accent); border-color: var(--accent);
}
.toggle-input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }

/* ── Team detail — positions chip list ── */
.td-positions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  margin-bottom: var(--sp-3);
}
.td-positions-list:empty::before {
  content: 'No roles yet — add one below.';
  color: var(--text-3);
  font-size: 12.5px;
  align-self: center;
}
.td-position-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2, #f4f4f5);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 13px;
  color: var(--text-1);
}
.td-position-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  transition: color .15s, background .15s;
}
.td-position-chip-remove:hover { color: var(--danger); background: var(--danger-bg, #fee2e2); }
.td-position-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── New service dialog — team selection ── */
.sv-teams-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 6px;
}
.sv-team-check {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.sv-team-check:hover { border-color: var(--accent); }
.sv-team-check input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.sv-team-check:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }

/* ── Service detail — more (⋯) menu ── */
.sd-more-menu {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); box-shadow: 0 4px 16px rgba(0,0,0,.15);
  min-width: 170px; overflow: hidden;
}
.sd-more-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 13.5px; color: var(--text); text-align: left;
  transition: background .12s;
}
.sd-more-item:hover { background: var(--surface-2); }
.sd-more-item.sd-more-danger { color: var(--neg); }
.sd-more-item.sd-more-danger:hover { background: color-mix(in srgb, var(--neg) 10%, transparent); }

/* ── Roster role editing ── */
.roster-add-role {
  border-top: 1px solid var(--line);
  padding: 8px var(--sp-3);
}
.roster-add-role-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; color: var(--text-3); padding: 2px 0;
  transition: color .15s;
}
.roster-add-role-btn:hover { color: var(--accent); }
.roster-add-role-form {
  display: flex; align-items: center; gap: 6px;
}
.roster-remove-role {
  display: none; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 2px; border-radius: 3px;
  transition: color .12s, background .12s; margin-left: 4px;
  line-height: 0;
}
.slot-name { display: flex; align-items: center; }
.roster-slot:hover .roster-remove-role { display: flex; }
.roster-remove-role:hover { color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, transparent); }

/* ── Member heat map ─────────────────────────────────────────── */
.hm-canvas {
  height: calc(100vh - 230px);
  min-height: 420px;
  width: 100%;
  border-radius: var(--r-lg, 14px);
  overflow: hidden;
  border: 1px solid var(--line, #25252a);
  background: var(--bg, #0c0c0d);
}
.hm-canvas .leaflet-container { height: 100%; width: 100%; background: var(--bg, #0c0c0d); font: inherit; }
/* Dark map chrome — match the app's dark surfaces */
.hm-canvas .leaflet-control-zoom a {
  background: var(--surface, #161618); color: var(--text, #f4f4f5);
  border-color: var(--line, #25252a);
}
.hm-canvas .leaflet-control-zoom a:hover { background: var(--surface-2, #1d1d20); }
.hm-canvas .leaflet-bar { border-color: var(--line, #25252a); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hm-canvas .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface, #161618) 88%, transparent);
  color: var(--text-3, #7c7d85);
}
.hm-canvas .leaflet-control-attribution a { color: var(--text-2, #b8b9bf); }
.hm-canvas .leaflet-popup-content-wrapper, .hm-canvas .leaflet-popup-tip {
  background: var(--surface, #161618); color: var(--text, #f4f4f5);
  border: 1px solid var(--line, #25252a);
}
.hm-stats {
  display: flex; flex-wrap: wrap; gap: var(--sp-3, 12px);
  margin-bottom: var(--sp-4, 16px);
}
.hm-stat {
  background: var(--surface, #161618);
  border: 1px solid var(--line, #25252a);
  border-radius: var(--r-md, 10px);
  padding: 10px 16px; min-width: 120px;
}
.hm-stat .hm-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--text, #f4f4f5); }
.hm-stat .hm-stat-label { font-size: 11.5px; color: var(--text-3, #7c7d85); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.hm-church-pin {
  background: var(--accent, #FFCC00);
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--bg, #0c0c0d); box-shadow: 0 0 0 2px var(--accent, #FFCC00), 0 2px 6px rgba(0,0,0,.5);
}

/* ════════════════════════════════════════════════════════════
   PEOPLE PAGE REDESIGN
   ════════════════════════════════════════════════════════════ */

/* ── Stat cards ───────────────────────────────────────────── */
.pp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3, 12px);
  margin: var(--sp-4, 16px) 0;
}
.pp-stat {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--line, #25252a);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tone) 9%, transparent), transparent 60%),
    var(--surface, #161618);
  overflow: hidden;
  min-height: 104px;
}
.pp-stat[data-tone="violet"] { --tone: #8b5cf6; }
.pp-stat[data-tone="blue"]   { --tone: #3b82f6; }
.pp-stat[data-tone="green"]  { --tone: #22c55e; }
.pp-stat[data-tone="amber"]  { --tone: #f5b50a; }
.pp-stat-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 16%, transparent);
}
.pp-stat-icon svg { width: 20px; height: 20px; }
.pp-stat-body { flex: 1 1 auto; min-width: 0; padding-right: 62px; }
.pp-stat-label { font-size: 12.5px; color: var(--text-2, #b8b9bf); font-weight: 500; margin-right: -56px; white-space: nowrap; }
.pp-stat-value { font-size: 30px; font-weight: 750; line-height: 1.1; margin: 2px 0 4px; color: var(--text, #f4f4f5); letter-spacing: -.02em; }
.pp-stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.pp-stat-delta svg { width: 13px; height: 13px; }
.pp-stat-delta.pos  { color: #34d399; }
.pp-stat-delta.warn { color: #f5b50a; }
.pp-spark {
  position: absolute; right: 12px; bottom: 14px;
  width: 70px; height: 34px;
  color: var(--tone); opacity: .85;
  pointer-events: none;
}
.pp-ring { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }

/* ── Toolbar ──────────────────────────────────────────────── */
.pp-toolbar {
  display: flex; align-items: center; gap: var(--sp-3, 12px);
  margin-bottom: var(--sp-3, 12px);
  flex-wrap: wrap;
}
.pp-search { flex: 1 1 280px; max-width: 420px; }
.pp-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-dd { position: relative; }
.pp-dd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--r-md, 10px);
  border: 1px solid var(--line, #25252a);
  background: var(--surface, #161618);
  color: var(--text, #f4f4f5);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.pp-dd-btn:hover { border-color: color-mix(in srgb, var(--accent, #FFCC00) 50%, var(--line)); }
.pp-dd-btn svg { width: 15px; height: 15px; color: var(--text-3, #7c7d85); }
.pp-dd.active .pp-dd-btn,
.pp-dd-btn.active { border-color: var(--accent, #FFCC00); color: var(--text); }
.pp-filters-btn svg { color: var(--text-2, #b8b9bf); }
.pp-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 200px; max-height: 320px; overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-md, 10px);
  border: 1px solid var(--line, #25252a);
  background: var(--surface, #161618);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.pp-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text, #f4f4f5); cursor: pointer;
}
.pp-dd-item:hover { background: var(--surface-2, #1d1d20); }
.pp-dd-item.sel { color: var(--accent, #FFCC00); font-weight: 600; }
.pp-dd-item .pp-dd-check { width: 14px; height: 14px; opacity: 0; }
.pp-dd-item.sel .pp-dd-check { opacity: 1; }
.pp-view { margin-left: auto; }

/* ── Table tweaks ─────────────────────────────────────────── */
.pp-table-wrap {
  border: 1px solid var(--line, #25252a);
  border-radius: var(--r-lg, 16px);
  overflow: hidden;
  max-height: none;
  background: var(--surface, #161618);
}
.pp-table { width: 100%; }
.pp-table thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-3, #7c7d85); font-weight: 600;
}
.pp-th-sub { font-size: 9.5px; opacity: .7; text-transform: none; letter-spacing: 0; }
.pp-table tbody tr { transition: background .12s; }
.pp-table tbody tr:hover { background: color-mix(in srgb, var(--accent, #FFCC00) 5%, transparent); }
.pp-role-sub { font-size: 11.5px; color: var(--text-3, #7c7d85); margin-top: 3px; }
.pp-member-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  color: var(--accent, #FFCC00);
  background: color-mix(in srgb, var(--accent, #FFCC00) 14%, transparent);
}

/* coloured group chips */
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 320px; }
.pp-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis;
  color: var(--cc, #b8b9bf);
  background: color-mix(in srgb, var(--cc, #b8b9bf) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc, #b8b9bf) 30%, transparent);
}
.pp-chip-more {
  color: var(--text-3, #7c7d85);
  background: var(--surface-2, #1d1d20);
  border: 1px solid var(--line, #25252a);
}

/* attendance donut */
.pp-attn { position: relative; width: 38px; height: 38px; }
.pp-attn svg { transform: rotate(-90deg); width: 38px; height: 38px; }
.pp-attn-track { stroke: var(--line, #25252a); }
.pp-attn-txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: var(--text, #f4f4f5);
}

/* engagement pills */
.pp-eng {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pp-eng svg { width: 12px; height: 12px; }
.pp-eng .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pp-eng.active    { color: #34d399; background: color-mix(in srgb, #34d399 14%, transparent); }
.pp-eng.watch     { color: #f5b50a; background: color-mix(in srgb, #f5b50a 14%, transparent); }
.pp-eng.needscare { color: #f87171; background: color-mix(in srgb, #f87171 14%, transparent); }
.pp-lastseen { line-height: 1.35; }
.pp-lastseen .sub { display: block; font-size: 11.5px; color: var(--text-3, #7c7d85); }

/* ── Grid (card) view ─────────────────────────────────────── */
.pp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3, 12px);
}
.pp-card {
  position: relative;
  padding: 16px;
  border-radius: var(--r-lg, 16px);
  border: 1px solid var(--line, #25252a);
  background: var(--surface, #161618);
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.pp-card:hover { border-color: color-mix(in srgb, var(--accent, #FFCC00) 45%, var(--line)); transform: translateY(-2px); }
.pp-card-top { display: flex; align-items: center; gap: 12px; }
.pp-card-top .avatar { width: 46px; height: 46px; font-size: 16px; }
.pp-card-name { font-weight: 650; font-size: 14.5px; color: var(--text, #f4f4f5); }
.pp-card-mail { font-size: 12px; color: var(--text-3, #7c7d85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.pp-card-chips { margin-top: 12px; }

@media (max-width: 1100px) {
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .pp-stats { grid-template-columns: 1fr; }
  .pp-view { margin-left: 0; }
}

.pp-ring { width: 64px; height: 64px; display: grid; place-items: center; }
.pp-ring svg { grid-area: 1 / 1; }
.pp-ring-txt { grid-area: 1 / 1; font-size: 13px; font-weight: 700; color: #34d399; }

/* ── In-app notifications ─────────────────────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  background: var(--neg); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  min-width: 15px; height: 15px;
  border-radius: 999px; display: grid; place-items: center;
  padding: 0 3px; pointer-events: none;
}
.notif-drop {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; max-height: 460px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--r-3); box-shadow: 0 8px 32px rgba(0,0,0,.22);
  overflow: hidden; display: flex; flex-direction: column;
  z-index: 9999;
}
.notif-drop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.notif-drop-title { font-size: 13px; font-weight: 700; }
.notif-read-all { font-size: 11.5px; color: var(--accent); background: none; border: none; cursor: pointer; padding: 0; }
.notif-read-all:hover { text-decoration: underline; }
.notif-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative; transition: background var(--dur-1);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-icon {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  flex-shrink: 0; margin-top: 1px;
}
.notif-icon.roster_removed { background: var(--neg-soft); color: var(--neg); }
.notif-icon.roster_added   { background: var(--pos-soft); color: var(--pos); }
.notif-icon.general        { background: var(--surface-3); color: var(--text-2); }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-body  { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-bottom: 4px; }
.notif-ago   { font-size: 11px; color: var(--text-3); }
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 6px;
}
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ── Song lyrics ──────────────────────────────────────────────────────────── */
.lyrics-section { margin-bottom: var(--sp-5); }
.lyrics-section:last-child { margin-bottom: 0; }
.lyrics-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 6px;
}
.lyrics-text {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.75;
  color: var(--text-1); margin: 0; white-space: pre-wrap; word-break: break-word;
}

/* ── CCLI search modal results ────────────────────────────────────────────── */
.ccli-result {
  padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background var(--dur-1);
}
.ccli-result:last-child { border-bottom: 0; }
.ccli-result:hover { background: var(--surface-2); }
.ccli-result-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.ccli-result-meta  { font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.ccli-result-num   { font-size: 11px; color: var(--text-3); }

/* ── Group detail — add-member search ─────────────────────────────────────── */
.gd-add-panel {
  margin-bottom: var(--sp-4);
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  background: var(--surface-1);
  overflow: visible;
  position: relative;
}
.gd-add-panel-inner {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 10px var(--sp-3);
}
.gd-add-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; font-family: var(--font-sans); color: var(--text-1);
  line-height: 1.4;
}
.gd-add-input::placeholder { color: var(--text-3); }
.gd-member-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 200;
  margin: 0; padding: 4px 0; list-style: none;
  max-height: 260px; overflow-y: auto;
}
.gd-person-result {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px var(--sp-3); cursor: pointer;
  transition: background var(--dur-1);
}
.gd-person-result:hover { background: var(--surface-2); }
.gd-result-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.gd-result-avatar-init {
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.gd-result-info {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0; flex: 1;
}
.gd-result-name  { font-size: 13px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-result-email { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-result-empty { padding: 12px var(--sp-3); font-size: 13px; color: var(--text-3); text-align: center; }

/* ── Login page editor ────────────────────────────────────────────────────── */
.lp-editor {
  display: grid; grid-template-columns: 1fr 380px; gap: var(--sp-4); align-items: start;
}
@media (max-width: 960px) { .lp-editor { grid-template-columns: 1fr; } }
.lp-form-card { height: fit-content; }
.lp-preview-wrap { position: sticky; top: var(--sp-4); }
.lp-preview-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: var(--sp-2); }
.lp-preview {
  border: 1px solid var(--line); border-radius: var(--r-3);
  overflow: hidden; background: var(--surface-1);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.lp-prev-hero {
  height: 140px; background: #222 center/cover no-repeat;
  position: relative; display: flex; align-items: flex-end; padding: 12px;
}
.lp-prev-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.lp-prev-logo { position: relative; z-index: 1; color: #fff; }
.lp-prev-logo img { height: 32px; object-fit: contain; }
.lp-prev-form { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.lp-prev-name { font-size: 15px; font-weight: 700; }
.lp-prev-tag  { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.lp-prev-field { height: 28px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); }
.lp-prev-btn {
  height: 32px; border-radius: var(--r-2); background: var(--accent);
  color: #000; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; margin-top: 2px;
}

/* ── Login page designer feature list ───────────────────────────────────── */
.lp-feature {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.lp-feature:last-child { border-bottom: 0; }
.lp-feature svg { flex-shrink: 0; color: var(--accent); opacity: .8; }

/* ── Vision Tags ──────────────────────────────────────────────────────────── */
.pd-vision-tags {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}
.vision-tag {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--r-2);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  text-align: left; cursor: pointer;
  transition: all var(--dur-1) var(--ease);
}
.vision-tag:hover { border-color: var(--accent); color: var(--text-1); }
.vision-tag.on { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); color: var(--text-1); }
.vision-tag:disabled { opacity: 0.5; cursor: wait; }
.vision-tag-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--line); transition: background var(--dur-1);
}
.vision-tag.on .vision-tag-dot { background: var(--accent); }

/* ── Tags card updates ────────────────────────────────────────────────────── */
.pd-tags-active { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--sp-2) var(--sp-3) var(--sp-2); min-height: 32px; align-items: center; }
.pd-tags-all { padding: 0 var(--sp-3) var(--sp-3); }
.pd-tags-all summary { font-size: 12px; color: var(--accent); cursor: pointer; padding: var(--sp-1) 0; user-select: none; }
.pd-tags-all summary:hover { text-decoration: underline; }
.pd-tags-all-list { display: flex; flex-direction: column; gap: 4px; margin-top: var(--sp-2); }

/* ── Person freeform tags ─────────────────────────────────────────────────── */
.person-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--text-1);
}
.person-tag.vision {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
}
.person-tag-x {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 14px; line-height: 1; color: var(--text-3);
  display: grid; place-items: center; width: 16px; height: 16px;
  border-radius: 50%;
}
.person-tag-x:hover { background: var(--neg-soft); color: var(--neg); }
.pd-tag-input-wrap { padding: var(--sp-2) var(--sp-3); }
.pd-tag-input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface-2); color: var(--text-1);
  font-size: 13px; padding: 6px 10px; outline: none;
  transition: border-color var(--dur-1);
}
.pd-tag-input:focus { border-color: var(--accent); }
.pd-tag-input::placeholder { color: var(--text-3); }
.pd-tag-suggestions {
  position: absolute; top: calc(100% + 2px); left: var(--sp-3); right: var(--sp-3);
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: 0 4px 16px rgba(0,0,0,.18); list-style: none; margin: 0; padding: 4px 0;
  z-index: 200; max-height: 220px; overflow-y: auto;
}
.pd-tag-opt {
  padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-tag-opt:hover, .pd-tag-opt:focus { background: var(--surface-2); outline: none; }

/* ═══════════════════════════════════════════════════════════════════
   BULK ROSTER — date-range picker modal
   ═══════════════════════════════════════════════════════════════════ */
@keyframes bsmFadeIn  { from { opacity:0 } to { opacity:1 } }
@keyframes bsmSlideUp { from { transform:translateY(28px) scale(.95); opacity:0 } to { transform:none; opacity:1 } }

.bsm-backdrop {
  position: fixed; inset: 0; z-index: 9100;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px) saturate(.8);
  display: flex; align-items: center; justify-content: center;
  animation: bsmFadeIn .18s ease;
}
.bsm-backdrop[hidden] { display: none !important; }

.bsm-card {
  width: 480px; max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 22px;
  padding: 30px 32px 28px;
  box-shadow: 0 48px 120px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  animation: bsmSlideUp .3s cubic-bezier(.34,1.35,.64,1);
}

.bsm-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }

.bsm-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

.bsm-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.bsm-sub   { font-size: 13px; color: var(--text-3); margin: 0; line-height: 1.4; }

.bsm-dates {
  display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px;
}
.bsm-date-label {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
}
.bsm-date-input {
  height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-family: inherit; width: 100%;
  color-scheme: dark; transition: border-color .13s, box-shadow .13s;
}
.bsm-date-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.bsm-date-arrow { color: var(--text-3); padding-bottom: 11px; flex-shrink: 0; }

.bsm-preview {
  font-size: 13px; color: var(--text-2);
  padding: 13px 15px; margin-bottom: 22px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  min-height: 44px; line-height: 1.5;
}
.bsm-preview-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.bsm-svc-chip {
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}
.bsm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════
   BULK ROSTER — full-screen overlay
   ═══════════════════════════════════════════════════════════════════ */
@keyframes brFadeIn { from { opacity:0 } to { opacity:1 } }

.br-overlay {
  position: fixed; inset: 0; z-index: 9200;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: brFadeIn .16s ease;
}
.br-overlay[hidden] { display: none !important; }

/* Top bar */
.br-topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.br-topbar-left  { display: flex; align-items: center; gap: 13px; }
.br-topbar-right { display: flex; align-items: center; gap: 10px; }

.br-close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; cursor: pointer; color: var(--text-2);
  transition: background .12s, color .12s, border-color .12s;
}
.br-close-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-3); }

.br-topbar-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.br-topbar-sub   { font-size: 11.5px; color: var(--text-3); }

.br-save-badge {
  font-size: 12px; font-weight: 600;
  color: #22c55e; padding: 3px 9px;
  background: rgba(34,197,94,.1); border-radius: 999px;
  border: 1px solid rgba(34,197,94,.25);
  animation: bsmFadeIn .2s ease;
}
.br-save-badge[hidden] { display: none !important; }

/* Body layout */
.br-body { flex: 1; display: flex; overflow: hidden; }

/* ── Left panel ── */
.br-panel {
  width: 270px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; overflow: hidden;
}

.br-panel-head {
  padding: 12px 14px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.br-panel-hint {
  font-size: 11.5px; color: var(--text-3); margin: 0 0 10px;
  line-height: 1.4;
}

/* Select-by-team toggle */
.br-filter-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 0 10px; user-select: none;
}
.br-filter-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.br-filter-track {
  width: 34px; height: 19px; border-radius: 999px; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--line);
  position: relative; transition: background .18s, border-color .18s;
}
.br-filter-toggle input:checked + .br-filter-track {
  background: var(--accent); border-color: var(--accent);
}
.br-filter-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.br-filter-toggle input:checked + .br-filter-track .br-filter-thumb { transform: translateX(15px); }
.br-filter-text { font-size: 12px; font-weight: 500; color: var(--text-2); }

.br-team-tabs {
  display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 12px;
}
.br-team-tab {
  padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-2); cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.br-team-tab:hover { background: var(--surface-2); color: var(--text); }
.br-team-tab.active {
  background: var(--accent); color: #111;
  border-color: var(--accent);
}

.br-search-row {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; color: var(--text-3);
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.br-search-row input {
  border: none; background: none; color: var(--text);
  font-size: 13px; flex: 1; outline: none; font-family: inherit;
}
.br-search-row input::placeholder { color: var(--text-3); }

.br-people-list {
  flex: 1; overflow-y: auto;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}

.br-panel-empty {
  padding: var(--sp-5); text-align: center;
  font-size: 12.5px; color: var(--text-3);
}

.br-person {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 10px;
  cursor: grab; user-select: none;
  border: 1px solid transparent;
  transition: background .1s, border-color .1s;
}
.br-person:hover  { background: var(--surface-2); border-color: var(--line); }
.br-person.br-person--assigned { opacity: 1; }
.br-person:active { cursor: grabbing; opacity: .7; }

.br-person-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; overflow: hidden;
  background: var(--surface-2);
}
.br-person-av img { width: 100%; height: 100%; object-fit: cover; }

.br-person-name {
  font-size: 13px; font-weight: 500; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.br-person-tag {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.br-person-dots { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
.br-person-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .7; }

.br-panel-foot {
  padding: 9px 14px; font-size: 11.5px; color: var(--text-3);
  border-top: 1px solid var(--line); flex-shrink: 0;
}

/* ── Grid area ── */
.br-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.br-grid-scroll {
  flex: 1; overflow: auto;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.br-grid-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.br-grid-scroll::-webkit-scrollbar-track { background: transparent; }
.br-grid-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.br-grid {
  display: grid;
  width: max-content; min-width: 100%;
}

/* Header row */
.br-corner-cell {
  position: sticky; top: 0; left: 0; z-index: 10;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 14px 16px;
  display: flex; align-items: flex-end;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--text-3);
}

.br-svc-head {
  position: sticky; top: 0; z-index: 8;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 0 16px 14px;
  min-width: 180px;
}
.br-svc-accent { height: 4px; margin: 0 -16px 12px; border-radius: 0; }
.br-svc-date   { font-size: 13px; font-weight: 700; }
.br-svc-time   { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.br-svc-label  {
  font-size: 11px; color: var(--text-3); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 148px;
}
.br-svc-preacher {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
}
.br-svc-preacher-av {
  width: 22px; height: 22px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.br-svc-preacher-av img { width: 100%; height: 100%; object-fit: cover; }
.br-svc-preacher-name { font-size: 11.5px; color: var(--text-2); }

/* Dept separator */
.br-dept-sep {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 0;
}
.br-dept-sep-label {
  position: sticky; left: 0; z-index: 5;
  padding: 6px 16px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap; min-width: 200px;
}
.br-dept-sep-fill {
  flex: 1;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: 100%; min-height: 30px;
}

/* Position label */
.br-pos-label {
  position: sticky; left: 0; z-index: 4;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding: 0 16px;
  display: flex; align-items: center;
  font-size: 12.5px; color: var(--text-2);
  min-height: 72px; min-width: 200px;
}

/* Slot cell */
.br-slot {
  border-right: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  padding: 8px; min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.br-slot.br-drop-over {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.br-slot-empty {
  width: 100%; text-align: center; padding: 8px 10px;
  font-size: 11px; color: var(--text-3);
  border: 1.5px dashed color-mix(in srgb, var(--text-3) 35%, transparent);
  border-radius: 9px; cursor: default;
  transition: border-color .12s, color .12s;
}
.br-slot.br-drop-over .br-slot-empty {
  border-color: var(--accent); border-style: solid;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.br-slot:hover:not(.br-drop-over) .br-slot-empty {
  border-color: color-mix(in srgb, var(--text-3) 60%, transparent);
  color: var(--text-2);
}

/* Filled slot chip */
.br-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 6px 6px 7px;
  border-radius: 10px; width: 100%;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  cursor: grab; user-select: none;
  transition: opacity .1s, box-shadow .1s;
}
.br-chip:hover { box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.br-chip:active { cursor: grabbing; }
.br-chip.br-dragging { opacity: .3; }

.br-chip-av {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; overflow: hidden;
}
.br-chip-av img { width: 100%; height: 100%; object-fit: cover; }

.br-chip-name {
  font-size: 12px; font-weight: 600;
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.br-chip-rm {
  width: 20px; height: 20px; flex-shrink: 0;
  border: none; background: none; cursor: pointer; color: var(--text-3);
  border-radius: 5px; display: flex; align-items: center; justify-content: center;
  padding: 0; transition: color .1s, background .1s;
}
.br-chip-rm:hover { color: var(--text); background: rgba(255,255,255,.1); }

/* Grid loading state */
.br-grid-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text-3); font-size: 13px; gap: 10px;
}
.br-spin {
  width: 18px; height: 18px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Person blockout calendar ────────────────────────────────────────────── */
.pd-bcal-shell {
  border-top: 1px solid var(--border-soft); padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.pd-bcal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3);
}
.pd-bcal-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3);
}
.pd-bcal-nav { display: flex; align-items: center; gap: 4px; }
.pd-bcal-nav-btn {
  width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px;
  background: none; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: background .1s, color .1s;
}
.pd-bcal-nav-btn:hover { background: var(--bg-hover); color: var(--text); }
.pd-bcal-month-lbl {
  font-size: 12.5px; font-weight: 600; min-width: 100px; text-align: center; color: var(--text);
}
.pd-bcal-dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 2px;
}
.pd-bcal-dow-row span {
  text-align: center; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3); padding: 3px 0;
}
.pd-bcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.pd-bcal-cell {
  height: 27px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 5px; cursor: pointer; color: var(--text-2);
  transition: background .12s, color .12s; position: relative; user-select: none;
}
.pd-bcal-cell:not(.pd-bcal-cell--empty):hover { background: var(--bg-hover); color: var(--text); }
.pd-bcal-cell--empty { cursor: default; pointer-events: none; }
.pd-bcal-cell--today { font-weight: 700; color: var(--accent); }
.pd-bcal-cell--today::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--accent);
}
.pd-bcal-cell--blocked {
  background: var(--neg-soft); color: var(--neg); font-weight: 600; border-radius: 0;
}
.pd-bcal-cell--blocked:hover { background: var(--neg); color: #fff; }
.pd-bcal-cell--bs { border-radius: 5px 0 0 5px; }
.pd-bcal-cell--be { border-radius: 0 5px 5px 0; }
.pd-bcal-cell--bs.pd-bcal-cell--be { border-radius: 5px; }
/* Inline form */
.pd-bcal-form { margin-top: var(--sp-3); }
.pd-bcal-form-inner {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.pd-bcal-form-inner--rm {
  flex-direction: row; align-items: center; justify-content: space-between;
  border-color: var(--neg); background: var(--neg-soft); gap: 10px;
}
.pd-bcal-rm-label { font-size: 12.5px; color: var(--neg); flex: 1; }
.pd-bcal-form-row { display: flex; gap: 8px; }
.pd-bcal-form-lbl {
  display: flex; flex-direction: column; gap: 3px; flex: 1;
  font-size: 10.5px; color: var(--text-3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.pd-bcal-form-lbl input {
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 12.5px;
  width: 100%; font-weight: 400;
}
.pd-bcal-form-lbl input:focus { outline: none; border-color: var(--accent); }
.pd-bcal-form-btns { display: flex; gap: 6px; }
/* Blockout list */
.pd-bcal-bo-list { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: 4px; }
.pd-bcal-bo {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: var(--neg-soft); border: 1px solid transparent; border-radius: 7px;
  transition: border-color .12s;
}
.pd-bcal-bo:hover { border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.pd-bcal-bo-info { flex: 1; min-width: 0; }
.pd-bcal-bo-dates { display: block; font-size: 12.5px; font-weight: 600; color: var(--neg); }
.pd-bcal-bo-reason {
  display: block; font-size: 12px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-bcal-bo-rm {
  width: 22px; height: 22px; flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--neg) 50%, transparent); border-radius: 5px;
  background: none; cursor: pointer; color: var(--neg);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.pd-bcal-bo-rm:hover { background: var(--neg); color: #fff; border-color: var(--neg); }
.pd-bcal-bo-rm:disabled { opacity: .35; cursor: default; }
/* Add-dates button */
.pd-bcal-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; margin-top: var(--sp-3); padding: 7px 10px;
  border: 1.5px dashed var(--line); border-radius: 7px; background: none;
  cursor: pointer; font-size: 12.5px; color: var(--text-3);
  transition: border-color .12s, color .12s, background .12s;
}
.pd-bcal-add-btn:hover {
  border-color: var(--accent); color: var(--accent); background: var(--bg-2);
}

/* ── Camera capture modal ──────────────────────────────────────── */
.kc-cam-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.65); display: flex;
  align-items: center; justify-content: center; padding: 24px;
}
.kc-cam-card {
  background: var(--surface); border-radius: 16px; width: 100%;
  max-width: 520px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.kc-cam-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.kc-cam-title { font-weight: 600; font-size: 14px; }
.kc-cam-close {
  width: 28px; height: 28px; border: none; background: var(--surface-2);
  border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--text-2); display: grid; place-items: center;
}
.kc-cam-body {
  position: relative; background: #000;
  min-height: 300px; display: flex; align-items: center; justify-content: center;
}
.kc-cam-video  { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.kc-cam-canvas { display: none; }
.kc-cam-preview-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.kc-cam-preview-img  { max-width: 100%; max-height: 360px; object-fit: contain; }
.kc-cam-footer {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--line); justify-content: flex-end;
}

/* ── Child photo upload area ──────────────────────────────────── */
.kc-child-photo-area {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0; margin-bottom: 4px;
}
.kc-child-photo-circle {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--text-3);
  background-size: cover; background-position: center;
  overflow: hidden; cursor: pointer; transition: border-color .15s;
}
.kc-child-photo-circle:hover { border-color: var(--accent); }
.kc-child-photo-btns { display: flex; flex-direction: column; gap: 6px; }
.kc-child-photo-btns button { font-size: 12px; white-space: nowrap; }

/* ── Enrollment screen configurator (Kiosk tab) ──────────────── */
.kce-shell {
  display: grid; grid-template-columns: 280px 1fr;
  gap: 0; height: calc(100vh - 160px); min-height: 500px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface);
}
.kce-sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--surface);
  overflow: hidden;
}
.kce-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.kce-sidebar-title { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }

.kce-palette {
  padding: 10px; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.kce-palette-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--line); background: var(--surface-2);
  transition: background .1s, border-color .1s;
  user-select: none;
}
.kce-palette-item:hover { background: var(--surface-3); border-color: var(--accent); color: var(--text); }
.kce-palette-item-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.kce-palette-label { font-size: 11.5px; color: var(--text-3); }

.kce-settings { flex: 1; overflow-y: auto; padding: 12px; }
.kce-settings-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.kce-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.kce-field label { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.kce-field input, .kce-field select, .kce-field textarea {
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; font-size: 12.5px; background: var(--surface);
  color: var(--text); font-family: inherit; width: 100%;
}
.kce-field textarea { resize: vertical; min-height: 60px; }
.kce-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.kce-main {
  display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
.kce-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface); flex-shrink: 0;
}
.kce-toolbar-label { font-size: 11.5px; color: var(--text-3); }

.kce-canvas {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.kce-canvas-empty {
  text-align: center; padding: 40px 20px; color: var(--text-3);
  font-size: 13px; border: 2px dashed var(--line); border-radius: 10px;
}

.kce-block {
  background: var(--surface); border: 2px solid var(--line); border-radius: 10px;
  display: flex; align-items: stretch; overflow: hidden;
  cursor: pointer; transition: border-color .12s;
  position: relative;
}
.kce-block:hover, .kce-block.is-selected { border-color: var(--accent); }
.kce-block-drag {
  width: 28px; background: var(--surface-2); display: flex; align-items: center;
  justify-content: center; cursor: grab; flex-shrink: 0; color: var(--text-3);
  font-size: 14px;
}
.kce-block-drag:active { cursor: grabbing; }
.kce-block-body { flex: 1; padding: 10px 12px; min-width: 0; }
.kce-block-type { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.kce-block-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kce-block-rm {
  padding: 6px 10px; background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 16px; align-self: flex-start; margin-top: 6px;
}
.kce-block-rm:hover { color: var(--neg); }

.kce-preview-wrap {
  flex-shrink: 0; border-top: 1px solid var(--line);
  background: var(--surface); max-height: 240px; overflow: hidden;
}
.kce-preview-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .07em; padding: 6px 14px; border-bottom: 1px solid var(--line);
}
.kce-preview {
  overflow-x: auto; overflow-y: auto; max-height: 196px;
  background: #fafbff;
}
.kce-preview-inner {
  display: flex; flex-direction: column; gap: 0; min-height: 100%;
}

/* kce preview block renders */
.kcep-banner {
  padding: 20px 24px;
  font-family: 'Inter', sans-serif;
}
.kcep-banner-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.kcep-banner-title { font-size: 22px; font-weight: 800; margin: 6px 0 4px; line-height: 1.15; }
.kcep-banner-subtitle { font-size: 13px; opacity: .8; }
.kcep-logo { padding: 12px 24px; display: flex; justify-content: center; }
.kcep-logo img { max-height: 60px; max-width: 200px; object-fit: contain; }
.kcep-announcement {
  margin: 0 24px; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
}
.kcep-richtext { padding: 10px 24px; font-size: 13px; line-height: 1.6; }

/* new family wizard photo section */
.kc-nf-photo-area {
  display: flex; align-items: center; gap: 12px; padding: 6px 0 2px;
}
.kc-nf-photo-circle {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-3);
  background-size: cover; background-position: center; overflow: hidden;
}

/* ── New form field types ──────────────────────────────────────── */

/* Star rating — canvas preview */
.fb-rating-row { display: flex; gap: 3px; }
.fb-star { font-size: 22px; color: var(--line); }
.fb-star.fb-star-lit { color: #f59e0b; }

/* Star rating — builder preview + public form */
.fp-rating { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fp-rating .fp-star { background: none; border: none; font-size: 28px; color: var(--line); cursor: pointer; padding: 0; line-height: 1; transition: color .1s, transform .1s; }
.fp-rating .fp-star:hover,
.fp-rating .fp-star.fp-star-active { color: #f59e0b; transform: scale(1.15); }

/* Linear scale — canvas preview */
.fb-scale-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-scale-btns-prev { display: flex; gap: 4px; }
.fb-scale-btn-prev { min-width: 32px; height: 32px; border-radius: var(--r-1); background: var(--bg-2,rgba(0,0,0,.06)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.fb-scale-lbl { font-size: 11px; color: var(--text-3); }

/* Linear scale — builder preview + public form */
.fp-scale { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-scale-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.fp-scale-btn { min-width: 36px; height: 36px; border-radius: var(--r-1); background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-1); transition: background .12s, border-color .12s, color .12s; }
.fp-scale-btn:hover { border-color: var(--accent); color: var(--accent); }
.fp-scale-btn.fp-scale-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fp-scale-end-lbl { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* Yes / No */
.fb-yn-row { display: flex; gap: 12px; }
.fp-yn-row { display: flex; gap: 12px; }
/* The Yes/No options reuse .field.row, which is built for full-width STACKED
   rows (space-between + a bottom divider + last-child padding reset). Inline in
   .fp-yn-row that made "Yes" get a stray underline and extra bottom padding
   while "No" lost its bottom padding — so the two radios sat at different
   heights. Reset those to a compact, symmetric, left-aligned pair. */
.fp-yn-row label.field.row {
  padding: 0;
  border-bottom: 0;
  justify-content: flex-start;
  gap: 8px;
}
.fp-yn-row input[type="radio"] { accent-color: var(--accent); cursor: pointer; }

/* ── Number Slider ─────────────────────────────────────────────── */
.fp-slider-wrap { display: flex; flex-direction: column; gap: 6px; }
.fp-slider-num {
  font-size: 52px; font-weight: 700; line-height: 1;
  color: var(--accent); text-align: center; letter-spacing: -0.02em;
  min-height: 56px;
}
.fp-slider-row { display: flex; align-items: center; gap: 10px; }
.fp-slider-end { font-size: 13px; font-weight: 600; color: var(--text-2); flex-shrink: 0; min-width: 24px; text-align: center; }
.fp-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: var(--fp-track, 6px); border-radius: calc(var(--fp-track, 6px) / 2);
  background: var(--bg-2, rgba(0,0,0,.12));
  outline: none; cursor: pointer;
}
.fp-slider::-webkit-slider-runnable-track { height: var(--fp-track, 6px); border-radius: calc(var(--fp-track, 6px) / 2); background: var(--bg-2, rgba(0,0,0,.12)); }
.fp-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--fp-ball, 32px); height: var(--fp-ball, 32px);
  border-radius: calc(var(--fp-ball, 32px) / 2);
  background: var(--accent); cursor: pointer;
  margin-top: calc((var(--fp-track, 6px) - var(--fp-ball, 32px)) / 2);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: transform .1s, box-shadow .1s;
}
.fp-slider::-webkit-slider-thumb:hover { transform: scale(1.1); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fp-slider::-moz-range-track { height: var(--fp-track, 6px); border-radius: calc(var(--fp-track, 6px) / 2); background: var(--bg-2, rgba(0,0,0,.12)); }
.fp-slider::-moz-range-thumb { width: var(--fp-ball, 32px); height: var(--fp-ball, 32px); border-radius: calc(var(--fp-ball, 32px) / 2); background: var(--accent); cursor: pointer; border: none; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
/* builder canvas preview */
.fb-slider-prev { display: flex; flex-direction: column; gap: 4px; }
.fb-slider-prev-num { font-size: 28px; font-weight: 700; color: var(--accent); text-align: center; line-height: 1; }
.fb-slider-prev-row { display: flex; align-items: center; gap: 6px; }
/* photo field — public form */
.fp-photo-wrap { display: flex; flex-direction: column; gap: 10px; }
.fp-photo-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-2); background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; border: none; }
.fp-photo-btn:hover { opacity: .88; }
.fp-photo-preview { display: flex; flex-direction: column; gap: 8px; }
.fp-photo-img { max-width: 100%; border-radius: var(--r-2); display: block; }
.fp-photo-retake { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-1); background: var(--surface); border: 1.5px solid var(--line); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-1); }
.fp-photo-retake:hover { border-color: var(--accent); color: var(--accent); }
/* builder preview for photo field */
.fb-photo-prev { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-2); background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; width: fit-content; }

/* ── Get Involved new block types ─────────────────────────── */
/* Hero: accent line + dual CTA */
.gi-hero-ctas { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:12px; }
.gi-hero--left .gi-hero-ctas { justify-content:flex-start; }
.gi-cta--ghost-white { background:transparent; border:2px solid rgba(255,255,255,.6); color:#fff; box-shadow:none; }
.gi-cta--ghost-white:hover { border-color:#fff; background:rgba(255,255,255,.12); }

/* Feature Strip */
.gi-fstrip { padding:28px 32px; }
.gi-fstrip--dark  { background:#111; color:#fff; }
.gi-fstrip--light { background:var(--surface,#f5f5f5); color:var(--text-1); }
.gi-fstrip-cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:20px; max-width:920px; margin:0 auto; }
.gi-fstrip-col  { display:flex; align-items:flex-start; gap:14px; }
.gi-fstrip-icon { font-size:26px; flex-shrink:0; margin-top:2px; }
.gi-fstrip-title { font-size:12.5px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; margin-bottom:5px; line-height:1.3; }
.gi-fstrip--dark  .gi-fstrip-desc { font-size:12px; color:rgba(255,255,255,.6); line-height:1.5; }
.gi-fstrip--light .gi-fstrip-desc { font-size:12px; color:var(--text-3); line-height:1.5; }

/* Content + Photos split */
.gi-csplit { padding:60px 32px; background:var(--bg); }
@media(max-width:640px){ .gi-csplit { padding:40px 20px; } }
.gi-csplit-inner { display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:center; max-width:920px; margin:0 auto; }
@media(max-width:680px){ .gi-csplit-inner { grid-template-columns:1fr; gap:32px; } }
.gi-csplit-inner--right .gi-csplit-text  { order:2; }
.gi-csplit-inner--right .gi-csplit-photos { order:1; }
.gi-csplit-eyebrow { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; color:var(--accent); border-bottom:2.5px solid var(--accent); display:inline-block; padding-bottom:5px; margin-bottom:14px; }
.gi-csplit-heading { font-size:34px; font-weight:800; line-height:1.15; margin:0 0 14px; color:var(--text-1); }
.gi-csplit-body { color:var(--text-2); line-height:1.65; margin-bottom:24px; font-size:14.5px; }
.gi-csplit-photos { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.gi-csplit-photos--single { grid-template-columns:1fr; }
.gi-csplit-photo-wrap { position:relative; overflow:hidden; border-radius:10px; }
.gi-csplit-photo-wrap img { width:100%; height:200px; object-fit:cover; display:block; }
.gi-csplit-photos--single .gi-csplit-photo-wrap img { height:300px; }
.gi-csplit-placeholder { background:var(--surface); border:1.5px dashed var(--line); border-radius:10px; height:200px; }
.gi-csplit-play { position:absolute; bottom:14px; left:50%; transform:translateX(-50%); background:var(--accent); color:#000; border-radius:30px; padding:10px 20px; font-weight:700; font-size:12.5px; display:inline-flex; align-items:center; gap:8px; white-space:nowrap; text-decoration:none; }
.gi-csplit-video .gi-csplit-photo-wrap img { height:260px; }

/* Next Steps CTA */
.gi-nscta { padding:60px 32px; color:#fff; }
@media(max-width:640px){ .gi-nscta { padding:40px 20px; } }
.gi-nscta-inner { display:grid; grid-template-columns:1fr 2fr; gap:48px; align-items:center; max-width:920px; margin:0 auto; }
@media(max-width:680px){ .gi-nscta-inner { grid-template-columns:1fr; gap:32px; } }
.gi-nscta-heading { font-size:30px; font-weight:800; line-height:1.2; margin:0 0 14px; }
.gi-nscta-body { color:rgba(255,255,255,.7); font-size:13.5px; line-height:1.6; }
.gi-nscta-steps { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media(max-width:680px){ .gi-nscta-steps { grid-template-columns:repeat(2,1fr); } }
.gi-nscta-step { text-align:center; }
.gi-nscta-step-icon { font-size:32px; display:block; margin-bottom:8px; }
.gi-nscta-step-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; }
.gi-nscta-step-desc  { font-size:11.5px; color:rgba(255,255,255,.6); margin-top:5px; line-height:1.4; }
.gi-nscta-btn-wrap { text-align:center; margin-top:36px; }

/* ── Service roster: Assign / Confirmations tabs + confirmation log ───────── */
.sd-roster-tabs { display:flex; gap:4px; padding:4px; margin:0 0 12px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; }
.sd-roster-tab { flex:1; border:none; background:transparent; color:var(--text-2); font:inherit; font-size:13px; font-weight:700; padding:7px 10px; border-radius:7px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px; transition:background .12s,color .12s; }
.sd-roster-tab:hover { color:var(--text); }
.sd-roster-tab.active { background:var(--surface); color:var(--text); box-shadow:0 1px 2px rgba(0,0,0,.18); }
.sd-roster-tab-count { min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--warn-soft,rgba(245,158,11,.16)); color:var(--warn,#f59e0b); font-size:11px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; }
.sd-roster-log-summary { font-size:12.5px; color:var(--text-2); margin:2px 2px 12px; }
.sd-roster-log-summary b { color:var(--text); }
.rlog-group { margin-bottom:14px; }
.rlog-group-h { font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.07em; color:var(--text-3); margin:0 2px 6px; }
.rlog-row { display:flex; align-items:center; gap:10px; padding:9px 10px; border:1px solid var(--line); border-radius:10px; margin-bottom:6px; background:var(--surface); }
.rlog-av { width:30px; height:30px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; color:#fff; }
.rlog-main { flex:1; min-width:0; }
.rlog-name { font-size:13.5px; font-weight:600; line-height:1.2; }
.rlog-pos  { font-size:11.5px; color:var(--text-2); margin-top:1px; }
.rlog-side { text-align:right; flex-shrink:0; }
.rlog-when { font-size:10.5px; color:var(--text-3); margin-top:3px; white-space:nowrap; }
.rlog-pill { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:800; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.rlog-pill::before { content:""; width:6px; height:6px; border-radius:50%; }
.rlog-pill.accepted { background:var(--pos-soft); color:var(--pos); }
.rlog-pill.accepted::before { background:var(--pos); }
.rlog-pill.declined { background:var(--neg-soft); color:var(--neg); }
.rlog-pill.declined::before { background:var(--neg); }
.rlog-pill.pending  { background:var(--warn-soft,rgba(245,158,11,.16)); color:var(--warn,#f59e0b); }
.rlog-pill.pending::before { background:var(--warn,#f59e0b); }
.rlog-empty { text-align:center; color:var(--text-2); font-size:13px; padding:28px 16px; line-height:1.5; }
.rlog-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 2px 12px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.rlog-actions .rlog-channel { font-size:12px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); margin-right:auto; }
.rlog-informed { font-size:10.5px; color:var(--text-3); margin-top:3px; white-space:nowrap; }
.rlog-informed.no { color:var(--warn,#f59e0b); }

/* ── Workflows admin (finite-state-machine engine) ───────────────── */
.wfa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wfa-card { padding: 16px; cursor: pointer; transition: border-color .12s, transform .12s; }
.wfa-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.wfa-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wfa-card-desc { margin: 8px 0 12px; font-size: 13px; min-height: 18px; }
.wfa-card-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-3); }
.wfa-chip { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.wfa-chip-published { background: var(--accent-soft); color: var(--accent); }
.wfa-chip-draft { background: var(--surface-2); color: var(--text-3); }

.wfa-ed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.wfa-ed-meta { padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.wfa-meta-row { display: flex; gap: 16px; flex-wrap: wrap; }
.wfa-meta-row .eb-field { flex: 1; min-width: 200px; }

.wfa-states { display: flex; flex-direction: column; gap: 12px; }
.wfa-state { padding: 14px; }
.wfa-state-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wfa-state-key { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text-3); background: var(--surface-2); padding: 2px 7px; border-radius: var(--r-1); }
.wfa-state-name { flex: 1; min-width: 120px; font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 6px 8px; color: var(--text); }
.wfa-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.wfa-mini { width: 26px; height: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-1); cursor: pointer; color: var(--text-3); }
.wfa-mini:hover { border-color: var(--accent); color: var(--accent); }
.wfa-mini.danger:hover { border-color: var(--neg); color: var(--neg); }

.wfa-sub { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.wfa-sub-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.wfa-empty { font-size: 12.5px; margin: 0 0 8px; }
.wfa-note { font-size: 12px; margin: 4px 0 0; }

.wfa-action { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px; margin-bottom: 8px; }
.wfa-action-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.wfa-action-top select { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); font-size: 13px; }
.wfa-action-cfg { display: flex; flex-direction: column; gap: 8px; }
.wfa-cfg { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-3); }
.wfa-cfg input, .wfa-cfg select { font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); }

/* ── Interactive workflow tasks (fields + services + outcome buttons) ── */
.ti-wrap { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ti-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ti-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.ti-f > span { font-weight: 600; }
.ti-f input, .ti-f select, .ti-f textarea {
  font-size: 13px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: var(--r-1); background: var(--surface); color: var(--text);
  font-family: inherit; width: 100%;
}
.ti-f input:focus, .ti-f select:focus, .ti-f textarea:focus { outline: none; border-color: var(--accent); }
.ti-f textarea { resize: vertical; line-height: 1.5; }
.ti-f input:disabled, .ti-f select:disabled, .ti-f textarea:disabled { opacity: .7; cursor: not-allowed; }
.ti-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ti-check input { width: auto; accent-color: var(--accent); }

.ti-svcs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ti-svc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ti-svc-res { font-size: 12px; font-weight: 600; }
.ti-svc-res.pos { color: var(--pos); }
.ti-svc-res.neg { color: var(--neg); }
.ti-svc-link { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.ti-svc-link:hover { text-decoration: underline; }

.ti-outcomes { display: flex; gap: 8px; flex-wrap: wrap; }
.ti-neg { color: var(--neg); border-color: var(--line); }
.ti-neg:hover { background: var(--neg-soft); border-color: var(--neg); }
.ti-chosen { font-size: 12px; color: var(--text-2); }

.wfa-assignee-results { position: relative; z-index: 5; margin-top: -4px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); max-height: 180px; overflow-y: auto; }
.wfa-assignee-opt { padding: 6px 10px; font-size: 13px; cursor: pointer; }
.wfa-assignee-opt:hover { background: var(--surface-2); }
.wfa-assignee-empty { padding: 8px 10px; font-size: 12px; }
.wfa-assignee-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.wfa-chip-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.wfa-chip-person .wfa-mini { width: 18px; height: 18px; border: none; }

/* ── Workflow editor tabs ─────────────────────────────────────── */
.wfa-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 var(--sp-4); }
.wfa-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-3);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 9px 14px; cursor: pointer; }
.wfa-tab:hover { color: var(--text); }
.wfa-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Progress Gantt ───────────────────────────────────────────── */
/* Grid columns are shared by the axis header and every row so the bars line up
   with the tick labels. --gname/--gtotal keep the three tracks in step. */
.wfa-gtop { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.wfa-gcounts { display: flex; gap: var(--sp-4); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.wfa-gcounts b { color: var(--text); font-size: 14px; }
.wfa-gscope { display: flex; gap: 2px; }
.wfa-gscope .btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.wfa-gflag { display: inline-block; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--neg); background: var(--neg-soft); border-radius: var(--r-pill);
  padding: 2px 8px; margin-left: 6px; }
.wfa-gdone { color: var(--pos); font-weight: 800; margin-left: 6px; }
.wfa-gdone.is-neg { color: var(--neg); }

.wfa-glegend { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.wfa-gl { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.wfa-gl i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

.wfa-gwrap { padding: 0; overflow-x: auto; --gname: 190px; --gtotal: 70px; }
.wfa-gaxis, .wfa-grow { display: grid; grid-template-columns: var(--gname) minmax(420px, 1fr) var(--gtotal);
  align-items: stretch; min-width: 680px; }
.wfa-gaxis { position: sticky; top: 0; z-index: 2; background: var(--surface);
  border-bottom: 1px solid var(--line); height: 30px; }
.wfa-gaxis .wfa-gtrack { position: relative; }
.wfa-gtick { position: absolute; top: 8px; font-size: 10.5px; color: var(--text-3); white-space: nowrap;
  transform: translateX(-50%); }
.wfa-gaxis .wfa-gtotal { display: flex; align-items: center; justify-content: flex-end; padding-right: 12px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }

.wfa-grow { border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--dur-1) var(--ease); }
.wfa-grow:last-child { border-bottom: 0; }
.wfa-grow:hover { background: var(--surface-2); }
.wfa-grow.is-late { box-shadow: inset 3px 0 0 var(--neg); }

.wfa-gname { padding: 9px 12px; min-width: 0; border-right: 1px solid var(--line); }
.wfa-gperson { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfa-gsub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

.wfa-gtrack { position: relative; min-height: 42px; }
/* Faint vertical grid so bars can be read against the axis. */
.wfa-grow .wfa-gtrack { background-image: repeating-linear-gradient(to right,
  var(--line) 0 1px, transparent 1px calc(100% / 6)); background-size: calc(100% / 6) 100%; }
.wfa-gbar { position: absolute; top: 11px; height: 20px; border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; padding: 0 6px; min-width: 3px; opacity: .92; }
.wfa-gbar:hover { opacity: 1; outline: 2px solid var(--text); outline-offset: -1px; }
.wfa-gbar span { font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
/* The step someone is sitting in right now — hatched so it reads as ongoing. */
.wfa-gbar.is-current { background-image: repeating-linear-gradient(45deg,
  rgba(255, 255, 255, .22) 0 6px, transparent 6px 12px); border-right: 2px solid var(--text); }
.wfa-gnow { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); z-index: 1; }
.wfa-gnow::after { content: 'now'; position: absolute; top: 1px; left: 3px; font-size: 9px;
  font-weight: 800; color: var(--accent); }
.wfa-gtrunc { position: absolute; left: 2px; top: 14px; font-size: 13px; color: var(--text-3); cursor: help; }
.wfa-gtotal { display: flex; align-items: center; justify-content: flex-end; padding-right: 12px;
  font-size: 11.5px; font-weight: 700; color: var(--text-2); }

@media (max-width: 720px) {
  .wfa-gwrap { --gname: 130px; --gtotal: 56px; }
}

.wfa-transition { border: 1px solid var(--line); border-radius: var(--r-2); padding: 8px 10px; margin-bottom: 8px; }
.wfa-tr-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wfa-tr-arrow { color: var(--accent); font-weight: 700; }
.wfa-tr-line select, .wfa-tr-line input { font-size: 12.5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); }
.wfa-tr-label { flex: 1; min-width: 100px; }
.wfa-tr-cond { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; font-size: 12px; }
.wfa-tr-cond input, .wfa-tr-cond select { font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); }

.wfa-instances { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.wfa-inst-list { display: flex; flex-direction: column; gap: 6px; }
.wfa-inst { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); font-size: 13px; }
.wfa-inst > span:first-child { font-weight: 600; min-width: 140px; }
.wfa-inst .muted { flex: 1; }

/* ── Communications module ───────────────────────────────────────── */
.cx-rows { display: flex; flex-direction: column; gap: 8px; }
.cx-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); cursor: pointer; transition: border-color .12s; }
.cx-row:hover { border-color: var(--accent); }
.cx-row-main { flex: 1; min-width: 0; }
.cx-row-title { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.cx-row-sub { font-size: 12.5px; margin-top: 3px; }
.cx-row-stats { font-size: 12.5px; white-space: nowrap; }
.cx-row-actions { display: flex; gap: 6px; }
.cx-ch { font-size: 13px; }

.cx-bar { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.cx-name { flex: 1; min-width: 160px; font-size: 16px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); padding: 8px 10px; color: var(--text); }
.cx-channel { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); }
.cx-save-status { font-size: 12px; }

.cx-shell { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.cx-rail { display: flex; flex-direction: column; gap: 16px; }
.cx-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px; }
.cx-sec-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin: 0 0 12px; }
.cx-preview { position: sticky; top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.cx-preview-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cx-preview-subject { font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cx-preview-frame { width: 100%; height: 460px; border: 0; background: var(--surface-2); }
.cx-preview-empty { padding: 48px 24px; text-align: center; color: var(--text-3); font-size: 13.5px; line-height: 1.7; background: var(--surface-2); }
.cx-preview-empty span { font-size: 12px; opacity: .7; }
.cx-phone { padding: 24px; display: flex; justify-content: center; }
.cx-bubble { background: var(--accent-soft); color: var(--text); border-radius: 16px; padding: 12px 16px; max-width: 260px; font-size: 14px; line-height: 1.45; }
/* Channel label shown in the preview when Email + SMS are both active. */
.cx-preview-chan { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px 4px; }
.cx-preview-chan-sms { border-top: 1px solid var(--line); margin-top: 6px; }
.cx-preview-chan-wa { color: #25d366; }
/* WhatsApp message bubble (green, distinct from the SMS accent bubble). */
.cx-bubble-wa { background: #25d366; color: #04310f; }
/* WhatsApp composer blocks */
.cx-msg-wa .cx-wa-note { font-size: 12.5px; line-height: 1.5; margin: 10px 0; }
.cx-wa-vars { margin-top: 12px; }
.cx-wa-vars-h { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; flex-wrap: wrap; }
.cx-wa-var { margin-bottom: 8px; }

/* Push (app) channel */
.cx-preview-chan-push { color: #6366f1; }
.cx-msg-push .cx-push-note { font-size: 12.5px; line-height: 1.5; margin: 10px 0; }
.cx-push-preview { padding: 24px 18px; display: flex; justify-content: center; }
.cx-push-card { width: 100%; max-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.cx-push-app { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.cx-push-icon { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 5px; background: var(--accent); color: #111; font-size: 12px; }
.cx-push-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.cx-push-body { font-size: 13px; line-height: 1.45; color: var(--text-2); }

/* Send-review modal (last checkpoint before a real send) */
.cxsend-body-wrap { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); max-height: 62vh; overflow-y: auto; }
.cxsend-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cxsend-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 12.5px; font-weight: 600; }
.cxsend-sched { font-size: 13px; color: var(--text-2); }
.cxsend-count { font-size: 15px; color: var(--text); }
.cxsend-msg { border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; background: var(--surface-2); }
.cxsend-msg-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.cxsend-subj { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.cxsend-body { font-size: 13.5px; line-height: 1.5; color: var(--text-2); word-break: break-word; }
.cxsend-recips-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.cxsend-who-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.cxsend-who { display: inline-flex; padding: 4px 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.cxsend-more { color: var(--text-3); }
.cxsend-warns { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.cxsend-warns li { font-size: 12.5px; color: var(--warn, #d98a1a); line-height: 1.45; }
.cxsend-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); }
/* "Use the same message for email & SMS" mirror toggle. */
.cx-mirror { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; cursor: pointer; }
.cx-mirror input { accent-color: var(--accent); }
.cx-mirror-note { font-size: 12px; margin-top: 6px; opacity: .8; }

/* Message groups (saved recipient lists) */
.cx-gdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 2px; }
.cxg-row { display: flex; gap: 12px; }
.cxg-results { border: 1px solid var(--line); border-radius: var(--r-2); margin-top: 6px; max-height: 220px; overflow-y: auto; background: var(--surface); }
.cxg-result { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: 13.5px; }
.cxg-result:last-child { border-bottom: 0; }
.cxg-result:hover { background: var(--surface-2); }
.cxg-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cxg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--accent-soft); color: var(--text); border-radius: 14px; font-size: 12.5px; }
.cxg-chip button { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cxg-chip button:hover { color: var(--bad, #e5484d); }

.cx-actionbar { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); position: sticky; bottom: 12px; flex-wrap: wrap; }
.cx-counts { font-weight: 600; font-variant-numeric: tabular-nums; }
.cx-sched-summary { font-size: 13px; }

.cx-aud-block { margin-bottom: 12px; }
.cx-aud-lbl { font-size: 12px; font-weight: 700; color: var(--text-3); display: block; margin-bottom: 6px; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; }
.cx-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
.cx-chip button { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; }
.cx-empty { font-size: 12.5px; }
.cx-src-add { display: flex; gap: 6px; flex-wrap: wrap; }
.cx-src-add select { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); font-size: 13px; }
.cx-aud-live { margin-top: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cx-aud-sample { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cx-samp { font-size: 11.5px; color: var(--text-3); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.cx-opt { color: var(--neg); }

.cx-msg-tabs { margin-bottom: 12px; display: inline-flex; }
.cx-row2 { display: flex; gap: 12px; }
.cx-row2 .eb-field { flex: 1; }
.cx-tokens { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cx-token { font-family: var(--font-mono, monospace); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; cursor: pointer; color: var(--text-2); }
.cx-token:hover { border-color: var(--accent); color: var(--accent); }
.cx-rt-toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
.cx-rt-toolbar button { width: 30px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-1); cursor: pointer; color: var(--text-2); font-size: 12px; }
.cx-rt { min-height: 200px; border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px; background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.6; outline: none; }
.cx-rt:focus { border-color: var(--accent); }
.cx-sms-meta { font-size: 12px; margin-top: 8px; }
.cx-warn { color: var(--warn, #b45309); }

.cx-sched-modes { margin-bottom: 12px; display: inline-flex; }
.cx-dow { display: flex; gap: 5px; margin-bottom: 10px; }
.cx-dow-b { width: 34px; height: 32px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-1); cursor: pointer; color: var(--text-2); font-size: 12px; }
.cx-dow-b.active { background: var(--accent); color: #111; border-color: var(--accent); }

.cx-tiles { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.cx-tile { flex: 1; min-width: 110px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 14px 16px; }
.cx-tile-v { font-size: 26px; font-weight: 700; }
.cx-tile-l { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

.cx-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cx-pal { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-1); cursor: pointer; font-size: 12.5px; color: var(--text); }
.cx-pal:hover { border-color: var(--accent); }
.cx-pal span { font-weight: 700; }
.cx-canvas { display: flex; flex-direction: column; gap: 8px; }
.cx-canvas-empty { padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-2); }
.cx-blk { position: relative; border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px; background: var(--surface); }
.cx-blk-type { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 6px; }
.cx-blk-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 3px; }
.cx-blk-tools button { width: 22px; height: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; cursor: pointer; color: var(--text-3); font-size: 11px; }
.cx-blk-tools .danger:hover { color: var(--neg); border-color: var(--neg); }
.cx-blk-input { width: 100%; margin-top: 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-family: inherit; }

@media (max-width: 900px) { .cx-shell { grid-template-columns: 1fr; } .cx-preview { position: static; } }
