html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
}

#mainContainer {
  display: flex;
  height: 100vh;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

.glowing-border {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
  transition:
    box-shadow 0.3s ease,
    border 0.3s ease;
}

.glowing-border-instant {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
}

.glowing-border-switcher {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
  background: rgba(0, 0, 0, 0.4) !important;
  transition:
    box-shadow 0.3s ease,
    border 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
}

.glowing-border-switcher label {
  color: white !important;
}

.glowing-border-switcher-instant {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
  background: rgba(0, 0, 0, 0.4) !important;
  color: white !important;
}

.glowing-border-switcher-instant label {
  color: white !important;
}

/* Left column (Col 1) */
#col1 {
  flex: 0 0 20%;
  width: 20%;
  box-sizing: border-box;
  height: calc(100vh - 20px);
  background: transparent;
}

#col1 .card {
  border: none;
  box-shadow: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.col1-top {
  border: none;
  background: transparent;
}

.col1-bottom {
  overflow-y: hidden;
  flex: 1;
  border: none;
  padding: 10px;
  padding-top: 5px;
  background: transparent;
}

#col1 .card-header {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  padding: 10px;
  padding-bottom: 5px;
}

.header-row {
  margin-bottom: 0px;
  background: transparent;
}

.header-row:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.header-row-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(-90deg, #445b3e, #2e8d34);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}

.header-row-dark {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
  background: rgba(0, 0, 0, 0.4) !important;
  transition: background 0.3s ease;
}

.header-row-dark-instant {
  border: 2px solid lightgreen !important;
  box-shadow: 0 0 10px 2px lightgreen !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

/* Three-line stack with credit text anchored at the bottom. */
.logo-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
  gap: 2px;
  padding-top: 2px;
}

.logo-container .app-title {
  margin-top: -4px;
  line-height: 1.05;
}

.logo-container .app-version {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
}

/* Keep credit text subtle and aligned to the bottom. */
.logo-container .app-credit {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.1;
}

.app-credit-link{
  color: inherit;
  text-decoration: none;
}
.app-credit-link:hover{
  text-decoration: underline;
}
.app-credit-link i{
  margin-right: 6px;
}

.logo-container h4 {
  margin: 0;
  font-size: 1.8rem;
  color: #fff;
}

.logo-svg-container {
  width: 80px;
  flex-shrink: 0;
  opacity: 0.85;
  transition:
    opacity 0.3s ease-in-out,
    transform 0.3s ease-in-out;
}

.logo-svg-container svg {
  width: 100%;
  height: auto;
}

.logo-svg-container:hover {
  opacity: 1;
  transform: scale(1.05);
  filter: brightness(1.2);
}

.header-row-2 {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.csv-switcher {
  display: flex;
  width: 100%;
  height: 47px;
  border: 1.5px solid rgba(0, 128, 0, 0.637);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: #f9f9f9;
}

.upper-switcher {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.lower-switcher {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.csv-switcher input[type="radio"] {
  display: none;
}

.csv-switcher label {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  transition:
    background 0.3s ease,
    color 0.3s ease;
  font-weight: 500;
  color: #555;
}

.csv-switcher input[type="radio"]:checked + label {
  background: rgb(0, 153, 0);
  color: white;
}

.csv-switcher label:hover {
  background: #e0e0e0;
}

.csv-switcher.disabled {
  opacity: 0.6;
  pointer-events: none;
  border-color: green;
  background: #ddd;
}

.csv-switcher.disabled label {
  color: #999;
  background: none;
}

.header-row-3 {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

/* Middle column (Col 2) */
#col2 {
  flex: 0 0 50%;
  width: 50%;
  box-sizing: border-box;
  position: relative;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: calc(100vh - 40px);
  margin-top: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 0.5px solid green;
}

.watermark {
  position: absolute;
  bottom: 65px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  font-size: 0.8rem;
  color: #fff;
}

.watermark-text {
  font-family: sans-serif;
  font-weight: bold;
}

.watermark-logo {
  width: 140px;
  height: 40px;
}

.help-overlay-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 100;
}
.help-overlay-button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.help-overlay-button:active {
  transform: scale(0.98);
}

.toggle-button-container {
  min-width: 37px;
  position: absolute;
  bottom: 20px;
  right: 164px;
  justify-content: center;
}

.toggle-button-container .btn {
  width: 38px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  text-align: center;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: transparent;
  filter: brightness(1);
  transition:
    transform 0.3s ease-in-out,
    filter 0.3s ease-in-out,
    opacity 0.3s ease;
  will-change: filter, opacity;
  z-index: 0;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
}

.toggle-button-container .btn .btn-text {
  position: relative;
  z-index: 3;
  color: white;
}

.toggle-button-container .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #570ea6, #1c5bc8);
  transition: opacity 0.4s ease;
  z-index: 1;
  opacity: 1;
}

.toggle-button-container .btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e53935, #e35d5b);
  transition: opacity 0.8s ease;
  z-index: 1;
  opacity: 0;
}

.toggle-button-container .btn.map-mode::before {
  opacity: 1;
}

.toggle-button-container .btn.map-mode::after {
  opacity: 0;
}

.toggle-button-container .btn.graph-mode::before {
  opacity: 0;
}

.toggle-button-container .btn.graph-mode::after {
  opacity: 1;
}

.toggle-button-container .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.3);
}

