/* Right column: hub slides in like profile collapse */
.right-panel-wrapper {
  overflow: hidden;
}

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

.right-panel-wrapper.country-hub-open #countryHubPanel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.country-hub-panel {
  --hub-pad: 12px;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: var(--hub-pad);
  padding-bottom: max(16px, calc(14px + 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(6, 16, 22, 0.98), rgba(3, 8, 12, 0.99));
}

.country-hub-panel[hidden] {
  display: none !important;
}

.country-hub-panel-header {
  position: relative;
  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) + 8px) 10px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(58, 166, 255, 0.22);
}

.country-hub-head-left {
  min-width: 0;
  flex: 1;
  padding-right: 6px;
}

.country-hub-head-right {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-chrome-gap, 28px);
  flex-shrink: 0;
  min-height: var(--ui-chrome-size, 28px);
}

.country-hub-code {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: rgba(54, 220, 255, 0.92);
  text-transform: uppercase;
  padding: 0;
  border: none;
  background: transparent;
}

.country-hub-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220, 244, 255, 0.96);
  line-height: 1.25;
}

.country-hub-sub {
  margin: 4px 0 0;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(150, 190, 210, 0.85);
}

.country-hub-panel-close {
  position: absolute !important;
  top: var(--ui-chrome-inset, 4px) !important;
  right: var(--ui-chrome-inset, 4px) !important;
  left: auto !important;
  flex-shrink: 0;
  z-index: 2;
}

.country-hub-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.country-hub-hero {
  margin: 0 0 10px;
  width: 100%;
}

.country-hub-hero-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(2, 8, 12, 0.95);
  overflow: hidden;
  cursor: zoom-in;
  border: none;
  border-radius: 14px;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  backface-visibility: hidden;
}

.country-hub-hero-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.country-hub-hero-stage img.is-ready {
  opacity: 1;
}

.country-hub-hero-stage--contain {
  aspect-ratio: unset;
  min-height: 120px;
  height: auto;
}

.country-hub-hero-stage--contain img {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  object-fit: contain;
}

.country-hub-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(200, 240, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, text-shadow 0.18s ease, filter 0.18s ease;
}

.country-hub-hero-nav--prev {
  left: 8px;
}

.country-hub-hero-nav--next {
  right: 8px;
}

.country-hub-hero-nav:hover:not(:disabled),
.country-hub-hero-nav:focus-visible:not(:disabled) {
  color: rgba(255, 255, 255, 1);
  text-shadow:
    0 0 10px rgba(90, 220, 255, 0.95),
    0 0 18px rgba(54, 184, 255, 0.55);
  filter: drop-shadow(0 0 6px rgba(90, 220, 255, 0.45));
}

.country-hub-hero-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.country-hub-hero-fact {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(235, 248, 255, 0.96);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  text-align: left;
}

.country-hub-about,
.country-hub-section,
.country-hub-attribution {
  margin-left: 0;
  margin-right: 0;
}

.country-hub-about {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(200, 228, 240, 0.9);
}

.country-hub-section {
  margin-bottom: 12px;
}

.country-hub-section-title {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(180, 220, 235, 0.9);
}

