/**
 * Geospatial AI Curator — Client HUD & Discovery Capsule Styling
 * Design Philosophy: Map-First (95% visual for isometric gigapixel map), Glassmorphism, Minimalist Cyberpunk.
 */

:root {
  --curator-bg-glass: rgba(15, 23, 42, 0.82);
  --curator-bg-glass-card: rgba(30, 41, 59, 0.72);
  --curator-bg-glass-hover: rgba(51, 65, 85, 0.85);
  --curator-border-glass: rgba(255, 255, 255, 0.12);
  --curator-border-glow: rgba(56, 189, 248, 0.45);
  --curator-border-glow-active: rgba(56, 189, 248, 0.85);
  
  --curator-cyan: #38bdf8;
  --curator-amber: #fbbf24;
  --curator-emerald: #34d399;
  --curator-rose: #fb7185;
  --curator-indigo: #818cf8;

  --curator-text-primary: #f8fafc;
  --curator-text-secondary: #94a3b8;
  --curator-text-muted: #64748b;

  --curator-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --curator-font-display: 'Outfit', var(--curator-font-sans);
}

/* ─── Global Reset & Map Canvas ─────────────────────────────────────────── */
.curator-overlay-root {
  --curator-scale: 1;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--curator-font-sans);
  color: var(--curator-text-primary);
  z-index: 500;
  user-select: none;
}

/* Fluid responsive scaling across screen widths */
@media (min-width: 1366px) {
  .curator-overlay-root {
    --curator-scale: 1.15;
  }
}
@media (min-width: 1680px) {
  .curator-overlay-root {
    --curator-scale: 1.28;
  }
}
@media (min-width: 2160px) {
  .curator-overlay-root {
    --curator-scale: 1.48;
  }
}

/* Fullscreen mode scaling across all browsers & OpenSeadragon */
:fullscreen .curator-overlay-root,
:-webkit-full-screen .curator-overlay-root,
.curator-overlay-root.is-fullscreen,
.osd-is-fullscreen .curator-overlay-root {
  --curator-scale: 1.30;
}

@media (min-width: 1600px) {
  :fullscreen .curator-overlay-root,
  :-webkit-full-screen .curator-overlay-root,
  .curator-overlay-root.is-fullscreen,
  .osd-is-fullscreen .curator-overlay-root {
    --curator-scale: 1.40;
  }
}

@media (min-width: 2160px) {
  :fullscreen .curator-overlay-root,
  :-webkit-full-screen .curator-overlay-root,
  .curator-overlay-root.is-fullscreen,
  .osd-is-fullscreen .curator-overlay-root {
    --curator-scale: 1.58;
  }
}

/* Ensure OpenSeadragon canvas and its map pins stay beneath HUD overlays */
.openseadragon-container:has(> .curator-overlay-root) > .openseadragon-canvas {
  z-index: 10 !important;
}

/* Ensure OpenSeadragon controls (top-left buttons, navigator minimap) stay visible above overlays */
.openseadragon-container:has(> .curator-overlay-root) > div:not(.openseadragon-canvas):not(.curator-overlay-root) {
  z-index: 700 !important;
}

.openseadragon-container .navigator {
  opacity: 1 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden !important;
}

/* ─── Minimalist Corner Scan Status Indicator ─────────────────────────── */
.curator-scan-indicator {
  position: relative;
  vertical-align: top;
  margin: 2px 3px;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  cursor: pointer;
  z-index: 50;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              background 0.2s ease,
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

.curator-scan-indicator.scanning {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.curator-scan-indicator:hover {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(56, 189, 248, 0.6);
  transform: scale(1);
}

.curator-scan-indicator:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.curator-scan-indicator .curator-scan-spinner { display: none; }
.curator-scan-indicator.scanning .curator-scan-spinner { display: block; }
.curator-scan-indicator.scanning .curator-control-icon { display: none; }

.curator-scan-spinner {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.6));
  animation: curator-spin 0.85s linear infinite;
}

.curator-scan-spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #7dd3fc;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 3px #38bdf8;
}

