/* ═══════════════════════════════════════════════════════════════════════════
   CINNAMON GUIDE — Thailand Coffee Intelligence
   Premium Dark Theme CSS with Glassmorphism
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─── */
:root {
  --bg-deep: #0c0a09;
  --bg-surface: rgba(28, 25, 23, 0.85);
  --bg-surface-solid: #1c1917;
  --bg-elevated: rgba(41, 37, 36, 0.75);
  --bg-hover: rgba(68, 64, 60, 0.4);

  --accent-primary: #d4a574;
  --accent-primary-dim: rgba(212, 165, 116, 0.15);
  --accent-secondary: #a3e635;
  --accent-secondary-dim: rgba(163, 230, 53, 0.12);
  --accent-gradient: linear-gradient(135deg, #d4a574, #c2410c);
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-green: #22c55e;

  --text-primary: #faf5ef;
  --text-secondary: #a8a29e;
  --text-muted: #78716c;

  --border-subtle: rgba(168, 162, 158, 0.15);
  --border-medium: rgba(168, 162, 158, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(212, 165, 116, 0.15);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 60px;
  --filter-w: 300px;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family);
  background: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection styling */
::selection {
  background: rgba(212, 165, 116, 0.3);
  color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 162, 158, 0.25);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 162, 158, 0.4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(12, 10, 9, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
}

/* Logo group */
.header-left {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Ecosystem nav link */
.eco-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.eco-nav-link:hover {
  color: var(--accent-secondary);
  border-color: rgba(163, 230, 53, 0.4);
  background: rgba(163, 230, 53, 0.08);
}

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

.logo-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(212, 165, 116, 0.4));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* City toggle */
.header-center {
  flex: 0 0 auto;
}

.city-toggle {
  position: relative;
  display: flex;
  background: rgba(28, 25, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.city-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-base);
  white-space: nowrap;
}

.city-btn:hover {
  color: var(--text-primary);
}

.city-btn.active {
  color: var(--bg-deep);
}

.city-btn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition-base);
}

.city-btn.active .city-btn-dot {
  background: var(--bg-deep);
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.city-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  width: calc(50% - 4px);
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-spring);
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.city-toggle-indicator.right {
  transform: translateX(calc(100% + 2px));
}

/* Header right */
.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

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

.filter-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: var(--bg-deep);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-family);
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-spring);
}

.filter-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.shop-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.shop-count-number {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-secondary);
  font-variant-numeric: tabular-nums;
}

.shop-count-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.app-main {
  display: flex;
  height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
}


/* ═══════════════════════════════════════════════════════════════════════════
   FILTER PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.filter-panel {
  width: var(--filter-w);
  min-width: var(--filter-w);
  height: 100%;
  overflow-y: auto;
  background: rgba(12, 10, 9, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform var(--transition-spring), opacity var(--transition-base);
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
}

.filter-panel-title svg {
  color: var(--accent-primary);
}

.filter-reset-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-reset-btn:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.08);
}

/* Filter sections */
.filter-sections {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group {
  padding: 14px 0;
  border-bottom: 1px solid rgba(168, 162, 158, 0.08);
  opacity: 0;
  transform: translateY(8px);
  animation: filterSlideIn 0.4s ease forwards;
}

.filter-group[data-delay="0"] { animation-delay: 0.05s; }
.filter-group[data-delay="1"] { animation-delay: 0.1s; }
.filter-group[data-delay="2"] { animation-delay: 0.15s; }
.filter-group[data-delay="3"] { animation-delay: 0.2s; }
.filter-group[data-delay="4"] { animation-delay: 0.25s; }
.filter-group[data-delay="5"] { animation-delay: 0.3s; }
.filter-group[data-delay="6"] { animation-delay: 0.35s; }

@keyframes filterSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-primary);
  margin-bottom: 10px;
}

/* Checkboxes */
.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.filter-checkbox:hover {
  background: var(--bg-hover);
}

.filter-checkbox input {
  display: none;
}

.filter-checkbox-mark {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-medium);
  background: transparent;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.filter-checkbox-mark::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 7px;
  border: solid var(--bg-deep);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition-spring);
}

.filter-checkbox input:checked ~ .filter-checkbox-mark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.filter-checkbox input:checked ~ .filter-checkbox-mark::after {
  transform: rotate(45deg) scale(1);
}

.filter-checkbox-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.filter-checkbox input:checked ~ .filter-checkbox-label {
  color: var(--text-primary);
}

/* Toggle switches */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 0;
}

.filter-toggle input {
  display: none;
}

.filter-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(120, 113, 108, 0.3);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.filter-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-spring);
}

.filter-toggle input:checked ~ .filter-toggle-track {
  background: var(--accent-primary-dim);
  border-color: var(--accent-primary);
}

.filter-toggle input:checked ~ .filter-toggle-track .filter-toggle-thumb {
  transform: translateX(18px);
  background: var(--accent-primary);
  box-shadow: 0 0 8px rgba(212, 165, 116, 0.4);
}