.country-hub-link-btn {
  width: 100%;
  border: 1px solid rgba(54, 184, 255, 0.4);
  background: rgba(8, 24, 36, 0.85);
  color: rgba(200, 240, 255, 0.95);
  padding: 8px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.country-hub-link-btn:hover {
  border-color: rgba(90, 220, 255, 0.7);
  box-shadow: 0 0 14px rgba(54, 184, 255, 0.18);
}

.country-hub-section--youtube .country-hub-youtube {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.country-hub-yt-card {
  position: relative;
  display: block;
  border: 1px solid rgba(58, 166, 255, 0.28);
  overflow: hidden;
  text-decoration: none;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
}

.country-hub-yt-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.country-hub-yt-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  color: #fff;
  line-height: 1.25;
}

.country-hub-yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 45, 70, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.country-hub-attribution {
  margin: 8px 0 0;
  font-size: 8px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: rgba(140, 175, 195, 0.82);
}

/* Domino hub trigger — 5 dots, glow on hover, no borders */
.ui-domino-trigger {
  width: var(--ui-chrome-size, 28px);
  height: var(--ui-chrome-size, 28px);
  min-width: var(--ui-chrome-size, 28px);
  min-height: var(--ui-chrome-size, 28px);
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--ui-domino-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.15s ease;
}

.ui-domino-trigger:hover,
.ui-domino-trigger:focus-visible {
  color: var(--ui-domino-hover-color);
  text-shadow:
    0 0 8px rgba(88, 182, 255, 0.9),
    0 0 16px rgba(58, 166, 255, 0.45);
  transform: none;
}

.ui-domino-trigger.is-active {
  color: var(--ui-domino-active-color);
  text-shadow:
    0 0 10px rgba(125, 252, 138, 0.85),
    0 0 18px rgba(58, 166, 255, 0.4);
}

.ui-domino-trigger.is-active .ui-domino-dots--five i {
  box-shadow: 0 0 8px rgba(125, 252, 138, 0.9);
}

.ui-domino-trigger[data-tip] {
  position: relative;
}

.ui-domino-trigger[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  font-size: 8px;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(4, 10, 8, 0.94);
  border: 1px solid rgba(143, 211, 255, 0.25);
  color: rgba(210, 230, 240, 0.92);
  transition: opacity 0.15s ease;
  z-index: 120;
}

/* NODE LOG: tooltip opens downward — upward tips get clipped by panel header/tools */
.left-panel .places-panel .ui-domino-trigger[data-tip]::after {
  top: calc(100% + 6px);
  bottom: auto;
  left: auto;
  right: 0;
  transform: none;
  z-index: 120;
}
.ui-domino-trigger[data-tip]:hover::after,
.ui-domino-trigger[data-tip]:focus-visible::after {
  opacity: 1;
}

.ui-domino-dots--five {
  display: grid;
  grid-template-columns: repeat(3, 3px);
  grid-template-rows: repeat(3, 3px);
  gap: 2px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.ui-domino-dots--five i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: block;
  box-shadow: 0 0 4px transparent;
  transition: box-shadow 0.18s ease;
}

.ui-domino-trigger:hover .ui-domino-dots--five i,
.ui-domino-trigger:focus-visible .ui-domino-dots--five i {
  box-shadow: 0 0 6px rgba(120, 210, 255, 0.75);
}

.ui-domino-dots--five i:nth-child(1) {
  grid-area: 1 / 1;
}
.ui-domino-dots--five i:nth-child(2) {
  grid-area: 1 / 3;
}
.ui-domino-dots--five i:nth-child(3) {
  grid-area: 2 / 2;
}
.ui-domino-dots--five i:nth-child(4) {
  grid-area: 3 / 1;
}
.ui-domino-dots--five i:nth-child(5) {
  grid-area: 3 / 3;
}

.left-panel .place-country-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 0;
}

.left-panel .places-panel {
  --node-domino-size: 26px;
  --node-domino-dot: 2.5px;
  --node-domino-grid: 12px;
}

.left-panel .places-panel .ui-domino-trigger {
  width: var(--node-domino-size) !important;
  height: var(--node-domino-size) !important;
  min-width: var(--node-domino-size) !important;
  min-height: var(--node-domino-size) !important;
}

.left-panel .places-panel .ui-domino-dots--five {
  grid-template-columns: repeat(3, var(--node-domino-dot));
  grid-template-rows: repeat(3, var(--node-domino-dot));
  gap: 2px;
  width: var(--node-domino-grid);
  height: var(--node-domino-grid);
}

.left-panel .places-panel .ui-domino-dots--five i {
  width: var(--node-domino-dot);
  height: var(--node-domino-dot);
}

.left-panel .places-panel .place-item:has(.ui-domino-trigger:hover),
.left-panel .places-panel .place-item:has(.ui-domino-trigger:focus-visible),
.left-panel .places-panel .place-city:has(.ui-domino-trigger:hover),
.left-panel .places-panel .place-city:has(.ui-domino-trigger:focus-visible) {
  position: relative;
  z-index: 6;
}