@keyframes curator-spin {
  to { transform: rotate(360deg); }
}

/* ─── Map Pins & Overlay Styling ────────────────────────────────────────── */
.curator-map-pin {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.curator-map-pin:hover {
  z-index: 30;
}

.curator-map-pin.pin-active {
  z-index: 28;
}

body.hide-pins .curator-map-pin,
.hide-pins .curator-map-pin {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Scalable Pin Body: scales down with zoom out, clamped between min and max */
.curator-pin-body {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--curator-pin-scale, 1));
  transform-origin: center center;
  transition: transform 0.05s linear;
  pointer-events: none;
}

/* Core Dot */
.curator-pin-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #dcf4fd 15%, #38bdf8 65%, #0ea5e9 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px #38bdf8, 0 0 12px rgba(56, 189, 248, 0.75);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translate(-50%, -50%);
  top: 0;
  left: 0;
  animation: curator-pin-breath 2s infinite ease-in-out;
  pointer-events: none;
}

/* Rhythmic breathing pulse */
@keyframes curator-pin-breath {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 5px #38bdf8, 0 0 10px rgba(56, 189, 248, 0.65);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(56, 189, 248, 0.85);
  }
}

/* Expanding Radar Sonar Waves - tightly bounded to max scale(2.5) */
.curator-pin-dot::before,
.curator-pin-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.5);
  transform: translate(-50%, -50%) scale(1);
  opacity: calc(0.85 * var(--curator-pin-opacity, 1));
  pointer-events: none;
  animation: curator-pin-sonar 2.2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.curator-pin-dot::after {
  animation-delay: 1.1s;
}

@keyframes curator-pin-sonar {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: calc(0.85 * var(--curator-pin-opacity, 1));
  }
  60% {
    border-color: #38bdf8;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
    border-color: rgba(56, 189, 248, 0);
  }
}

/* Active & Hover States for Dot */
.curator-map-pin:hover .curator-pin-dot,
.curator-map-pin.pin-active .curator-pin-dot {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #e0f7fe 25%, #38bdf8 80%);
  border-color: #ffffff;
  box-shadow: 0 0 10px #38bdf8, 0 0 20px rgba(56, 189, 248, 0.95);
  animation: none;
  transform: translate(-50%, -50%) scale(1.15);
}

/* Minimalist Floating Tooltip Tag (Hidden by default, shown on hover/active) */
.curator-pin-tag {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--curator-border-glow);
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 10px rgba(56, 189, 248, 0.2);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  z-index: 25;
}

.curator-pin-tag::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.94) transparent transparent transparent;
}

.curator-map-pin:hover .curator-pin-tag,
.curator-map-pin.pin-active .curator-pin-tag {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
  border-color: rgba(56, 189, 248, 0.8);
  color: var(--curator-cyan);
}


/* ─── AI Curator Discovery Capsule (Ultra-Translucent Glassmorphism) ───── */
.curator-discovery-capsule {
  position: absolute;
  bottom: calc(16px * var(--curator-scale, 1));
  left: calc(16px * var(--curator-scale, 1));
  transform: translateY(8px);
  box-sizing: border-box;
  width: calc(280px * var(--curator-scale, 1));
  max-width: calc(100% - 32px);
  max-height: calc(100% - 72px);
  overflow-y: auto;
  background: rgba(248, 250, 252, 0.90);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: calc(14px * var(--curator-scale, 1));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
  color: #1e293b;
  padding: calc(14px * var(--curator-scale, 1));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 500;
  font-size: calc(13px * var(--curator-scale, 1));
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--curator-scale, 1));
}

.curator-discovery-capsule.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.capsule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(8px * var(--curator-scale, 1));
}

.capsule-header {
  color: #0f172a;
  font-size: calc(16px * var(--curator-scale, 1));
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
  flex: 1;
}

.capsule-title { overflow-wrap: anywhere; }

.capsule-header .capsule-icon {
  display: flex;
  align-items: center;
  color: #38bdf8;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
}