.filter-toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.filter-toggle input:checked ~ .filter-toggle-label {
  color: var(--text-primary);
}

/* Range slider */
.filter-slider-container {
  padding: 4px 0;
}

.filter-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(120, 113, 108, 0.25);
  outline: none;
  cursor: pointer;
}

.filter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(212, 165, 116, 0.3), 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.filter-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.filter-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(212, 165, 116, 0.3), 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

.filter-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.filter-slider-labels span:nth-child(2) {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MAP
   ═══════════════════════════════════════════════════════════════════════════ */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

/* Override Leaflet controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-surface-solid) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 16px !important;
  transition: all var(--transition-fast) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
}

.leaflet-control-attribution {
  background: rgba(12, 10, 9, 0.7) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* Custom map markers */
.coffee-marker {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.coffee-marker-inner {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  transition: all var(--transition-fast);
  animation: markerAppear 0.4s var(--transition-spring) backwards;
}

.coffee-marker:hover .coffee-marker-inner {
  transform: rotate(-45deg) scale(1.15);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), var(--shadow-glow);
}

.coffee-marker-score {
  transform: rotate(45deg);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-family);
  color: var(--bg-deep);
  line-height: 1;
}

.coffee-marker.score-high .coffee-marker-inner {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.coffee-marker.score-mid .coffee-marker-inner {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.coffee-marker.score-low .coffee-marker-inner {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.coffee-marker.filtered-out {
  opacity: 0.15;
  pointer-events: none;
}

.coffee-marker.filtered-out .coffee-marker-inner {
  filter: grayscale(1);
}

@keyframes markerAppear {
  from {
    opacity: 0;
    transform: rotate(-45deg) scale(0.3);
  }
}

/* Unverified markers: smaller, gray/muted */
.marker-unverified .coffee-marker-inner {
  background: rgba(120, 113, 108, 0.6);
  border: 1px solid rgba(168, 162, 158, 0.3);
  width: 24px;
  height: 24px;
}
.marker-unverified .coffee-marker-score {
  font-size: 10px;
  color: #a8a29e;
}
.marker-unverified:hover .coffee-marker-inner {
  background: rgba(120, 113, 108, 0.8);
}

/* Chain markers: smaller, muted blue-teal */
.marker-chain .coffee-marker-inner {
  background: rgba(100, 116, 139, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  width: 24px;
  height: 24px;
}
.marker-chain .coffee-marker-score {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}
.marker-chain:hover .coffee-marker-inner {
  background: rgba(100, 116, 139, 0.8);
}

/* Filter type toggles container */
.filter-type-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Marker name tooltip */
.coffee-marker-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 5px 10px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-family);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.coffee-marker:hover .coffee-marker-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.coffee-marker-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-surface-solid);
}

/* Cluster markers */
.marker-cluster {
  background: transparent !important;
}

.marker-cluster div {
  width: 40px !important;
  height: 40px !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  border-radius: 50% !important;
  background: rgba(212, 165, 116, 0.2) !important;
  border: 2px solid var(--accent-primary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--accent-primary) !important;
  font-family: var(--font-family) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.2);
}

.marker-cluster-small div {
  background: rgba(212, 165, 116, 0.15) !important;
}
.marker-cluster-medium div {
  background: rgba(212, 165, 116, 0.22) !important;
}
.marker-cluster-large div {
  background: rgba(212, 165, 116, 0.3) !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   DETAIL PANEL (Bottom Sheet)
   ═══════════════════════════════════════════════════════════════════════════ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.detail-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.detail-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  z-index: 2000;
  background: rgba(18, 16, 14, 0.96);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border-top: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-panel.open {
  transform: translateY(0);
}

.detail-panel-handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(168, 162, 158, 0.3);
  margin: 12px auto 0;
}

.detail-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.detail-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: rotate(90deg);
}

.detail-content {
  padding: 20px 28px 32px;
}

/* Detail header */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-shop-info {
  flex: 1;
  min-width: 0;
}

.detail-shop-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.detail-shop-district {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.detail-shop-district svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
}

