/* ==========================================================================
   Adhyarth Wealth & Asset Management — Tools Page Stylesheet
   Bespoke, refined typography, luxury fintech terminal aesthetic.
   Loads after styles.css and inherits all global design tokens.
   ========================================================================== */

/* ---------- Nav Active Highlighting ------------- */
.nav-links a.active {
  color: var(--navy);
  font-weight: 600;
}

.nav-links a.active::after {
  width: 100%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

/* ---------- PAGE HERO ---------- */
.page-hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(ellipse 60% 50% at 85% 30%, rgba(201, 162, 39, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 15% 20%, rgba(13, 27, 61, 0.03) 0%, transparent 60%),
    linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--warm-white);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(201, 162, 39, 0.3) 50%, transparent 100%);
}

.page-hero .eyebrow {
  color: var(--gold-soft);
  background: rgba(201, 162, 39, 0.15);
  border-color: rgba(201, 162, 39, 0.35);
  margin-bottom: 18px;
}

.page-hero .eyebrow::before {
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3);
}

.page-hero h1 {
  color: var(--warm-white);
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 700;
  margin-top: 14px;
  max-width: 680px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.page-hero p.sub {
  color: rgba(250, 250, 248, 0.72);
  font-size: 16.5px;
  line-height: 1.65;
  margin-top: 18px;
  max-width: 600px;
}

/* ---------- QUICK-JUMP CONTENTS ---------- */
.toc {
  background: var(--warm-white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 78px;
  z-index: 90;
}

.toc .wrap {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 16px 32px;
  justify-content: center;
}

.toc a {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--charcoal-soft);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.toc a:hover {
  color: var(--gold);
}

.toc a.active {
  color: var(--gold);
}

/* ---------- SECTION GENERAL ---------- */
.tools-section {
  padding: 80px 0;
  position: relative;
}

.section-num {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

/* Status Pill Header Badge */
.market-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1E462B;
  background: rgba(62, 122, 80, 0.12);
  border: 1px solid rgba(62, 122, 80, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.market-status-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3E7A50;
  box-shadow: 0 0 0 3px rgba(62, 122, 80, 0.25);
  animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {

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

  50% {
    transform: scale(1.35);
    opacity: 0.65;
    box-shadow: 0 0 0 5px rgba(62, 122, 80, 0.12);
  }
}

/* Generic Institutional Data Notice Banner */
.widget-placeholder,
.data-notice-banner {
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
  margin-top: 28px;
  box-shadow: var(--shadow-xs);
}

.widget-placeholder .widget-icon,
.data-notice-banner .widget-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(201, 162, 39, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(13, 27, 61, 0.06);
}

.widget-placeholder .widget-text strong,
.data-notice-banner .widget-text strong {
  display: block;
  color: var(--navy);
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.widget-placeholder .widget-text span,
.data-notice-banner .widget-text span {
  font-size: 13.5px;
  color: var(--charcoal-soft);
  line-height: 1.5;
}

/* ==========================================================================
   1. MARKET TRACKER (Terminal-Grade Data Table)
   ========================================================================== */
#tracker {
  background: var(--warm-white);
}

.ticker-table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  background: #FFFFFF;
  transition: box-shadow 0.3s ease;
}

.ticker-table-wrap:hover {
  box-shadow: var(--shadow-md);
}

.ticker-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
}

.ticker-table th,
.ticker-table td {
  text-align: left;
  padding: 16px 24px;
  font-size: 14.5px;
  border-bottom: 1px solid rgba(13, 27, 61, 0.06);
}

.ticker-table th {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--ivory);
  border-bottom: 1.5px solid var(--line);
}

.ticker-table td {
  color: var(--charcoal);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.ticker-table tr:hover td {
  background: rgba(201, 162, 39, 0.03);
}

.ticker-table tr:last-child td {
  border-bottom: none;
}

.ticker-table td.name {
  color: var(--navy);
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-table td.name::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
  display: inline-block;
}

.ticker-table td.placeholder {
  font-style: normal;
  color: var(--charcoal-soft);
}

/* Up/Down Directional Pill Badges */
.chg {
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.chg.up {
  color: #1E462B;
  background: rgba(62, 122, 80, 0.12);
  border: 1px solid rgba(62, 122, 80, 0.22);
}

.chg.down {
  color: #5A221C;
  background: rgba(180, 69, 58, 0.10);
  border: 1px solid rgba(180, 69, 58, 0.22);
}

.chg.flat {
  color: var(--charcoal-soft);
  background: rgba(13, 27, 61, 0.05);
  border: 1px solid rgba(13, 27, 61, 0.08);
}

/* ==========================================================================
   2. MARKET DASHBOARD (Fintech Grid & Cleaned Up Cards)
   ========================================================================== */
#dashboard {
  background: var(--ivory);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 28px;
  align-items: stretch;
}

.dashboard-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-smooth), border-color 0.35s ease;
}

