/**
 * GT News stage — Mini + web (map yields when News active)
 */
:root {
  --gt-news-bg: #080e12;
  --gt-news-panel: #0b1218;
  --gt-news-border: rgba(61, 187, 255, 0.28);
  --gt-news-accent: #00ff88;
  --gt-news-accent2: #3dbbff;
  --gt-news-text: #e8fff3;
  --gt-news-muted: rgba(232, 255, 243, 0.55);
  --gt-news-mono: ui-monospace, "SF Mono", Consolas, monospace;
}

/* Injected News tab (before Capital Flows) */
#gt-news-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(232, 255, 243, 0.7);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#gt-news-tab[aria-selected="true"] {
  background: rgba(0, 170, 255, 0.15);
  border-color: rgba(0, 170, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.12);
}

#gt-news-tab .gt-news-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gt-news-accent);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.55);
}

/* SPA keeps React active classes — force only News highlighted */
body.gt-news-active nav[aria-label="Global data views"] button[role="tab"]:not(#gt-news-tab) {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(232, 255, 243, 0.55) !important;
  box-shadow: none !important;
}

body.gt-news-active
  nav[aria-label="Global data views"]
  button[role="tab"]:not(#gt-news-tab)
  .animate-pulse,
body.gt-news-active
  nav[aria-label="Global data views"]
  button[role="tab"]:not(#gt-news-tab)
  span.mono {
  display: none !important;
}

body.gt-news-active #gt-news-tab[aria-selected="true"] {
  background: rgba(0, 170, 255, 0.15) !important;
  border-color: rgba(0, 170, 255, 0.45) !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(0, 170, 255, 0.12) !important;
}

/* Keep View dropdown above the News stage (never get clipped) */
body.gt-news-active nav[aria-label="Global data views"],
body.gt-news-active #gt-main-tab-dd,
body.gt-news-active #gt-main-tab-select {
  position: relative;
  z-index: 8700;
}

.gt-news-stage {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--gt-news-top, 120px);
  bottom: 0;
  z-index: 8500;
  flex-direction: column;
  background: var(--gt-news-bg);
  color: var(--gt-news-text);
  font-family: Inter, system-ui, sans-serif;
  border-top: 1px solid rgba(61, 187, 255, 0.18);
  /* Fully opaque — never let map/globe bleed through */
  opacity: 1;
  isolation: isolate;
}

body.gt-news-active .gt-news-stage {
  display: flex;
}

/*
 * News owns the viewport under the tab strip.
 * Capital Flows "Global Flow Rankings" lives in a left ASIDE sibling of <main>,
 * so hiding only #root main left it bleeding through under Intelligence Feed.
 */
body.gt-news-active #root main,
body.gt-news-active #root .flex-1.grid,
body.gt-news-active #root .flex-1.grid > *,
body.gt-news-active #root aside {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

body.gt-news-active #gt-news-stage,
body.gt-news-active #gt-news-stage * {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
}

body.gt-news-active #gt-news-stage {
  background: var(--gt-news-bg, #080e12) !important;
  opacity: 1 !important;
}

body.gt-news-active #gt-news-stage .gt-news-stage__feed,
body.gt-news-active #gt-news-stage .gt-news-stage__bar,
body.gt-news-active #gt-news-stage .gt-news-feed-tabs {
  background: var(--gt-news-panel, #0b1218) !important;
}


/* Hide map / globe stack while News is the active view */
/* superseded by news14 full-grid hide */


body.gt-news-active .leaflet-container,
body.gt-news-active .leaflet-pane,
body.gt-news-active canvas.maplibregl-canvas,
body.gt-news-active #root canvas,
body.gt-news-active #root webgl,
body.gt-news-active .mapboxgl-canvas,
body.gt-news-active .maplibregl-canvas {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.gt-news-stage__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.65rem 0.85rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--gt-news-panel);
}

.gt-news-stage__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gt-news-refresh-btn {
  margin-left: auto;
  min-width: 40px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--gt-news-border);
  background: rgba(61, 187, 255, 0.1);
  color: var(--gt-news-accent2);
  font-size: 1rem;
  cursor: pointer;
}

.gt-news-stage__meta {
  margin: 0;
  flex: 1 1 100%;
  font-family: var(--gt-news-mono);
  font-size: 0.68rem;
  color: var(--gt-news-muted);
}

.gt-news-feed-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}

.gt-news-feed-tabs::-webkit-scrollbar {
  display: none;
}

.gt-news-feed-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--gt-news-muted);
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
}

.gt-news-feed-tab[aria-selected="true"] {
  border-color: rgba(0, 255, 136, 0.45);
  color: var(--gt-news-accent);
  background: rgba(0, 255, 136, 0.08);
}

.gt-news-period {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.55rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}