.toggle-button-container .btn:active {
  transform: scale(0.98);
}

.toggle-button-container .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: brightness(0.8);
}

.toggle-button-container .btn:disabled::before,
.toggle-button-container .btn:disabled::after {
  opacity: 0.5 !important;
  transition: opacity 0.3s ease;
}

.screenshot-button,
.restore-button,
.map-layer-button {
  width: 38px;
  z-index: 9999;
}

.map-layer-button {
  position: absolute;
  min-width: 37px;
  bottom: 20px;
  right: 116px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition:
    background 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.map-layer-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #4caf50, #1b872b);
  filter: brightness(1.2);
}

.map-layer-button:active:not(:disabled) {
  transform: scale(0.95);
}

.map-layer-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #999, #ccc);
  box-shadow: none;
  transform: none;
}

.map-layer-menu {
  position: absolute;
  bottom: 70px; /* Align the menu bottom with the button top. */
  right: 116px; /* Match the button's horizontal alignment. */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform-origin: bottom;
  transform: scaleY(0);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  z-index: 9998;
}
.map-layer-menu.active {
  transform: scaleY(1);
  opacity: 1;
}

.map-layer-menu .menu-entry {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  background: #fff;
}
.map-layer-menu .menu-entry:last-child {
  border-bottom: none;
}
.map-layer-menu .menu-entry i {
  width: 20px; /* Keep icon width consistent. */
  text-align: center;
  margin-right: 10px;
}
.map-layer-menu .menu-text {
  flex: 1;
  font-size: 0.9rem;
  color: #333;
}

/* Toggle switch styles scoped to .map-layer-menu. */
.map-layer-menu .switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.map-layer-menu .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.map-layer-menu .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.map-layer-menu .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.map-layer-menu .switch input:checked + .slider {
  background-color: #4caf50;
}

.map-layer-menu .switch input:checked + .slider:before {
  transform: translateX(20px);
}

.screenshot-button {
  position: absolute;
  min-width: 37px;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition:
    background 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.screenshot-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #4caf50, #1b872b);
  filter: brightness(1.2);
}

.screenshot-button:active:not(:disabled) {
  transform: scale(0.95);
}

.screenshot-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #999, #ccc);
  box-shadow: none;
  transform: none;
}

.restore-button {
  position: absolute;
  min-width: 37px;
  bottom: 20px;
  right: 68px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition:
    background 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.restore-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #4caf50, #1b872b);
  filter: brightness(1.2);
}

.restore-button:active:not(:disabled) {
  transform: scale(0.95);
}

