/* ========================================================= 
   tsl209.css (FULL UPDATED)
   - Premium "finance terminal" polish
   - No HTML/JS changes required
   ========================================================= */

/* 0. RESET & BASE LAYOUT */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

html {
  scroll-behavior: smooth;
}

:root{
  --bg: #020617;                /* deep navy */
  --bg2: #030a1a;               /* slightly different navy for gradients */
  --panel: #f9fafb;             /* card background */
  --text: #e5e7eb;              /* main text on dark */
  --muted: #9ca3af;             /* muted text */
  --muted2: #cbd5f5;            /* heading subtext */
  --ink: #0f172a;               /* dark text on light */
  --ink2: #0b1220;
  --borderDark: #111827;
  --borderLight: #e5e7eb;
  --blue: #60a5fa;
  --blue2:#0369a1;
  --radius: 16px;
  --radiusSm: 12px;
  --shadow1: 0 10px 28px rgba(15,23,42,.18);
  --shadow2: 0 16px 40px rgba(15,23,42,.22);
  --shadow3: 0 22px 70px rgba(2,6,23,.35);
}

::selection{
  background: rgba(96,165,250,0.28);
}

/* =========================================================
   ✅ MOBILE TAP HIGHLIGHT / "BLUE SQUARE" REMOVAL (CSS ONLY)
   ========================================================= */
*{
  -webkit-tap-highlight-color: transparent;
}

a, button,
.circle, .label-circle,
.news-logo-square,
.header-link, .dropbtn,
.side-menu .section, .side-menu a,
.node .factor-cycle-btn,
.node-system .rundown a, .node-system .share-link a{
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Remove default focus outline on touch taps, but KEEP for keyboard via :focus-visible */
:where(
  a, button, [role="button"],
  .circle, .label-circle,
  .news-logo-square,
  .header-link, .dropbtn,
  .side-menu .section, .side-menu a,
  .node .factor-cycle-btn,
  .node-system .rundown a, .node-system .share-link a
):focus:not(:focus-visible){
  outline: none;
}

/* Nice “pressed” feel on touch devices (no blue overlay) */
@media (hover: none) and (pointer: coarse){
  .circle:active,
  .label-circle:active{
    transform: translateY(0) scale(0.98);
  }

  .node-system .rundown a:active,
  .node-system .share-link a:active,
  .side-menu .section:active,
  .side-menu .submenu a:active,
  .side-menu > ul > li > a:active,
  .header-link:active,
  button:active{
    opacity: 0.88;
  }

  .news-logo-square:active{
    filter: brightness(1.15);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(96,165,250,0.10), transparent 55%),
              radial-gradient(900px 600px at 10% 20%, rgba(34,197,94,0.06), transparent 55%),
              radial-gradient(900px 600px at 90% 30%, rgba(239,68,68,0.05), transparent 55%),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* subtle scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

.content-wrapper {
  flex: 1;
  position: relative;
  min-height: auto;
  width: 100%;
}

/* 1. HEADER */
header {
  background: rgba(2,6,23,0.78);
  color: #f9fafb;
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 1200;
  border-bottom: 1px solid rgba(17,24,39,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
}

header::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.35), transparent);
  pointer-events:none;
}

.hamburger {
  display: inline-block !important;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: #e5e7eb;
  margin-right: 16px;
  z-index: 1300;
  transition: transform .15s ease, color .15s ease;
}

.hamburger:hover {
  color: var(--blue);
  transform: translateY(-1px);
}
.hamburger:active { transform: translateY(0); }

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
}

.logo {
  height: 32px;
  margin-right: 0;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.35));
}

.logo-text {
  font-size: 18px;
  font-weight: 720;
  letter-spacing: 0.02em;
  color: #f9fafb;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.header-link {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31,41,55,0.9);
  background: rgba(2,6,23,0.55);
  transition: border-color .15s ease, color .15s ease, transform .15s ease, background .15s ease;
}

.header-link i { font-size: 14px; }

.header-link:hover {
  border-color: rgba(96,165,250,0.65);
  color: #f9fafb;
  background: rgba(96,165,250,0.10);
  transform: translateY(-1px);
}
.header-link:active{ transform: translateY(0); }

