@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;600&display=swap');

:root {
  --ink: #1a1a1a;
  --muted: #666;
  --paper: #fff;
  --panel: #fafafa;
  --accent: #000;
  --accent-soft: #e5e5e5;
  --highlight: #000;
  --line: rgba(0, 0, 0, 0.1);
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 4px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --asset-check: loaded;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-y: scroll;
}

body.app {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  min-height: 100vh;
  height: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================================================
   LANDING PAGE
   ===================================================== */

.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px clamp(16px, 5vw, 64px);
}

.landing-header {
  text-align: center;
  margin-bottom: 16px;
}

.landing-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.landing-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}
.landing-intro {
  max-width: 36rem;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 820px;
  width: 100%;
}

@media (max-width: 640px) {
  .landing-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 36px 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
}

.landing-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.landing-card-icon {
  margin-bottom: 24px;
  opacity: 0.7;
}

.landing-card:hover .landing-card-icon {
  opacity: 1;
}

.landing-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.landing-card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.landing-card-count {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}

.landing-card-arrow {
  position: absolute;
  bottom: 16px;
  right: 20px;
  font-size: 1.25rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  color: var(--muted);
}

.landing-card:hover .landing-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.landing-footer {
  margin-top: 64px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.landing-footer a {
  color: var(--muted);
  text-decoration: none;
}

.landing-footer a:hover {
  color: var(--ink);
}

.landing-cards-single {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin: 24px auto 0;
}

/* Showcase Page */
.showcase-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.showcase-header {
  margin-bottom: 40px;
}

.showcase-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.showcase-back:hover {
  color: var(--ink);
}

.showcase-section {
  margin-bottom: 64px;
}

.showcase-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.showcase-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 640px;
}

.showcase-map {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.showcase-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 24px 0 10px;
}

.showcase-subtitle:first-of-type {
  margin-top: 0;
}

.showcase-map {
  margin-bottom: 24px;
}

.showcase-map iframe {
  width: 100%;
  height: 640px;
  border: none;
  display: block;
}

.showcase-footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.showcase-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.showcase-footer a:hover {
  color: var(--ink);
}

/* =====================================================
   UNIFIED PAGE SHELL - Public Views
   ===================================================== */

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px clamp(16px, 4vw, 48px) 48px;
  min-height: 100vh;
}

/* Embed mode: remove header and nav, prevent overflow */
html:has(.embed-mode) {
  overflow-y: hidden;
}

.embed-mode {
  overflow: hidden;
}

.embed-mode .page-header,
.embed-mode .view-tabs {
  display: none;
}

.embed-mode .page-shell {
  padding: 8px 16px 0;
  min-height: auto;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.embed-mode .content-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.embed-mode .view-list .content-area {
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.embed-mode .split-container,
.embed-mode .map-container-full {
  flex: 1;
  min-height: 0;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: #000;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 0;
}

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

/* Header Logo */
.header-logo {
  flex-shrink: 0;
}

.header-logo-candle {
  position: relative;
}

.header-flame-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.header-flame {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 18px;
  z-index: 1;
  pointer-events: none;
  animation: header-flame-glow 1.275s ease-in-out infinite alternate;
}

@keyframes header-flame-glow {
  0%   { opacity: 0.9;  transform: translateX(-50%) scale(1) translateY(0); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 5px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 7px rgba(255, 180, 40, 0.63)); }
  25%  { opacity: 1;    transform: translateX(-50%) scale(1.06) translateY(-0.8px); filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)) drop-shadow(0 0 8px rgba(255, 230, 100, 0.9)) drop-shadow(0 0 10px rgba(255, 180, 40, 0.9)); }
  50%  { opacity: 0.9;  transform: translateX(-50%) scale(0.94) translateY(0.6px); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 4px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 6px rgba(255, 180, 40, 0.585)); }
  75%  { opacity: 1;    transform: translateX(-50%) scale(1.04) translateY(-0.5px); filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)) drop-shadow(0 0 7px rgba(255, 225, 90, 0.9)) drop-shadow(0 0 9px rgba(255, 180, 40, 0.9)); }
  100% { opacity: 0.9;  transform: translateX(-50%) scale(1) translateY(0); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 5px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 7px rgba(255, 180, 40, 0.63)); }
}