.restore-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #999, #ccc);
  box-shadow: none;
  transform: none;
}

#timeControlsContainer {
  position: absolute;
  align-items: center;
  gap: 10px;
  bottom: 20px;
  left: 20px;
  width: 54%;
  z-index: 9999;
  display: none;
  border-radius: 8px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
}

#timeControlsContainer button {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 8px;
  margin: 0 0px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition:
    transform 0.3s ease,
    background 0.3s ease;
}

#timeControlsContainer button:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

#timeControlsContainer button:active {
  transform: scale(0.98);
}

#timeControlsContainer input[type="range"] {
  flex: 1;
  width: 100%;
  margin: 0 5px;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

#timeControlsContainer input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #ccc;
  border-radius: 3px;
}

#timeControlsContainer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  border-radius: 50%;
  margin-top: -4px;
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

#timeControlsContainer input[type="range"]::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, #4caf50, #1b872b);
  transform: scale(1.1);
}

#timeControlsContainer input[type="range"]::-moz-range-track {
  height: 6px;
  background: #ccc;
  border-radius: 3px;
}

#timeControlsContainer input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #4caf50, #1b872b);
  border-radius: 50%;
  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

#timeControlsContainer input[type="range"]::-moz-range-thumb:hover {
  background: linear-gradient(135deg, #4caf50, #1b872b);
  transform: scale(1.1);
}

#timeControlsContainer button:focus,
#timeControlsContainer input[type="range"]:focus {
  outline: none;
}

.current-date-widget {
  display: inline-flex !important;
  min-width: 50px;
  position: absolute;
  left: 36.5%;
  transform: translateX(-50%);
  bottom: 45px;
  z-index: 9999;
  color: gray;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  align-items: center;
}

.current-date-label {
  text-align: right;
  font-weight: bold;
  margin-right: 5px;
}

.current-date-value {
  text-align: left;
  font-weight: normal;
}

/* Right column (Col 3) */
.col3 {
  flex: 0 0 30%;
  width: 30%;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 20px);
  border: none;
  position: relative;
}

/* Miscellaneous styles and animations. */
.col1-bottom-section-content {
  padding: 6px 10px;
}

#networkTransRiskScore {
  z-index: 9999;
  display: none;
  position: absolute;
  top: 20px;
  left: 22px;
  color: green;
  font-size: 1rem;
  font-weight: 600;
}

.initial-sr,
.current-sr {
  font-family: sans-serif;
}

.trade-info-header {
  flex: 0 0 45px;
  padding: 8px 10px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  border: 0.5px solid green;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 5px;
}

.trade-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 0.5px solid green;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-width: 0;
}

.trade-section:first-child {
  margin-bottom: 5px;
}

.trade-section-header {
  height: 37px;
  padding: 8px;
  padding-left: 11px;
  border-bottom: 1px solid #ddd;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background: green;
  color: white;
  font-size: 14px;
  font-weight: bold;
  flex: 0 0 auto;
}

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

.trade-list::-webkit-scrollbar-thumb {
  background-color: green;
  border-radius: 4px;
}

.trade-list::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.2);
}

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

.trade-list {
  flex: 1;
  color: white;
  background: transparent;
  padding: 10px;
  padding-top: 5px;
  overflow-y: auto;
}

.trade-item {
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.8rem;
}

.trade-item:last-child {
  border-bottom: none;
}

.trade-dest,
.trade-src {
  font-weight: 500;
}

.trade-volume {
  font-weight: 600;
}

.trade-header-checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  bottom: 1px;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
  vertical-align: middle;
  margin-left: 10px;
}

.trade-header-checkbox:enabled:checked {
  background: #4caf50;
  border-color: transparent;
}

.trade-header-checkbox:disabled,
.trade-header-checkbox:disabled:checked {
  background: #999;
  border-color: #999;
  cursor: not-allowed;
}

.trade-checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
  margin-left: 10px;
  position: relative;
}