/* 2. SLIDE-OUT SIDE-MENU */
.side-menu {
  position: fixed;
  top: 60px;
  left: 0;
  width: 260px;
  height: calc(100% - 60px);
  background: rgba(2,6,23,0.92);
  color: #e5e7eb;
  padding: 20px 10px;
  transform: translateX(calc(-100% - 10px));
  transition: transform .3s ease;
  z-index: 1100;
  overflow-y: auto;
  border-right: 1px solid rgba(17,24,39,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.side-menu.open::after{
  content:"";
  position: fixed;
  inset: 60px 0 0 0;
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: -1;
}

.side-menu.open { transform: translateX(0); }

.side-menu .section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 8px;
  font-weight: 650;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  color: #e5e7eb;
  transition: background .15s ease;
}

.side-menu .section:hover { background: rgba(96,165,250,0.08); }

.side-menu .toggle {
  transition: transform .3s ease, color .15s ease;
  font-size: 11px;
  color: #9ca3af;
}

.expandable.open .toggle {
  transform: rotate(45deg);
  color: var(--blue);
}

.side-menu .submenu {
  display: none;
  margin: 4px 0 10px 18px;
  list-style: none;
  padding: 0;
}

.side-menu .expandable { margin-block-end: 2px; }

.side-menu a,
.side-menu a:visited {
  color: #d1d5db;
  text-decoration: none;
  font-size: 13px;
}

.side-menu .submenu a {
  display: block;
  padding: 5px 0 5px 22px;
  position: relative;
  font-weight: 450;
  transition: color .15s ease;
}

.side-menu .submenu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border: 1px solid rgba(107,114,128,0.9);
  border-radius: 50%;
  background: rgba(2,6,23,0.9);
}

.side-menu .submenu a:hover,
.side-menu > ul > li > a:hover {
  color: #f9fafb;
}

.side-menu > ul > li > a {
  display: block;
  padding: 9px 8px;
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}

.side-menu > ul > li > a:hover{ background: rgba(96,165,250,0.08); }

.side-menu ul {
  list-style: none;
  margin: 0;
  padding: 0 0 60px;
}

.welcome {
  padding: 10px 8px;
  font-weight: 550;
  font-size: 13px;
  opacity: .95;
  border-bottom: 1px solid rgba(17,24,39,0.9);
  margin-bottom: 10px;
}

.brand {
  margin-top: auto;
  padding: 12px 8px;
  font-size: 12px;
  text-align: center;
  opacity: .65;
  transition: opacity .15s ease;
}

.brand:hover { opacity: .85; }

/* 3. LEGACY DROPDOWNS */
.dropdown { position: relative; }

