/* City Places panel — slides in like country hub */
.right-panel-wrapper.city-places-open #rightPanel {
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}

.right-panel-wrapper.city-places-open #cityPlacesPanel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.right-panel-wrapper.city-places-open.country-hub-open #countryHubPanel {
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}

.city-places-panel {
  --cp-pad: 12px;
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: var(--cp-pad);
  padding-bottom: max(14px, calc(12px + env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.25s ease;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(8, 18, 14, 0.98), rgba(4, 10, 8, 0.99));
}

.city-places-panel[hidden] {
  display: none !important;
}

.city-places-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 calc(var(--ui-chrome-inset, 4px) + var(--ui-chrome-size, 28px) + 6px) 8px 0;
  border-bottom: 1px solid rgba(125, 252, 138, 0.2);
}

.city-places-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200, 245, 220, 0.95);
}

.city-places-sub {
  margin: 4px 0 0;
  font-size: 10px;
  color: rgba(160, 210, 195, 0.75);
}

.city-places-toolbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 88px 1fr auto auto;
  gap: 6px;
  margin: 10px 0 6px;
}

.city-places-select,
.city-places-search-input {
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(80, 130, 100, 0.35);
  background: rgba(5, 12, 9, 0.65);
  color: #e8f2ec;
  font-size: 11px;
  padding: 0 8px;
}

.city-places-search-btn,
.city-places-add-manual {
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  border: 1px solid rgba(125, 252, 138, 0.35);
  background: rgba(8, 22, 16, 0.8);
  color: rgba(200, 245, 220, 0.95);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.city-places-add-manual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.city-places-search-results {
  flex-shrink: 0;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 6px;
}

.city-places-search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  border: 1px solid rgba(80, 130, 100, 0.25);
  background: rgba(6, 14, 11, 0.55);
  color: inherit;
  cursor: pointer;
}

.city-places-search-hit:hover {
  border-color: rgba(125, 252, 138, 0.4);
  background: rgba(10, 24, 18, 0.75);
}

.city-places-search-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(220, 245, 230, 0.95);
}

.city-places-search-meta {
  display: block;
  font-size: 9px;
  color: rgba(160, 200, 185, 0.8);
  margin-top: 2px;
}

.city-places-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.city-places-empty {
  font-size: 10px;
  line-height: 1.45;
  color: rgba(160, 200, 185, 0.85);
  margin: 0 0 10px;
}

.city-places-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-place-card {
  border-radius: 12px;
  border: 1px solid rgba(80, 130, 100, 0.28);
  background: rgba(5, 12, 9, 0.62);
  padding: 10px;
}

.city-place-card-top {
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  gap: 8px;
  align-items: start;
}

.city-place-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 18, 14, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(125, 252, 138, 0.75);
  font-size: 18px;
}

.city-place-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.city-place-name {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(220, 245, 230, 0.96);
}

.city-place-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(160, 210, 195, 0.85);
  margin-top: 2px;
}

.city-place-address,
.city-place-source {
  margin: 4px 0 0;
  font-size: 9px;
  line-height: 1.35;
  color: rgba(150, 190, 175, 0.8);
}

.city-place-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 6px;
  font-size: 10px;
}

.city-place-rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.city-place-rating-input {
  flex: 1;
  min-width: 60px;
  accent-color: rgba(125, 252, 138, 0.85);
}

.city-place-community-val {
  font-weight: 700;
  color: rgba(58, 166, 255, 0.95);
}

.city-place-comment {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(80, 130, 100, 0.3);
  background: rgba(4, 10, 8, 0.55);
  color: #e8f2ec;
  font-size: 11px;
  padding: 6px 8px;
  resize: vertical;
  min-height: 44px;
}

.city-place-photos {
  margin-top: 8px;
}

.city-place-photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.city-place-photo-thumb {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(80, 130, 100, 0.35);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(4, 10, 8, 0.5);
}

.city-place-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.city-place-photo-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(125, 252, 138, 0.35);
  color: rgba(180, 230, 200, 0.9);
  cursor: pointer;
}