.trade-checkbox:enabled:checked {
  background: #4caf50;
  border-color: transparent;
}

.trade-checkbox:disabled,
.trade-checkbox:disabled:checked {
  background: #999;
  border-color: #999;
  cursor: not-allowed;
}

.trade-header-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.trade-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.no-trades {
  text-align: center;
  font-style: italic;
  color: #777;
}

.trade-info-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.trade-panel {
  height: 60%;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.trade-sections {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: 1fr 1fr;
  overflow-y: auto;
}

.in-arbo-container {
  visibility: hidden;
  height: calc(40% - 10px);
  width: 100%;
  padding: 10px;
  border: 0.5px solid rgb(69, 116, 69);
  border-radius: 8px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  background: rgba(0, 0, 0, 0.4);
}

.inArboTitle {
  position: absolute;
  z-index: 11;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.arbo-link {
  opacity: 1;
  stroke: #46fa46;
  stroke-width: 1;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
  animation: dashFlow 2s linear infinite;
}

@keyframes dashFlow {
  to {
    stroke-dashoffset: -10;
  }
}

.no-arbo {
  position: absolute;
  top: 40px;
  text-align: center;
  font-style: italic;
  color: #777;
}

.global-stats-chart {
  box-sizing: border-box;
  width: calc(100% - 10px);
  height: 33.3vh;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: absolute;
  z-index: 10;
  border: 0.5px solid green;
}

#globalStatsControls {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px;
  z-index: 11;
  font-family: Arial, sans-serif;
}

#globalStatsControls label {
  margin-right: 5px;
  font-size: 14px;
  font-weight: bold;
}

#globalStatsControls select {
  border-radius: 3px;
  background: green;
  color: white;
  font-size: 14px;
  outline: none;
}

#globalStatsControls select:hover {
  filter: brightness(1.2);
}

.node-stats-chart {
  box-sizing: border-box;
  width: calc(100% - 10px);
  height: calc(100vh - 33.3vh - 50px);
  border-radius: 8px;
  margin-top: calc(33.3vh + 10px);
  margin-bottom: 10px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 0.5px solid green;
  position: absolute;
  z-index: 10;
}

#nodeStatsControls {
  position: absolute;
  top: calc(33.3vh + 20px);
  left: 10px;
  padding: 10px;
  z-index: 11;
  font-family: Arial, sans-serif;
}

#nodeStatsControls label {
  margin-right: 5px;
  font-size: 14px;
  font-weight: bold;
}

#nodeStatsControls select {
  border-radius: 3px;
  background: green;
  color: white;
  font-size: 14px;
  outline: none;
}

#nodeStatsControls select:hover {
  filter: brightness(1.2);
}

/* D3-specific styles. */
.node {
  cursor: pointer;
  stroke-width: 4.5px;
  stroke-dasharray: 5 5;
  animation: dash 2s linear infinite;
}

.nodeOver {
  cursor: pointer;
}

circle:hover,
g.node:hover {
  cursor: pointer;
}

.trade-donut {
  cursor: pointer;
}

.inactive-overlay-selected i {
  color: white;
}

@keyframes breathing {
  0% {
    stroke-opacity: 1;
    transform: scale(1);
  }

  50% {
    stroke-opacity: 1;
    transform: scale(1.15);
  }

  100% {
    stroke-opacity: 1;
    transform: scale(1);
  }
}

@keyframes breathing-legend {
  0% {
    stroke-opacity: 1;
    transform: scale(1);
  }

  50% {
    stroke-opacity: 1;
    transform: scale(1);
  }

  100% {
    stroke-opacity: 1;
    transform: scale(1);
  }
}

.hotspotStroke {
  stroke-dasharray: 5 5;
  animation:
    dash 2s linear infinite,
    breathing 2.5s ease-in-out infinite;
}

.hotspotHalo {
  fill: none;
  stroke: orange;
  stroke-width: 2;
  opacity: 0.8;
  animation: pulseHalo 1.5s infinite;
}

