:root {
  --navy: #061b33;
  --navy-2: #0b2a4a;
  --blue: #0f4aa3;
  --gold: #c49136;
  --ink: #0d1b2e;
  --muted: #64748b;
  --line: #e5e7eb;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f9fc;
}
.serif { font-family: Georgia, 'Times New Roman', serif; }

/* ── SHELL ─────────────────────────────────────────────────── */
.builder-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.app-sidebar {
  background: linear-gradient(180deg, #061b33 0%, #07162a 100%);
  color: #dbeafe;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  z-index: 40;
  pointer-events: auto;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: calc(100% - 1.2rem);
  padding: .65rem .9rem;
  margin: .1rem .6rem;
  border-radius: .55rem;
  border: none;
  background: transparent;
  color: #c3d6f0;
  font-size: .87rem;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .13s, color .13s;
  position: relative;
  z-index: 2;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active { background: #153b66; color: #fff; }
.sidebar-child { padding-left: 2.4rem; font-size: .84rem; color: #a8bfd6; }
.sidebar-child.active { background: rgba(255,255,255,.06); color: #e0eeff; }
#website-children.collapsed { display: none; }
.sidebar-chevron { transition: transform .15s ease; }
.sidebar-chevron.rotated { transform: rotate(180deg); }

/* ── ADMIN VIEWS ───────────────────────────────────────────── */
.admin-view {
  min-height: calc(100vh - 76px);
  padding: 2rem 2.5rem;
  background: #f7f9fc;
  overflow-y: auto;
}
.admin-view-inner { max-width: 1100px; margin: 0 auto; }
.admin-view-narrow { max-width: 640px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.admin-stat-value { font-size: 1.5rem; font-weight: 900; color: #0f3c85; }
.admin-stat-label { font-size: .78rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(15,23,42,.04);
}
.admin-card-title { font-size: 1.15rem; font-weight: 900; color: #0d1b2e; margin: 0 0 .5rem; }
.admin-card-text { font-size: .9rem; color: #64748b; margin: 0 0 1rem; line-height: 1.5; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.admin-quick-link {
  text-align: left;
  padding: 1rem 1.1rem;
  border: 1px solid #e8edf4;
  border-radius: .8rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.admin-quick-link:hover { border-color: #9db4d4; background: #eef4ff; }
.admin-quick-link strong { display: block; font-size: .9rem; color: #0d1b2e; margin-bottom: .2rem; }
.admin-quick-link span { font-size: .78rem; color: #64748b; }
.admin-page-list { display: flex; flex-direction: column; gap: .4rem; }
.admin-page-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border: 1px solid #e8edf4;
  border-radius: .7rem;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: #334155;
  transition: background .12s, border-color .12s;
}
.admin-page-row:hover { background: #f8fafc; border-color: #c3d0e0; }
.admin-badge {
  font-size: .7rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.admin-badge.live { background: #dcfce7; color: #166534; }
.admin-badge.draft { background: #f1f5f9; color: #64748b; }
.admin-form { display: flex; flex-direction: column; gap: 1rem; }
.admin-field .input { width: 100%; }
.admin-tips { margin: 0; padding-left: 1.2rem; color: #64748b; font-size: .9rem; line-height: 1.7; }
.admin-inline-link {
  background: none;
  border: none;
  padding: 0;
  color: #0f4aa3;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.admin-inline-link:hover { color: #0b2a4a; }
.sidebar-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #a8c8f0;
}
.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon { color: #e8f2ff; }
.sidebar-icon svg,
.toolbar-btn svg,
.tab svg,
.panel-list-icon svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}
.toolbar-btn.icon-only {
  width: 38px;
  min-width: 38px;
  padding: 0;
  justify-content: center;
}
.page-list-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}
.page-list-row.active .page-list-icon { color: #0f4aa3; }

/* ── TOPBAR ────────────────────────────────────────────────── */
.topbar {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 30;
}
.device-toggle {
  border: 1px solid #cbd5e1;
  border-radius: .55rem;
  overflow: hidden;
  background: #fff;
}
.device-toggle button {
  height: 38px;
  padding: 0 .8rem;
  font-weight: 700;
  font-size: .82rem;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .45rem;
  transition: background .12s, color .12s;
}
.device-toggle button:hover { background: #f1f5f9; color: #16315a; }
.device-toggle button.active { background: #eef4ff; color: #16315a; }
.toolbar-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  height: 38px;
  padding: 0 .85rem;
  border-radius: .55rem;
  font-weight: 700;
  font-size: .84rem;
  color: #16315a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .45rem;
  transition: background .12s, border-color .12s;
}
.toolbar-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.toolbar-btn.primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.toolbar-btn.primary:hover { background: #b07e2a; border-color: #b07e2a; }
.toolbar-btn.blue { background: #fff; color: #0f3c85; border-color: #0f3c85; }
.toolbar-btn.blue:hover { background: #eef4ff; }
.toolbar-btn.danger { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.toolbar-btn.danger:hover { background: #fef2f2; border-color: #f87171; }
.admin-card-danger { border-color: #fecaca; background: #fffbfb; margin-top: 1rem; }
.admin-card-danger .admin-card-title { color: #b91c1c; }
.logo-upload-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.logo-upload-preview {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: .75rem;
  background: #f8fafc;
  padding: .5rem;
}
.logo-upload-preview-dark {
  background: #061b33;
  border-color: #1e3a5f;
}
.app-sidebar img#sidebar-admin-logo:hover { opacity: .85; }
.logo-upload-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.logo-upload-actions .hidden { display: none; }
.logo-upload-actions label.cursor-pointer { cursor: pointer; }

/* ── BUILDER GRID ──────────────────────────────────────────── */
.builder-grid {
  display: grid;
  grid-template-columns: 290px minmax(580px, 1fr) 300px;
  min-height: calc(100vh - 76px);
}
.panel {
  background: #fff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.panel-right {
  border-left: 1px solid var(--line);
  border-right: 0;
  overflow-y: auto;
}

/* ── PANEL TABS ────────────────────────────────────────────── */
.tab {
  padding: .85rem .35rem .7rem;
  font-size: .78rem;
  color: #94a3b8;
  border-bottom: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}
.tab:hover { color: #475569; }
.tab.active { color: #0f4aa3; border-bottom-color: #0f4aa3; }
.panel-tab-content { }
.panel-section-label {
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: #94a3b8;
  margin-bottom: .6rem;
}
.hidden { display: none !important; }

/* ── BLOCK CARDS ───────────────────────────────────────────── */
.block-card {
  user-select: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 18px 44px 1fr;
  gap: .6rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid #e8edf4;
  border-radius: .8rem;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.04);
  transition: border-color .12s, box-shadow .12s, transform .1s;
}
.block-card:hover {
  border-color: #9db4d4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15,23,42,.08);
}
.block-card.dragging { opacity: .5; }
.drag-handle { color: #c1cdd8; display: flex; align-items: center; justify-content: center; cursor: grab; }
.block-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: .7rem;
  background: #eef4ff;
  color: #0f4aa3;
}

/* ── SECTIONS LIST ─────────────────────────────────────────── */
.section-list-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .75rem;
  border: 1px solid #e8edf4;
  border-radius: .7rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.section-list-item:hover { background: #f8fafc; border-color: #c3d0e0; }
.section-list-item.active { background: #eef4ff; border-color: #9ab5d8; }
.section-list-drag { color: #c1cdd8; display: flex; align-items: center; }
.section-list-btn {
  width: 26px;
  height: 26px;
  border-radius: .4rem;
  border: 1px solid #e8edf4;
  background: #fff;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.section-list-btn:hover { background: #f1f5f9; color: #0f4aa3; border-color: #9db4d4; }
.section-list-btn.danger:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }

/* ── CANVAS ────────────────────────────────────────────────── */
.canvas-wrap {
  padding: 2rem 1.5rem;
  overflow: auto;
  background: radial-gradient(circle at 50% 0%, #ffffff 0, #f3f6fb 48%, #eaeff7 100%);
}
.preview-shell {
  margin: 0 auto;
  transition: width .22s ease;
}
.preview-shell.desktop { width: 760px; }
.preview-shell.tablet  { width: 640px; }
.preview-shell.mobile  { width: 390px; }
.preview-shell.layout-full.desktop,
.preview-shell.layout-full.tablet,
.preview-shell.layout-full.mobile { width: 100%; max-width: none; }
.preview-shell.layout-full .website-canvas { border-radius: 0; }
.preview-shell.drop-highlight { outline: 3px dashed #0f4aa3; border-radius: 1rem; outline-offset: 4px; }
.canvas-wrap.canvas-full { padding-left: 0; padding-right: 0; }
.canvas-wrap.canvas-full .preview-shell.layout-full .website-canvas { border-left: 0; border-right: 0; border-radius: 0; }
.website-canvas {
  background: #fff;
  border: 1px solid #d0daea;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15,23,42,.1), 0 4px 12px rgba(15,23,42,.06);
  overflow: hidden;
}
.site-shell-boxed {
  max-width: 80rem;
  margin: 2rem auto;
  box-shadow: 0 20px 50px rgba(15,23,42,.1), 0 4px 12px rgba(15,23,42,.06);
}
.site-shell-full {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.layout-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.layout-toggle-btn {
  border: 1px solid #dde4ef;
  background: #fff;
  color: #475569;
  font-size: .82rem;
  font-weight: 800;
  border-radius: .65rem;
  padding: .65rem .75rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.layout-toggle-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.layout-toggle-btn.active {
  background: #eef4ff;
  border-color: #0f4aa3;
  color: #0f4aa3;
}

/* ── SECTION WRAPPERS ──────────────────────────────────────── */
.site-section { position: relative; border: 2px solid transparent; transition: border-color .15s; }
.site-section:hover { border-color: rgba(15,92,255,.15); }
.site-section.selected { border-color: #0f5cff; box-shadow: 0 0 0 3px rgba(15,92,255,.08) inset; }
.site-section.selected::before {
  content: attr(data-label);
  position: absolute;
  z-index: 10;
  top: -25px;
  left: 8px;
  background: #0f5cff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px 4px 4px 0;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
  pointer-events: none;
}

/* ── SECTION TOOLBAR ───────────────────────────────────────── */
.section-toolbar {
  display: none;
  position: absolute;
  z-index: 20;
  top: -33px;
  right: 8px;
  background: #0f4aa3;
  border-radius: .45rem;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15,74,163,.3);
}
.site-section.selected .section-toolbar { display: flex; }
.section-toolbar button {
  width: 32px;
  height: 30px;
  color: rgba(255,255,255,.85);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .1s, color .1s;
}
.section-toolbar button:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ── RESIZE HANDLES ────────────────────────────────────────── */
.handle {
  display: none;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #0f5cff;
  position: absolute;
  z-index: 16;
  box-shadow: 0 0 0 2px white;
}
.site-section.selected .handle { display: block; }
.handle.t { top: -5px; left: 50%; transform: translateX(-50%); }
.handle.b { bottom: -5px; left: 50%; transform: translateX(-50%); }
.handle.l { left: -5px; top: 50%; transform: translateY(-50%); }
.handle.r { right: -5px; top: 50%; transform: translateY(-50%); }

/* ── INSPECTOR ─────────────────────────────────────────────── */
.inspector-header { border-bottom: 1px solid var(--line); }
.inspector-label { font-size: .76rem; font-weight: 800; color: #475569; margin-bottom: .4rem; }
.toolbar-action {
  width: 32px;
  height: 32px;
  border-radius: .45rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.toolbar-action:hover { background: #f1f5f9; color: #0f4aa3; border-color: #9db4d4; }
.toolbar-action.danger:hover { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }
.input, .select {
  width: 100%;
  border: 1px solid #dde4ef;
  border-radius: .5rem;
  padding: .6rem .75rem;
  font-size: .85rem;
  background: #fff;
  color: #12203a;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus {
  outline: none;
  border-color: #0f4aa3;
  box-shadow: 0 0 0 3px rgba(15,74,163,.1);
}
.accordion { border-top: 1px solid #edf1f6; padding-top: 1rem; margin-top: 1rem; }
.toggle {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
  transition: background .15s;
}
.toggle.on { background: #0f4aa3; }
.toggle::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: left .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after { left: 21px; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: #061b33;
  color: #fff;
  padding: .85rem 1.1rem;
  border-radius: .8rem;
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  font-size: .88rem;
  font-weight: 600;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── APP DIALOG ─────────────────────────────────────────────── */
.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.app-dialog.show {
  opacity: 1;
  pointer-events: auto;
}
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 27, 51, .58);
  backdrop-filter: blur(6px);
}
.app-dialog-card {
  position: relative;
  width: min(440px, 92vw);
  background: #fff;
  border-radius: 1.25rem;
  padding: 2rem 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .3);
  transform: scale(.9) translateY(16px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.34, 1.4, .64, 1), opacity .22s ease;
}
.app-dialog.show .app-dialog-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.app-dialog-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  animation: dialogIconPop .45s cubic-bezier(.34, 1.4, .64, 1) .08s both;
}
.app-dialog-icon.info { background: #eef4ff; color: #0f4aa3; }
.app-dialog-icon.success { background: #ecfdf5; color: #059669; }
.app-dialog-icon.danger { background: #fef2f2; color: #dc2626; }
.app-dialog-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 .55rem;
  line-height: 1.35;
}
.app-dialog-message {
  font-size: .9rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0 0 1.5rem;
  white-space: pre-line;
}
.app-dialog-actions {
  display: flex;
  gap: .65rem;
  justify-content: center;
  flex-wrap: wrap;
}
.app-dialog-btn {
  border: 1px solid #dde4ef;
  background: #fff;
  color: #475569;
  font-size: .88rem;
  font-weight: 800;
  border-radius: .65rem;
  padding: .7rem 1.2rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, transform .12s;
  min-width: 120px;
}
.app-dialog-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.app-dialog-btn:active { transform: scale(.97); }
.app-dialog-btn.primary {
  background: #0f4aa3;
  border-color: #0f4aa3;
  color: #fff;
}
.app-dialog-btn.primary:hover { background: #0c3d88; border-color: #0c3d88; }
.app-dialog-btn.success {
  background: #059669;
  border-color: #059669;
  color: #fff;
}
.app-dialog-btn.success:hover { background: #047857; border-color: #047857; }
.app-dialog-btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.app-dialog-btn.danger:hover { background: #b91c1c; border-color: #b91c1c; }
@keyframes dialogIconPop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3,10,20,.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
}
.modal.show { display: flex; }
.modal-card {
  width: min(1100px, 95vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}

/* ── SITE COMPONENTS (rendered inside canvas) ───────────────── */
.site-logo-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: .2rem;
  border-radius: .55rem;
  cursor: pointer;
  transition: box-shadow .15s, background .15s;
}
.site-logo-picker:hover {
  background: #f1f5f9;
  box-shadow: 0 0 0 2px rgba(15, 74, 163, .25);
}
.site-logo-picker:focus-visible {
  outline: 2px solid #0f4aa3;
  outline-offset: 2px;
}
.site-logo-picker-overlay {
  position: absolute;
  inset: 0;
  border-radius: .45rem;
  background: rgba(6, 27, 51, .72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .2rem;
  text-align: center;
  line-height: 1.2;
}
.site-logo-picker:hover .site-logo-picker-overlay { opacity: 1; }
.site-nav a { color: #27364b; text-decoration: none; font-weight: 700; font-size: .82rem; }
.site-btn-gold {
  background: var(--gold);
  color: #fff;
  border: 0;
  border-radius: .45rem;
  padding: .7rem 1.1rem;
  font-weight: 800;
  font-size: .87rem;
  cursor: pointer;
  transition: background .13s;
}
.site-btn-gold:hover { background: #b07e2a; }
.site-btn-blue {
  background: #0b2a65;
  color: #fff;
  border: 0;
  border-radius: .45rem;
  padding: .7rem 1.1rem;
  font-weight: 800;
  font-size: .87rem;
  cursor: pointer;
  transition: background .13s;
}
.site-btn-blue:hover { background: #0d3478; }
.site-btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.7);
  border-radius: .45rem;
  padding: .68rem 1rem;
  font-weight: 800;
  font-size: .87rem;
  cursor: pointer;
  transition: background .13s;
}
.site-btn-outline:hover { background: rgba(255,255,255,.12); }
.hero-bg { background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: #000; pointer-events: none; }
.site-btn-ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: .45rem;
  padding: .65rem 1rem;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.site-btn-ghost:hover { background: rgba(255,255,255,.25); }

/* ── MODULE PANEL ───────────────────────────────────────────── */
.module-card {
  padding: .85rem 1rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color .13s, box-shadow .13s;
}
.module-card.enabled { border-color: #bfdbfe; }
.module-card.disabled { background: #f8fafc; border-color: #e2e8f0; }
.module-card.active-page { box-shadow: 0 0 0 2px #93c5fd; }
.module-card:hover { border-color: #93c5fd; }

/* ── NEW BLOCK TYPES ────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--line);
  border-radius: .75rem;
  overflow: hidden;
  background: #fff;
}
.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--gold); font-weight: 900; }
details[open] .faq-question::after { content: '−'; }
.faq-answer {
  padding: 0 1.25rem 1rem;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.team-card {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #fff;
}
.team-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #fef3c7);
  color: var(--navy);
  font-weight: 900;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  margin: 0 auto .75rem;
}
.group-card, .volunteer-card, .blog-card {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  transition: box-shadow .13s;
}
.group-card:hover, .volunteer-card:hover, .blog-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.giving-box {
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #f8fafc;
}
.blog-tag {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gold);
  background: #fef9ee;
  padding: .2rem .5rem;
  border-radius: .25rem;
}
.livestream-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: #fca5a5;
  background: rgba(239,68,68,.15);
  padding: .3rem .75rem;
  border-radius: 999px;
}
.map-placeholder { background: linear-gradient(135deg, #e2e8f0, #f1f5f9); }

/* ── SERMON / PODCAST PLAYER ─────────────────────────────────── */
.sr-empty { padding: 2.5rem; text-align: center; color: #94a3b8; font-weight: 600; border: 2px dashed #e2e8f0; border-radius: 1rem; }
.sr-featured { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 1.25rem; padding: 1.25rem; cursor: pointer; transition: box-shadow .15s; }
.sr-featured:hover { box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.sr-featured-art { width: 200px; height: 200px; object-fit: cover; border-radius: 1rem; }
.sr-featured-title { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin-top: .35rem; }
.sr-featured-meta { font-size: .85rem; color: #64748b; font-weight: 600; margin-top: .25rem; }
.sr-featured-excerpt { font-size: .9rem; color: #475569; margin-top: .75rem; line-height: 1.5; }
.sr-episode-list { display: flex; flex-direction: column; gap: .65rem; }
.sr-episode { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem 1.1rem; background: #fff; border: 1px solid #e8edf4; border-radius: 1rem; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.sr-episode:hover { border-color: #0f4aa3; box-shadow: 0 6px 20px rgba(15,74,163,.08); }
.sr-episode.sr-playing { border-color: #0f4aa3; background: #f8fbff; }
.sr-episode-art { width: 72px; height: 72px; object-fit: cover; border-radius: .65rem; }
.sr-episode-date { font-size: .72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.sr-episode-title { font-size: 1rem; font-weight: 800; color: #0f172a; margin-top: .15rem; }
.sr-episode-meta { font-size: .78rem; color: #64748b; font-weight: 600; margin-top: .15rem; }
.sr-episode-excerpt { font-size: .8rem; color: #94a3b8; margin-top: .35rem; line-height: 1.4; }
.sr-episode-duration { font-size: .78rem; font-weight: 700; color: #64748b; font-variant-numeric: tabular-nums; }
.sr-episode-play { width: 40px; height: 40px; border-radius: 999px; border: 0; background: #0f4aa3; color: #fff; display: grid; place-items: center; cursor: pointer; }
.sr-player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; transform: translateY(100%); transition: transform .32s cubic-bezier(.34,1.2,.64,1); }
.sr-player.sr-active { transform: translateY(0); }
body.sr-player-open { padding-bottom: 88px; }
.sr-player-bar { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.25rem; background: linear-gradient(180deg, #0a1f3d 0%, #061b33 100%); border-top: 1px solid rgba(255,255,255,.08); box-shadow: 0 -8px 30px rgba(0,0,0,.25); color: #fff; flex-wrap: wrap; }
.sr-pl-art { width: 48px; height: 48px; border-radius: .5rem; object-fit: cover; flex-shrink: 0; }
.sr-pl-meta { min-width: 120px; max-width: 220px; flex: 1; }
.sr-pl-title { display: block; font-size: .88rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-pl-sub { display: block; font-size: .72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-pl-controls { display: flex; align-items: center; gap: .35rem; }
.sr-btn { border: 0; background: rgba(255,255,255,.08); color: #fff; border-radius: .45rem; padding: .4rem .55rem; font-size: .72rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .12s; }
.sr-btn:hover { background: rgba(255,255,255,.16); }
.sr-pl-play { width: 42px; height: 42px; border-radius: 999px; background: var(--gold); color: #fff; padding: 0; }
.sr-pl-progress-wrap { display: flex; align-items: center; gap: .5rem; flex: 2; min-width: 180px; }
.sr-pl-progress { flex: 1; accent-color: var(--gold); height: 4px; }
.sr-pl-time-current, .sr-pl-time-total { font-size: .7rem; font-weight: 700; color: #94a3b8; font-variant-numeric: tabular-nums; min-width: 2.5rem; }
.sr-pl-speed { min-width: 2.5rem; }
.sr-pl-volume { width: 72px; accent-color: var(--gold); }
.sr-pl-drawer { position: absolute; bottom: 100%; left: 0; right: 0; max-height: 320px; overflow: auto; background: #0a1f3d; border-top: 1px solid rgba(255,255,255,.1); padding: 1rem 1.25rem; }
.sr-pl-drawer.hidden { display: none; }
.sr-pl-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.sr-pl-item { display: flex; align-items: center; gap: .75rem; width: 100%; border: 0; background: transparent; color: #fff; text-align: left; padding: .55rem .5rem; border-radius: .5rem; cursor: pointer; }
.sr-pl-item:hover, .sr-pl-item.active { background: rgba(255,255,255,.08); }
.sr-pl-item img { width: 40px; height: 40px; border-radius: .35rem; object-fit: cover; }
.sr-pl-item strong { display: block; font-size: .85rem; }
.sr-pl-item small { color: #94a3b8; font-size: .72rem; }
.sr-pl-item em { margin-left: auto; font-size: .72rem; color: #94a3b8; font-style: normal; }
.sermon-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-field-full { grid-column: 1 / -1; }
.sermon-upload-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.sermon-upload-row .input { flex: 1; min-width: 200px; }
.sermon-table-wrap { overflow-x: auto; }
.sermon-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sermon-table th, .sermon-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid #edf1f6; }
.sermon-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 800; }
.sermon-row-actions { white-space: nowrap; }
@media (max-width: 768px) {
  .sr-featured { grid-template-columns: 1fr; }
  .sr-featured-art { width: 100%; height: 180px; }
  .sr-episode { grid-template-columns: 56px 1fr auto; }
  .sr-episode-excerpt { display: none; }
  .sr-pl-meta { display: none; }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .builder-grid { grid-template-columns: 270px minmax(480px,1fr); }
  .panel-right { display: none; }
}
@media (max-width: 960px) {
  .builder-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .builder-grid { grid-template-columns: 1fr; }
  .panel { display: none; }
  .topbar { padding: 1rem; height: auto; flex-direction: column; gap: .75rem; align-items: flex-start; }
  .canvas-wrap { padding: 1rem; }
  .preview-shell.desktop, .preview-shell.tablet, .preview-shell.mobile { width: 100%; }
}

/* ── AI STUDIO ──────────────────────────────────────────────── */
.ai-balance-badge {
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(135deg, #0b2a4a, #1e40af);
  color: #fff; padding: .75rem 1.25rem; border-radius: 1rem; min-width: 110px;
}
.ai-balance-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; font-weight: 700; }
.ai-balance-value { font-size: 1.75rem; font-weight: 900; line-height: 1.1; }
.ai-balance-unit { font-size: .7rem; opacity: .8; font-weight: 600; }
.ai-packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.ai-pack-card {
  border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1.25rem;
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.ai-pack-card:hover { border-color: #93c5fd; box-shadow: 0 4px 20px rgba(30,64,175,.08); }
.ai-gen-form { max-width: 720px; }
.ai-gen-result { margin-top: 1rem; padding: 1rem; border-radius: 1rem; background: #f0fdf4; border: 1px solid #bbf7d0; }
.ai-gen-result.hidden { display: none; }
.ai-gen-preview { max-width: 100%; border-radius: .75rem; border: 1px solid #e2e8f0; }
.ai-ref-grid { display: flex; flex-wrap: wrap; gap: .75rem; min-height: 80px; }
.ai-ref-empty {
  flex: 1; min-width: 200px; padding: 1.25rem; border: 2px dashed #e2e8f0; border-radius: .75rem;
  text-align: center; color: #94a3b8; font-size: .85rem; font-weight: 600;
}
.ai-ref-thumb {
  position: relative; width: 88px; height: 88px; border-radius: .75rem; overflow: hidden;
  border: 2px solid #e2e8f0; background: #f8fafc;
}
.ai-ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-ref-remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 999px;
  background: rgba(15,23,42,.75); color: #fff; font-size: 14px; font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.ai-ref-remove:hover { background: #dc2626; }

/* ── MEDIA MANAGER ──────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.media-grid-compact { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
.media-empty-state {
  padding: 2.5rem 1rem; text-align: center; border: 2px dashed #e2e8f0;
  border-radius: 1rem; color: #94a3b8;
}
.media-card {
  border: 1px solid #e2e8f0; border-radius: .85rem; overflow: hidden;
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.media-card-pickable { cursor: pointer; }
.media-card-pickable:hover { border-color: #3b82f6; box-shadow: 0 4px 16px rgba(59,130,246,.12); }
.media-card-img { position: relative; aspect-ratio: 1; background: #f8fafc; }
.media-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-badge {
  position: absolute; top: 6px; left: 6px; font-size: .62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: .2rem .45rem;
  border-radius: 999px; background: rgba(15,23,42,.72); color: #fff;
}
.media-card-meta { padding: .55rem .65rem .65rem; }
.media-card-name {
  font-size: .72rem; font-weight: 700; color: #334155; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.media-card-date { font-size: .65rem; color: #94a3b8; margin-top: .15rem; }
.media-card-actions { display: flex; gap: .35rem; margin-top: .4rem; }
.media-card-btn {
  font-size: .65rem; font-weight: 700; padding: .25rem .45rem; border-radius: .4rem;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; cursor: pointer;
}
.media-card-btn:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.media-card-btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.media-picker-modal .modal-card { max-width: 900px; width: calc(100% - 2rem); max-height: 85vh; display: flex; flex-direction: column; }
.media-picker-body { overflow-y: auto; padding: 1rem 1.25rem 1.25rem; flex: 1; }
.media-picker-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid #f1f5f9; }