.dashboard-card--clickable {
  cursor: pointer;
}

.dashboard-card--clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.dashboard-card--clickable:hover .dash-expand-badge {
  background: var(--gold);
  color: var(--navy-midnight);
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.35);
  transform: translateY(-1px);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dash-card-header .dash-icon {
  margin-bottom: 0;
}

.dash-expand-badge {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.3);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
}

.dash-expand-badge svg {
  transition: transform 0.2s ease;
}

.dashboard-card--clickable:hover .dash-expand-badge svg {
  transform: translate(2px, -2px);
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 162, 39, 0.3);
}

.dashboard-card:hover::before {
  opacity: 1;
}

.dashboard-card .dash-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--ivory);
  border: 1px solid rgba(13, 27, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease-spring), background-color 0.3s ease, border-color 0.3s ease;
}

.dashboard-card:hover .dash-icon {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.35);
  transform: scale(1.06);
}

.dashboard-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--navy);
}

.dashboard-card p {
  font-size: 14px;
  color: var(--charcoal-soft);
  line-height: 1.5;
  margin-bottom: 20px;
}

.dash-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: 0;
}

/* Placeholder for sync status */
.chart-placeholder {
  height: 120px;
  border-radius: 10px;
  border: 1px dashed var(--pale-blue);
  background: linear-gradient(135deg, rgba(198, 210, 222, 0.12) 0%, rgba(201, 162, 39, 0.04) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  margin-top: 4px;
}

/* --- A. Sector Performance Heatmap --- */
.dash-heatmap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  margin-top: 0;
}

.dash-heatmap .heat-cell {
  border-radius: 8px;
  padding: 9px 6px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
  cursor: default;
}

.dash-heatmap .heat-cell:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.dash-heatmap .sector-name {
  display: block;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10.5px;
}

.dash-heatmap .sector-pct {
  display: block;
  font-weight: 800;
  margin-top: 3px;
  font-size: 11.5px;
}

.dash-body[data-dash-target="sector-performance"] {
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
  padding-right: 4px;
}

.dash-body[data-dash-target="sector-performance"]::-webkit-scrollbar {
  width: 4px;
}

.dash-body[data-dash-target="sector-performance"]::-webkit-scrollbar-track {
  background: transparent;
}

.dash-body[data-dash-target="sector-performance"]::-webkit-scrollbar-thumb {
  background: rgba(13, 27, 61, 0.2);
  border-radius: 4px;
}

.dash-body[data-dash-target="sector-performance"]::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* --- B. FII / DII Activity --- */
.dash-fii-list {
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}

.dash-fii-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border: 1px solid rgba(13, 27, 61, 0.06);
  transition: background-color 0.2s ease;
}

.dash-fii-row:hover {
  background: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.dash-fii-row .category {
  font-weight: 700;
  color: var(--navy);
}

.dash-fii-row .net-value {
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
}

.dash-fii-row .net-value.up {
  color: #1E462B;
  background: rgba(62, 122, 80, 0.12);
  border: 1px solid rgba(62, 122, 80, 0.2);
}

.dash-fii-row .net-value.down {
  color: #5A221C;
  background: rgba(180, 69, 58, 0.10);
  border: 1px solid rgba(180, 69, 58, 0.2);
}

/* --- C. Top Gainers & Losers and Two-Column Cards --- */
.dash-two-col {
  font-size: 12.5px;
  font-family: 'Manrope', sans-serif;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 0;
  align-items: start;
}

.dash-two-col>div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-two-col h4 {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
}

.dash-two-col h4.up {
  color: #1E462B;
  background: rgba(62, 122, 80, 0.12);
  border: 1px solid rgba(62, 122, 80, 0.22);
}

.dash-two-col h4.down {
  color: #5A221C;
  background: rgba(180, 69, 58, 0.10);
  border: 1px solid rgba(180, 69, 58, 0.22);
}

.dash-two-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dash-two-col li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(13, 27, 61, 0.06);
}