@keyframes pulseHalo {
  0% {
    r: 0;
    opacity: 0.8;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.hotspotLegend {
  stroke-dasharray: 5 5;
  animation:
    dash 2s linear infinite,
    breathing-legend 2.5s ease-in-out infinite;
  right: 20px;
  bottom: 120px;
  min-width: 95px;
  height: 140px;
  position: absolute;
  border-radius: 4px;
  cursor: move;
}

.hotspotInfoButton {
  position: absolute;
  left: 238px;
  top: 18px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 18px;
  background: none;
  border: none;
}

.hotspotInfoButton i {
  color: green;
}

.statsContainer {
  cursor: move;
  position: absolute;
  top: 60px;
  left: 20px;
  width: 220px;
  height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: none;
  border-radius: 4px;
  padding: 4px;
  padding-right: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: gray;
  font-family: sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
}

.stat-icon {
  width: 24px;
  text-align: center;
}

.stat-label {
  flex: 1;
  text-align: left;
  margin-left: 8px;
}

.stat-value {
  text-align: right;
  margin-left: 8px;
}

.link {
  fill: none;
  stroke-width: 1.5px;
  opacity: 0.2;
}

.linkOver {
  fill: none;
  stroke: #2ca02c;
  stroke-width: 4px;
  opacity: 1;
  stroke-dasharray: 5 5;
  animation: dash 2s linear infinite;
}

.linkSelectOut {
  fill: none;
  opacity: 1;
  stroke: #46fa46;
  stroke-width: 1.5px;
  stroke-dasharray: 5 5;
  animation: dash 2s linear infinite;
}

.linkSelectOutOver {
  fill: none;
  opacity: 1;
  stroke: fuchsia;
  stroke-width: 2.5px;
  stroke-dasharray: 5 5;
  animation: dash 1s linear infinite;
}

.linkSelectIn {
  fill: none;
  opacity: 1;
  stroke: #fcc67e;
  stroke-width: 1.5px;
  stroke-dasharray: 5 5;
  animation: dash 2s linear infinite;
}

.linkSelectInOver {
  fill: none;
  opacity: 1;
  stroke: fuchsia;
  stroke-width: 2.5px;
  stroke-dasharray: 5 5;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -10;
  }
}

.bubble text {
  font: 12px sans-serif;
  fill: black;
}

.map path {
  fill: none;
  stroke: #999;
  stroke-width: 1;
}

.annotation-group {
  pointer-events: none;
  position: relative;
}

.current-date-annotation {
  font-size: 0.9rem;
  fill: #000000;
  pointer-events: none;
}

.annotation-connector {
  stroke-dasharray: 4, 2;
  opacity: 0.9;
}

#radial-labels-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

#tradeClusters {
  border: 0.5px solid green;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  height: calc(50% - 5px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.trade-clusters-label {
  position: absolute;
  padding: 10px;
  margin-right: 5px;
  font-size: 14px;
  font-weight: bold;
}

#tradeDistribution {
  border: 0.5px solid green;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  height: calc(50% - 5px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.trade-distribution-label {
  position: absolute;
  padding: 10px;
  margin-right: 5px;
  font-size: 14px;
  font-weight: bold;
}

#tradeNodeDistribution {
  visibility: hidden;
  border: 0.5px solid green;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  height: calc(50% - 5px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.trade-node-distribution-label {
  position: absolute;
  padding: 10px;
  margin-right: 5px;
  font-size: 14px;
  font-weight: bold;
}

/* Focus-mode Trade Placeholder overlay UI */
#tradeNodeInsight {
  position: relative;
  overflow: hidden;
}

#tradeNodeInsight svg.trade-placeholder-svg {
  position: absolute;
  inset: 0;
}

/* Keep label/controls/summary above the SVG */
.trade-nodeinsight-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 6;
  pointer-events: none;
}

#tradeNodeInsight {
  visibility: hidden;
  border: 0.5px solid green;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  height: calc(50% - 5px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

#tradeNodeInsightControls {
  position: absolute;
  top: 32px;
  left: 10px;
  right: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

#tradeNodeInsightControls label {
  margin: 0;
  color: white;
  white-space: nowrap;
}

#tradeNodeInsightSelect {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.25);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}

#tradeNodeInsightSummary {
  position: absolute;
  top: 58px;
  left: 10px;
  right: 10px;
  z-index: 6;
  font-size: 11px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.cluster-annotation .annotation-note-label {
  font-size: 8px;
}

.cluster-annotation .annotation-note-title {
  font-size: 10px;
}

.node-annotation rect.annotation-note-bg {
  fill: green;
  fill-opacity: 0.8;
  rx: 4;
  ry: 4;
}

.node-annotation .annotation-connector .connector {
  stroke: green;
}

.node-annotation .annotation-note .note-line {
  stroke: green;
}

.node-annotation .annotation-note text {
  fill: white;
}

.node-annotation.selected rect.annotation-note-bg {
  fill: white;
}

.node-annotation.selected .annotation-connector .connector {
  stroke: white;
}

.node-annotation.selected .annotation-note .note-line {
  stroke: white;
}

.node-annotation.selected .annotation-note text {
  fill: gray;
}

svg.custom-radar rect.annotation-bg {
  fill: green;
  fill-opacity: 0.8;
  rx: 4;
  ry: 4;
}

svg.custom-radar.selected rect.annotation-bg {
  fill: white;
}

svg.custom-radar path.node-radar {
  fill: rgba(255, 255, 255, 0.2);
  stroke: rgba(255, 255, 255, 1);
  stroke-width: 2;
}

svg.custom-radar.selected path.node-radar {
  fill: rgba(0, 0, 0, 0.2);
  stroke: rgba(0, 0, 0, 1);
}

svg.custom-radar line {
  stroke: rgba(255, 255, 255, 0.5);
}

svg.custom-radar.selected line {
  stroke: rgba(0, 0, 0, 0.5);
}

svg.custom-radar path.radar-baseline {
  stroke: rgba(255, 255, 255, 0.7);
}

svg.custom-radar.selected path.radar-baseline {
  stroke: rgba(0, 0, 0, 0.7);
}

circle.vertex {
  fill: rgba(255, 255, 255, 1);
}

circle.vertex.selected {
  fill: rgba(0, 0, 0, 1);
}

.radial-axis-label {
  color: white;
  font-size: 10px;
}

.radial-axis-label.selected {
  color: gray;
}

.line {
  fill: none;
  stroke: #e3d000;
  stroke-miterlimit: 10;
  stroke-width: 1;
  animation: line-pulse 5s ease infinite;
  -moz-animation: line-pulse 5s ease infinite;
  /* Firefox */
  -webkit-animation: line-pulse 5s ease infinite;
  /* Safari and Chrome */
  -o-animation: line-pulse 5s ease infinite;
  /* Opera */
}

@keyframes dashFlow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -10;
  }
}