.header-logo-star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.header-logo-star svg {
  width: 28px;
  height: 28px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-text h1 {
  font-family: var(--sans);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  margin: 0;
  color: #fff;
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.header-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.header-nav-link.active {
  background: rgba(218, 165, 32, 0.2);
  border-color: goldenrod;
  color: #fff;
}

.brand-tagline {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* View Navigation Tabs */
.view-tabs {
  display: flex;
  background: var(--panel);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--line);
  border-top: none;
  overflow: hidden;
  margin-bottom: 20px;
}

.view-tabs .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  position: relative;
}

.view-tabs .tab:last-child {
  border-right: none;
}

.view-tabs .tab:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink);
}

.view-tabs .tab.active {
  color: #000;
  font-weight: 600;
  box-shadow: inset 0 -3px 0 0 #000;
}

.view-tabs .tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Public Filter Bar */
.filter-bar-public {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar-public .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-bar-public select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  min-width: 140px;
  font-family: inherit;
}

.filter-bar-public .filter-search {
  margin-left: auto;
}

.filter-bar-public .filter-search input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  width: 160px;
  font-family: inherit;
}

.filter-bar-public .filter-search input::placeholder,
.filter-bar-public .location-input-wrapper input::placeholder {
  color: var(--muted);
}

/* Location Filter */
.filter-bar-public .filter-location {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.filter-bar-public .location-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-bar-public .location-input-wrapper input {
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  width: 175px;
  font-family: inherit;
}

.filter-bar-public .location-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.filter-bar-public .location-clear:hover {
  background: rgba(0, 0, 0, 0.15);
  color: var(--ink);
}

.filter-bar-public .filter-location select {
  min-width: 70px;
}

.clear-filters-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.clear-filters-btn:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

/* Content Area */
.content-area {
  animation: fade-up 0.4s ease both;
}

/* =====================================================
   LIST VIEW - Card Grid
   ===================================================== */

.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}

.place-card {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.place-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(218, 165, 32, 0.4);
}

.card-photo {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f0f0;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.place-card:not(:has(.card-photo)) .card-content {
  padding-top: 24px;
}

/* Cards without photos: add a subtle top accent */
.place-card:not(:has(.card-photo))::before {
  content: '';
  display: block;
  height: 3px;
  background: #000;
  opacity: 0.08;
}

.card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-title {
  flex: 1;
  min-width: 0;
}

.card-header h2 {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-header p.muted {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: #000;
  background: #f0f0f0;
  border-radius: 50%;
}

.description {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

.address-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex: 0 1 auto;
  min-width: 0;
}
.address-link:hover { color: #000; border-color: var(--accent-soft); }
.address-link svg { flex-shrink: 0; width: 12px; height: 12px; }
.address-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recommendation callout */
.recommendation-callout {
  border: 1px solid #f5f1ec;
  border-left: 3px solid #f5f1ec;
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fffefa;
}

.rec-heading {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.rec-attribution {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: var(--muted);
  font-size: 0.85rem;
}

.rec-by-name {
  font-family: 'Dancing Script', cursive;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.rec-quote {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  font-style: italic;
}

.card-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.card-links .link-btn {
  font-size: 0.72rem;
  padding: 6px 10px;
}

/* =====================================================
   LINK BUTTONS
   ===================================================== */

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  background: transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.link-btn:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

.link-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.link-btn-icon {
  padding: 7px;
}

.link-btn-icon:hover svg {
  color: #fff;
}

/* =====================================================
   SPLIT VIEW - Compact Cards + Map
   ===================================================== */

.split-container {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 16px;
  height: calc(100vh - 340px);
  min-height: 400px;
}

.split-list {
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.split-list::-webkit-scrollbar {
  width: 8px;
}

.split-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}

.split-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  min-height: 48px;
}

.split-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar styling */
.split-list {
  scrollbar-width: auto;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.04);
}

.split-map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f5f5f5;
}

.split-map #map {
  width: 100%;
  height: 100%;
}

/* Compact Card */
.compact-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: visible;
  transition: box-shadow 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.compact-card:hover {
  border-color: rgba(218, 165, 32, 0.4);
}

.compact-card.highlighted {
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.type-stockist .compact-card.expanded {
  background: #fffefa;
  border-color: rgba(218, 165, 32, 0.5);
  box-shadow: 0 0 0 1px rgba(218, 165, 32, 0.3), 0 2px 12px rgba(218, 165, 32, 0.2);
  border-left: 3px solid goldenrod;
}
.type-recommendation .compact-card.expanded {
  background: #fffefa;
  border-color: rgba(218, 165, 32, 0.5);
  box-shadow: 0 0 0 1px rgba(218, 165, 32, 0.3), 0 2px 12px rgba(218, 165, 32, 0.2);
  border-left: 3px solid goldenrod;
}

.compact-card[data-no-coords] {
  opacity: 0.5;
}

.compact-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 56px;
}

.compact-card-main:hover {
  background: rgba(0, 0, 0, 0.02);
}

.compact-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.compact-logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #000;
  border-radius: 50%;
}