.dash-two-col li .symbol {
  font-weight: 700;
  color: var(--navy);
  font-size: 12.5px;
}

.dash-two-col li .price.up {
  color: #1E462B;
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dash-two-col li .price.down {
  color: #5A221C;
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Scrollable List for 52W High / Low */
.dash-scroll-list {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
  padding-right: 4px;
}

.dash-scroll-list::-webkit-scrollbar {
  width: 4px;
}

.dash-scroll-list::-webkit-scrollbar-track {
  background: transparent;
}

.dash-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(13, 27, 61, 0.2);
  border-radius: 4px;
}

.dash-scroll-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* --- D. Advance / Decline --- */
.dash-ad-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  margin-top: 0;
}

.dash-ad-table th {
  padding: 8px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  border-bottom: 1.5px solid var(--line);
}

.dash-ad-table th.adv {
  color: #1E462B;
  text-align: center;
}

.dash-ad-table th.dec {
  color: #5A221C;
  text-align: center;
}

.dash-ad-table td {
  padding: 9px 6px;
  border-bottom: 1px solid rgba(13, 27, 61, 0.06);
  vertical-align: middle;
}

.dash-ad-table tr:hover td {
  background: rgba(201, 162, 39, 0.03);
}

.dash-ad-table td.index-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 13px;
}

.dash-ad-table td.adv-val {
  font-weight: 800;
  color: #1E462B;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dash-ad-table td.dec-val {
  font-weight: 800;
  color: #5A221C;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dash-ad-table td.unch-val {
  font-weight: 600;
  color: var(--charcoal-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* --- E. Volume Leaders --- */
.dash-volume-list {
  list-style: none;
  padding: 0;
  margin-top: 0;
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  display: flex;
  flex-direction: column;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.dash-volume-list::-webkit-scrollbar {
  width: 4px;
}

.dash-volume-list::-webkit-scrollbar-thumb {
  background: rgba(13, 27, 61, 0.2);
  border-radius: 4px;
}

.dash-volume-list::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

.dash-volume-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(13, 27, 61, 0.06);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.dash-volume-list li:hover {
  background: rgba(201, 162, 39, 0.04);
}

.dash-volume-list .symbol {
  font-weight: 700;
  color: var(--navy);
  display: block;
  font-size: 13px;
}

.dash-volume-list .vol {
  color: var(--charcoal-soft);
  font-size: 11.5px;
  font-weight: 500;
}

.dash-volume-list .price {
  font-weight: 700;
  color: var(--navy);
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.dash-volume-list .pct.up {
  color: #1E462B;
  font-weight: 700;
  font-size: 11.5px;
}

.dash-volume-list .pct.down {
  color: #5A221C;
  font-weight: 700;
  font-size: 11.5px;
}

.dash-empty {
  color: var(--charcoal-soft);
  font-style: italic;
  margin-top: 12px;
  padding: 12px;
  text-align: center;
}

/* ==========================================================================
   3. FEAR & GREED INDICATOR
   ========================================================================== */
#fear-greed {
  background: var(--warm-white);
}

.gauge-panel {
  display: flex;
  gap: 60px;
  align-items: center;
  flex-wrap: wrap;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}

.gauge-panel:hover {
  box-shadow: var(--shadow-md);
}

.gauge-wrap {
  flex-shrink: 0;
  width: 280px;
  position: relative;
}

.gauge-wrap svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(13, 27, 61, 0.08));
}

.gauge-reading {
  margin-top: -42px;
  text-align: center;
}

.gauge-reading .score {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 38px;
  color: var(--navy);
  display: block;
  line-height: 1;
}

.gauge-reading .label {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
  display: block;
}

.gauge-reading .gauge-asof {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--charcoal-soft);
  margin-top: 8px;
  display: block;
}

/* Needle swings smoothly into position on load and on each live update,
   rather than snapping instantly. Excluded under prefers-reduced-motion
   via the site-wide rule already in styles.css/tools.css. */