.city-places-attribution {
  margin: 12px 0 4px;
  font-size: 8px;
  line-height: 1.4;
  opacity: 0.65;
}

.city-places-hint {
  font-size: 10px;
  opacity: 0.8;
  margin: 0;
}

/* NODE LOG: Places chip — same frame/transparency as gallery & Show nodes */
.node-places-chip.node-gallery-btn {
  /* inherits .node-gallery-btn from styles.css */
}

.node-places-chip .fa-location-dot {
  font-size: 12px;
  filter: var(--ui-gallery-btn-icon-filter);
}

.left-panel .node-places-chip .fa-location-dot {
  font-size: 15px;
  filter: var(--ui-gallery-btn-icon-filter);
}

.node-places-chip.is-active {
  border-color: var(--ui-places-chip-active-border) !important;
  background: var(--ui-places-chip-active-bg) !important;
  box-shadow: none;
  color: var(--ui-places-chip-active-color);
}

.node-places-chip.is-active .fa-location-dot {
  filter: var(--ui-gallery-btn-icon-filter);
}

.node-places-chip--empty {
  border-color: var(--ui-gallery-btn-empty-border) !important;
  background: var(--ui-places-chip-empty-bg);
}

.node-places-chip--empty .fa-location-dot,
.node-places-chip--empty .node-places-count {
  opacity: var(--ui-places-chip-empty-opacity);
  filter: none;
}

.left-panel .node-places-chip .node-places-count {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.left-panel .place-country-rail .node-places-chip,
.left-panel .place-city-rail .node-places-chip {
  width: 100%;
  height: 28px;
  min-height: 28px;
  box-sizing: border-box;
  padding: 0 2px;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.node-places-map-add {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ui-places-chip-map-add-color);
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}

.node-places-map-add:hover {
  color: var(--ui-places-chip-map-add-hover);
  filter: none;
}

.node-places-chip--picking {
  border-color: rgba(125, 252, 138, 0.55) !important;
  box-shadow: 0 0 12px rgba(125, 252, 138, 0.25);
}

.node-places-chip--picking .node-places-map-add {
  color: #7dfc8a;
}

/* Map: hover on named POI / venue — ring + plus affordance */
.map-hover-tip--poi-add .mapboxgl-popup-content {
  padding: 4px 8px 5px;
  border-color: rgba(125, 252, 138, 0.42);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(125, 252, 138, 0.18);
  pointer-events: none;
}

.map-hover-tip-inner--poi {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
}

.map-poi-hover-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: rgba(220, 245, 230, 0.96);
}

.map-poi-hover-add {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(125, 252, 138, 0.55);
  background: rgba(8, 22, 16, 0.85);
  color: rgba(125, 252, 138, 0.98);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(125, 252, 138, 0.25);
}

/* City mode: hand/grab; locked city = bold green plus (no glow disk) */
.mapboxgl-canvas.map-canvas--city-pick-mode {
  cursor: grab !important;
}

.mapboxgl-canvas.map-canvas--city-pick-mode:active {
  cursor: grabbing !important;
}

.mapboxgl-canvas.map-canvas--settlement-hit,
.mapboxgl-canvas.map-canvas--city-pick-mode.map-canvas--settlement-hit {
  cursor: pointer !important;
}

.mapboxgl-canvas.map-canvas--settlement-hit:active,
.mapboxgl-canvas.map-canvas--city-pick-mode.map-canvas--settlement-hit:active {
  cursor: pointer !important;
}

.map-hover-tip.mapboxgl-popup {
  z-index: 120 !important;
}

/* Премиальная подсказка города — без рамок, компактная, только мягкое стекло */
.map-hover-tip--place .mapboxgl-popup-content,
.map-hover-tip--place.map-hover-tip--settlement-ready .mapboxgl-popup-content,
.map-hover-tip.map-hover-tip--place.map-hover-tip--settlement-glass .mapboxgl-popup-content {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
  transform: none;
}

