:root {
  --editor-bg: #eef2f5;
  --panel-bg: #ffffff;
  --panel-border: #dce3ea;
  --ink: #17202a;
  --muted: #667585;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --canvas-shadow: 0 24px 70px rgba(31, 42, 55, 0.16);
}

body.page-builder-mode .site-shell {
  display: block;
  min-height: 100vh;
}

body.public-builder-mode #publicSiteCanvas {
  min-height: 100vh;
}

body.page-builder-mode .site-shell > .topbar {
  display: none;
}

body.public-builder-mode .site-shell > .topbar {
  display: none;
}

body.page-builder-mode .app-shell {
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  width: 100%;
}

.back-admin {
  align-items: center;
  background: #0f766e;
  border: 1px solid #0b5f59;
  border-radius: 10px;
  box-shadow: 0 5px 12px rgba(15, 118, 110, .18);
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  gap: 10px;
  min-height: 42px;
  min-width: 146px;
  padding: 10px 15px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.back-admin:hover,
.back-admin:focus-visible {
  background: #115e59;
  border-color: #0f4f4a;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .3);
  color: #fff;
  transform: translateX(-2px);
}

.back-admin i {
  font-size: 18px;
}

.save-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.save-status.text-warning { color: #946200 !important; }
.save-status.text-danger { color: #b42318 !important; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--editor-bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.editor-sidebar,
.inspector-panel {
  background: var(--panel-bg);
  border-color: var(--panel-border);
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  scrollbar-gutter: stable;
}

.editor-sidebar {
  border-right: 1px solid var(--panel-border);
}

.editor-sidebar-close,
.editor-sidebar-backdrop {
  display: none;
}

.inspector-panel {
  border-left: 1px solid var(--panel-border);
}

.editor-sidebar .inspector-card {
  background: #f8fafc;
}

.editor-sidebar .inspector-content {
  max-height: none;
}

.editor-sidebar .empty-state {
  padding: 18px 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}

.brand-lockup small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #111827;
  color: #fff;
}

.sidebar-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--panel-border);
}

.section-title {
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.page-list,
.template-list {
  display: grid;
  gap: 8px;
}

.page-item,
.palette-item,
.template-item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  text-align: left;
  transition: 0.16s ease;
  width: 100%;
}

.page-item {
  overflow: hidden;
  padding: 0;
}

.page-select {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex: 1;
  font: inherit;
  gap: 10px;
  min-height: 42px;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
}

.page-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-delete {
  align-items: center;
  background: transparent;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  flex: 0 0 36px;
  height: 36px;
  margin-right: 3px;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}

.page-delete:hover,
.page-delete:focus-visible {
  background: #fff1f2;
  color: #dc2626;
}

.page-delete:disabled {
  cursor: not-allowed;
  opacity: .35;
}

.page-item:hover,
.palette-item:hover,
.template-item:hover {
  border-color: #9db7ff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.08);
}

.page-item.active,
.template-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #1742af;
}

.template-item {
  min-height: 56px;
}

.template-item span:last-child {
  display: grid;
  gap: 2px;
}

.template-item small {
  color: var(--muted);
  font-size: 11px;
}

.template-swatch {
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 34px;
  width: 42px;
}