.dropbtn {
  background: none;
  border: none;
  color: #f9fafb;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}

.dropbtn a {
  color: inherit;
  text-decoration: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #f9fafb;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  z-index: 10;
  border-radius: 10px;
  overflow: hidden;
}

.dropdown-content a {
  display: block;
  padding: 10px 12px;
  color: #0f172a;
  text-decoration: none;
}

.dropdown-content a:hover { background: #e5e7eb; }

.dropdown:hover .dropdown-content { display: block; }

/* 4. STOCK-TICKER */
.stock-tickers {
  background: rgba(2,6,23,0.9);
  overflow: hidden;
  padding: 10px 20px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(17,24,39,0.9);
  position: relative;
  width: 100%;
}

.stock-tickers::before,
.stock-tickers::after{
  content:"";
  position:absolute;
  top:0; bottom:0;
  width: 70px;
  z-index: 2;
  pointer-events:none;
}
.stock-tickers::before{
  left:0;
  background: linear-gradient(90deg, rgba(2,6,23,0.95), transparent);
}
.stock-tickers::after{
  right:0;
  background: linear-gradient(270deg, rgba(2,6,23,0.95), transparent);
}

.ticker-wrapper { overflow: hidden; }

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 34s linear infinite;
  will-change: transform;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 80px;
  font-size: 13px;
  color: #e5e7eb;
}

.ticker-symbol { font-weight: 700; color: #e5e7eb; }

.ticker-price {
  margin: 0 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ticker-arrow { vertical-align: middle; }

/* 5. NODE-NETWORK & VISUALS */
.node-network-container {
  position: relative;
  padding: 12px 10px 210px;
  min-height: 6000px;
  background:
    radial-gradient(1100px 650px at 50% 0%, rgba(96,165,250,0.08), transparent 60%),
    radial-gradient(900px 550px at 10% 35%, rgba(34,197,94,0.05), transparent 60%),
    radial-gradient(900px 550px at 90% 35%, rgba(239,68,68,0.04), transparent 60%),
    var(--bg);
}

.node-network-container::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity: 0.15;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at 50% 20%, black 0 55%, transparent 85%);
}

.node-network {
  position: relative;
  width: 900px;
  height: 1200px;
}

.system-text {
  position: absolute;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.node { position: absolute; }

/* Circles */
.circle {
  width: 80px;
  height: 80px;
  background: var(--panel);
  border-radius: 50%;
  border: 1px solid rgba(203,213,245,0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
  position: relative;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.circle:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15,23,42,.18);
  border-color: rgba(96,165,250,0.55);
}

.circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.label-circle {
  background: #020617;
  color: #f9fafb;
  font-weight: 760;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(96,165,250,0.95);
  position: relative;
  box-shadow: 0 10px 26px rgba(2,6,23,.35);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.label-circle:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(2,6,23,.45);
  border-color: rgba(147,197,253,0.95);
}

/* impact rings */
.node.impact-pos .circle::after,
.node.impact-pos .label-circle::after,
.node.impact-neg .circle::after,
.node.impact-neg .label-circle::after,
.node.impact-neu .circle::after,
.node.impact-neu .label-circle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  pointer-events: none;
  border: 3px solid transparent;
  box-shadow: 0 0 14px rgba(0,0,0,0.06);
}
.node.impact-pos .circle::after,
.node.impact-pos .label-circle::after { border-color: rgba(34,197,94,0.85); }
.node.impact-neg .circle::after,
.node.impact-neg .label-circle::after { border-color: rgba(239,68,68,0.85); }
.node.impact-neu .circle::after,
.node.impact-neu .label-circle::after { border-color: rgba(148,163,184,0.9); }

/* CARD WRAPPER */
.node-system {
  position: absolute;
  width: 400px;
  height: 520px;
  border: 1px solid transparent;
  z-index: 1;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.node-system::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(135deg, rgba(15,23,42,0.02), rgba(15,23,42,0.06));
}

.node-system > * { position: relative; z-index: 1; }

.node-system:hover{
  transform: translateY(-2px);
  transition: transform .18s ease;
}

/* nodes container */
.node-system .nodes-container {
  position: absolute;
  left: 50%;
  top: 72px;
  width: 400px;
  height: 460px;
  transform: translateX(-50%);
  transform-origin: top center;
}

/* Put subheadings (index-label) INSIDE the card */
.index-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 760;
  margin: 0;
  z-index: 999;
  color: var(--ink2);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.index-label .flag-icon {
  width: 30px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.18);
}

/* ACTION LINKS */
.node-system .rundown,
.node-system .share-link {
  position: absolute;
  top: 38px;
  display: flex;
  align-items: center;
  z-index: 12;
}

.node-system .rundown { left: 44px; }
.node-system .share-link { right: 44px; left: auto; }

.node-system .rundown a,
.node-system .share-link a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  font-size: 12.5px;
  line-height: 1;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: rgba(15,23,42,0.92);
  text-decoration: none;
  white-space: nowrap;
  transition: color .14s ease, transform .14s ease, text-decoration-color .14s ease;
}