#gauge-needle {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: 130px 130px;
}

.gauge-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.gauge-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--charcoal);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border: 1px solid rgba(13, 27, 61, 0.05);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.gauge-legend .legend-row:hover {
  background: #FFFFFF;
  transform: translateX(4px);
  box-shadow: var(--shadow-xs);
}

.gauge-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ---------- Fear & Greed component breakdown ---------- */
.gauge-components {
  margin-top: 28px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: var(--shadow-sm);
}

.gauge-components-title {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 18px;
}

.gauge-component-row {
  display: grid;
  grid-template-columns: 170px 1fr 40px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.gauge-component-row + .gauge-component-row {
  border-top: 1px solid rgba(13, 27, 61, 0.06);
}

.gauge-component-label {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--charcoal);
}

.gauge-component-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--ivory);
  overflow: hidden;
}

.gauge-component-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.gauge-component-score {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gauge-component-unavailable {
  grid-column: 2 / span 2;
  font-size: 12.5px;
  color: var(--charcoal-soft);
  font-style: italic;
}

@media (max-width: 640px) {
  .gauge-component-row {
    grid-template-columns: 1fr 32px;
    grid-template-areas:
      "label score"
      "bar bar";
    row-gap: 6px;
  }
  .gauge-component-label { grid-area: label; }
  .gauge-component-score { grid-area: score; }
  .gauge-component-bar { grid-area: bar; }
  .gauge-component-unavailable { grid-column: 1 / -1; }
}

/* ==========================================================================
   4. MACRO INDICATORS (KPI Stat Tiles)
   ========================================================================== */
#macro {
  background: var(--ivory);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.macro-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-smooth), border-color 0.35s ease;
}

.macro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.macro-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 162, 39, 0.3);
}

.macro-card:hover::before {
  opacity: 1;
}

.macro-card .label {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  display: block;
  margin-bottom: 12px;
}

.macro-card .value {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  display: block;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.macro-card .as-of {
  font-size: 12.5px;
  color: var(--charcoal-soft);
  margin-top: 10px;
  display: block;
  font-style: normal;
}

/* ==========================================================================
   5. FINANCIAL CALCULATORS (Grid & Modal Overhaul)
   ========================================================================== */
#calculators {
  background: var(--warm-white);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.calc-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-smooth), border-color 0.35s ease;
}

.calc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 162, 39, 0.35);
}

.calc-card .calc-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--ivory);
  border: 1px solid rgba(13, 27, 61, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease-spring), background-color 0.3s ease;
}

.calc-card:hover .calc-icon {
  background: rgba(201, 162, 39, 0.12);
  transform: scale(1.06);
}

.calc-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--navy);
}

.calc-card p {
  font-size: 14.5px;
  color: var(--charcoal-soft);
  line-height: 1.6;
  margin-bottom: 26px;
  flex-grow: 1;
}

.calc-status {
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  display: inline-flex;
  align-self: flex-start;
  transition: all 0.25s ease;
}

.calc-card--live {
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.calc-status--live {
  color: var(--warm-white);
  background: linear-gradient(180deg, #13244D 0%, #0D1B3D 100%);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(13, 27, 61, 0.15);
}

.calc-card--live:hover .calc-status--live {
  background: linear-gradient(180deg, #D4AF37 0%, #C9A227 100%);
  border-color: var(--gold);
  color: var(--navy-midnight);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.4);
}

/* ==========================================================================
   SECTOR PERFORMANCE EXPANDED MODAL (75% Browser Size)
   ========================================================================== */
.sector-modal-overlay {
  padding: 0;
}

.sector-modal {
  max-width: 75vw;
  max-height: 80vh;
  max-height: 80dvh;
  width: 75vw;
}

.sector-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 44px 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.sector-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(250, 250, 248, 0.06);
  border: 1px solid rgba(250, 250, 248, 0.14);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  color: rgba(250, 250, 248, 0.5);
}

.sector-search-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.sector-search-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--warm-white);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
}

.sector-search-wrap input::placeholder {
  color: rgba(250, 250, 248, 0.4);
}