.template-swatch.template-studio {
  background: linear-gradient(135deg, #071d49 0 34%, #087bd8 34% 68%, #15b9e8 68%);
}

.template-swatch.template-bold {
  background: linear-gradient(135deg, #111827 0 55%, #facc15 55% 74%, #ef4444 74%);
}

.template-swatch.template-editorial {
  background: linear-gradient(135deg, #fbf7ef 0 55%, #1f2937 55% 70%, #b45309 70%);
}

.template-swatch.template-neon {
  background: linear-gradient(135deg, #0f1020 0 50%, #22d3ee 50% 68%, #f472b6 68%);
}

.template-swatch.template-earth {
  background: linear-gradient(135deg, #eef2e6 0 50%, #53755b 50% 72%, #d08c60 72%);
}

.block-palette {
  display: grid;
  gap: 8px;
}

.section-insert-control {
  align-items: center;
  display: flex;
  height: 28px;
  justify-content: center;
  position: relative;
  z-index: 4;
}

.section-insert-control::before {
  background: #dbe7f5;
  content: '';
  height: 1px;
  left: 12%;
  position: absolute;
  right: 12%;
  top: 50%;
}

.section-insert-control button {
  align-items: center;
  background: #fff;
  border: 1px solid #b8cbe0;
  border-radius: 999px;
  color: #2563eb;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
  opacity: .45;
  padding: 5px 10px;
  position: relative;
  transition: opacity .15s ease, box-shadow .15s ease, transform .15s ease;
}

.section-insert-control:hover button,
.section-insert-control button:focus-visible {
  box-shadow: 0 6px 16px rgba(37, 99, 235, .18);
  opacity: 1;
  transform: translateY(-1px);
}

.editor-choice-modal .modal-header {
  align-items: flex-start;
}

#addSectionModal .modal-dialog,
#templateModal .modal-dialog {
  height: min(820px, calc(100vh - 32px));
  margin: 16px auto;
  max-height: calc(100vh - 32px);
}

#addSectionModal .modal-content,
#templateModal .modal-content {
  display: flex;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

#addSectionModal .modal-body,
#templateModal .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.choice-grid {
  display: grid;
  gap: 9px;
}

.section-choice {
  align-items: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--ink);
  display: grid;
  gap: 11px;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  padding: 11px 12px;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  width: 100%;
}

.section-choice:hover,
.section-choice:focus-visible {
  background: #f5f9ff;
  border-color: #8fb2f5;
  transform: translateX(2px);
}

.section-choice-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 9px;
  color: var(--accent);
  display: grid;
  height: 36px;
  justify-items: center;
  width: 36px;
}

.section-choice span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.section-choice small {
  color: var(--muted);
  font-size: 11px;
}

.section-choice-arrow {
  color: #94a3b8;
}

.template-choice-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-choice {
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  display: grid;
  gap: 11px;
  padding: 12px;
  position: relative;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.template-choice:hover,
.template-choice:focus-visible,
.template-choice.active {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .13);
  transform: translateY(-2px);
}

.template-preview {
  align-items: flex-end;
  background: #eef2f7;
  border: 1px solid #d8e0e8;
  border-radius: 9px;
  display: flex;
  gap: 5px;
  height: 104px;
  overflow: hidden;
  padding: 12px;
  position: relative;
}

.template-preview i { color: rgba(255,255,255,.9); left: 10px; position: absolute; top: 9px; }
.template-preview b { background: rgba(255,255,255,.88); border-radius: 3px; height: 12px; width: 28%; }
.template-preview em { background: rgba(255,255,255,.52); border-radius: 3px; height: 8px; width: 50%; }
.template-preview.template-studio { background: linear-gradient(135deg,#071d49,#087bd8 58%,#15b9e8); }
.template-preview.template-bold { background: linear-gradient(135deg,#111827 0 55%,#facc15 55% 74%,#ef4444 74%); }
.template-preview.template-editorial { background: linear-gradient(135deg,#fbf7ef 0 55%,#1f2937 55% 70%,#b45309 70%); }
.template-preview.template-neon { background: linear-gradient(135deg,#0f1020,#22d3ee 55%,#f472b6); }
.template-preview.template-earth { background: linear-gradient(135deg,#eef2e6,#53755b 58%,#d08c60); }
.template-preview.template-chapel { background: linear-gradient(135deg,#251b1a,#8d4938 58%,#d8b27c); }
.template-preview.template-community { background: linear-gradient(135deg,#e8f7ff,#1784c7 58%,#45c486); }
.template-preview.template-olive { background: linear-gradient(135deg,#f4f0df,#667c4b 58%,#c8a56a); }
.template-preview.template-sunrise { background: linear-gradient(135deg,#fff5e8,#f29a62 58%,#e56d78); }
.template-preview.template-ministry { background: linear-gradient(135deg,#172554,#4759a9 58%,#8b83d8); }
.template-choice-copy { display: grid; gap: 3px; }.template-choice-copy small { color: var(--muted); font-size: 11px; }.template-selected { color: #08724f; font-size: 11px; font-weight: 800; position: absolute; right: 12px; top: 116px; }

.editor-main {
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  scrollbar-gutter: stable;
}

.site-logo [data-site-field="brand"] {
  border-radius: 6px;
  outline: 0;
  padding: 2px 4px;
  transition: background .15s ease, box-shadow .15s ease;
}

.site-logo [data-site-field="brand"][contenteditable="true"]:hover,
.site-logo [data-site-field="brand"][contenteditable="true"]:focus {
  background: rgba(8, 123, 216, .10);
  box-shadow: 0 0 0 2px rgba(8, 123, 216, .18);
}

.topbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(31, 42, 55, .06);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 18px;
  max-width: 1180px;
  padding: 10px 12px;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.2;
  margin: 2px 0 0;
}

.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 1 auto;
  max-width: 100%;
}

.viewport-switch {
  display: inline-flex;
  gap: 4px;
}

.topbar-actions > .btn,
.viewport-switch .btn {
  min-height: 38px;
}

.sidebar-toggle {
  display: none;
}

.editor-save-button {
  min-width: 92px;
  white-space: nowrap;
}

.topbar-actions .active {
  background: var(--accent);
  color: #fff;
}

.mode-switch {
  background: #dfe6ee;
  border: 1px solid #cdd7e2;
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.mode-btn {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #526173;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
}

.mode-btn.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  color: #111827;
}

.topbar-actions .mode-btn.active {
  background: #fff;
  color: #111827;
}

.app-shell.preview-mode {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.preview-mode .editor-sidebar,
.app-shell.preview-mode .inspector-panel {
  display: none;
}

.app-shell.preview-mode .editor-main {
  padding: 22px clamp(16px, 4vw, 40px);
}

.app-shell.preview-mode .topbar {
  max-width: 1320px;
}

.app-shell.preview-mode .canvas-frame:not(.mobile) {
  max-width: 1320px;
}

.canvas-frame {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--canvas-shadow);
  margin: 0 auto;
  max-width: 1180px;
  min-height: calc(100vh - 114px);
  overflow: hidden;
  transition: max-width 0.2s ease;
}

.canvas-frame.mobile {
  max-width: 430px;
}

.browser-bar {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 7px;
  height: 42px;
  padding: 0 14px;
}

.browser-bar span {
  background: #cbd5e1;
  border-radius: 50%;
  display: block;
  height: 10px;
  width: 10px;
}

.browser-bar span:first-child {
  background: #fb7185;
}

.browser-bar span:nth-child(2) {
  background: #fbbf24;
}

.browser-bar span:nth-child(3) {
  background: #34d399;
}

.address {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  flex: 1;
  font-size: 12px;
  margin-left: 8px;
  padding: 5px 10px;
}

.site-canvas {
  container-type: inline-size;
  min-height: 720px;
  overflow-wrap: anywhere;
}

.site-navbar {
  align-items: center;
  border-bottom: 1px solid #e8edf2;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 5vw, 56px);
  position: relative;
}

.site-brand-row {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 180px;
}

.site-logo {
  font-weight: 800;
}

.site-menu-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.site-menu-toggle span {
  background: currentColor;
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 18px;
}

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.site-nav-link,
.site-nav button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #64748b;
  display: inline-flex;
  font-size: 14px;
  gap: 6px;
  padding: 8px 10px;
  text-decoration: none;
}

.site-nav-link:hover {
  background: #f8fafc;
  color: #111827;
}

.site-nav-link.active,
.site-nav button.active {
  background: #f1f5f9;
  color: #111827;
}

.site-nav-auth {
  align-items: center;
  background: var(--site-accent, #08724f);
  border: 1px solid var(--site-accent, #08724f);
  border-radius: 8px;
  color: #fff !important;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 14px;
  text-decoration: none;
}

.site-nav-auth:hover {
  filter: brightness(.92);
  color: #fff !important;
}

.site-nav-dropdown {
  padding-bottom: 10px;
  position: relative;
}

.site-nav-dropdown::after {
  content: '';
  display: block;
  height: 12px;
  left: 0;
  position: absolute;
  right: 0;
  top: 100%;
}

.site-dropdown-menu {
  background: #fff;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
  display: none;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% - 2px);
  z-index: 30;
}

.site-nav-dropdown:hover .site-dropdown-menu,
.site-nav-dropdown:focus-within .site-dropdown-menu,
.site-nav-dropdown.dropdown-open .site-dropdown-menu {
  display: grid;
  gap: 3px;
}

.site-dropdown-menu a {
  border-radius: 7px;
  color: #526173;
  display: block;
  font-size: 14px;
  padding: 9px 10px;
  text-decoration: none;
}

.site-dropdown-menu a:hover {
  background: #f1f5f9;
  color: #111827;
}

.editable-block {
  border: 2px solid transparent;
  position: relative;
  scroll-margin-top: 92px;
}

.editable-block:hover {
  border-color: rgba(37, 99, 235, 0.3);
}

.editable-block.selected {
  border-color: var(--accent);
}

.block-toolbar {
  background: #111827;
  border-radius: 8px;
  color: #fff;
  display: none;
  gap: 4px;
  left: 12px;
  padding: 4px;
  position: absolute;
  top: 12px;
  z-index: 10;
}

.block-toolbar::before {
  color: #94a3b8;
  content: "Section";
  font-size: 11px;
  font-weight: 700;
  padding: 0 7px 0 5px;
  align-self: center;
}

.editable-block.selected > .block-toolbar {
  display: flex;
}

.site-canvas.is-preview .editable-block,
.site-canvas.is-preview .editable-block:hover,
.site-canvas.is-preview .editable-block.selected {
  border-color: transparent;
}

.site-canvas.is-preview .block-toolbar {
  display: none;
}

.site-canvas.is-preview [contenteditable="false"] {
  cursor: default;
}

.block-toolbar button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.block-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}

[contenteditable="true"] {
  border-radius: 6px;
  outline: 0;
}

[contenteditable="true"]:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.hero-section {
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 48%, #edf7f1 100%);
  padding: clamp(52px, 8vw, 96px) clamp(22px, 7vw, 76px);
}

.hero-inner {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.hero-kicker {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  margin-bottom: 18px;
}

.hero-copy {
  color: #526173;
  font-size: 18px;
  line-height: 1.7;
  max-width: 680px;
}

.hero-media,
.split-media,
.gallery-tile {
  background-position: center;
  background-size: cover;
}

.hero-media {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(39, 54, 71, 0.2);
  min-height: clamp(220px, 34cqw, 360px);
}

.section-pad {
  padding: clamp(42px, 6vw, 78px) clamp(22px, 7vw, 76px);
}

.section-heading {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  margin-bottom: 14px;
}

.section-copy {
  color: #627084;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 760px;
}

.card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.feature-card {
  background: #fff;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transition: 0.18s ease;
}

.feature-card:hover {
  box-shadow: 0 16px 38px rgba(31, 42, 55, 0.1);
  transform: translateY(-2px);
}

.feature-icon {
  align-items: center;
  background: #ecfdf5;
  border-radius: 8px;
  color: #047857;
  display: inline-flex;
  font-size: 22px;
  height: 44px;
  justify-content: center;
  margin-bottom: 16px;
  width: 44px;
}

.card-link {
  align-items: center;
  color: #2563eb;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  margin-top: 18px;
  text-decoration: none;
}

.card-link:hover {
  color: #1742af;
}

.split-section {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.split-media {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  min-height: clamp(210px, 32cqw, 340px);
}

.gallery-strip {
  display: grid;
  gap: 14px;
  grid-auto-columns: minmax(min(82%, 260px), 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 2px 0 12px;
  scroll-snap-type: x mandatory;
  scrollbar-color: #94a3b8 transparent;
}

.gallery-tile {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  min-width: 0;
  scroll-snap-align: start;
}

.gallery-tile:first-child {
  aspect-ratio: 4 / 3;
  grid-column: auto;
  grid-row: auto;
}

.video-section {
  background: #f8fafc;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.video-frame iframe {
  border: 0;
  height: 100%;
  width: 100%;
}

.logo-grid,
.testimonial-grid,
.pricing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.logo-card {
  align-items: center;
  background: #fff;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  color: #111827;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 128px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  transition: 0.18s ease;
}

.logo-card:hover {
  border-color: #9db7ff;
  box-shadow: 0 14px 34px rgba(31, 42, 55, 0.09);
}

.logo-card img {
  max-height: 52px;
  max-width: min(100%, 180px);
  object-fit: contain;
}

.logo-card span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.testimonials-section {
  background: #f8fafc;
}

.testimonial-card,
.pricing-card {
  background: #fff;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
}

.testimonial-card > i {
  color: #2563eb;
  font-size: 30px;
  margin-bottom: 12px;
}

.testimonial-card p {
  color: #334155;
  line-height: 1.7;
}

.testimonial-card strong,
.testimonial-card span {
  display: block;
}

.testimonial-card span {
  color: #64748b;
  font-size: 14px;
}

.pricing-card {
  gap: 14px;
}

.pricing-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.pricing-card .price {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.1;
}

.pricing-card p {
  color: #64748b;
  line-height: 1.65;
  margin: 0;
}

.cta-band {
  align-items: center;
  background: #111827;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  padding: clamp(36px, 6vw, 64px) clamp(22px, 7vw, 76px);
}

.cta-band p {
  color: #cbd5e1;
  margin: 0;
}

.cta-band > div {
  flex: 1 1 300px;
  min-width: 0;
}

.cta-band .btn {
  flex: 0 0 auto;
}

@container (max-width: 720px) {
  .site-navbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-brand-row {
    width: 100%;
  }

  .site-menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    align-items: stretch;
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .site-navbar.menu-open .site-nav {
    display: flex;
  }

  .site-nav-link,
  .site-nav button,
  .site-nav-auth {
    justify-content: space-between;
    width: 100%;
  }

  .site-nav-dropdown {
    padding-bottom: 0;
    width: 100%;
  }

  .site-nav-dropdown::after {
    display: none;
  }

  .site-dropdown-menu {
    background: rgba(255, 255, 255, 0.58);
    border: 0;
    box-shadow: none;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 2px 0 2px 14px;
    position: static;
  }

  .site-dropdown-menu a {
    padding: 8px 10px;
  }

  .hero-section,
  .section-pad {
    padding: 36px 20px;
  }

  .hero-inner,
  .split-section,
  .card-grid,
  .logo-grid,
  .testimonial-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .gallery-strip {
    grid-auto-columns: minmax(78%, 1fr);
  }

  .cta-band {
    align-items: flex-start;
    flex-direction: column;
    padding: 34px 20px;
  }

  .cta-band .btn,
  .hero-section .btn,
  .split-section .btn {
    width: 100%;
  }
}

@container (max-width: 460px) {
  .site-navbar {
    padding: 16px;
  }

  .hero-section,
  .section-pad {
    padding: 30px 16px;
  }

  .hero-title {
    font-size: 30px;
  }

  .section-heading,
  .cta-band .h1 {
    font-size: 26px;
  }

  .feature-card {
    padding: 18px;
  }

  .testimonial-card,
  .pricing-card {
    padding: 18px;
  }

  .hero-media,
  .split-media {
    min-height: 200px;
  }
}

.empty-state {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-height: 190px;
  padding: 24px;
  text-align: center;
}

.empty-state i {
  font-size: 30px;
}

.inspector-content {
  display: grid;
  gap: 14px;
}

.inspector-card {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px;
}

.inline-property-editor {
  position: absolute;
  z-index: 50;
  width: min(300px, calc(100% - 24px));
  padding: 10px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}

.site-canvas [data-editor-media],
.site-canvas [data-editor-link] {
  cursor: pointer;
}

.inline-property-title {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.inline-property-editor .inline-upload {
  border: 1px solid #dbeafe;
  color: #2563eb;
  display: block;
  margin-top: 7px;
  text-align: center;
}

.json-output {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  min-height: 440px;
}

.church-card-grid { align-items: stretch; }
.church-card { display: flex; flex-direction: column; gap: 10px; }
.church-card-icon { color: var(--site-accent); font-size: 24px; }
.church-card-meta, .church-sermon-meta { display: flex; gap: 10px; color: var(--site-accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.church-card-location { color: var(--site-muted); font-size: 13px; margin: 0; }
.church-date-badge { align-self: flex-start; padding: 7px 10px; border-radius: 6px; background: var(--site-soft); color: var(--site-accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.church-quote-icon { color: var(--site-accent); font-size: 28px; }
.church-contact-band { gap: 24px; }
.church-contact-details { display: grid; gap: 7px; color: var(--site-cta-muted); font-size: 13px; }
.church-contact-details span { display: flex; align-items: center; gap: 8px; }
.church-contact-details i { color: var(--site-cta-ink); }
.church-item-editor { border-top: 1px solid var(--panel-border); padding-top: 12px; margin-top: 12px; }

@media (max-width: 1180px) {
  body.page-builder-mode {
    overflow: auto;
  }

  body.page-builder-mode .app-shell {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .inspector-panel {
    border-left: 0;
    border-top: 1px solid var(--panel-border);
    grid-column: 1 / -1;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  body.page-builder-mode .editor-main,
  body.page-builder-mode .editor-sidebar {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 860px) {
  body.editor-sidebar-open {
    overflow: hidden;
  }

  .back-admin {
    justify-content: center;
    width: 100%;
  }

  .app-shell {
    display: block;
  }

  .editor-sidebar {
    background: var(--panel-bg);
    display: block;
    height: 100dvh;
    left: 0;
    max-height: none;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform .22s ease, visibility .22s;
    visibility: hidden;
    width: min(320px, calc(100vw - 40px));
    z-index: 2050;
  }

  .app-shell.mobile-sidebar-open .editor-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .editor-sidebar-backdrop {
    background: rgba(7, 20, 40, .52);
    display: block;
    inset: 0;
    position: fixed;
    z-index: 2040;
  }

  .editor-sidebar-backdrop[hidden] {
    display: none;
  }

  .editor-sidebar-close {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--panel-border);
    border-radius: 9px;
    color: var(--ink);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    margin-left: auto;
    width: 36px;
  }

  .inspector-panel {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .editor-main {
    min-height: 100dvh;
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
    border-radius: 12px;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    position: sticky;
    top: 8px;
    z-index: 100;
  }

  .topbar-actions {
    align-items: stretch;
    gap: 5px;
    justify-content: flex-start;
    width: 100%;
  }

  .topbar-actions > * {
    flex: 0 0 auto;
  }

  .save-status {
    align-self: center;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .back-admin {
    min-height: 38px;
    min-width: 0;
    padding: 8px 10px;
  }

  .back-admin span {
    display: none;
  }

  .sidebar-toggle {
    font-size: 0;
    min-width: 40px;
    padding: 8px;
  }

  .sidebar-toggle i {
    font-size: 17px;
  }

  .editor-save-button {
    font-size: 0;
    min-width: 40px;
    padding: 8px;
  }

  .editor-save-button i {
    font-size: 17px;
  }

  .mode-btn {
    font-size: 0;
    min-height: 38px;
    padding: 0 9px;
  }

  .mode-btn i {
    font-size: 17px;
  }

  .canvas-frame {
    border-radius: 12px;
    min-height: calc(100dvh - 86px);
  }

  .browser-bar {
    height: 36px;
    padding: 0 10px;
  }

  .browser-bar .address {
    font-size: 11px;
    max-width: calc(100% - 48px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .editor-choice-modal .modal-header {
    padding: 14px;
  }

  .editor-choice-modal .modal-body {
    max-height: 68vh;
    overflow-y: auto;
    padding: 12px;
  }

  .template-choice-grid {
    grid-template-columns: 1fr;
  }

  .template-preview {
    height: 82px;
  }

  .template-selected {
    right: 12px;
    top: 94px;
  }

  .section-choice {
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    padding: 10px;
  }

  .section-choice-icon {
    height: 32px;
    width: 32px;
  }

  .block-toolbar {
    gap: 3px;
    left: 8px;
    max-width: calc(100% - 16px);
    overflow-x: auto;
    top: 8px;
  }

  .block-toolbar::before {
    display: none;
  }

  .block-toolbar button {
    flex: 0 0 38px;
    height: 38px;
    width: 38px;
  }

  .inline-property-editor {
    width: min(300px, calc(100vw - 24px));
  }

  .section-insert-control button span {
    display: none;
  }

  .hero-inner,
  .split-section,
  .card-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .cta-band,
  .site-navbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