.gt-news-period::-webkit-scrollbar {
  display: none;
}

.gt-news-period-tab {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--gt-news-muted);
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
}

.gt-news-period-tab[aria-selected="true"] {
  border-color: rgba(61, 187, 255, 0.45);
  color: var(--gt-news-accent2);
  background: rgba(61, 187, 255, 0.08);
}

.gt-news-stage__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.65rem 1.25rem;
}

.gt-news-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 720px;
}

.gt-news-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gt-news-item__link {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.25rem;
  color: inherit;
  text-decoration: none;
}

.gt-news-item__link:active,
.gt-news-item__link:hover {
  background: rgba(0, 255, 136, 0.06);
}

.gt-news-item__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gt-news-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gt-news-item__thumb.is-empty {
  background:
    linear-gradient(135deg, rgba(61, 187, 255, 0.12), rgba(0, 255, 136, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.gt-news-item__thumb.is-empty img {
  display: none;
}

.gt-news-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.gt-news-item__headline {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.gt-news-item__meta {
  display: block;
  font-family: var(--gt-news-mono);
  font-size: 0.7rem;
  color: var(--gt-news-muted);
  margin-bottom: 0.25rem;
}

.gt-news-item__blurb {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(232, 255, 243, 0.62);
  margin-bottom: 0.25rem;
}

.gt-news-item__summary {
  display: block;
  font-size: 0.78rem;
  color: rgba(232, 255, 243, 0.7);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gt-news-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.gt-news-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gt-news-accent2);
  border: 1px solid rgba(61, 187, 255, 0.28);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.gt-news-state {
  max-width: 720px;
  margin: 1.25rem auto;
  padding: 0.85rem;
  color: var(--gt-news-muted);
  font-size: 0.88rem;
  text-align: center;
}

.gt-news-state--error {
  color: #ffb4b4;
}

.gt-news-retry-btn {
  margin-top: 0.65rem;
  min-height: 40px;
  padding: 0.4rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--gt-news-border);
  background: rgba(61, 187, 255, 0.12);
  color: var(--gt-news-accent2);
  font-weight: 650;
  cursor: pointer;
}

.gt-news-skeleton {
  max-width: 720px;
  margin: 0.65rem auto;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gt-news-skeleton__line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.06)
  );
  background-size: 200% 100%;
  animation: gt-news-shimmer 1.2s linear infinite;
  margin-bottom: 0.4rem;
}

.gt-news-skeleton__line--w80 {
  width: 82%;
}
.gt-news-skeleton__line--w40 {
  width: 42%;
}

@keyframes gt-news-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.gt-news-stage__foot {
  padding: 0.45rem 0.85rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.65rem;
  color: var(--gt-news-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--gt-news-panel);
}






@media (max-width: 720px) {
  .gt-news-item__summary {
    display: none;
  }

  .gt-news-item__thumb {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }

  /*
   * Dedicated News page on phone (Mini + web):
   * remove map/browse/asset chrome; News owns the stage under VIEW.
   */
  body.gt-news-active #root main {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  /* Asset Class / trade strips sit between main and Brief — hide on News */
  body.gt-news-active #root > div > .shrink-0.border-t {
    display: none !important;
  }

  body.gt-news-active .gt-news-stage {
    top: var(--gt-news-top, 128px);
    bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    background: var(--gt-news-bg) !important;
    box-shadow: none;
  }

  /* TOOLS sits in the feed header row — park it under View, not on the title */
  body.gt-news-active #gt-tools-fab {
    z-index: 8710;
    top: var(--gt-tools-fab-top, 96px) !important;
  }

  /* React brief hidden when persist chrome is on; keep fallback if dock missing */
  body.gt-news-active:not(.gt-persist-chrome-on) .gt-brief-footer-wrap {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9000 !important;
  }
}

@media (max-width: 400px) {
  .gt-news-stage__title {
    font-size: 0.88rem;
  }
  .gt-news-item__headline {
    font-size: 0.86rem;
  }
  .gt-news-item__thumb {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }
}