.node-system .rundown a:hover,
.node-system .share-link a:hover {
  color: var(--blue2);
  transform: translateY(-1px);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.node-system .rundown a:active,
.node-system .share-link a:active { transform: translateY(0); }

.node-system .rundown i,
.node-system .share-link i {
  color: currentColor;
  margin: 0;
  display: inline-block;
}

/* IMPACT ARROW */
.node-system .impact-arrow{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 40px;
  pointer-events: none;
  z-index: 10;
  top: 38px;
  isolation: isolate;
  border-radius: 8px;
}

.node-system .impact-arrow::before{
  content: "";
  position: absolute;
  inset: 3px 4px 8px 4px;
  border-radius: 7px;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to right,
      rgba(15,23,42,0.08) 0 1px,
      transparent 1px 18px
    ),
    repeating-linear-gradient(
      to top,
      rgba(15,23,42,0.06) 0 1px,
      transparent 1px 10px
    );
  opacity: 0.9;
}

.node-system .impact-arrow::after{
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 10px;
  z-index: 1;
  pointer-events: none;
  --axis: rgba(15,23,42,0.45);
  background:
    linear-gradient(var(--axis), var(--axis)) left 50% / calc(100% - 8px) 1px no-repeat,
    linear-gradient(45deg, var(--axis) 0 50%, transparent 50% 100%) right 50% / 6px 6px no-repeat,
    linear-gradient(-45deg, var(--axis) 0 50%, transparent 50% 100%) right 50% / 6px 6px no-repeat;
  opacity: 0.95;
}

