:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #efece2;
  --ink: #1e2a24;
  --muted: #66716b;
  --brand: #7d3f2b;
  --brand-dark: #5e2d20;
  --accent: #bd8a3c;
  --border: #ddd8cb;
  --low: #2f8f63;
  --moderate: #d08a19;
  --high: #b9423d;
  --shadow: 0 20px 50px rgba(41, 39, 32, 0.10);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}

.skip-link:focus { top: 16px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(247, 245, 239, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(125, 63, 43, 0.12);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
}

.nav-link.active {
  background: var(--ink);
  color: white;
}

.view { display: none; }
.view.active { display: block; }

.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 52px;
  align-items: center;
  padding: 70px clamp(18px, 6vw, 90px);
  background:
    radial-gradient(circle at 82% 15%, rgba(189, 138, 60, 0.25), transparent 28%),
    radial-gradient(circle at 10% 20%, rgba(125, 63, 43, 0.17), transparent 30%),
    linear-gradient(145deg, #f8f3e8, #e7dfca);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h2, .admin-header h2 {
  margin: 0;
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero-content > p {
  max-width: 720px;
  margin: 24px 0;
  color: #4c5751;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
}

.btn.primary:hover { background: var(--brand-dark); }

.btn.secondary {
  background: rgba(255,255,255,0.75);
  border-color: var(--border);
  color: var(--ink);
}

.hero-status {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.status-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 20px;
  background: var(--ink);
  color: white;
}

.status-label, .metric-card span, .status-grid span {
  color: rgba(255,255,255,0.68);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}

.status-card strong {
  font-size: 2.2rem;
}

.status-card > span:last-child {
  color: rgba(255,255,255,0.78);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.status-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.status-grid > div {
  padding: 13px;
  border-radius: 14px;
  background: rgba(255,255,255,0.76);
}

.status-grid span {
  color: var(--muted);
  font-size: 0.66rem;
}

.status-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 1.4rem;
}

.alert-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 6vw, 90px);
  background: #fff0d5;
  border-block: 1px solid #efd5a6;
  color: #6e4b13;
}

.icon-btn, .modal-close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
}

.content-section {
  padding: 72px clamp(18px, 6vw, 90px);
}

.soft-bg { background: var(--surface-soft); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 50%;
}
.dot.low { background: var(--low); }
.dot.moderate { background: var(--moderate); }
.dot.high { background: var(--high); }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 20px;
}

#map {
  height: 440px;
  min-height: 440px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #dde3dd;
}

.site-panel {
  height: 440px;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.search-box input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfaf7;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 15px;
}