.circle {
  fill: transparent;
  transition: fill 300ms ease;
}

.blue-bg {
  fill: #e3d000;
  animation: circle-pulse 10s linear infinite;
  -moz-animation: circle-pulse 10s linear infinite;
  /* Firefox */
  -webkit-animation: circle-pulse 10s linear infinite;
  /* Safari and Chrome */
  -o-animation: circle-pulse 10s linear infinite;
  /* Opera */
  -webkit-animation-delay: 3s;
  /* Chrome, Safari, and Opera */
  animation-delay: 3s;
}

@keyframes circle-pulse {
  0%,
  100% {
    fill: #e3d000;
  }

  50% {
    fill: #00fff7;
  }
}

@keyframes line-pulse {
  0%,
  100% {
    stroke: #e3d000;
  }

  50% {
    stroke: #00f7ff;
  }
}

@keyframes svg-pulse {
  0%,
  100% {
    stroke: #00e3c5;
  }

  50% {
    stroke: #ffffff;
  }
}

/* Intro overlay. */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: overlayFadeIn 0.4s ease forwards;
}

.intro-overlay.hide {
  animation: overlayFadeOut 0.4s ease forwards;
  pointer-events: none;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes overlayFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.intro-content {
  background: #fff;
  color: #111827;
  border-radius: 14px;
  width: min(1080px, 92vw);
  padding: 22px 22px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: contentSlideIn 0.4s ease forwards;
}
.intro-overlay.hide .intro-content {
  animation: contentSlideOut 0.4s ease forwards;
}

@keyframes contentSlideIn {
  from {
    transform: translateY(-24px);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes contentSlideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-16px);
    opacity: 0;
  }
}

