:root {
  --bg: #F6F5F0;
  --surface: #FFFFFF;
  --surface-alt: #EFF3F1;
  --border: #DCE4E0;
  --border-subtle: rgba(11, 31, 51, 0.08);
  --ink: #0B1F33;
  --muted: #4B5B6B;
  --accent: #0F766E;
  --accent-soft: #E6F4F1;
  --accent-hover: #0B5C56;
  --gold: #B45309;
  --gold-soft: #FEF3C7;
  --danger: #991B1B;
  --warn: #B45309;
  --ok: #0F766E;
  --photo: #5B21B6;
  --photo-soft: #F3E8FF;
  --font-display: 'Frank Ruhl Libre', Georgia, serif;
  --font-body: 'Heebo', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, Consolas, monospace;
  --text-heading: 1.25rem;
  --text-body: 0.9375rem;
  --text-sm: 0.8125rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(11, 31, 51, 0.06);
  --shadow-md: 0 12px 30px rgba(11, 31, 51, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  overflow-x: clip;
}

/* Slim App Header with Integrated Search & Icon Nav */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 500;
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 8px 20px;
  display: grid;
  grid-template-columns: auto minmax(260px, 500px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  cursor: pointer;
}

.brand-mark {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.brand-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.1;
}

.brand-meta {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}

/* Integrated Pill Search + Embedded Sliders Icon */
.header-search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
}

.search-field {
  height: 42px;
  border-radius: 999px !important;
  padding: 0 42px 0 82px !important;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  font-size: var(--text-body);
  box-shadow: 0 1px 4px rgba(11, 31, 51, 0.04);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.search-field:focus {
  background: var(--surface) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.clear-input-btn {
  position: absolute;
  left: 46px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 50%;
}

.clear-input-btn:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.search-embedded-actions {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-pill-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.icon-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toggle-filters-btn.is-open,
.toggle-filters-btn.has-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

/* 4-Icon Top Navigation */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.nav-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-btn:hover {
  color: var(--ink);
}

.nav-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(11, 31, 51, 0.08);
}

.nav-btn.active svg {
  opacity: 1;
}

/* Views */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.page-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.workspace-shell {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Airbnb-Style Borderless Icon-Over-Word Category Strip */
.category-ribbon-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 2px 20px 0;
}

.quick-chips-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: safe center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-chips-row::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 64px;
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 10px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.quick-chip svg {
  flex-shrink: 0;
  opacity: 0.72;
  transition: transform 150ms var(--ease-out), opacity 150ms var(--ease-out);
}

.quick-chip:hover {
  color: var(--ink);
  border-bottom-color: var(--border);
}

.quick-chip:hover svg {
  opacity: 1;
  transform: translateY(-1px);
}

.quick-chip.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--ink);
}

.quick-chip.active svg {
  opacity: 1;
}

.quick-chip-photo.active {
  color: var(--photo);
  border-bottom-color: var(--photo);
}

/* Collapsible Filter Drawer */
.advanced-filters {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
}

.advanced-filters.is-open {
  display: block;
}

.advanced-filters-inner {
  max-width: 1460px;
  margin: 0 auto;
}

.filter-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-field {
  min-width: 0;
}

.filter-field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.filter-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.toggles-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.filter-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.switch-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  transition: border-color 160ms var(--ease-out);
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Full-Bleed Map + Side Rail Workspace */
.mobile-view-switch {
  display: none;
}

.split-workspace {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 0;
  align-items: stretch;
  height: calc(100vh - 122px);
  min-height: 540px;
}

.map-pane {
  position: relative;
  overflow: hidden;
  background: #EAECEF;
}

#mapContainer {
  width: 100%;
  height: 100%;
  min-height: 500px;
  z-index: 1;
}

#mapContainer.map-mode-clean .leaflet-tile-pane {
  filter: saturate(0.32) contrast(0.95) brightness(1.04) sepia(0.06);
}

/* Icon-Only Floating Map Controls */
.map-floating-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 420;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(11, 31, 51, 0.14);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(11, 31, 51, 0.14);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.map-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.map-icon-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.map-layers-wrap {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 430;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.map-style-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 5px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(11, 31, 51, 0.14);
  box-shadow: var(--shadow-md);
}

.map-style-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.map-style-btn:hover {
  border-color: var(--accent);
}

.map-style-btn.active {
  background: var(--ink);
  color: #FFFFFF;
}

.swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.sw-clean { background: #ECE8DF; }
.sw-light { background: #F1F5F9; }
.sw-osm { background: #B7E4C7; }
.sw-sat { background: #1E3A5F; }

.map-legend {
  position: absolute;
  bottom: 24px;
  right: 14px;
  z-index: 410;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(11, 31, 51, 0.12);
  box-shadow: 0 2px 10px rgba(11, 31, 51, 0.08);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
}

/* Custom architectural clusters & bespoke SVG pins */
.kcluster-icon {
  background: transparent;
  border: none;
}

.kcluster {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 6px 16px rgba(11, 31, 51, 0.28);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.kcluster:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(11, 31, 51, 0.34);
}

.kcluster-sm {
  width: 36px;
  height: 36px;
  font-size: var(--text-sm);
  background: var(--accent);
}

.kcluster-md {
  width: 44px;
  height: 44px;
  font-size: var(--text-body);
  background: #0B4F4A;
}

.kcluster-lg {
  width: 52px;
  height: 52px;
  font-size: var(--text-body);
  background: var(--ink);
}

.kpin-wrap {
  background: transparent;
  border: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 150ms var(--ease-out), filter 150ms var(--ease-out);
}

.kpin-wrap .kpin-svg {
  display: block;
  filter: drop-shadow(0 3px 5px rgba(11, 31, 51, 0.32));
}

.kpin-wrap:hover,
.kpin-wrap.is-hovered {
  transform: scale(1.16) translateY(-2px);
  z-index: 950 !important;
}

.kpin-wrap.is-selected {
  transform: scale(1.24) translateY(-3px);
  z-index: 1000 !important;
}

.kpin-wrap.is-selected .kpin-svg {
  filter: drop-shadow(0 0 6px rgba(15, 118, 110, 0.65)) drop-shadow(0 4px 8px rgba(11, 31, 51, 0.38));
}

.user-loc-wrap {
  background: transparent;
  border: none;
}

.user-loc-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563EB;
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25);
  animation: userPulse 2.2s ease-out infinite;
}

@keyframes userPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Directory Side Rail, Kashrut Authority Seals & Card Brand Logos */
.list-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.list-count-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.list-count-label {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
}

.live-summary {
  font-size: var(--text-sm);
  color: var(--muted);
}

.sort-select {
  width: auto;
  min-width: 132px;
  padding: 6px 10px;
  font-size: var(--text-sm);
  background: var(--bg);
}

.list-scroll {
  flex: 1;
  overflow-y: auto;
}

.biz-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}

.biz-row:last-child {
  border-bottom: none;
}

.biz-row:hover {
  background: #F9FBFA;
}

.biz-row.is-selected {
  background: var(--accent-soft);
  box-shadow: inset -3px 0 0 var(--accent);
}

/* Business Visual Tile / Certificate Photo Thumbnail */
.seal-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.seal-wrap.seal-lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.tile-teal {
  background: var(--accent-soft);
  color: var(--accent);
}

.tile-warm {
  background: var(--gold-soft);
  color: var(--gold);
}

.tile-slate {
  background: var(--surface-alt);
  color: var(--muted);
}

.seal-photo {
  border: 1.5px solid rgba(91, 33, 182, 0.45);
  background: var(--photo-soft);
}

.seal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seal-cam-pip {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--photo);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
}

.biz-content {
  flex: 1;
  min-width: 0;
}

.biz-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.biz-name {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.biz-dist {
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  margin-right: auto;
}

.biz-sub {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-body-line {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cuisine-micro-icon {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* Compact Icon-Only Card Actions (Waze, Google Maps, Expand) */
.card-logo-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.logo-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.logo-icon-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--bg);
  transform: translateY(-1px);
}

.empty-state-box {
  padding: 36px 20px;
  text-align: center;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted);
}

.page-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.page-icon-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Shared Buttons */
.btn-primary {
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: var(--text-sm);
}

.btn-subtle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.btn-subtle:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-subtle:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Section headings, KPI strip & tables */
.page-intro {
  margin-bottom: 18px;
}

.section-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-desc {
  margin: 0;
  font-size: var(--text-body);
  color: var(--muted);
  max-width: 65ch;
}

.sub-heading {
  margin: 0 0 10px;
  font-size: var(--text-heading);
  font-weight: 700;
  color: var(--ink);
}

.st-active { color: var(--ok); }
.st-expired { color: var(--warn); }
.st-revoked { color: var(--danger); }
.st-unknown { color: var(--muted); }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 14px 0 18px;
  margin-bottom: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-label {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.transparency-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.bar-track {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt);
  margin: 4px 0 14px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 16px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 6px;
}

.toolbar-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

th,
td {
  text-align: right;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-body);
}