.compact-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.compact-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

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

.compact-location.same-line::before {
  content: '\00B7';
  margin-right: 6px;
  color: var(--muted);
}

.compact-desc {
  font-size: 0.78rem;
  color: var(--ink);
  margin: 4px 0 0;
  line-height: 1.4;
  width: 100%;
}

.expand-btn {
  background: none;
  border: none;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, transform 0.2s;
  flex-shrink: 0;
}

.expand-btn:hover {
  color: #000;
}

.compact-card.expanded .expand-btn {
  transform: rotate(180deg);
}

.compact-card-expanded {
  display: none;
  border-top: 1px solid var(--line);
}

.compact-card.expanded .compact-card-expanded {
  display: block;
}

.expanded-photo {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f0f0;
}

.expanded-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.expanded-content {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expanded-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.expanded-links .link-btn {
  font-size: 0.7rem;
  padding: 5px 8px;
}

/* Split view adjustments */
.split-list .expanded-photo {
  display: none;
}

.split-list .recommendation-callout {
  font-size: 0.82rem;
}

.split-list .rec-heading {
  font-size: 0.62rem;
}

.split-list .rec-by-name {
  font-size: 1rem;
}

/* =====================================================
   FULL MAP VIEW
   ===================================================== */

.view-map .content-area {
  flex: 1;
}

.map-container-full {
  height: calc(100vh - 300px);
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.embed-mode .map-container-full {
  border-radius: 0;
  border: none;
}

.embed-mode .split-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
}

.map-container-full #map {
  width: 100%;
  height: 100%;
}

/* Leaflet attribution — muted, no color */
.leaflet-control-attribution {
  color: #999 !important;
  opacity: 0.7;
}

.leaflet-control-attribution a {
  color: #999 !important;
}

.leaflet-control-attribution .leaflet-attribution-flag {
  filter: grayscale(1) opacity(0.5);
}

/* =====================================================
   MAP MARKERS
   ===================================================== */

.leaflet-marker-icon.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.25s;
  overflow: hidden;
}

.marker-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.leaflet-marker-icon.custom-marker.marker-fading {
  opacity: 0;
  transition: opacity 0.25s !important;
}

.marker-stockist {
  background: #000;
  border: 2px solid #fff;
}

.marker-recommendation {
  background: #444;
  border: 2px solid #fff;
  transition: box-shadow 0.2s ease-out;
}