.capsule-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: calc(24px * var(--curator-scale, 1));
  height: calc(24px * var(--curator-scale, 1));
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.capsule-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.capsule-badges {
  display: flex;
  align-items: center;
  gap: calc(6px * var(--curator-scale, 1));
  flex-wrap: wrap;
}

.capsule-badge {
  font-size: calc(10.5px * var(--curator-scale, 1));
  font-weight: 500;
  padding: calc(2px * var(--curator-scale, 1)) calc(7px * var(--curator-scale, 1));
  border-radius: calc(4px * var(--curator-scale, 1));
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  max-width: calc(200px * var(--curator-scale, 1));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.capsule-badge.badge-height {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

.capsule-badge.badge-year {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
}

.capsule-summary {
  color: #334155;
  font-size: calc(12.5px * var(--curator-scale, 1));
  line-height: 1.55;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.capsule-summary.expanded { display: block; }

.capsule-loading-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-style: italic;
  font-size: 12px;
}

.capsule-loading-text::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: capsule-spin 0.8s linear infinite;
}

@keyframes capsule-spin {
  to { transform: rotate(360deg); }
}

.capsule-summary::-webkit-scrollbar {
  width: 4px;
}

.capsule-summary::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.capsule-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.capsule-extra-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.capsule-extra-info:empty { display: none; }
.capsule-section-label { color: #93a4b8; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; }
.capsule-interaction-text { margin: 0; color: #b8c4d4; font-size: 12px; line-height: 1.6; }
.capsule-related-title { color: #e2e8f0; font-size: 13px; }
.capsule-distance { color: #93a4b8; font-size: 11px; }
.capsule-action, .capsule-read-more {
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: #7dd3fc;
  background: transparent;
  border: 0;
  padding: 0;
}
.capsule-read-more { align-self: flex-start; font-size: 12px; }
.capsule-action { padding: 8px 12px; border: 1px solid #334155; border-radius: 6px; font-size: 12px; }
.capsule-action:hover { background: #243244; }
.curator-discovery-capsule button:focus-visible, .curator-discovery-capsule a:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 3px;
}
.curator-connection-group .curator-connection-line,
.curator-connection-group .curator-connection-dot { animation: none; filter: none; }
@media (max-width: 480px) {
  .curator-discovery-capsule { bottom: 12px; left: 12px; max-width: calc(100% - 24px); max-height: 55%; padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .curator-discovery-capsule { transition: none; }
}

.capsule-wiki-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.capsule-wiki-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.capsule-conn-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.capsule-conn-narrative {
  margin-top: 6px;
  padding: 8px 11px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.capsule-conn-header {
  font-size: 11.5px;
  font-weight: 600;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.capsule-conn-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  overflow-wrap: break-word;
  word-break: break-word;
}

@keyframes curator-dash-flow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -32;
  }
}

.curator-connection-aura {
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
  animation: curator-pulse-aura 3.6s ease-in-out infinite;
}

@keyframes curator-pulse-aura {
  0%, 100% { stroke-opacity: 0.16; stroke-width: 4px; }
  50% { stroke-opacity: 0.32; stroke-width: 5.5px; }
}

.curator-connection-line {
  stroke-dasharray: 6 10;
  animation: curator-dash-flow 3.6s linear infinite !important;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.65));
  will-change: stroke-dashoffset;
  pointer-events: none;
}

.curator-connection-dot {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
  animation: pulse-dot 3.2s ease-in-out infinite;
}

.curator-traveling-photon {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.85));
  pointer-events: none;
}

@keyframes curator-ripple {
  0% {
    r: 5px;
    opacity: 0.65;
    stroke-width: 1.5px;
  }
  50% {
    r: 12px;
    opacity: 0.25;
    stroke-width: 1px;
  }
  100% {
    r: 20px;
    opacity: 0;
    stroke-width: 0.5px;
  }
}

.curator-connection-ripple {
  fill: none;
  animation: curator-ripple 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

@keyframes pulse-dot {
  0% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.3)); }
  50% { filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.75)); }
  100% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.3)); }
}