.sector-filter-pills {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.sector-pill {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(250, 250, 248, 0.06);
  border: 1px solid rgba(250, 250, 248, 0.14);
  color: rgba(250, 250, 248, 0.65);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sector-pill:hover {
  background: rgba(250, 250, 248, 0.1);
  color: var(--warm-white);
}

.sector-pill.active {
  background: var(--gold);
  color: var(--navy-midnight);
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
}

.sector-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 44px 36px;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
}

.sector-modal-body::-webkit-scrollbar {
  width: 5px;
}

.sector-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.sector-modal-body::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.35);
  border-radius: 4px;
}

/* Full heatmap grid inside the modal */
.sector-modal-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
}

.sector-modal-heatmap .heat-cell {
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease, opacity 0.25s ease;
  cursor: default;
}

.sector-modal-heatmap .heat-cell:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.sector-modal-heatmap .heat-cell.filtered-out {
  display: none;
}

.sector-modal-heatmap .sector-name {
  display: block;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.sector-modal-heatmap .sector-pct {
  display: block;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sector-modal-no-results {
  text-align: center;
  padding: 40px 20px;
  color: rgba(250, 250, 248, 0.4);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 980px) {
  .sector-modal {
    max-width: 92vw;
    width: 92vw;
    max-height: 85vh;
  }

  .sector-modal-toolbar {
    padding: 0 24px 14px;
    gap: 10px;
  }

  .sector-modal-body {
    padding: 8px 24px 28px;
  }

  .sector-modal-heatmap {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .sector-modal {
    max-width: 100vw;
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }

  .sector-modal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sector-search-wrap {
    max-width: none;
  }

  .sector-modal-heatmap {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   CALCULATOR MODAL (Obsidian Gold Institutional Dialog - Centered Over Screen)
   ========================================================================== */
.calc-modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  /* Higher than header (z-index: 100), TOC (z-index: 90), and mobile menu (z-index: 200) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 11, 24, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.calc-modal-overlay.open {
  background: rgba(5, 11, 24, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.calc-modal-overlay[hidden] {
  display: none !important;
}

.calc-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: min(820px, calc(100vh - 48px));
  max-height: min(820px, calc(100dvh - 48px));
  margin: auto;
  overflow: hidden;
  background: linear-gradient(160deg, #101E42 0%, #071022 100%);
  border: 1px solid rgba(250, 250, 248, 0.14);
  border-radius: var(--radius-lg);
  box-shadow:
    0 40px 90px -20px rgba(5, 11, 24, 0.75),
    0 1px 0 rgba(250, 250, 248, 0.12) inset,
    0 0 0 1px rgba(201, 162, 39, 0.12) inset;
  color: var(--warm-white);
  will-change: transform, opacity;
}

.calc-modal[hidden] {
  display: none !important;
}

.calc-modal::before {
  content: '';
  position: absolute;
  top: -25%;
  right: -20%;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(201, 162, 39, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.calc-modal::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 240px;
  height: 240px;
  border: 1px dashed rgba(201, 162, 39, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.calc-modal-eyebrow {
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  position: relative;
  z-index: 1;
  padding: 44px 44px 0;
  flex-shrink: 0;
}

.calc-modal h3 {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--warm-white);
  position: relative;
  z-index: 1;
  padding: 0 44px;
  flex-shrink: 0;
}

.calc-modal-sub {
  font-size: 14px;
  color: rgba(250, 250, 248, 0.65);
  margin-top: 8px;
  max-width: 480px;
  position: relative;
  z-index: 1;
  padding: 0 44px 20px;
  flex-shrink: 0;
  line-height: 1.5;
}

.calc-modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(250, 250, 248, 0.08);
  border: 1px solid rgba(250, 250, 248, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--warm-white);
  transition: all 0.25s ease;
}

.calc-modal-close svg path {
  stroke: var(--warm-white);
}

.calc-modal-close:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: rotate(90deg);
}

.calc-modal-close:hover svg path {
  stroke: var(--navy-midnight);
}

/* Scrollable Body */
.calc-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 44px 36px;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.5) transparent;
}

.calc-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.calc-modal-body::-webkit-scrollbar {
  width: 6px;
}

.calc-modal-body::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.4);
  border-radius: 4px;
}

.calc-columns {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
}

.calc-col-inputs {
  min-width: 0;
}

.calc-col-outputs {
  min-width: 0;
  position: sticky;
  top: 10px;
  align-self: start;
}

/* Inputs & Glass Sliders */
.calc-field {
  margin-bottom: 26px;
}

.calc-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.calc-field-head label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--warm-white);
}