.custom-marker.highlighted {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 999 !important;
}

.custom-marker.active {
  transform: scale(1.25);
  z-index: 999 !important;
}
.type-stockist .custom-marker.active {
  overflow: visible;
}
.type-recommendation .custom-marker.active {
  box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.6), 0 0 12px 4px rgba(218, 165, 32, 0.3);
}

/* Hover state — z-index lift + type-specific effects */
.custom-marker.hovered {
  z-index: 900 !important;
}
.marker-stockist.hovered {
  overflow: visible;
}

/* Hover flame — quick entrance then settle into glow loop */
.marker-flame.flame-enter {
  animation: flame-enter 0.25s ease-out forwards;
}
@keyframes flame-enter {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.3) translateY(3px); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

/* Recommendation hover glow */
.marker-recommendation.hovered {
  box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.45), 0 0 10px 3px rgba(218, 165, 32, 0.2);
  transition: box-shadow 0.2s ease-out;
}

/* Flame SVG injected into active stockist markers */
.marker-flame {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 10px;
  z-index: 1;
  pointer-events: none;
  animation: marker-flame-glow 1.275s ease-in-out infinite alternate;
}

@keyframes marker-flame-glow {
  0%   { opacity: 0.9;  transform: translateX(-50%) scale(1) translateY(0); filter: drop-shadow(0 0 2px rgba(255,255,255,0.9)) drop-shadow(0 0 4px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 5px rgba(255, 180, 40, 0.63)); }
  25%  { opacity: 1;    transform: translateX(-50%) scale(1.04) translateY(-0.5px); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 6px rgba(255, 230, 100, 0.9)) drop-shadow(0 0 7px rgba(255, 180, 40, 0.9)); }
  50%  { opacity: 0.9;  transform: translateX(-50%) scale(0.95) translateY(0.5px); filter: drop-shadow(0 0 2px rgba(255,255,255,0.9)) drop-shadow(0 0 3px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 4px rgba(255, 180, 40, 0.585)); }
  75%  { opacity: 1;    transform: translateX(-50%) scale(1.03) translateY(-0.4px); filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 5px rgba(255, 225, 90, 0.9)) drop-shadow(0 0 6px rgba(255, 180, 40, 0.9)); }
  100% { opacity: 0.9;  transform: translateX(-50%) scale(1) translateY(0); filter: drop-shadow(0 0 2px rgba(255,255,255,0.9)) drop-shadow(0 0 4px rgba(255, 220, 80, 0.9)) drop-shadow(0 0 5px rgba(255, 180, 40, 0.63)); }
}