/* ─── Endpoint Connection Name Tags ────────────────────────────────── */
.curator-endpoint-tag {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  color: #f8fafc;
  font-family: var(--curator-font-sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 8px rgba(56, 189, 248, 0.2);
  transform: translate(-50%, -100%) translateY(-10px);
  z-index: 550;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
  line-height: 1.35;
}

.curator-endpoint-tag::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
}

.curator-endpoint-tag.from {
  border: 1px solid rgba(56, 189, 248, 0.75);
  color: #7dd3fc;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(56, 189, 248, 0.25);
}
.curator-endpoint-tag.from::after {
  border-color: rgba(15, 23, 42, 0.88) transparent transparent transparent;
}

.curator-endpoint-tag.to {
  border: 1px solid rgba(52, 211, 153, 0.75);
  color: #6ee7b7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(52, 211, 153, 0.25);
}
.curator-endpoint-tag.to::after {
  border-color: rgba(15, 23, 42, 0.88) transparent transparent transparent;
}

/* ─── Explore Next Place Pill (Inside Discovery Capsule) ────────────── */
.capsule-next-place {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(240, 249, 255, 0.90);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #0369a1;
  font-family: var(--curator-font-sans);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  user-select: none;
}

.capsule-next-place:hover {
  background: rgba(224, 242, 254, 0.98);
  border-color: rgba(56, 189, 248, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.18);
  color: #0284c7;
}

.capsule-next-place:active {
  transform: translateY(0);
}

.next-place-label {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.next-place-sparkle {
  color: #0284c7;
  font-size: 11px;
  flex-shrink: 0;
}

.next-place-arrow {
  color: #0284c7;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.capsule-next-place:hover .next-place-arrow {
  transform: translateX(2px);
}

/* Hide normal pins when connection is active */
.curator-overlay-root.hide-pins .curator-map-pin {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.5) !important;
}

/* ─── Minimalist Connection Notification (Toast Notification) ────────── */
.curator-conn-notify {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(10, 14, 23, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  cursor: default;
}

.curator-conn-notify.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.conn-notify-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.conn-notify-text strong {
  color: #f1f5f9;
  font-weight: 600;
}

.conn-notify-dist {
  color: #64748b;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.conn-notify-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.conn-notify-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.5);
}

.conn-notify-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.conn-notify-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

/* ─── Minimalist Connection Modal (Compact, Positioned at Bottom-Left) ─ */
.curator-conn-modal {
  position: absolute;
  bottom: calc(16px * var(--curator-scale, 1));
  left: calc(16px * var(--curator-scale, 1));
  transform: translateY(20px) scale(0.97);
  width: calc(380px * var(--curator-scale, 1));
  max-width: calc(100vw - 32px);
  background: rgba(248, 250, 252, 0.90);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: calc(14px * var(--curator-scale, 1));
  padding: calc(14px * var(--curator-scale, 1)) calc(16px * var(--curator-scale, 1)) calc(12px * var(--curator-scale, 1)) calc(16px * var(--curator-scale, 1));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.25s ease, padding 0.25s ease;
  z-index: 600;
  overflow: hidden;
  color: #1e293b;
}

.curator-conn-modal.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
  .curator-conn-modal {
    left: 12px;
    right: 12px;
    bottom: 14px;
    width: auto;
    max-width: none;
  }
}

.conn-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(8px * var(--curator-scale, 1));
}

.conn-modal-title-group {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--curator-scale, 1));
}