.node-system.arrow-green .impact-arrow{ color: #16a34a; }
.node-system.arrow-red   .impact-arrow{ color: #dc2626; }

.node-system .impact-arrow svg{
  width: 110px;
  height: 30px;
  overflow: visible;
  display: block;
  position: absolute;
  top: 2px;
  left: 0;
  z-index: 2;
  transform: scaleX(0.88) scaleY(1.45);
  transform-origin: 50% 50%;
}

.node-system.arrow-red .impact-arrow svg{
  transform: scaleX(0.88) scaleY(1.45) scaleY(-1);
  transform-origin: 50% 50%;
}

.node-system .impact-arrow path{
  fill: none !important;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: impactDraw 1.6s ease-in-out infinite;
}

@keyframes impactDraw{
  0%   { stroke-dashoffset: 220; opacity: 0; }
  10%  { opacity: 1; }
  60%  { stroke-dashoffset: 0; opacity: 1; }
  90%  { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 220; opacity: 0; }
}

/* keep non-mobile positioning */
@media (min-width: 769px){
  .node-system .rundown,
  .node-system .share-link{ top: 55px !important; }
  .node-system .impact-arrow{ top: 55px !important; }
}

@keyframes walkCycle {
  from { transform: translateX(0); }
  to   { transform: translateX(2px); }
}
.node-system .rundown i { animation: walkCycle .6s infinite alternate ease-in-out; }

/* Info text */
.info-box {
  position: absolute;
  width: 150px;
  min-height: 28px;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  color: rgba(15,23,42,0.92);
  text-align: center;
  line-height: 1.15;
  padding: 6px 6px;
  z-index: 4;
  transform: translateX(-35px);
}

.info-box[id$="-info-top"] { left: 160px !important; }

/* animated dots */
.moving-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  left: 0;
  top: 0;
  box-shadow: 0 0 6px rgba(96,165,250,0.55);
}

/* NEWS ICON SQUARES */
.news-logo-square{
  position: absolute;
  z-index: 50;
  transform: translate(-50%, -50%);
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: #000000 !important;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
  cursor: pointer;
  color: #ffffff !important;
  transition: transform .14s ease, box-shadow .14s ease;
}

.news-logo-square * ,
.news-logo-square span,
.news-logo-square a{ color: #ffffff !important; }

.news-logo-square.badge-square{ width: 26px; padding: 0; }
.news-logo-square.badge-pill{
  width: auto;
  max-width: 56px;
  padding: 0 8px;
}

.news-logo-square span{
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.news-logo-square:hover{
  transform: translate(-50%, -50%) translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,.55), 0 0 0 1px rgba(96,165,250,0.25);
}

/* default h2 used in node-network */
h2 {
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  position: absolute;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 650;
}

.news-logo { width: 25px; height: 25px; object-fit: contain; }
.news-title { font-size: 14px; color: var(--ink); }

/* modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #f9fafb;
  margin: 12% auto;
  padding: 20px 20px 22px;
  border: 1px solid #e5e7eb;
  width: 86%;
  max-width: 640px;
  border-radius: 14px;
  text-align: left;
  box-shadow: 0 18px 60px rgba(15,23,42,.35);
  color: #0f172a;
}

.modal-content h2 { position: static; margin: 0 0 10px; }

.close-button {
  color: #9ca3af;
  float: right;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #111827;
  text-decoration: none;
}

#summaryContent {
  font-size: 15px;
  line-height: 1.55;
  color: #111827;
  margin-top: 10px;
}

#summaryContent.loading {
  font-style: italic;
  color: #9ca3af;
}

/* HEADING LOOK */
.us-market-heading h2,
.us-market-heading .ny-subheading,
.intl-main-heading,
.asia-main-heading {
  position: static !important;
  display: block !important;
  text-align: left !important;
}

.intl-main-heading,
.asia-main-heading,
.us-market-heading h2 {
  font-size: 22px !important;
  font-weight: 760 !important;
  margin: 0 0 10px 0 !important;
  color: #f9fafb !important;
  letter-spacing: 0.01em;
}

.ny-subheading,
.intl-subheading,
.asia-subheading {
  display: block !important;
  margin-top: 6px !important;
  line-height: 1.35 !important;
  font-size: 15px !important;
  color: var(--muted2) !important;
}

/* region headings (desktop default) */
#europe-lenses,
#intl-frankfurt,
#intl-paris,
.asia-heading {
  position: absolute;
  width: 400px;
  text-align: left;
  font-size: 15px;
  z-index: 10;
}

/* =========================================================
   ✅ TABLET / MID SCREENS (iPad Air etc)
   ✅ FIXED: 3rd card ALWAYS under the 1st card (left column)
   ✅ STOCKS: flow 2-by-2; last ends under left column
   ========================================================= */
@media (min-width: 769px) and (max-width: 1279px) {

  /* full-bleed header/ticker/footer */
  header,
  .stock-tickers,
  footer{
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  /* ✅ 2-column GRID */
  .node-network-container{
    min-height: auto !important;
    padding: 12px 16px 210px !important;

    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;

    max-width: 920px !important;
    margin: 0 auto !important;

    align-items: start !important;
  }

  .node-network{
    width: 100% !important;
    height: auto !important;
    position: static !important;
    display: contents !important;
  }

  /* ✅ cards become grid items (no absolute coords) */
  .node-system{
    position: relative !important;
    top: auto !important;
    left: auto !important;

    width: 100% !important;
    max-width: none !important;

    height: 520px !important;
    margin: 0 !important;

    border: 1px solid rgba(229,231,235,0.95) !important;
    border-radius: var(--radius) !important;
    background: #f9fafb !important;
    box-shadow: var(--shadow1) !important;
    overflow: hidden !important;
    z-index: 1 !important;

    justify-self: stretch !important;
  }

  .node-system .nodes-container{
    position: absolute !important;
    left: 50% !important;
    top: 92px !important;
    width: 400px !important;
    height: 460px !important;
    transform: translateX(-50%) scale(0.92) !important;
    transform-origin: top center !important;
  }

  /* ✅ Make ALL headings/labels flow (not absolute) */
  #us-lenses,
  #europe-lenses,
  .asia-heading,
  #intl-frankfurt,
  #intl-paris,
  #asia-nikkei,
  #asia-hangseng,
  #asia-shanghai,
  #stock-nyc-1,
  #stock-nyc-2,
  #stock-nyc-3,
  #commodity-1,
  #commodity-2,
  #commodity-3,
  #currency-1,
  #currency-2,
  #currency-3,
  #crypto-1,
  #crypto-2,
  #crypto-3{
    position: static !important;
    width: auto !important;
    z-index: 10 !important;
  }

  /* Main section headings span both columns */
  #us-lenses,
  #europe-lenses,
  .asia-heading,
  #stock-nyc-1{
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin: 28px 0 10px 0 !important;
    text-align: left !important;
  }

  /* ✅ STOCKS: remove extra row-headings so it flows 2-by-2 naturally */
  #stock-nyc-2,
  #stock-nyc-3{
    display: none !important;
  }

  /* --------------------------
     ✅ LABEL RULES (THE FIX)
     - If a label is SINGLE (only one city label before a card),
       it MUST span both columns so it doesn't steal col 1 and push
       the next card into col 2.
     - Then we align it visually left/right.
     -------------------------- */

  /* EUROPE single labels */
  #intl-frankfurt{
    grid-column: 1 / -1 !important;
    justify-self: end !important;
    text-align: right !important;
    margin: 0 0 8px 0 !important;
  }

  #intl-paris{
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }

  /* ASIA: Tokyo left + HK right on SAME row */
  #asia-nikkei{
    grid-column: 1 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }
  #asia-hangseng{
    grid-column: 2 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }

  /* Shanghai single label */
  #asia-shanghai{
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }

  /* COMMODITIES/CURRENCY/CRYPTO: first two labels share a row, third is single */
  #commodity-1, #currency-1, #crypto-1{
    grid-column: 1 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }
  #commodity-2, #currency-2, #crypto-2{
    grid-column: 2 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }
  #commodity-3, #currency-3, #crypto-3{
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
  }

  /* ✅ also ensure stray absolute h2 doesn't break flow on tablet */
  .node-network-container h2:not(.index-label){
    position: static !important;
  }

  /* ===== ORDERING (kept from your file) ===== */

  /* US */
  #us-lenses { order: 100; }
  #system1  { order: 110; }
  #system2  { order: 111; }
  #system3  { order: 112; }

  /* EUROPE */
  #europe-lenses   { order: 200; }
  #intl-frankfurt  { order: 210; }
  #system4         { order: 220; }  /* FTSE */
  #system5         { order: 221; }  /* DAX */
  #intl-paris      { order: 230; }
  #system6         { order: 231; }  /* CAC (now under FTSE col) */

  /* ASIA */
  .asia-heading    { order: 300; }
  #asia-nikkei     { order: 310; }
  #asia-hangseng   { order: 311; }
  #system7         { order: 320; }  /* Nikkei */
  #system8         { order: 321; }  /* Hang Seng */
  #asia-shanghai   { order: 330; }
  #system9         { order: 331; }  /* Shanghai (now under Nikkei col) */

  /* STOCKS (continuous 2-by-2 flow) */
  #stock-nyc-1     { order: 400; }
  #system10        { order: 410; }
  #system11        { order: 411; }
  #system12        { order: 412; }
  #system13        { order: 413; }
  #system14        { order: 414; }
  #system15        { order: 415; }
  #system16        { order: 416; }
  #system17        { order: 417; }
  #system18        { order: 418; }

  /* COMMODITIES */
  #commodity-1     { order: 500; }
  #commodity-2     { order: 501; }
  #system19        { order: 510; }
  #system20        { order: 511; }
  #commodity-3     { order: 520; }
  #system21        { order: 521; }

  /* CURRENCIES */
  #currency-1      { order: 600; }
  #currency-2      { order: 601; }
  #system22        { order: 610; }
  #system23        { order: 611; }
  #currency-3      { order: 620; }
  #system24        { order: 621; }

  /* CRYPTO */
  #crypto-1        { order: 700; }
  #crypto-2        { order: 701; }
  #system25        { order: 710; }
  #system26        { order: 711; }
  #crypto-3        { order: 720; }
  #system27        { order: 721; }
}