.left-panel .place-country-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--node-domino-size, 26px);
  grid-template-rows: auto auto;
  column-gap: 4px;
  row-gap: 2px;
  align-items: start;
  width: 100%;
}

.left-panel .place-country-name-text {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.left-panel .place-country-name-meta {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.left-panel .place-country-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: end;
  width: var(--node-domino-size, 26px);
  height: var(--node-domino-size, 26px);
  margin-top: 1px;
  margin-right: -1px;
}

.left-panel .place-actions .ui-domino-trigger {
  margin-right: 2px;
}

.left-panel .place-country-line--stats {
  padding-right: 4px;
}

.ui-glow-icon {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.left-panel .place-country-rating-stat {
  margin-right: 6px;
}

/* Terminal ⋮ — near photos, not on close */
.terminal-photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.terminal-hub-btn {
  width: var(--ui-chrome-size, 28px);
  height: var(--ui-chrome-size, 28px);
  min-width: var(--ui-chrome-size, 28px);
  min-height: var(--ui-chrome-size, 28px);
  border: none;
  background: transparent;
  color: var(--ui-terminal-hub-btn-color, var(--ui-domino-color));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.terminal-hub-btn:hover,
.terminal-hub-btn:focus-visible {
  color: var(--ui-terminal-hub-btn-hover, var(--ui-domino-hover-color));
  text-shadow: none;
}

.terminal-date-wrap:has(.terminal-date-input--valid) {
  border-color: rgba(90, 220, 140, 0.55);
}

.terminal-date-wrap:has(.terminal-date-input--invalid) {
  border-color: rgba(255, 90, 110, 0.65);
}

.terminal-date-input::placeholder {
  color: var(--ui-terminal-date-placeholder);
  letter-spacing: 0.06em;
}

/* Fullscreen photo over map */
.map-panel {
  position: relative;
}

.hub-map-viewer {
  position: absolute;
  inset: 0;
  z-index: 28;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #000;
}

.hub-map-viewer[hidden] {
  display: none !important;
}

.hub-map-viewer-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hub-map-viewer-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.hub-map-viewer-stage img.is-ready {
  opacity: 1;
}

/* NoDUS / portrait assets: full figure visible, height bound to map panel */
.hub-map-viewer--fit-photo .hub-map-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-map-viewer--fit-photo .hub-map-viewer-stage img {
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  max-width: min(100%, 92vw);
  max-height: calc(100% - 88px);
  object-fit: contain;
  object-position: center center;
}

.hub-map-viewer-fact {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(240, 250, 255, 0.96);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  text-align: center;
}

.hub-map-viewer-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 8px 12px 12px;
  font-size: 9px;
  line-height: 1.35;
  color: rgba(170, 200, 220, 0.88);
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
}

.hub-map-viewer-close {
  position: absolute !important;
  top: 4px;
  right: 6px;
  z-index: 3;
}

.hub-map-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, text-shadow 0.18s ease, filter 0.18s ease;
}

.hub-map-viewer-nav--prev {
  left: 12px;
}

.hub-map-viewer-nav--next {
  right: 12px;
}

.hub-map-viewer-nav:hover,
.hub-map-viewer-nav:focus-visible {
  color: #fff;
  text-shadow:
    0 0 12px rgba(90, 220, 255, 0.95),
    0 0 22px rgba(54, 184, 255, 0.5);
  filter: drop-shadow(0 0 8px rgba(90, 220, 255, 0.4));
}

.terminal-window .terminal-header {
  position: relative;
  padding: 12px 52px 10px !important;
  min-height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
}

.terminal-window .terminal-title {
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.2 !important;
}

.terminal-window .terminal-hub-btn {
  position: absolute !important;
  top: var(--ui-chrome-inset) !important;
  right: calc(var(--ui-chrome-inset) + var(--ui-chrome-size) + var(--ui-chrome-gap)) !important;
  left: auto !important;
  margin: 0 !important;
  z-index: 3;
  width: var(--ui-chrome-size) !important;
  height: var(--ui-chrome-size) !important;
  min-width: var(--ui-chrome-size) !important;
  min-height: var(--ui-chrome-size) !important;
}

.terminal-window .terminal-close.ui-close {
  position: absolute !important;
  top: var(--ui-chrome-inset) !important;
  right: var(--ui-chrome-inset) !important;
  left: auto !important;
  z-index: 4;
  width: var(--ui-chrome-size) !important;
  height: var(--ui-chrome-size) !important;
  min-width: var(--ui-chrome-size) !important;
  min-height: var(--ui-chrome-size) !important;
}

.terminal-date-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--ui-terminal-date-wrap-border);
  background: var(--ui-terminal-date-wrap-bg);
  border-radius: var(--radius-sm);
  padding: 2px 4px 2px 6px;
}