.conn-modal-badge {
  font-size: calc(10px * var(--curator-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0369a1;
  background: rgba(224, 242, 254, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: calc(2.5px * var(--curator-scale, 1)) calc(7px * var(--curator-scale, 1));
  border-radius: calc(6px * var(--curator-scale, 1));
}

.conn-modal-dist {
  font-size: calc(11px * var(--curator-scale, 1));
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.conn-modal-actions {
  display: flex;
  align-items: center;
  gap: calc(4px * var(--curator-scale, 1));
}

.conn-modal-action-btn {
  width: calc(24px * var(--curator-scale, 1));
  height: calc(24px * var(--curator-scale, 1));
  border-radius: calc(6px * var(--curator-scale, 1));
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.12);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.conn-modal-action-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(51, 65, 85, 0.25);
}

/* ─── Route / Bridge Indicator (Minimal Dual Landmark Connection) ─────── */
.conn-bridge-container {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--curator-scale, 1));
  font-size: calc(13px * var(--curator-scale, 1));
  font-weight: 600;
  color: #0f172a;
  margin: calc(4px * var(--curator-scale, 1)) 0 calc(10px * var(--curator-scale, 1)) 0;
  padding: calc(6px * var(--curator-scale, 1)) 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  min-width: 0;
}

.conn-endpoint-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0f172a;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.conn-endpoint-name:hover {
  color: #0284c7;
  text-decoration: underline;
}

.conn-bridge-arrow {
  display: inline-flex;
  align-items: center;
  color: #0284c7;
  flex-shrink: 0;
}

/* ─── Narrative (Refined Brief Summary) ─────────────────────────────── */
.conn-modal-narrative {
  font-size: calc(12.5px * var(--curator-scale, 1));
  line-height: 1.62;
  color: #334155;
  margin-bottom: calc(12px * var(--curator-scale, 1));
  padding: 0;
  max-height: min(42vh, calc(340px * var(--curator-scale, 1)));
  overflow-y: auto;
  overflow-wrap: break-word;
  word-break: break-word;
}

.conn-modal-narrative::-webkit-scrollbar {
  width: 3px;
}

.conn-modal-narrative::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 3px;
}

/* ─── Progress Line & Footer ────────────────────────────────────── */
.conn-modal-progress-wrap {
  width: 100%;
  height: 2px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: calc(9px * var(--curator-scale, 1));
}

.conn-modal-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  transition: width 1s linear;
}

.conn-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.conn-modal-timer {
  font-size: calc(11px * var(--curator-scale, 1));
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.conn-modal-timer strong {
  color: #0f172a;
  font-weight: 600;
}

.conn-modal-return-btn {
  display: inline-flex;
  align-items: center;
  gap: calc(5px * var(--curator-scale, 1));
  background: rgba(224, 242, 254, 0.65);
  border: 1px solid rgba(3, 105, 161, 0.2);
  color: #075985;
  padding: calc(5px * var(--curator-scale, 1)) calc(11px * var(--curator-scale, 1));
  border-radius: calc(7px * var(--curator-scale, 1));
  font-size: calc(11.5px * var(--curator-scale, 1));
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.conn-modal-return-btn:hover {
  background: rgba(186, 230, 253, 0.85);
  color: #0369a1;
  border-color: rgba(3, 105, 161, 0.35);
}

/* ─── Minimized Compact View Mode ───────────────────────────────── */
.curator-conn-modal.minimized {
  padding: 8px 12px;
  border-radius: 10px;
  width: auto;
  max-width: 320px;
}

.curator-conn-modal.minimized .conn-modal-header {
  margin-bottom: 0;
}

.curator-conn-modal.minimized .conn-bridge-container,
.curator-conn-modal.minimized .conn-modal-narrative,
.curator-conn-modal.minimized .conn-modal-progress-wrap,
.curator-conn-modal.minimized .conn-modal-footer {
  display: none !important;
}

/* ─── In-Capsule Minimalist Prompts ─────────────────────────────── */
.capsule-conn-prompt {
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.capsule-conn-prompt:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
}

.conn-prompt-left {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.conn-prompt-left strong {
  color: #e2e8f0;
}

.capsule-conn-prompt .explore-link {
  font-size: 11px;
  font-weight: 500;
  color: #38bdf8;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.capsule-proact-bar {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.24);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-sizing: border-box;
}

.capsule-proact-bar:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fef08a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

.capsule-proact-bar:active {
  transform: translateY(0);
}

.capsule-proact-bar .proact-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.capsule-proact-bar strong {
  color: #fef08a;
}

.capsule-proact-bar .proact-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: #fbbf24;
  transition: transform 0.2s ease;
}

.capsule-proact-bar:hover .proact-icon {
  transform: translateX(2px);
  color: #fef08a;
}


.curator-scan-indicator[data-state="success"],
.curator-scan-indicator[data-state="scanning"] {
  color: var(--curator-cyan);
  border-color: var(--curator-cyan);
  background: rgba(8, 47, 73, 0.85);
}

.curator-scan-indicator[data-state="error"],
.curator-scan-indicator[data-state="empty"] {
  color: var(--curator-amber);
  border-color: var(--curator-amber);
}

.curator-scan-indicator:disabled { cursor: wait; }



.curator-scan-indicator[aria-pressed="true"] { color: var(--curator-cyan); border-color: var(--curator-cyan); }
.curator-scan-indicator[data-state="error"] { color: var(--curator-amber); border-color: var(--curator-amber); }

/* ─── Explore Invite Pill (Floating notification) ─────────────────────── */
.curator-explore-invite {
  position: absolute;
  top: calc(52px * var(--curator-scale, 1));
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  display: flex;
  align-items: center;
  gap: calc(2px * var(--curator-scale, 1));
  max-width: calc(100% - 32px);
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: calc(24px * var(--curator-scale, 1));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(56, 189, 248, 0.12);
  padding: calc(3px * var(--curator-scale, 1)) calc(4px * var(--curator-scale, 1)) calc(3px * var(--curator-scale, 1)) calc(6px * var(--curator-scale, 1));
  z-index: 600;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease;
}

.curator-explore-invite.entered {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.curator-explore-invite.leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition-duration: 0.2s;
}

.curator-explore-invite:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1), 0 0 10px rgba(56, 189, 248, 0.15);
}