.map-hover-tip--place .mapboxgl-popup-tip,
.map-hover-tip--place.map-hover-tip--settlement-glass.map-hover-tip--settlement-ready .mapboxgl-popup-tip {
  display: none !important;
}

/* Country hover — single pill + bottom funnel (no double frame) */
.map-hover-tip--country .mapboxgl-popup-content {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.map-country-hover-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px 6px;
  max-width: 220px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(110, 255, 200, 0.32);
  background: linear-gradient(
    135deg,
    rgba(12, 28, 24, 0.84) 0%,
    rgba(28, 12, 18, 0.78) 100%
  );
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgba(110, 255, 200, 0.08),
    0 6px 20px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(72, 220, 160, 0.12);
}

.map-country-hover-glass__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 248, 246, 0.98);
}

.map-hover-tip--country .mapboxgl-popup-tip {
  border-top-color: rgba(18, 30, 26, 0.92) !important;
}

.map-hover-tip--country.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: rgba(18, 30, 26, 0.92) !important;
}

/* Custom pin hover — same glass as global toast, above marker */
.map-marker-tip .mapboxgl-popup-content {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.map-marker-tip-glass {
  border: 1px solid var(--ui-toast-border);
  border-radius: 12px;
  background: var(--ui-toast-bg);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ui-toast-text);
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.35;
  padding: 8px 14px;
  max-width: 260px;
  text-align: center;
  pointer-events: none;
}

.map-marker-tip-glass__title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-marker-tip--pin .mapboxgl-popup-tip {
  border-top-color: rgba(8, 20, 16, 0.94) !important;
}

.map-settlement-hover-glass.map-hover-tip-inner--settlement-ready {
  pointer-events: auto;
  cursor: pointer;
}

.map-hover-tip--settlement-ready .mapboxgl-popup-content {
  pointer-events: auto;
  cursor: pointer;
}

.map-settlement-hover-glass {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 5px;
  max-width: 220px;
  white-space: nowrap;
  border-radius: 10px;
  border: 1px solid rgba(110, 255, 200, 0.28);
  background: linear-gradient(
    135deg,
    rgba(12, 28, 24, 0.78) 0%,
    rgba(28, 12, 18, 0.72) 100%
  );
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgba(110, 255, 200, 0.08),
    0 6px 20px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(72, 220, 160, 0.12);
  transition:
    opacity 0.08s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.08s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .map-settlement-hover-glass {
    background: rgba(28, 10, 14, 0.92);
  }
}

.map-city-hover-name,
.map-settlement-hover-glass__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 248, 246, 0.98);
}

.map-city-hover-action,
.map-settlement-hover-glass__action {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 168, 148, 0.98);
  text-shadow: 0 0 10px rgba(255, 130, 110, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  text-shadow: none;
  box-shadow: none;
}

.map-hover-tip--poi-add .mapboxgl-popup-content {
  pointer-events: none;
}

/* Node comment lock toggle (terminal NOTE) */
.terminal-field--note {
  position: relative;
}

.terminal-field--note #terminalNote {
  resize: none;
  padding-bottom: 22px;
}

.terminal-note-lock {
  position: absolute;
  top: auto;
  bottom: 7px;
  right: 7px;
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(143, 211, 255, 0.22);
  background: rgba(8, 16, 14, 0.7);
  color: rgba(190, 220, 235, 0.78);
  font-size: 9.5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
  z-index: 2;
}

.terminal-note-lock:hover {
  color: rgba(220, 240, 255, 0.95);
  border-color: rgba(143, 211, 255, 0.42);
  transform: translateY(-1px);
}

.terminal-note-lock.is-locked {
  color: #7dfc8a;
  border-color: rgba(125, 252, 138, 0.6);
  background: rgba(20, 48, 28, 0.7);
  box-shadow: 0 0 0 1px rgba(125, 252, 138, 0.25),
    0 0 14px rgba(125, 252, 138, 0.35);
}

@keyframes mnm-poi-ring-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}