.marker-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.marker-initial {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.marker-icon {
  width: 20px;
  height: 20px;
}

.marker-type-icon {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.place-tooltip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =====================================================
   MODAL
   ===================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.modal .modal-type-icon {
  display: none;
}

.modal-body {
  display: flex;
  flex-direction: column;
}

.modal-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f0f0;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.modal-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-location {
  font-size: 0.85rem;
  white-space: nowrap;
}

.modal-address {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -4px 0 0;
}

.modal-description {
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
}

.modal-recommendation {
  border: 1px solid #f5f1ec;
  border-left: 3px solid #f5f1ec;
  padding: 10px 14px;
  background: #fffefa;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.modal-recommendation .rec-heading {
  font-size: 0.65rem;
}

.modal-recommendation .rec-by-name {
  font-size: 1.3rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding-top: 4px;
}

/* =====================================================
   ADMIN LAYOUT
   ===================================================== */

body.admin {
  font-family: var(--sans);
  color: var(--ink);
  background: #f5f5f5;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 48px);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #000;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.admin-brand-mark {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.admin-brand span {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 4px;
}

.admin-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.01em;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.admin-nav a.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.admin-main {
  min-height: 50vh;
}

/* Flash / Alert messages */
.flash, .alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.flash-success, .alert.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-error, .alert.error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.flash-warning, .alert.warning { background: #fff3e0; color: #ef6c00; border: 1px solid #ffe0b2; }

/* Dashboard */
.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.dash-sync-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.dash-sync-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 3px;
}

.dash-sync-status.is-success { background: #e8f5e9; color: #2e7d32; }
.dash-sync-status.is-error { background: #fce4ec; color: #c62828; }

.dash-sync-msg {
  color: var(--ink);
}

/* Batch progress indicator */
.batch-progress {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 24px;
}
.batch-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.batch-progress-label { font-weight: 600; }
.batch-progress-count { color: var(--muted); }
.batch-progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.batch-progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.batch-progress-detail {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Admin Panel */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn:hover {
  background: #f5f5f5;
}

.btn.primary {
  background: #000;
  color: #fff;
  border-color: #000;
}

.btn.primary:hover {
  background: #222;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: #999;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn.tiny {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn.danger {
  color: #c62828;
  border-color: #ef9a9a;
}

.btn.danger:hover {
  background: #fce4ec;
}

/* Status pills */
.pill {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.published { background: #e8f5e9; color: #2e7d32; }
.pill.draft { background: #f5f5f5; color: #666; }
.pill.hidden { background: #fce4ec; color: #c62828; }
.pill.warning { background: #fff3e0; color: #ef6c00; }

/* Admin tables */
.admin-table,
.places-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.places-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.admin-table td,
.places-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover td,
.places-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table column widths */
.col-select { width: 36px; text-align: center; }
.col-name { min-width: 180px; }
.col-location { min-width: 120px; }
.col-type { width: 100px; }
.col-status { width: 100px; }
.col-flags { width: 120px; }
.col-actions { width: 70px; text-align: right; }

.place-checkbox { accent-color: #000; }

.place-name {
  font-weight: 500;
}

.muted { color: var(--muted); }
.tiny { font-size: 0.75rem; }

/* Admin forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form label > span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.form input[type="text"],
.form input[type="url"],
.form input[type="email"],
.form input[type="number"],
.form select,
.form textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.form-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.grid-form { gap: 12px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.wide { grid-column: 1 / -1; }
.half { grid-column: span 2; }

.display-field {
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: monospace;
  color: var(--muted);
  min-height: 36px;
}

.status-toggles {
  display: flex;
  gap: 20px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  accent-color: #000;
}

.media-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.actions {
  padding-top: 16px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
}

/* Admin filter bar */
.admin-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card-link:hover {
  border-color: #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #000;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

.stat-detail {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Google Places Lookup */
.lookup-section {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  background: #f9f9f9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.lookup-section label {
  flex: 1;
}

.lookup-results {
  display: none;
  margin-top: 8px;
}

.lookup-results.visible {
  display: block;
}

.lookup-result-item {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.lookup-result-item:hover {
  background: #f5f5f5;
}

.result-name {
  font-weight: 500;
}

.result-address {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Media preview */
.media-panel {
  margin-top: -8px;
}

.media-preview {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.media-preview img {
  max-height: 180px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.media-preview .logo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.media-preview .placeholder {
  width: 180px;
  height: 120px;
  background: #f5f5f5;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline;
}

/* Sortable columns */
.sortable a {
  text-decoration: none;
  color: inherit;
}

.sortable a:hover {
  color: #000;
}

/* Dashboard sections */
.dashboard-section {
  margin-bottom: 24px;
}

.dashboard-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}

.dashboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Login */
.login-panel {
  max-width: 380px;
  margin: 10vh auto 0;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.login-panel .form input {
  width: 100%;
}

.login-panel .form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Selection count */
.selection-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* Bulk actions bar */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.bulk-actions select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: inherit;
}

/* =====================================================
   VIEW VARIANTS
   ===================================================== */

/* View-specific page-shell adjustments */
.view-list { }
.view-split { }

.view-404 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.error-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-message {
  text-align: center;
  padding: 48px 24px;
}

.error-message h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.error-message p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 24px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Type icon badges */
.type-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.type-icon {
  display: inline-block;
  vertical-align: middle;
}

.type-stockist { color: var(--ink); }
.type-recommendation { color: var(--ink); }

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-container {
    grid-template-columns: 1fr;
    grid-template-rows: 35% 65%;
    height: calc(100vh - 300px);
    min-height: 500px;
  }

  .split-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    overflow-y: auto;
  }

  .split-map {
    height: 100%;
    min-height: 250px;
  }

  .embed-mode .split-container {
    height: auto;
    min-height: 0;
  }

  .form-row-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 16px;
  }

  .page-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
  }

  .header-nav-link {
    font-size: 0.85rem;
    padding: 5px 12px;
  }

  .filter-bar-public {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
  }

  /* Row 1: State + Location + Radius — all on one line */
  .filter-bar-public .filter-group:first-child {
    flex: 0 0 auto;
  }

  .filter-bar-public .filter-group:first-child select {
    min-width: unset;
    width: auto;
    padding: 6px 24px 6px 8px;
  }

  .filter-bar-public .filter-location {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0;
    border-left: none;
  }

  .filter-bar-public .location-input-wrapper {
    flex: 1 1 0;
    min-width: 0;
  }

  .filter-bar-public .location-input-wrapper input {
    width: 100%;
    min-width: 0;
    padding: 6px 24px 6px 8px;
    font-size: 0.8rem;
  }

  .filter-bar-public .filter-location select {
    min-width: unset;
    width: auto;
    padding: 6px 22px 6px 6px;
    font-size: 0.8rem;
  }

  /* Row 2: Search — full width */
  .filter-bar-public .filter-search {
    flex: 1 0 100%;
    margin-left: 0;
    order: 1;
  }

  .filter-bar-public .filter-search input {
    width: 100%;
    min-width: unset;
    padding: 6px 10px;
  }

  .modal-card {
    width: 95%;
    max-height: 90vh;
  }

  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .media-uploads {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .admin-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   TILE CACHE ADMIN
   ===================================================== */

.admin-section {
  max-width: 800px;
}

.admin-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.section-desc {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.9rem;
}

.tc-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tc-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  flex: 1;
  min-width: 100px;
}

.tc-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.tc-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tc-settings,
.tc-actions {
  margin-bottom: 32px;
}

.tc-settings h3,
.tc-actions h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tc-range-row {
  margin-bottom: 20px;
}

.tc-range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tc-range-header label {
  font-size: 0.9rem;
  font-weight: 500;
}

.tc-range-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.tc-range-row input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--accent-soft);
  border-radius: 3px;
  outline: none;
}

.tc-range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

.tc-range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: none;
}

.tc-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 0;
}

.tc-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.tc-toggle-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.tc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.tc-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.tc-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent-soft);
  border-radius: 24px;
  transition: background-color 0.2s;
}

.tc-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.tc-toggle-switch input:checked + .tc-toggle-slider {
  background-color: var(--ink);
}

.tc-toggle-switch input:checked + .tc-toggle-slider::before {
  transform: translateX(20px);
}

.tc-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tc-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.tc-result-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.tc-result-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.tc-progress {
  margin-top: 12px;
}

.tc-progress-bar {
  height: 6px;
  background: var(--accent-soft);
  border-radius: 3px;
  overflow: hidden;
}

.tc-progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.tc-progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Confirmation modal */
.tc-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.tc-modal-overlay.active {
  display: flex;
}

.tc-modal-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.tc-modal-box h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  border: none;
  padding: 0;
}

.tc-modal-box p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tc-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.btn-primary:hover {
  background: #333;
}

.btn-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

@media (max-width: 640px) {
  .tc-stats {
    flex-wrap: wrap;
  }

  .tc-stat-card {
    min-width: 80px;
    flex: 1 1 calc(33% - 8px);
  }

  .tc-action-buttons {
    flex-direction: column;
  }
}