.terminal-date-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 4px 2px !important;
  caret-color: var(--ui-terminal-date-input-caret);
  color: var(--ui-terminal-date-input-color);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.terminal-date-input:focus {
  outline: none;
}

.terminal-date-cal-btn {
  border: none;
  background: transparent;
  color: var(--ui-terminal-date-cal-color);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.terminal-date-cal-btn:hover,
.terminal-date-cal-btn:focus-visible {
  color: var(--ui-terminal-date-cal-hover);
  text-shadow: none;
}

.tf-thread-subtopics {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tf-thread-subtopics-title {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(150, 190, 210, 0.85);
}

.tf-thread-subtopic-btn,
.tf-thread-add-subtopic,
.tf-thread-back-parent {
  border: none;
  background: rgba(8, 22, 32, 0.75);
  color: rgba(200, 240, 255, 0.92);
  text-align: left;
  padding: 6px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.18s ease, text-shadow 0.18s ease, background 0.18s ease;
}

.tf-thread-subtopic-btn:hover,
.tf-thread-add-subtopic:hover,
.tf-thread-back-parent:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(90, 220, 255, 0.45);
  background: rgba(12, 30, 44, 0.9);
}

.tf-thread-add-subtopic {
  margin-top: 8px;
  letter-spacing: 0.06em;
}

.tf-thread-back-parent {
  margin-bottom: 6px;
  width: 100%;
}

.place-country-tomato-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 170, 150, 0.88);
  font-size: 8px;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.place-country-tomato-strip:hover,
.place-country-tomato-strip:focus-visible {
  color: rgba(255, 220, 200, 1);
  text-shadow: 0 0 10px rgba(255, 100, 90, 0.45);
}

.place-country-tomato-pill {
  white-space: nowrap;
}

.place-country-tomato-sep {
  opacity: 0.55;
}

.tomato-nodelog-prompt {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.tomato-nodelog-prompt-card {
  width: min(320px, 100%);
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 100, 90, 0.35);
  background: linear-gradient(165deg, rgba(22, 8, 10, 0.98), rgba(8, 6, 8, 0.98));
  box-shadow: 0 0 28px rgba(255, 70, 70, 0.18);
}

.tomato-nodelog-prompt-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 170, 150, 0.95);
}

.tomato-nodelog-prompt-country {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 235, 228, 0.96);
}

.tomato-nodelog-prompt-stats {
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255, 200, 180, 0.88);
}

.tomato-nodelog-prompt-text {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(220, 210, 205, 0.9);
}

.tomato-nodelog-prompt-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tomato-nodelog-prompt-btn {
  flex: 1;
  border: none;
  padding: 7px 8px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, text-shadow 0.18s ease, background 0.18s ease;
}

.tomato-nodelog-prompt-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(210, 210, 210, 0.92);
}

.tomato-nodelog-prompt-btn--go {
  background: rgba(255, 70, 70, 0.22);
  color: rgba(255, 230, 220, 0.98);
}

.tomato-nodelog-prompt-btn:hover {
  text-shadow: 0 0 10px rgba(255, 120, 100, 0.55);
}
