:root {
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --charcoal: #1e232d;
  --charcoal-light: #2b3240;
  --gold: #f5c430;
  --gold-dark: #b88714;
  --gold-soft: #fffbeb;
  --navy: #111827;
  --primary: #1d4ed8;
  --primary-soft: #eff6ff;
  --reg-green: #16a34a;
  --reg-green-bg: #dcfce7;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --danger: #e11d48;
  --danger-bg: #fff1f2;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 22px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--canvas);
  color: var(--text-main);
  line-height: 1.55;
  padding-bottom: 38px; /* Space for fixed bottom market ticker */
  font-size: 14px;
}
a { color: var(--text-main); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* Strict 1200px Centered Portal Grid Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 1240px) {
  .container { padding: 0; }
}

/* ==========================================================================
   TWO-TIER PORTAL STICKY HEADER (Benchmarking Tier-1 Financial Portals)
   ========================================================================== */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.header-top {
  background: var(--charcoal);
  height: 72px;
  color: #fff;
}
.header-top-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff !important;
  flex-shrink: 0;
}
.portal-emblem {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px rgba(245, 196, 48, 0.35);
}
.portal-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.portal-brand-name { font-size: 20px; font-weight: 900; letter-spacing: 0.3px; color: #fff; }
.portal-brand-sub { font-size: 11.5px; color: #9ca3af; font-weight: 500; margin-top: 2px; }
.portal-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  margin-left: 8px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-mini-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 3px 3px 3px 14px;
  width: 290px;
}
.header-mini-search input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--navy);
  background: transparent;
}
.header-mini-search button {
  background: var(--gold-dark);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.header-mini-search button:hover { background: #9a6f0d; }

.lang-pills {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 2px;
}
.lang-pills a {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.lang-pills a.active {
  background: var(--gold);
  color: var(--charcoal);
  font-weight: 800;
}

.header-cta-gold {
  background: var(--gold);
  color: var(--charcoal) !important;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.header-cta-gold:hover { background: #fbd04c; }

/* Second Tier Full-Bleed Gold Channel Bar */
.header-nav-bar {
  background: var(--gold);
  height: 46px;
  border-bottom: 1px solid #e5b420;
}
.header-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.channel-links {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.channel-links::-webkit-scrollbar { display: none; }
.channel-links a {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2329;
  position: relative;
  white-space: nowrap;
}
.channel-links a:hover, .channel-links a.active {
  background: rgba(0, 0, 0, 0.07);
  color: #000;
}
.channel-links a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  background: var(--charcoal);
  border-radius: 2px 2px 0 0;
}
.nav-right-badge {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--charcoal);
  background: rgba(255, 255, 255, 0.55);
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ==========================================================================
   PORTAL SECTION HEADERS & MODULAR GRID SYSTEM (1200px Exact Proportions)
   ========================================================================== */
.portal-section { margin-top: 24px; }

.sec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.sec-bar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.sec-heading {
  font-size: 21px;
  font-weight: 800;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1.2;
}
.sec-heading::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--gold-dark);
  border-radius: 2px;
  display: inline-block;
}
.sec-sub-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sec-tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.sec-tab-btn.active, .sec-tab-btn:hover {
  background: var(--charcoal);
  color: var(--gold);
  border-color: var(--charcoal);
}
.more-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.more-link:hover { color: var(--primary); }

/* Asymmetric & Symmetric Portal Grids */
.portal-split-search {
  display: grid;
  grid-template-columns: 780px 400px;
  gap: 20px;
  align-items: stretch;
}
.portal-split-main {
  display: grid;
  grid-template-columns: 375px 805px;
  gap: 20px;
  align-items: stretch;
}
.portal-split-terminal {
  display: grid;
  grid-template-columns: 790px 390px;
  gap: 20px;
  align-items: stretch;
}
.portal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.portal-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}

.p-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

/* ==========================================================================
   SECTION 1: TOP FEATURED CORE BROKERS STRIP + SEARCH HUB (780 + 400)
   ========================================================================== */
.top-broker-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.strip-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.strip-tile:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-hover);
}
.strip-corner-tag {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--emerald-bg);
  color: var(--emerald);
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 0 var(--radius) 0 6px;
  border-left: 1px solid #a7f3d0;
  border-bottom: 1px solid #a7f3d0;
}