/* Left column owns title + feed pills + list (PC Mini + non-Mini web) */
.gt-news-stage__columns {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

.gt-news-stage__feed {
  flex: 1 1 56% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: var(--gt-news-bg, #080e12);
}

.gt-news-stage__feed .gt-news-stage__bar {
  flex: 0 0 auto !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gt-news-stage__feed .gt-news-feed-tabs {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  min-height: 48px !important;
  padding: 0.4rem 0.75rem !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  position: relative;
  z-index: 3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--gt-news-panel, #0b1218);
}

.gt-news-stage__feed .gt-news-feed-tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 0.75rem !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.gt-news-stage__feed .gt-news-period {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  min-height: 40px !important;
  padding: 0.25rem 0.75rem 0.45rem !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  position: relative;
  z-index: 3;
  background: var(--gt-news-panel, #0b1218);
}

.gt-news-stage__feed .gt-news-stage__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.gt-news-stage__columns .gt-news-list {
  max-width: none !important;
  margin: 0 !important;
}

.gt-news-snapshot {
  flex: 0 0 min(44%, 520px) !important;
  width: min(44%, 520px) !important;
  min-width: 280px !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: rgba(7, 16, 28, 0.96);
  border-left: 1px solid rgba(61, 187, 255, 0.18);
}

.gt-news-stage__foot {
  flex: 0 0 auto !important;
}

/* Phone News: stack feed + snapshot without overlap */

/*
 * Phone (Mini + non-Mini): music bar stays fixed.
 * News stage scrolls above it; Markets Snapshot expands to full list height.
 * Order: 4 headlines → snapshot (all rows) → more headlines.
 */
@media (max-width: 820px) {
  body.gt-news-active.gt-persist-chrome-on .gt-news-stage,
  html.gt-news-active body.gt-persist-chrome-on .gt-news-stage {
    /* keep clear of fixed music/brief chrome — do not cover the bar */
    bottom: var(--gt-persist-chrome-h, 110px) !important;
  }

  body.gt-news-active .gt-news-stage {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
  }

  .gt-news-stage__columns {
    flex: 0 0 auto !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .gt-news-stage__feed {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .gt-news-stage__feed .gt-news-stage__body {
    flex: 0 0 auto !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .gt-news-snapshot {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    border-left: none !important;
    border-top: 1px solid rgba(61, 187, 255, 0.22) !important;
    background: #070f18 !important;
  }

  /* Expand snapshot table to natural full height (no inner scroll trap) */
  .gt-news-snapshot #gt-forecast-chart-root,
  .gt-news-snapshot .gt-fc-panel,
  .gt-news-snapshot .gt-fc-panel--news {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    background: #070f18 !important;
    border: none !important;
    box-shadow: none !important;
  }

  .gt-news-snapshot .gt-fc-list-wrap {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }

  .gt-news-snapshot .gt-fc-table {
    width: 100%;
  }

  #gt-news-more-list.gt-news-list--more {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.65rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--gt-news-bg, #080e12);
  }

  .gt-news-stage__foot {
    flex: 0 0 auto !important;
    padding-bottom: 0.75rem !important;
  }
}

/* news17: all headlines stay in #gt-news-list (no split after snapshot) */
@media (max-width: 820px) {
  #gt-news-more-list {
    display: none !important;
  }
}

/* Mobile: Top Markets is its own View — hide snapshot under News; News feed hidden on Top Markets */
@media (max-width: 820px) {
  body.gt-news-active:not(.gt-topmarkets-active) .gt-news-snapshot,
  body.gt-news-active:not(.gt-topmarkets-active) #gt-news-snapshot-slot {
    display: none !important;
  }

  body.gt-topmarkets-active .gt-news-stage__feed {
    display: none !important;
  }

  body.gt-topmarkets-active .gt-news-stage__columns {
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    height: 100% !important;
  }

  body.gt-topmarkets-active .gt-news-snapshot,
  body.gt-topmarkets-active #gt-news-snapshot-slot {
    display: flex !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    border-top: none !important;
  }

  body.gt-topmarkets-active .gt-news-snapshot #gt-forecast-chart-root,
  body.gt-topmarkets-active .gt-news-snapshot .gt-fc-panel--news {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body.gt-topmarkets-active .gt-news-snapshot .gt-fc-list-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.gt-topmarkets-active .gt-news-stage__foot {
    display: none !important;
  }

  body.gt-topmarkets-active .gt-news-stage {
    overflow: hidden !important;
  }
}


/*
 * news22: hide snapshot under News only on *mobile* View chrome / Mini phone.
 * PC Mini + PC wead.live keep News | Top Markets ticker side-by-side.
 */
@media (max-width: 820px) {
  body.gt-news-active:not(.gt-topmarkets-active):has(#gt-main-tab-dd:not([hidden])) .gt-news-snapshot,
  body.gt-news-active:not(.gt-topmarkets-active):has(#gt-main-tab-dd:not([hidden])) #gt-news-snapshot-slot,
  html.wead-mini-embed body.gt-news-active:not(.gt-topmarkets-active) .gt-news-snapshot,
  html.wead-mini-embed body.gt-news-active:not(.gt-topmarkets-active) #gt-news-snapshot-slot,
  html[data-wead-mini-embed="1"] body.gt-news-active:not(.gt-topmarkets-active) .gt-news-snapshot,
  html[data-wead-mini-embed="1"] body.gt-news-active:not(.gt-topmarkets-active) #gt-news-snapshot-slot {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