.calc-field-value {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(250, 250, 248, 0.18);
  border-radius: 8px;
  padding: 6px 12px;
  background: rgba(250, 250, 248, 0.06);
  backdrop-filter: blur(8px);
}

.unit-affix {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-soft);
}

.calc-num-input {
  width: 72px;
  border: none;
  background: transparent;
  text-align: right;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--warm-white);
  -moz-appearance: textfield;
}

.calc-num-input:focus {
  outline: none;
}

.calc-num-input::-webkit-outer-spin-button,
.calc-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.unit-affix--suffix {
  order: 2;
}

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(250, 250, 248, 0.16);
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3.5px solid var(--warm-white);
  box-shadow: 0 0 0 1px var(--gold), 0 4px 14px rgba(201, 162, 39, 0.45);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.calc-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 3.5px solid var(--warm-white);
  box-shadow: 0 0 0 1px var(--gold), 0 4px 14px rgba(201, 162, 39, 0.45);
  cursor: pointer;
}

/* Toggle Fields */
.calc-field--toggle .calc-toggle-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.calc-toggle-label {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--warm-white);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 150px;
}

.calc-toggle-hint {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: rgba(250, 250, 248, 0.55);
}

.calc-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.calc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.calc-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(250, 250, 248, 0.18);
  transition: background 0.25s ease;
}

.calc-switch-track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warm-white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease-spring);
}

.calc-switch input:checked+.calc-switch-track {
  background: var(--gold);
}

.calc-switch input:checked+.calc-switch-track::before {
  transform: translateX(18px);
}

/* Results */
.calc-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(250, 250, 248, 0.05);
  border: 1px solid rgba(250, 250, 248, 0.08);
}

.calc-result-item .label {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(250, 250, 248, 0.7);
}

.calc-result-item .value {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--warm-white);
  font-variant-numeric: tabular-nums;
}

.calc-result-item--highlight {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25) 0%, rgba(201, 162, 39, 0.08) 100%);
  border: 1px solid rgba(201, 162, 39, 0.45);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.15);
}

.calc-result-item--highlight .label {
  color: var(--gold-soft);
  font-weight: 700;
}

.calc-result-item--highlight .value {
  color: var(--warm-white);
  font-size: 22px;
  font-weight: 800;
}

.calc-result-item--muted {
  background: transparent;
  border: 1px dashed rgba(250, 250, 248, 0.25);
}

.calc-disclaimer {
  font-size: 11.5px;
  color: rgba(250, 250, 248, 0.45);
  margin-top: 18px;
  line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Adaptive Breakpoints)
   ========================================================================== */
@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-card {
    min-height: 360px;
  }

  .macro-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toc .wrap {
    padding: 14px 32px;
    gap: 18px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
  }

  .toc .wrap::-webkit-scrollbar {
    display: none;
  }

  .toc a {
    flex-shrink: 0;
  }

  .gauge-panel {
    padding: 32px;
    gap: 36px;
  }
}

@media (max-width: 640px) {
  .calc-modal-overlay {
    padding: 12px;
  }

  .calc-modal {
    max-height: calc(100dvh - 24px);
    border-radius: var(--radius);
  }

  .calc-columns {
    display: block;
  }

  .calc-col-outputs {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(250, 250, 248, 0.14);
  }

  .calc-modal-eyebrow {
    padding: 28px 24px 0;
  }

  .calc-modal h3 {
    font-size: 22px;
    padding: 0 24px;
  }

  .calc-modal-sub {
    padding: 0 24px 16px;
  }

  .calc-modal-close {
    top: 16px;
    right: 16px;
  }

  .calc-modal-body {
    padding: 4px 24px 16px;
    max-height: 60vh;
  }

  .ticker-table th,
  .ticker-table td {
    padding: 12px 14px;
    font-size: 13.5px;
  }

  .gauge-panel {
    flex-direction: column;
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .macro-grid {
    grid-template-columns: 1fr;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .dash-heatmap {
    grid-template-columns: repeat(2, 1fr);
  }
}