.filter {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.filter.active {
  background: var(--ink);
  color: white;
}

.site-list {
  display: grid;
  flex: 1;
  min-height: 0;
  gap: 10px;
  overflow: auto;
  padding-right: 3px;
}

.site-item {
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  padding: 14px;
  transition: transform .2s ease, border-color .2s ease;
}

.site-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.site-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.site-item h3 {
  margin: 0;
  font-size: 1rem;
}

.site-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.badge.low { background: #ddf4e9; color: #246b4a; }
.badge.moderate { background: #fff0d2; color: #8d5b0c; }
.badge.high { background: #f9dedc; color: #8e2e2a; }

.journey-grid, .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.journey-card, .feature-card {
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.step-number {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.journey-card h3, .feature-card h3 {
  margin: 15px 0 8px;
}

.journey-card p, .feature-card p {
  margin: 0;
  color: var(--muted);
}

.feature-grid { grid-template-columns: repeat(4, 1fr); }

.feature-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 900;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  padding: 54px clamp(18px, 6vw, 90px) 30px;
}

.admin-header h2 {
  font-size: clamp(2.2rem, 4.5vw, 4.2rem);
}

.admin-header p {
  max-width: 700px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 clamp(18px, 6vw, 90px) 24px;
}

.metric-card {
  padding: 20px;
  border-radius: 18px;
  background: var(--ink);
  color: white;
}

.metric-card span {
  color: rgba(255,255,255,.62);
}

.metric-card strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 2rem;
}

.metric-card small { color: rgba(255,255,255,.66); }

.admin-layout {
  display: grid;
  grid-template-columns: 1.5fr .8fr;
  gap: 18px;
  padding: 0 clamp(18px, 6vw, 90px) 18px;
}

.admin-card {
  padding: 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.card-heading h3 { margin: 0; }
.card-heading p { margin: 4px 0 18px; color: var(--muted); }

.admin-site-controls {
  display: grid;
  gap: 10px;
}

.admin-site-row {
  display: grid;
  grid-template-columns: 1.2fr .7fr .75fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #faf9f5;
  border: 1px solid var(--border);
}

.admin-site-row strong { font-size: .92rem; }

.admin-site-row input,
.admin-site-row select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  font-weight: 750;
  font-size: .88rem;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.toggle-row input { width: auto; }

.reports-card {
  margin: 0 clamp(18px, 6vw, 90px) 70px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.report-table th {
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.empty-state {
  padding: 26px;
  border-radius: 14px;
  background: #faf9f5;
  color: var(--muted);
  text-align: center;
}

.modal {
  width: min(600px, calc(100% - 30px));
  border: 0;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
}

.modal::backdrop {
  background: rgba(20, 24, 22, .62);
  backdrop-filter: blur(4px);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
}

.modal-header h2 { margin: 0; }
.modal-header p { color: var(--muted); }

.site-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.site-detail-box {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.site-detail-box span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .06em;
}

.site-detail-box strong { display: block; margin-top: 4px; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2000;
  transform: translateY(120px);
  opacity: 0;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transition: .25s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.custom-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 6px 18px rgba(0,0,0,.24);
}

.custom-marker span {
  transform: rotate(45deg);
  color: white;
  font-weight: 900;
  font-size: 11px;
}

.custom-marker.low { background: var(--low); }
.custom-marker.moderate { background: var(--moderate); }
.custom-marker.high { background: var(--high); }


.site-panel-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.category-filter {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.category-filter select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfaf7;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

#siteResultCount {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}

.site-area {
  margin-top: -6px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
}

.visitor-tip-box {
  grid-column: 1 / -1;
}

.visitor-tip-box strong {
  font-weight: 650;
}

.admin-site-controls {
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  #map { height: 400px; min-height: 400px; }
  .site-panel { height: 430px; min-height: 430px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .main-nav { width: 100%; }
  .nav-link { flex: 1; }
  .hero { min-height: auto; padding-top: 48px; }
  .hero h2 { font-size: 2.7rem; }
  .status-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .journey-grid, .feature-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .admin-site-row { grid-template-columns: 1fr; }
  .site-detail-grid { grid-template-columns: 1fr; }
  .report-table, .report-table tbody, .report-table tr, .report-table td {
    display: block;
  }
  .report-table thead { display: none; }
  .report-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
  .report-table td { border: 0; padding: 4px 0; }
  #map { height: 330px; min-height: 330px; }
  .site-panel { height: 420px; min-height: 420px; }
  .map-instruction { display: none; }
}

@media (max-width: 620px) {
  .site-panel-meta { grid-template-columns: 1fr; align-items: stretch; }
  #siteResultCount { padding-bottom: 0; }
  .visitor-tip-box { grid-column: auto; }
}

/* Interactive-map usability improvements */
.map-heading-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.map-reset-btn {
  padding: 9px 13px;
  min-height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}

.map-shell {
  position: relative;
  min-width: 0;
}

.map-shell #map {
  width: 100%;
}

.map-instruction {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 58px;
  max-width: calc(100% - 72px);
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 9px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.site-item {
  cursor: pointer;
  font-family: inherit;
}

.site-item:focus-visible {
  outline: 3px solid rgba(163, 111, 53, .28);
  outline-offset: 2px;
}

.site-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(163, 111, 53, .12);
  background: #fffdf8;
}

.site-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.map-focus-hint {
  color: var(--brand);
  font-size: .78rem;
  font-weight: 850;
}

.map-focus-hint::before {
  content: "◎ ";
}

.site-details-btn,
.map-popup-actions button,
.map-popup-actions a {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: var(--ink);
  color: white;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.site-details-btn:hover,
.map-popup-actions button:hover,
.map-popup-actions a:hover {
  opacity: .86;
}

.map-popup {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.map-popup > strong {
  font-size: .96rem;
}

.map-popup > span,
.map-popup > small {
  color: #59625d;
  line-height: 1.35;
}

.map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.map-popup-actions a {
  background: #f0eee7;
  color: var(--ink);
  border: 1px solid var(--border);
}

.leaflet-control-zoom a {
  font-weight: 900;
}

@media (max-width: 760px) {
  .map-heading-tools {
    justify-items: start;
  }

  .map-instruction {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 30px);
    text-align: center;
  }
}

.site-focus-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.site-focus-btn:focus-visible {
  outline: 3px solid rgba(163, 111, 53, .28);
  outline-offset: 5px;
  border-radius: 9px;
}

.site-focus-btn .map-focus-hint {
  display: inline-block;
  margin-top: 11px;
}

.site-item-actions small {
  color: var(--muted);
  font-size: .7rem;
}

/* Full-stack backend and administration additions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backend-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.backend-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moderate);
}
.backend-status.online::before { background: var(--low); }
.backend-status.error::before { background: var(--high); }
.backend-status.local::before { background: var(--accent); }
.backend-status.pending::before { animation: statusPulse 1s infinite alternate; }
@keyframes statusPulse { to { opacity: .25; } }

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
}

.admin-user-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.admin-locked {
  margin: 0 clamp(18px, 6vw, 90px) 70px;
  padding: 34px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  background: var(--surface);
  text-align: center;
}
.admin-locked strong { display: block; font-size: 1.25rem; }
.admin-locked p { max-width: 720px; margin: 9px auto 18px; color: var(--muted); }

.admin-site-row {
  grid-template-columns: minmax(190px, 1.35fr) 105px 125px auto auto;
}
.admin-site-name { display: grid; gap: 2px; }
.admin-site-name small, .admin-site-row label > span { color: var(--muted); font-size: .7rem; font-weight: 750; }
.admin-site-row label { display: grid; gap: 4px; }
.compact-toggle { display: flex !important; align-items: center; gap: 6px !important; white-space: nowrap; font-size: .78rem; }
.compact-toggle input { width: auto; }

.row-actions, .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.small-btn {
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--ink);
  color: white;
  font-size: .72rem;
  font-weight: 800;
}
.small-btn.ghost { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--border); }
.small-btn.danger { background: #f7e9e7; color: var(--high); border: 1px solid #efcbc6; }

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.event-card {
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.event-card img { width: calc(100% + 40px); height: 170px; object-fit: cover; margin: -20px -20px 16px; }
.event-card > span { color: var(--brand); font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.event-card h3 { margin: 7px 0; }
.event-card p { margin: 6px 0 0; color: var(--muted); }
.wide-empty { grid-column: 1 / -1; }

.admin-secondary-layout { grid-template-columns: 1fr 1fr; padding-bottom: 70px; }
.split-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.admin-event-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.admin-event-item:last-child { border-bottom: 0; }
.admin-event-item div:first-child { display: grid; gap: 3px; }
.admin-event-item small { color: var(--muted); }

.table-scroll { overflow: auto; max-height: 520px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.compact-modal { width: min(460px, calc(100% - 30px)); }
.wide-modal { width: min(900px, calc(100% - 30px)); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f8e7e5; color: var(--high); font-size: .84rem; }
.site-dialog-image { width: 100%; max-height: 340px; object-fit: cover; border-radius: 15px; margin-bottom: 18px; }
#siteDialogContent audio { width: 100%; margin-top: 12px; }

@media (max-width: 1100px) {
  .admin-site-row { grid-template-columns: minmax(180px, 1fr) 100px 120px; }
  .admin-site-row .compact-toggle, .admin-site-row .row-actions { grid-column: auto; }
  .event-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .topbar-actions { width: 100%; justify-content: space-between; }
  .backend-status { display: none; }
  .admin-header-actions { justify-content: flex-start; }
  .admin-secondary-layout, .event-grid { grid-template-columns: 1fr; }
  .form-grid-three { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar-actions { display: grid; }
  .admin-site-row { grid-template-columns: 1fr 1fr; }
  .admin-site-name, .admin-site-row .row-actions { grid-column: 1 / -1; }
  .form-grid-two { grid-template-columns: 1fr; }
  .split-heading, .admin-event-item { align-items: flex-start; flex-direction: column; }
}