.search-hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.search-intent-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.search-intent-pills span {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-sub);
  background: var(--surface-soft);
}
.search-intent-pills span.active {
  background: var(--charcoal);
  color: var(--gold);
}
.hero-search-box {
  display: flex;
  height: 56px;
  border: 2px solid var(--gold-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.hero-search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 15px;
  color: var(--navy);
}
.hero-search-box button {
  width: 118px;
  background: var(--gold-dark);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.hero-search-box button:hover { background: #9a6f0d; }

.odometer-rows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.odo-item {
  font-size: 13.5px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}
.odo-num {
  font-size: 21px;
  font-weight: 900;
  font-style: italic;
  color: var(--gold-dark);
  padding: 0 3px;
}
.notice-pill {
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}

.quick-matrix-box {
  background: #f8f9fb;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  padding: 12px 14px;
}
.quick-matrix-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.quick-matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px 10px;
}
.qm-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.qm-chip:hover { border-color: var(--primary); color: var(--primary); }
.qm-dot {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 4px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Right Spotlight Editorial Card */
.spotlight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.spotlight-banner {
  background: linear-gradient(135deg, #111827 0%, #1e293b 55%, #064e3b 100%);
  padding: 18px 20px;
  color: #fff;
  position: relative;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.spotlight-body {
  padding: 14px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.spotlight-list {
  list-style: none;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 8px;
}
.spotlight-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  gap: 8px;
}
.spotlight-list li a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* ==========================================================================
   SECTION 2: LEFT LEADERBOARD RAIL (375px) + RIGHT SHOWCASE & FEED (805px)
   ========================================================================== */
.leaderboard-rail {
  background: var(--surface);
  border: 1.5px solid #e6d5a7;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rail-header {
  background: linear-gradient(90deg, #fdf8ea, #f9efd2);
  border-bottom: 1px solid #ead8a6;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rail-title {
  font-size: 17px;
  font-weight: 900;
  color: #5c4206;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rail-tabs { display: flex; gap: 4px; }
.rail-tab {
  border: 1px solid rgba(184, 135, 20, 0.28);
  background: rgba(255, 255, 255, 0.7);
  color: #6b4f0b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.rail-tab.active {
  background: var(--charcoal);
  color: var(--gold);
  border-color: var(--charcoal);
}
.rail-list { flex: 1; divide-y: 1px solid var(--border); }
.rail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #f1f3f7;
  transition: background 0.12s;
}
.rail-row:hover { background: #fafbfc; }
.rail-logo-box {
  width: 78px;
  height: 54px;
  min-width: 78px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-top: 10px;
}
.rail-reg-ribbon {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--reg-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 5px 0 5px 0;
  line-height: 16px;
}
.rail-info { flex: 1; min-width: 0; }
.rail-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rail-broker-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-medal {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  background: #f1f5f9;
  color: #475569;
}
.rank-medal.r1 { background: #fbbf24; color: #78350f; }
.rank-medal.r2 { background: #cbd5e1; color: #1e293b; }
.rank-medal.r3 { background: #f59e0b; color: #fff; }

.rail-score-line {
  margin: 2px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.rail-score-num {
  font-size: 16.5px;
  font-weight: 900;
  color: var(--gold-dark);
}
.rail-micro-tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.micro-tag {
  font-size: 11px;
  color: var(--text-sub);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 0 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Right Showcase Top Strip (Rebate & VPS 5-Col Showcase Card) */
.rebate-showcase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 195px repeat(4, 1fr);
  overflow: hidden;
  margin-bottom: 18px;
}
.rebate-showcase-intro {
  background: linear-gradient(155deg, #eff6ff 0%, #dbeafe 100%);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}
.rebate-showcase-cell {
  padding: 13px 14px;
  border-right: 1px solid #f1f3f7;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.rebate-showcase-cell:last-child { border-right: none; }
.corner-save {
  position: absolute;
  top: 0;
  right: 0;
  background: #fef3c7;
  color: #b45309;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 0 0 0 6px;
}

/* Right Audit & Intelligence Feed */
.feed-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}
.feed-tabs { display: flex; gap: 22px; }
.feed-tab {
  padding: 8px 2px 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.feed-tab.active {
  color: var(--navy);
  font-size: 17px;
  font-weight: 900;
  border-bottom-color: var(--charcoal);
}
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 11px;
  display: grid;
  grid-template-columns: 186px 1fr;
  gap: 16px;
  align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feed-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}
.feed-thumb {
  width: 186px;
  height: 102px;
  border-radius: 6px;
  padding: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 800;
}

/* ==========================================================================
   SECTION 3 & 4: LIVE SPREAD TERMINAL + 3-COL MULTI-METRIC LEADERBOARDS
   ========================================================================== */
.reg-wall-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.reg-wall-tile {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.reg-wall-tile:hover {
  border-color: var(--primary);
  background: #fff;
}

.tri-rank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.tri-rank-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.tri-rank-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.tri-rank-row:last-child { border-bottom: none; }

/* ==========================================================================
   FIXED BOTTOM LIVE QUOTE TICKER & RIGHT UTILITY DOCK
   ========================================================================== */
.bottom-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  z-index: 90;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}
.ticker-label {
  background: var(--charcoal);
  color: var(--gold);
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 2;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  white-space: nowrap;
  animation: tickerSlide 38s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.quote-item { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.q-up { color: #16a34a; }
.q-down { color: #e11d48; }

.right-dock {
  position: fixed;
  right: 16px;
  bottom: 90px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.dock-btn {
  width: 58px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  text-align: center;
}
.dock-btn:last-child { border-bottom: none; }
.dock-btn:hover { background: var(--gold-soft); color: var(--gold-dark); }

/* ==========================================================================
   SHARED COMPONENTS FOR DETAIL, COMPARE, CALCULATOR & MODAL
   ========================================================================== */
.broker-cell { display: flex; align-items: center; gap: 11px; }
.broker-avatar {
  width: 38px; height: 38px; min-width: 38px; border-radius: 8px;
  color: #fff; font-weight: 900; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.broker-avatar-lg { width: 58px; height: 58px; min-width: 58px; border-radius: 12px; font-size: 20px; }
.country-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f3f4f6; border: 1px solid #d1d5db; color: #374151;
  font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.country-iso { background: var(--charcoal); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; font-weight: 800; }
.env-badge {
  display: inline-block; background: var(--emerald-bg); color: var(--emerald); border: 1px solid #6ee7b7;
  font-size: 11.5px; font-weight: 800; padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-tier1 { background: var(--reg-green-bg); color: #166534; border: 1px solid #86efac; }
.badge-tier2 { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.badge-tier3 { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-rebate { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px; border-radius: 6px; font-weight: 700;
  font-size: 13px; text-decoration: none !important; cursor: pointer; border: none;
  white-space: nowrap; word-break: keep-all; flex-shrink: 0; min-width: max-content; transition: 0.15s;
}
.btn-primary { background: var(--reg-green); color: #fff; }
.btn-primary:hover { background: #15803d; color: #fff; }
.btn-outline { background: #fff; color: var(--text-main); border: 1px solid var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.btn-amber { background: var(--gold); color: var(--charcoal); font-weight: 800; }
.btn-amber:hover { background: #eab308; color: var(--charcoal); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.data-table th {
  background: #f8f9fb; color: var(--text-sub); text-align: left;
  padding: 11px 13px; font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table td { padding: 12px 13px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; }
table.data-table td:last-child { white-space: nowrap; }
table.terminal-compact { font-size: 12.5px; }
table.terminal-compact th { padding: 9px 7px; font-size: 12px; }
table.terminal-compact td { padding: 9px 7px; }
table.data-table tr:hover td { background: #fafbfd; }
.text-right { text-align: right !important; }

.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 3px 9px; border-radius: 6px; font-weight: 900; font-size: 15px;
  background: var(--emerald-bg); color: var(--emerald); border: 1px solid #a7f3d0;
}

.geo-box {
  background: linear-gradient(to right, #f0fdf4, #f8fafc);
  border-left: 4px solid var(--reg-green);
  border-radius: 6px; padding: 14px 18px; margin: 16px 0;
  border-top: 1px solid #dcfce7; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.geo-box-title { font-size: 12.5px; font-weight: 800; color: #166534; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.geo-box p { font-size: 14px; color: var(--text-main); line-height: 1.65; }

.intent-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 2px solid var(--border);
  padding-bottom: 12px; margin: 16px 0 20px;
}
.intent-tabs a {
  padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13.5px;
  color: var(--text-sub); background: var(--surface-soft); border: 1px solid var(--border); white-space: nowrap;
}
.intent-tabs a.active { background: var(--charcoal); color: var(--gold); border-color: var(--charcoal); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.stat-tile { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: 13px 15px; }
.stat-tile .k { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-tile .v { font-size: 18px; font-weight: 800; color: var(--navy); margin-top: 3px; font-variant-numeric: tabular-nums; }

.bar-row { margin-bottom: 11px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.bar-track { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0284c7, #16a34a); border-radius: 99px; }

.radar-layout { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: center; }
.review-card { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 13px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 800; font-size: 14.5px; color: var(--navy); margin-bottom: 5px; }
.faq-a { color: var(--text-sub); font-size: 13.8px; }

.search-bar {
  display: flex; max-width: 720px; background: #fff; border-radius: 6px; padding: 4px; gap: 6px;
}
.search-bar input { flex: 1; min-width: 0; border: none; outline: none; padding: 10px 14px; font-size: 14.5px; }
.search-bar button { background: var(--gold-dark); color: #fff; border: none; padding: 10px 22px; border-radius: 5px; font-weight: 800; cursor: pointer; white-space: nowrap; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.65); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 300; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: #fff; border-radius: 12px; max-width: 580px; width: 100%; padding: 24px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.3); border: 1px solid var(--border); max-height: 92vh; overflow-y: auto;
}
.modal-tabs { display: flex; gap: 8px; margin: 14px 0 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.modal-tab-btn {
  flex: 1; padding: 9px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-soft); font-weight: 700; cursor: pointer; font-size: 13.5px; color: var(--text-sub);
}
.modal-tab-btn.active { background: var(--charcoal); color: var(--gold); border-color: var(--charcoal); }
.code-copy-box {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1.5px dashed #16a34a; border-radius: 8px; padding: 12px 16px; margin: 12px 0;
}
.code-copy-box code { font-size: 19px; font-weight: 900; color: #166534; letter-spacing: 0.6px; }

/* Portal Footer */
.portal-footer {
  background: var(--charcoal);
  color: #9ca3af;
  margin-top: 42px;
  padding: 34px 0 46px;
  font-size: 13px;
}
.portal-footer a { color: #d1d5db; }
.portal-footer a:hover { color: var(--gold); }
.footer-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-pipe-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0;
  font-weight: 600;
}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 20px; }

/* Responsive Breakpoints */
@media (max-width: 1199px) {
  .portal-split-search,
  .portal-split-main,
  .portal-split-terminal { grid-template-columns: 1fr; }
  .top-broker-strip { grid-template-columns: repeat(3, 1fr); }
  .rebate-showcase { grid-template-columns: 1fr 1fr; }
  .portal-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header-top { height: auto; padding: 10px 0; }
  .header-top-inner { flex-wrap: wrap; gap: 10px; }
  .portal-trust-pill, .header-mini-search, .nav-right-badge, .right-dock { display: none; }
  .top-broker-strip { grid-template-columns: repeat(2, 1fr); }
  .quick-matrix-grid { grid-template-columns: repeat(3, 1fr); }
  .rebate-showcase, .portal-grid-3, .portal-grid-4, .grid-2, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .feed-card { grid-template-columns: 1fr; }
  .feed-thumb { width: 100%; height: 84px; }
  .radar-layout { grid-template-columns: 1fr; justify-items: center; }
}