th {
  background: var(--surface-alt);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #F9FBFA;
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.sp-ok { background: var(--accent-soft); color: var(--ok); }
.sp-warn { background: var(--gold-soft); color: var(--warn); }
.sp-danger { background: #FEF2F2; color: var(--danger); }
.sp-neutral { background: var(--surface-alt); color: var(--muted); }

/* API & Keys layout */
.api-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.surface-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

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

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink);
}

.form-feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  display: none;
}

.form-feedback.visible {
  display: block;
}

.endpoint-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.endpoint-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: var(--text-sm);
}

.endpoint-list li:last-child {
  border-bottom: none;
}

.endpoint-list code,
.ltr-field {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.code-block {
  background: #0B1F33;
  color: #E2E8F0;
  padding: 14px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 10px 0 0;
}

/* Redesigned Business Detail Modal + 5-Logo Action Dock */
dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 600px;
  width: 92%;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 56px rgba(11, 31, 51, 0.25);
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(11, 31, 51, 0.54);
  backdrop-filter: blur(3px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.modal-header-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.modal-emblem {
  flex-shrink: 0;
}

.modal-title-group {
  min-width: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.modal-subtitle {
  margin: 3px 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}

.modal-close-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.modal-close-btn:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 20px;
}

.modal-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-cuisine-text {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.modal-logo-dock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.dock-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.dock-tile:hover {
  border-color: var(--accent);
  background: var(--bg);
  transform: translateY(-2px);
}

.dock-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
}

.dock-icon-waze {
  background: #E0F7FE;
}

.dock-icon-gmaps {
  background: #E8F0FE;
}

.dock-icon-greviews {
  background: #FEF9C3;
}

.dock-icon-phone {
  background: var(--accent-soft);
  color: var(--accent);
}

.dock-icon-photo {
  background: var(--photo-soft);
  color: var(--photo);
}

.modal-cert-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
}

.modal-cert-heading {
  margin: 0 0 12px;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
}

.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
}

.modal-info-label {
  color: var(--muted);
}

.modal-info-val {
  color: var(--ink);
  font-weight: 700;
}

.modal-photo,
.popup-thumb {
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 12px 0 4px;
}

.modal-photo { max-height: 340px; }
.popup-thumb { max-height: 130px; }

.modal-sources-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.modal-sources-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: var(--text-sm);
}

.modal-sources-list a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.modal-sources-list a:hover {
  text-decoration: underline;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.report-flag-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.report-flag-link:hover {
  color: var(--danger);
}

.community-form-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.community-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.community-preview-img {
  margin-top: 8px;
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.revocation-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--danger);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: var(--text-sm);
}

/* Cartographic Popup Mini-Card */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(11, 31, 51, 0.2);
  border: 1px solid var(--border);
  padding: 0;
}

.leaflet-popup-content {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  direction: rtl;
  text-align: right;
  min-width: 235px;
  max-width: 280px;
  margin: 12px 14px;
}

.popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.popup-seal-sm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.popup-seal-sm img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.map-popup-title {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.map-popup-addr {
  margin: 2px 0 0;
  color: var(--muted);
}

.popup-links {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.popup-primary-btn {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.popup-primary-btn:hover {
  background: var(--accent-hover);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 14px 20px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.footer-inner {
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

/* Mobile responsiveness */
@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: 1fr;
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-lockup {
    justify-content: space-between;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .nav-bar {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }

  .nav-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 4px;
    font-size: var(--text-sm);
  }

  .category-ribbon-bar {
    padding: 2px 10px 0;
  }

  .quick-chip {
    min-width: 58px;
    padding: 5px 8px 6px;
  }

  .page-shell {
    padding: 14px 14px 28px;
  }

  .filter-strip,
  .kpi-strip,
  .modal-info-grid,
  .community-grid-2,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .kpi-strip {
    gap: 12px;
  }

  .map-floating-controls {
    top: 10px;
    right: 10px;
  }

  .map-layers-wrap {
    top: 10px;
    left: 10px;
  }

  .map-legend {
    display: none;
  }

  .mobile-view-switch {
    display: flex;
    gap: 4px;
    background: var(--surface-alt);
    padding: 4px;
    margin: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }

  .mobile-pane-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 7px;
    cursor: pointer;
  }

  .mobile-pane-btn.active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(11, 31, 51, 0.08);
  }

  .split-workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .map-pane,
  .list-pane {
    display: none;
    border-right: none;
  }

  .split-workspace[data-mobile-view="map"] .map-pane {
    display: block;
    height: 64vh;
    min-height: 430px;
  }

  .split-workspace[data-mobile-view="list"] .list-pane {
    display: flex;
    max-height: 74vh;
  }

  #mapContainer {
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