.intro-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.intro-subtitle {
  margin: 6px 0 0;
  color: #6b7280;
}

.intro-left,
.intro-right {
  display: flex;
  flex-direction: column;
}

.intro-badge {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.25);
  padding: 6px 10px;
  border-radius: 12px;
  color: #1b872b;
  font-weight: 750;
  font-size: 1.2em;
  width: 100%;
  white-space: nowrap;
}
.intro-badge-left {
  align-self: center;
  text-align: center;
  justify-content: center;
}
.intro-badge-right {
  align-self: center;
  text-align: center;
  justify-content: center;
}

.intro-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
}

.intro-note {
  border: 1px solid rgba(0, 0, 0, 0.08);
  /* Optional gradient background. */
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.intro-dont-show-again {
  border: 1px solid rgba(175, 76, 76, 0.25);
  background: rgba(175, 76, 76, 0.07);
  padding: 6px 10px;
  border-radius: 6px;
}

.intro-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Keyboard stage. */
.kbd-annotated {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px) 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(30, 30, 30, 0.06),
    rgba(30, 30, 30, 0.02)
  );
  border: 1px solid rgba(0, 0, 0, 0.08);
}

#introKeyboard {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  justify-self: center;
}

.kbd-callout {
  position: relative;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 90, 0, 0.838);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.25;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.kbd-callout__title {
  font-weight: 800;
  margin-bottom: 4px;
}
.kbd-callout__title kbd {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.842);
  color: #fff;
  margin-right: 6px;
  font-weight: 900;
}

.kbd-callout--s {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
}
.kbd-callout--m {
  grid-column: 3;
  grid-row: 3;
  justify-self: end;
  align-self: start;
}
.kbd-callout--q {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: center;
}
.kbd-callout--h {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  align-self: start;
}
.kbd-callout--r {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
}
.kbd-callout--space {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  align-self: end;
}
.kbd-callout--f {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  align-self: end;
}
.kbd-callout--arrows {
  grid-column: 2;
  grid-row: 3;
  justify-self: center;
  align-self: end;
}

.kbd-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 141, 52, 0.35);
}
.kbd-callout--s .kbd-dot {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
}
.kbd-callout--r .kbd-dot,
.kbd-callout--h .kbd-dot {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
}

.kbd-callout--m .kbd-dot,
.kbd-callout--f .kbd-dot {
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
}

.kbd-callout--space .kbd-dot,
.kbd-callout--q .kbd-dot,
.kbd-callout--arrows .kbd-dot {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
}

/* Keyboard style adjustments. */
#introKeyboard .hg-button {
  border-radius: 10px;
  font-weight: 700;
}

#introKeyboard .hg-button.intro-key--hot {
  border: 2px solid rgba(46, 141, 52, 0.55);
  box-shadow: 0 0 10px rgba(46, 141, 52, 0.25);
}

#introKeyboard .hg-button.intro-key--hot {
  background: pink !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  box-shadow: 0 0 0 2px rgba(105, 255, 115, 0.55) !important;
  font-weight: 900 !important;
}

vg.leader-line,
svg.leader-line:not(:root) {
  overflow: visible !important;
  z-index: 25000 !important;
  pointer-events: none !important;
}

.leader-line {
  z-index: 25000 !important;
}