.detail-shop-instagram {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.detail-shop-instagram:hover {
  background: rgba(212, 165, 116, 0.25);
}

/* Meta score circle */
.meta-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.meta-score-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: var(--score-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.meta-score-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.meta-score-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
}

.meta-score-circle.score-high {
  --score-gradient: linear-gradient(135deg, #22c55e, #16a34a);
}
.meta-score-circle.score-high .meta-score-value { color: #22c55e; }

.meta-score-circle.score-mid {
  --score-gradient: linear-gradient(135deg, #f59e0b, #d97706);
}
.meta-score-circle.score-mid .meta-score-value { color: #f59e0b; }

.meta-score-circle.score-low {
  --score-gradient: linear-gradient(135deg, #ef4444, #dc2626);
}
.meta-score-circle.score-low .meta-score-value { color: #ef4444; }

/* Source info */
.meta-source-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-shrink: 0;
}

.meta-verified {
  font-size: 11px;
  color: var(--text-muted);
}

.meta-verified strong {
  color: var(--text-secondary);
}

.meta-completeness {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-completeness-bar {
  width: 60px;
  height: 3px;
  border-radius: var(--radius-full);
  background: rgba(120, 113, 108, 0.2);
  overflow: hidden;
}

.meta-completeness-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  transition: width 0.8s ease;
}

.meta-completeness-label {
  font-size: 10px;
  color: var(--text-muted);
}

/* Detail body grid */
.detail-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
}

/* Radar chart container */
.detail-radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-radar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.detail-radar-canvas-wrap {
  width: 240px;
  height: 240px;
  position: relative;
}

.detail-radar-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Detail sections */
.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-section {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.detail-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tags */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(28, 25, 23, 0.6);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.detail-tag:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.detail-tag.accent {
  background: var(--accent-primary-dim);
  border-color: rgba(212, 165, 116, 0.3);
  color: var(--accent-primary);
}

.detail-tag.green {
  background: var(--accent-secondary-dim);
  border-color: rgba(163, 230, 53, 0.2);
  color: var(--accent-secondary);
}

/* Hardware grid */
.hardware-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hardware-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hardware-item-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.hardware-item-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Roast spectrum bar */
.roast-bar-container {
  margin-bottom: 12px;
}

.roast-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.roast-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, #fde68a, #d4a574, #92400e, #451a03);
  position: relative;
  overflow: visible;
}

.roast-bar-indicator {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  transition: left 0.6s ease;
}

/* Flavor vectors */
.flavor-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flavor-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flavor-bar-name {
  font-size: 11px;
  color: var(--text-secondary);
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.flavor-bar-track {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(120, 113, 108, 0.15);
  overflow: hidden;
}

.flavor-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.flavor-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  width: 32px;
  font-variant-numeric: tabular-nums;
}

/* Space section icons */
.space-features {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.space-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.space-feature.active {
  color: var(--accent-secondary);
}

.space-feature svg {
  width: 16px;
  height: 16px;
}

/* Work-friendly meter */
.work-meter-container {
  margin-top: 8px;
}

.work-meter-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.work-meter {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(120, 113, 108, 0.15);
  overflow: hidden;
}

.work-meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--accent-secondary), #65a30d);
  transition: width 0.8s ease;
}

/* Supply chain */
.supply-chain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Award tags */
.award-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.award-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.2);
  font-size: 11px;
  font-weight: 500;
  color: #fbbf24;
}

.award-tag::before {
  content: '🏆';
  font-size: 10px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .filter-panel {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 1200;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .filter-panel.open {
    transform: translateX(0);
  }

  .filter-toggle-btn {
    display: flex;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-radar-canvas-wrap {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .detail-header {
    flex-wrap: wrap;
  }

  .hardware-grid,
  .supply-chain-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 52px;
  }

  .logo-subtitle {
    display: none;
  }

  .logo-title {
    font-size: 14px;
  }

  .city-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .city-btn-dot {
    display: none;
  }

  .shop-count-label {
    display: none;
  }

  .detail-content {
    padding: 16px 16px 24px;
  }

  .detail-shop-name {
    font-size: 20px;
  }

  .detail-panel {
    max-height: 80vh;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212, 165, 116, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   AUTH — 로그인 버튼 / 아바타 / 드롭다운 / Admin 버튼
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

/* Sign in 버튼 */
.auth-login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(212, 165, 116, 0.1);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}
.auth-login-btn:hover {
  background: rgba(212, 165, 116, 0.2);
  border-color: rgba(212, 165, 116, 0.5);
  transform: translateY(-1px);
}

/* 로그인 상태 영역 */
.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Admin 버튼 */
.auth-admin-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-family);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(194, 65, 12, 0.35);
}
.auth-admin-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.5);
}

/* 아바타 + 드롭다운 */
.auth-avatar-wrap {
  position: relative;
  cursor: pointer;
}
.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(212, 165, 116, 0.4);
  object-fit: cover;
  transition: border-color var(--transition-fast);
  display: block;
}
.auth-avatar-wrap:hover .auth-avatar {
  border-color: var(--accent-primary);
}

.auth-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all var(--transition-base);
  z-index: 1000;
}
.auth-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.auth-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.auth-dropdown-email {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 0;
}
.auth-dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 10px 0 8px;
}
.auth-dropdown-signout {
  width: 100%;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.auth-dropdown-signout:hover {
  background: rgba(239, 68, 68, 0.2);
}


/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 9, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.login-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.login-modal {
  position: relative;
  background: rgba(28, 25, 23, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(212, 165, 116, 0.08);
  transform: translateY(12px) scale(0.97);
  transition: transform var(--transition-spring);
  text-align: center;
}
.login-modal-overlay.open .login-modal {
  transform: translateY(0) scale(1);
}

.login-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.login-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.login-modal-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}
.login-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.login-modal-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.login-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.login-google-btn {
  display: flex !important;
  justify-content: center;
  margin-bottom: 16px;
}

.login-modal-privacy {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