/* =========================================================
   ✅ DESKTOP (true 3-column absolute layout)
   - Only for large screens now (prevents iPad squashing)
   ========================================================= */
@media (min-width: 1280px) {
  .node-system {
    border: 1px solid rgba(229,231,235,0.95);
    border-radius: var(--radius);
    background: #f9fafb;
    box-shadow: var(--shadow1);
    overflow: hidden;
  }

  .node-system:hover{
    box-shadow: var(--shadow2);
    border-color: rgba(96,165,250,0.35);
  }

  :root {
    --stock-row1-top: 2000px;
    --stock-gap: 20px;
    --card-h: 520px;
    --row-step: calc(var(--card-h) + var(--stock-gap));
    --shift-after-stocks: 80px;
  }

  #system13,
  #system14,
  #system15 {
    top: calc(var(--stock-row1-top) + var(--row-step)) !important;
  }

  #system16,
  #system17,
  #system18 {
    top: calc(var(--stock-row1-top) + (2 * var(--row-step))) !important;
  }

  #commodity-1,
  #commodity-2,
  #commodity-3 { top: calc(3570px + var(--shift-after-stocks)) !important; }

  #system19,
  #system20,
  #system21 { top: calc(3650px + var(--shift-after-stocks)) !important; }

  #currency-1,
  #currency-2,
  #currency-3 { top: calc(4220px + var(--shift-after-stocks)) !important; }

  #system22,
  #system23,
  #system24 { top: calc(4300px + var(--shift-after-stocks)) !important; }

  #crypto-1,
  #crypto-2,
  #crypto-3 { top: calc(4870px + var(--shift-after-stocks)) !important; }

  #system25,
  #system26,
  #system27 { top: calc(4950px + var(--shift-after-stocks)) !important; }

  .node-system .index-label,
  .node-system .rundown,
  .node-system .share-link { z-index: 12; }

  .node-network-container .node-system[style*="left: 0px"] { left: 30px !important; }
  .node-network-container .node-system[style*="left: 450px"] { left: 480px !important; }
  .node-network-container .node-system[style*="left: 900px"] { left: 930px !important; }

  #intl-frankfurt, #intl-paris { top: 620px !important; }
  #asia-hangseng, #asia-shanghai { top: 1270px !important; }
  #stock-nyc-2, #stock-nyc-3 { top: 1920px !important; }
  #commodity-2, #commodity-3 { top: 3570px !important; }
  #currency-2, #currency-3 { top: 4220px !important; }
  #crypto-2, #crypto-3 { top: 4870px !important; }
}