.explore-invite-btn {
  background: none;
  border: 0;
  color: #0c4a6e;
  padding: calc(6px * var(--curator-scale, 1)) calc(10px * var(--curator-scale, 1));
  cursor: pointer;
  font: inherit;
  font-size: calc(12.5px * var(--curator-scale, 1));
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: calc(6px * var(--curator-scale, 1));
  border-radius: calc(20px * var(--curator-scale, 1));
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.explore-invite-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #075985;
}

.explore-invite-btn svg {
  color: #38bdf8;
  flex-shrink: 0;
  width: calc(14px * var(--curator-scale, 1));
  height: calc(14px * var(--curator-scale, 1));
}

.invite-sep {
  color: #94a3b8;
  font-size: calc(14px * var(--curator-scale, 1));
}

.invite-cta {
  color: #0284c7;
  font-weight: 600;
}

.explore-invite-dismiss {
  background: none;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  width: calc(26px * var(--curator-scale, 1));
  height: calc(26px * var(--curator-scale, 1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.explore-invite-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
}

.curator-explore-invite button:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
  border-radius: calc(14px * var(--curator-scale, 1));
}

.curator-service-status {
  position: absolute;
  top: 44px;
  left: 12px;
  max-width: min(290px, calc(100% - 24px));
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 12px;
  background: rgba(248, 250, 252, .92);
  backdrop-filter: blur(12px);
  color: #475569;
  font: 11px/1.4 var(--curator-font-sans);
  box-shadow: 0 2px 8px #0f172a15;
  pointer-events: none;
}
.curator-service-status[hidden] { display: none; }
.navigator .displayregioncontainer { z-index: 30 !important; }
.navigator .displayregion { z-index: 31 !important; border: 2px solid #ef4444 !important; background: #ef444415; }
.curator-conn-modal { max-width: calc(100% - 32px); max-height: calc(100% - 72px); overflow-y: auto; box-sizing: border-box; }
.curator-conn-modal.minimized { max-width: min(calc(320px * var(--curator-scale)), calc(100% - 32px)); }
.conn-prompt-left, .capsule-conn-prompt .explore-link, .capsule-proact-bar { font-size: calc(11px * var(--curator-scale, 1)); }

.curator-scan-indicator[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  border: 1px solid #fff;
}
.curator-scan-indicator[data-state="error"]::after { background: #fbbf24; }