/* footer */
footer {
  background: rgba(2,6,23,0.95);
  color: #9ca3af;
  padding: 16px 10px;
  text-align: center;
  border-top: 1px solid rgba(17,24,39,0.9);
  width: 100%;
}

footer p {
  margin: 4px 0 2px;
  font-size: 12px;
}

.social-icons {
  text-align: center;
  margin-top: 8px;
}

.social-icons a {
  color: #e5e7eb;
  margin: 0 8px;
  font-size: 19px;
  text-decoration: none;
  transition: color .15s ease, transform .15s ease;
}

.social-icons a:hover {
  color: var(--blue);
  transform: translateY(-1px);
}

/* 6. MOBILE / TABLET OVERRIDES */
@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    width: 100%;
    margin: 0 !important;
  }

  .content-wrapper { padding-top: 60px; }

  .logo-container { margin-left: 8px; }
  .main-nav { display: none; }

  #us-lenses,
  #europe-lenses,
  #intl-frankfurt,
  #intl-paris,
  #asia-nikkei,
  #asia-hangseng,
  #asia-shanghai,
  #stock-nyc-1,
  #stock-nyc-2,
  #stock-nyc-3,
  #commodity-1,
  #commodity-2,
  #commodity-3,
  #currency-1,
  #currency-2,
  #currency-3,
  #crypto-1,
  #crypto-2,
  #crypto-3 {
    position: static !important;
    width: auto !important;
    text-align: left !important;
    margin: 28px 16px 14px !important;
    z-index: 10 !important;
  }

  .ny-subheading,
  .intl-subheading,
  .asia-subheading {
    display: block !important;
    padding-left: 18px !important;
    margin-top: 8px !important;
    margin-bottom: 6px !important;
    line-height: 1.35 !important;
  }

  .node-network-container {
    position: relative;
    min-height: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 220px !important;
  }

  .node-system {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: calc(100% - 32px) !important;
    max-width: 420px !important;
    height: 520px !important;
    margin: 10px auto 92px auto !important;
    border: 1px solid rgba(229,231,235,0.95) !important;
    border-radius: var(--radius) !important;
    background: #f9fafb !important;
    box-shadow: var(--shadow1) !important;
    overflow: hidden !important;
    z-index: 1 !important;
  }

  .node-system .nodes-container {
    position: absolute !important;
    left: 50% !important;
    top: 92px !important;
    width: 400px !important;
    height: 460px !important;
    transform: translateX(-50%) scale(0.88) !important;
    transform-origin: top center !important;
  }

  .node-system .circle,
  .node-system .label-circle {
    width: 88px !important;
    height: 88px !important;
  }

  .node-system .circle img {
    width: 100% !important;
    height: 100% !important;
  }

  .node-network-container .node-system:first-of-type {
    margin-top: 6px !important;
  }

  .index-label {
    position: absolute !important;
    top: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    z-index: 100 !important;
    text-align: center !important;
    width: 90% !important;
    white-space: nowrap !important;
  }

  .rundown {
    position: absolute !important;
    top: 44px !important;
    left: 12px !important;
    gap: 6px !important;
  }

  .share-link {
    position: absolute !important;
    top: 44px !important;
    right: 12px !important;
    left: auto !important;
  }

  .rundown a,
  .share-link a {
    font-size: 12.5px !important;
    white-space: nowrap !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .node-system .impact-arrow{
    top: 44px !important;
    width: 130px;
    height: 80px;
  }
  .node-system .impact-arrow svg{
    width: 130px;
    height: 70px;
    top: 4px;
    transform: scaleX(0.88) scaleY(1.45) !important;
  }
  .node-system.arrow-red .impact-arrow svg{
    transform: scaleX(0.88) scaleY(1.45) scaleY(-1) !important;
  }
  .node-system .impact-arrow::before{
    inset: 6px 6px 14px 6px;
  }
  .node-system .impact-arrow::after{
    bottom: 6px;
  }

  .info-box {
    width: 120px !important;
    min-height: 26px !important;
    height: auto !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    padding: 6px 6px !important;
    transform: translateX(-20px) !important;
  }

  .info-box[id$="-info-top"] { left: 160px !important; }

  .node-network-container h2:not(.index-label),
  .node-network-container .news-item {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    margin: 10px 16px !important;
    text-align: left !important;
  }

  .stock-tickers {
    padding: 10px 10px;
    font-size: 14px;
    min-height: 20px;
    width: 100%;
    margin: 0 !important;
  }

  .ticker-wrapper { display: flex; align-items: center; }
  .ticker { margin-right: 40px; }

  footer {
    position: relative !important;
    margin-top: 20px !important;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* FACTOR CYCLER */
.node { position: absolute; }

.node .factor-cycle-btn {
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.25);
  background: rgba(249,250,251,0.95);
  color: #0f172a;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(15,23,42,.18);
  transition: transform .14s ease, border-color .14s ease, color .14s ease;
}

.node.has-factor-stack .factor-cycle-btn { display: flex; }

.node .factor-cycle-btn:hover {
  border-color: rgba(96,165,250,0.65);
  color: var(--blue2);
  transform: translateY(-50%) translateX(1px);
}

.node .factor-cycle-btn:active { transform: translateY(-50%) scale(0.96); }

.node .factor-cycle-badge {
  position: absolute;
  right: -18px;
  top: calc(50% - 18px);
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 800;
  background: #0f172a;
  color: #f9fafb;
  border-radius: 999px;
  padding: 1px 6px;
  display: none;
  z-index: 21;
}

.node.has-factor-stack .factor-cycle-badge { display: inline-block; }

@media (max-width: 768px) {
  .node .factor-cycle-btn {
    right: -16px;
    width: 24px;
    height: 24px;
  }
  .node .factor-cycle-badge { right: -16px; }
}

/* ACCESSIBILITY: focus styles (keyboard only) */
:where(
  a, button, [role="button"],
  .circle, .label-circle,
  .news-logo-square,
  .dropbtn, .header-link,
  .side-menu .section, .side-menu a,
  .node .factor-cycle-btn,
  .node-system .rundown a, .node-system .share-link a
):focus-visible{
  outline: 2px solid rgba(96,165,250,0.9);
  outline-offset: 3px;
  border-radius: 10px;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
