/* ── Reset & base ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --bg4: #475569;
  --bg-glass: rgba(15, 23, 42, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-bright: #ffffff;
  --muted: #94a3b8;
  --green: #10b981;
  --red: #ef4444;
  --gold: #f59e0b;
  --blue: #1e40af;
  --accent: #3b82f6;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg2: #ffffff;
  --bg3: #e2e8f0;
  --bg4: #cbd5e1;
  --bg-glass: rgba(241, 245, 249, 0.9);
  --border: rgba(0, 0, 0, 0.08);
  --text: #0f172a;
  --text-bright: #000000;
  --muted: #475569;
  --blue: #2563eb;
  --accent: #2563eb;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

html {
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

a {
  color: var(--muted);
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
}

.muted {
  color: var(--muted);
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── Top bar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {

  height: 60px;
  border-radius: 8px;
  /* background: linear-gradient(135deg, #3b82f6, #6366f1); */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-bright);
  font-weight: 700;
  font-size: 14px;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-bright);
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.topbar-right {
  font-size: 12px;
  color: var(--muted);
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 20px;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
}

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 60px;
}

.blog-card-clickable {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.blog-card-clickable:hover {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-bright);
}

.field-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 12px 0 6px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.field-group label {
  font-size: 11px;
  color: var(--muted);
}

.field-row {
  display: flex;
  gap: 6px;
}

.field-row .field-group {
  flex: 1;
}

input[type="number"],
input[type="text"],
input[type="search"],
select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

select option {
  background: var(--bg2);
}

/* ── Signal toggles ────────────────────────────────────────────────────────── */
.signal-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.sig-btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: all .15s;
}

.sig-btn:hover {
  border-color: var(--blue);
  color: var(--text);
}

.sig-btn.active {
  background: rgba(39, 174, 96, .15);
  border-color: var(--green);
  color: var(--green);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.85), rgba(37, 99, 235, 1));
  color: #fff;
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.9), rgba(59, 130, 246, 1));
  border-color: rgba(147, 197, 253, 0.6);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.btn-primary:disabled {
  opacity: .5;
  cursor: default;
}

.btn-primary svg {
  width: 14px;
  height: 14px;
}

/* Danger variant (for Remove) */
.btn-danger {
  background: linear-gradient(145deg, rgba(231, 76, 60, 0.8), rgba(192, 57, 43, 1));
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(145deg, rgba(248, 113, 113, 0.9), rgba(231, 76, 60, 1));
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 6px 14px rgba(231, 76, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Social variant (flat colours but with same shadow structure) */
.btn-social {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-reset {
  width: 100%;
  margin-top: 12px;
  padding: 6px;
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
}

.btn-reset:hover {
  color: var(--text);
  border-color: var(--blue);
}

.sidebar-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--border);
}
.sidebar-legal a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-legal a:hover {
  color: var(--text);
}

/* ── Mobile view switcher (topbar) ─────────────────────────────────────────── */
.btn-mobile-view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.btn-mobile-view:hover {
  color: var(--text);
  border-color: #4b5a7a;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg3);
  color: var(--text);
}

/* ── Auth Buttons ──────────────────────────────────────────────────────────── */
.btn-signin {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, rgba(26, 39, 68, 0.7), rgba(15, 25, 41, 0.9));
  color: #fff;
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 20px;
  padding: 4px 16px 4px 4px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

.btn-signin:hover {
  background: linear-gradient(145deg, rgba(38, 56, 95, 0.8), rgba(22, 36, 59, 1));
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-signin:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.btn-signin-icon {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-signin.signout-variant {
  background: linear-gradient(145deg, rgba(231, 76, 60, 0.4), rgba(192, 57, 43, 0.5));
  border-color: rgba(231, 76, 60, 0.3);
  cursor: pointer;
  padding: 4px 16px 4px 8px;
  /* Slightly more left padding since no bright housing */
}

.btn-signin.signout-variant:hover {
  background: linear-gradient(145deg, rgba(231, 76, 60, 0.6), rgba(192, 57, 43, 0.8));
  border-color: rgba(231, 76, 60, 0.6);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-signin.signout-variant .btn-signin-icon {
  background: transparent;
  box-shadow: none;
  width: 20px;
}

/* ── Premium tier badge ─────────────────────────────────────────────────────── */
.badge-premium {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #1a1200;
  background: linear-gradient(135deg, #f5d060 0%, #c9942a 100%);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.7;
  white-space: nowrap;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
}

/* ── Breadth Widget ────────────────────────────────────────────────────────── */
.summary-bar {
  margin-bottom: 14px;
}

.breadth-widget {
  display: grid;
  grid-template-columns: 150px 190px 1fr;
  grid-template-rows: auto auto;
  gap: 0 20px;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35),
              0 1px 0 rgba(255, 255, 255, 0.04) inset,
              0 0 0 1px rgba(255, 255, 255, 0.02);
  animation: bw-fadein 0.4s ease;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

[data-theme="light"] .breadth-widget {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08),
              0 1px 0 rgba(0, 0, 0, 0.04) inset;
}

[data-theme="light"] .donut-track {
  stroke: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .donut-arc {
  filter: drop-shadow(0 0 4px currentColor);
  opacity: 0.9;
}

[data-theme="light"] .bh-today .bh-col {
  outline-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .bh-col {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

@keyframes bw-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.breadth-donut-wrap {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breadth-donut {
  width: 140px;
  height: 140px;
  overflow: visible;
}

.donut-track {
  stroke: rgba(255, 255, 255, 0.07);
}

.donut-arc {
  transition: filter 0.3s;
}

@keyframes dominating-glow {
  0% { filter: drop-shadow(0 0 5px currentColor); }
  100% { filter: drop-shadow(0 0 16px currentColor) brightness(1.2); }
}

.donut-arc-glow {
  animation: dominating-glow 1.4s infinite alternate ease-in-out;
}

.donut-center-num {
  font-size: 23px;
  font-weight: 700;
  fill: var(--text-bright);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.donut-center-lbl {
  font-size: 11px;
  fill: var(--muted);
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.04em;
}

.breadth-legend {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bl-item {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.bl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bl-label {
  font-size: 12px;
  color: var(--text);
}

.bl-count {
  font-size: 13px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

.bl-pct {
  font-size: 11px;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
}

.breadth-history {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.bh-header {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.bh-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 90px;
}

.bh-col-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  cursor: default;
  transition: transform 0.15s;
}

.bh-col-wrap:hover {
  transform: scaleY(1.04);
  transform-origin: bottom;
}

.bh-today .bh-col {
  outline: 1px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.bh-col {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.bh-seg {
  min-height: 1px;
  transition: flex 0.5s ease;
}

.bh-date {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  text-align: center;
}

.bh-today .bh-date {
  color: var(--accent);
  font-weight: 600;
}

.breadth-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

/* ── Top Gainers / Top Losers ──────────────────────────────────────────────── */
.gainers-losers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.gl-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gl-gainers { border-top: 2px solid #10b981; }
.gl-losers  { border-top: 2px solid #ef4444; }

.gl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 8px;
  border-bottom: 1px solid var(--border);
}

.gl-title {
  display: flex;
  align-items: center;
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-bright);
}

.gl-gainers .gl-title { color: #10b981; }
.gl-losers  .gl-title { color: #ef4444; }

.by-filters-badge {
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-left: auto; /* Push to the right edge */
  vertical-align: middle;
  letter-spacing: normal;
  opacity: 0.7;
}

.gl-list { padding: 4px 0; }

.gl-item {
  display: grid;
  grid-template-columns: 20px 32px 1fr auto;
  align-items: center;
  gap: 0 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s;
}

.gl-item:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .gl-item:nth-child(even) {
  background: var(--bg3);
}

.gl-item:hover { background: var(--bg3); }

[data-theme="light"] .gl-item:hover { background: var(--bg4); }

.gl-rank {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

/* reuse stock-logo-wrap sizing — just constrain it */
.gl-item .stock-logo-wrap {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.gl-item .stock-logo-letter {
  width: 28px;
  height: 28px;
  font-size: 11px;
  line-height: 28px;
}

.gl-item .stock-logo-img {
  width: 28px;
  height: 28px;
}

.gl-info { min-width: 0; }

.gl-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gl-symbol {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.gl-nums {
  text-align: right;
  flex-shrink: 0;
}

.gl-price {
  font-size: 12px;
  color: var(--text);
}

.gl-pct {
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.gl-empty {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.col-green {
  color: var(--green);
}

.col-red {
  color: var(--red);
}

.col-gold {
  color: var(--gold);
}

/* ── Error banner ──────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(231, 76, 60, .15);
  border: 1px solid #c0392b;
  border-radius: var(--radius);
  padding: 10px 14px;
  color: #f08080;
  font-size: 12px;
  margin-bottom: 12px;
}

/* ── Loading ───────────────────────────────────────────────────────────────── */
.loading-overlay {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  /* Adjust based on your layout */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

thead tr {
  background: var(--bg2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

thead th {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

tbody tr {
  border-top: 1px solid rgba(42, 63, 107, .5);
  cursor: pointer;
  transition: background .1s;
}

tbody tr:hover {
  background: rgba(42, 63, 107, .4);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

[data-theme="light"] tbody tr:nth-child(even) {
  background: var(--bg3);
}

[data-theme="light"] tbody tr:hover {
  background: rgba(59, 130, 246, 0.12);
}

td {
  padding: 9px 12px;
  vertical-align: middle;
}

.stock-name {
  font-weight: 600;
  color: var(--text-bright);
}

.stock-meta {
  font-size: 11px;
  color: var(--muted);
}

.price-val {
  font-family: "Consolas", monospace;
  font-weight: 600;
  color: var(--text-bright);
}

.chg-up {
  color: var(--green);
}

.chg-dn {
  color: var(--red);
}

.chg-sub {
  font-size: 11px;
  opacity: .75;
}

.vol-main {
  color: var(--text);
}

.vol-avg {
  font-size: 11px;
  color: var(--muted);
}

.vol-ratio-hi {
  color: var(--gold);
  font-weight: 700;
}

/* RSI zones */
.rsi-ob {
  color: var(--red);
  font-weight: 700;
}

.rsi-os {
  color: var(--green);
  font-weight: 700;
}

.rsi-label {
  font-size: 10px;
  display: block;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.1s ease;
}

th.sortable:hover {
  color: var(--primary);
}

/* Signal badges */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  margin: 1px 1px 1px 0;
}

.badge-bull {
  background: rgba(39, 174, 96, .15);
  border: 1px solid rgba(39, 174, 96, .4);
  color: #4ade80;
}

.badge-teal {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
  border-color: rgba(20, 184, 166, 0.4);
  box-shadow: 0 0 6px rgba(20, 184, 166, 0.15);
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 700;
}
[data-theme="light"] .badge-teal { background: rgba(15, 118, 110, 0.1); color: #0f766e; border-color: rgba(15, 118, 110, 0.3); box-shadow: none; }

/* Indicator badges (Vol Ratio, RSI, PE, PB, Div Yield combined cell) */
.ind-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.ind-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--mono, monospace);
  white-space: nowrap;
}

.ind-neutral {
  background: rgba(100, 116, 139, .12);
  border: 1px solid rgba(100, 116, 139, .25);
  color: #94a3b8;
}

.ind-vol-hi {
  background: rgba(243, 156, 18, .15);
  border: 1px solid rgba(243, 156, 18, .35);
  color: var(--gold);
}

.ind-ob {
  background: rgba(231, 76, 60, .1);
  border: 1px solid rgba(231, 76, 60, .3);
  color: #f87171;
}

.ind-os {
  background: rgba(39, 174, 96, .1);
  border: 1px solid rgba(39, 174, 96, .3);
  color: #4ade80;
}

.ind-div {
  background: rgba(243, 156, 18, .1);
  border: 1px solid rgba(243, 156, 18, .3);
  color: #f39c12;
}

/* ── Detail modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Detail modal must sit above the chart modal when both are open */
#modal-overlay {
  z-index: 300;
}

/* Share modal must always sit above all other modals */
#share-modal-overlay {
  z-index: 500;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

.modal-symbol {
  font-size: 12px;
  color: var(--muted);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-hero {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-price {
  font-size: 28px;
  font-weight: 700;
  font-family: "Consolas", monospace;
  color: var(--text-bright);
}

.hero-chg {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.modal-body {
  padding: 4px 20px 14px;
}

.modal-section {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 14px 0 6px;
}

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(42, 63, 107, .35);
  font-size: 12px;
}

.modal-row .r-label {
  color: var(--muted);
}

.modal-row .r-value {
  font-family: "Consolas", monospace;
  color: var(--text);
}

.modal-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 0;
}

.modal-links {
  padding: 8px 0;
}

.btn-link {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}

.btn-link:hover {
  background: var(--bg);
  border-color: var(--blue);
  color: var(--text);
}

.modal-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* ── Chart modal ───────────────────────────────────────────────────────────── */
.chart-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-modal:fullscreen {
  max-width: 100%;
  border-radius: 0;
  border: none;
  overflow-y: auto;
}

/* ── TradingView Widgets modal ─────────────────────────────────────────────── */
#tv-modal-overlay { z-index: 400; } /* above #modal-overlay(300) and chart(200) */

.tv-widgets-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header — no bottom border, blends into body */
.tv-widgets-modal .modal-head {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  background: var(--bg2);
  border-bottom: none;
  padding: 14px 18px;
}

/* Body: left column (Profile + Financials stacked) | right column (TA full height) */
.tv-body-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(90vh - 90px);
}

.tv-left-col {
  display: flex;
  flex-direction: column;
  flex: 1;            /* fill all space the TA column doesn't take */
  min-width: 0;
  min-height: 0;
}

/* Profile — top 30% of left column */
.tv-left-cell:first-child {
  position: relative;
  flex: 3;
  min-height: 0;
  overflow: hidden;
}

/* Financials — bottom 70% of left column */
.tv-left-cell:last-child {
  position: relative;
  flex: 7;
  min-height: 0;
  overflow: hidden;
}

.tv-right-col {
  position: relative;
  width: 425px;       /* minimum width for TA multiple-ratings without h-scroll */
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
}

/* Affiliate footer — no top border, blends with body */
.tv-modal-footer {
  padding: 8px 18px;
  font-size: 11px;
  color: #787b86;
  text-align: right;
  background: inherit;
  flex-shrink: 0;
}

.tv-aff-link {
  color: var(--muted);
  text-decoration: underline;
}

.tv-aff-link:hover {
  color: var(--text);
}

.chart-container {
  width: 100%;
  min-height: 380px;
  background: var(--bg2);
  /* chart navy — LWC bg is transparent so colour lives here */
  position: relative;
  /* anchor for the Ichimoku canvas overlay */
  overflow: hidden;
  /* clip cloud polygons at chart edges */
}

/* Period selector tabs */
.period-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.period-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: all .15s;
}

.period-btn:hover {
  border-color: var(--blue);
  color: var(--text);
}

.period-btn.active {
  background: rgba(59, 130, 246, .2);
  border-color: var(--blue);
  color: var(--text-bright);
}

/* ── TradingView Advanced Charts button ───────────────────────────────────── */
.btn-tradingview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  background: #2962FF;
  color: #fff;
  margin-left: auto;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: inherit;
}
.btn-tradingview:hover {
  background: #1E53E5;
  transform: translateY(-1px);
}
.btn-tradingview:active {
  transform: translateY(0);
  background: #1848CC;
}
.btn-tradingview.active {
  background: #1848CC;
  box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.5), inset 0 1px 3px rgba(0,0,0,0.3);
  transform: translateY(0);
}
.btn-tradingview svg {
  flex-shrink: 0;
}

/* TradingView redirect panel container */
.tv-chart-container {
  width: 100%;
  background: var(--bg2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  box-sizing: border-box;
}

.tv-redirect-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  text-align: center;
}

.tv-redirect-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tv-redirect-wordmark {
  font-size: 22px;
  font-weight: 700;
  color: #2962FF;
  letter-spacing: -0.5px;
}

.tv-redirect-symbol {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.5px;
}

.tv-redirect-name {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
}

.tv-redirect-info {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 4px 0 8px;
}

.tv-redirect-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2962FF;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.tv-redirect-cta:hover {
  background: #1E53E5;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}
.tv-redirect-cta:active {
  transform: translateY(0);
}

.tv-redirect-attr {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.tv-redirect-attr a {
  color: #2962FF;
  text-decoration: none;
}
.tv-redirect-attr a:hover {
  text-decoration: underline;
}

/* Dim period buttons when TradingView chart is active */
.period-tabs.tv-active .period-btn {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* ── Signal / Indicator toggle bar ─────────────────────────────────────────── */
.signal-toggle-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  flex-wrap: wrap;
}

.signal-toggle-bar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sig-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: all .18s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

.sig-toggle-btn svg {
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity .18s;
}

.sig-toggle-btn:hover {
  border-color: #3b82f6;
  color: var(--text);
  background: rgba(59, 130, 246, .08);
}

.sig-toggle-btn:hover svg {
  opacity: 1;
}

.sig-toggle-btn.active {
  background: rgba(59, 130, 246, .18);
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .2);
}

.sig-toggle-btn.active svg {
  opacity: 1;
}

.signal-toggle-bar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}

.sig-toggle-btn--vol {
  border-color: rgba(245, 158, 11, 0.3);
}

.sig-toggle-btn--vol:hover {
  border-color: #f59e0b;
  color: var(--text);
  background: rgba(245, 158, 11, .08);
}

.sig-toggle-btn--vol.active {
  background: rgba(245, 158, 11, .15);
  border-color: #f59e0b;
  color: #fcd34d;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .2);
}

/* ── Chart indicator sub-panels ─────────────────────────────────────────────── */
.chart-sub-panel {
  width: 100%;
  height: 120px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.chart-sub-panel-label {
  position: absolute;
  top: 4px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.social-panel {
  padding: 15px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

/* ── Major Indices bar ─────────────────────────────────────────────────────── */
.indices-bar {
  display: flex;
  gap: 10px;
  padding-bottom: 4px;
  margin-bottom: 14px;
  overflow: hidden; /* Hide the scrollbar and content outside bounds */
  width: 100%;     /* Never report intrinsic width of the marquee track */
  max-width: 100%;
}

/* Contains duplicated children and slides smoothly */
.indices-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  animation: indices-marquee 28s linear infinite;
  will-change: transform;
}

.indices-bar:hover .indices-track,
.indices-bar:active .indices-track {
  animation-play-state: paused;
}

@keyframes indices-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 5px)); /* half width minus half the gap */ }
}

.idx-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 148px;
  flex-shrink: 0;
  transition: border-color .15s;
}

.idx-card:hover {
  border-color: var(--blue);
}

/* Loading skeleton shimmer */
.idx-skeleton {
  min-height: 102px;
  background: linear-gradient(90deg,
      var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.idx-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.idx-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.2;
  margin-top: 2px;
}

.idx-chg-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 1px;
}

.idx-chg {
  font-size: 12px;
  font-weight: 700;
}

.idx-chg-abs {
  font-size: 11px;
  font-weight: 400;
  opacity: .7;
}

.idx-spark {
  margin-top: 8px;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.idx-spark svg {
  width: 100%;
  height: 44px;
}

/* ── Favourites star ─────────────────────────────────────────────────────── */
.th-fav {
  width: 32px;
  min-width: 32px;
  text-align: center;
  padding: 0 4px;
}

.td-fav {
  width: 32px;
  min-width: 32px;
  text-align: center;
  padding: 0 4px;
}

/* Header filter button */
.fav-hdr-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  color: var(--bg4);
  transition: color 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-hdr-btn:hover {
  color: #f5b800;
  transform: scale(1.15);
}

.fav-hdr-btn.fav-hdr-active {
  color: #f5b800;
  text-shadow: 0 0 8px rgba(245, 184, 0, 0.5);
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  color: var(--bg4);
  transition: color 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover {
  color: #f5b800;
  transform: scale(1.2);
}

.fav-btn.fav-active {
  color: #f5b800;
  text-shadow: 0 0 8px rgba(245, 184, 0, 0.5);
}

/* ── Toast notification ─────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 20px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}

.app-toast.app-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Price Ticker Bar ─────────────────────────────────────────────────────── */
.price-ticker {
  position: sticky;
  top: 0;
  z-index: 110;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.98), rgba(30, 41, 59, 0.92));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  height: 52px;
  display: flex;
  align-items: center;
}

.price-track {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  animation: price-marquee var(--ticker-duration, 85s) linear infinite;
  will-change: transform;
}

.price-ticker:hover .price-track {
  animation-play-state: paused;
}

.price-item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  /* Ticker background is always dark — pin text to light colours regardless of theme */
  color: #e2e8f0;
}

.price-item-symbol {
  color: #f8fafc;
  font-weight: 700;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: 0.01em;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-item-row2 {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.price-item-price {
  color: #e2e8f0;
  font-family: "Consolas", "SF Mono", monospace;
  font-weight: 700;
  font-size: 15px;
  opacity: 0.98;
}

.price-item-chg {
  font-weight: 600;
  font-family: "Consolas", "SF Mono", monospace;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Static colours — ticker bar background never changes with theme */
.price-item-chg.up   { color: #4ade80; }
.price-item-chg.down { color: #f87171; }
.price-item-chg.flat { color: #94a3b8; }

/* Direction badge — rounded square chip wrapping the arrow symbol */
.price-dir-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.price-item-chg.up   .price-dir-badge { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
.price-item-chg.down .price-dir-badge { background: rgba(248, 113, 113, 0.18); color: #f87171; }
.price-item-chg.flat .price-dir-badge { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.price-ticker::before,
.price-ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  pointer-events: none;
  z-index: 1;
}

.price-ticker::before {
  left: 0;
  background: linear-gradient(90deg, rgba(30, 41, 59, 1) 0%, rgba(30, 41, 59, 0) 100%);
}

.price-ticker::after {
  right: 0;
  background: linear-gradient(270deg, rgba(30, 41, 59, 1) 0%, rgba(30, 41, 59, 0) 100%);
}

@keyframes price-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ── Stock logo ────────────────────────────────────────────────────────────── */
/* Flex wrapper that holds the logo + name/meta stacked text */
.stock-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 36×36 rounded square, clips the img */
.stock-logo-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  overflow: hidden;
}

/* Coloured letter shown when logo is absent / loading */
.stock-logo-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
}

/* Actual company logo image — white background so transparent PNGs look clean */
.stock-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 9px;
}

/* News source: neutral letter shown while favicon loads or as fallback */
.news-source-letter {
  background: #2a3045;
}

/* News source favicon — transparent bg, gentle padding, no corner clip */
.news-source-favicon {
  background: transparent !important;
  padding: 5px !important;
  object-fit: contain;
  border-radius: 6px !important;
  image-rendering: auto;
}

/* Larger logo shown in the chart-modal header */
.chart-modal-logo-wrap .stock-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.chart-modal-logo-wrap .stock-logo-letter {
  font-size: 20px;
}

/* ── App footer bar ─────────────────────────────────────────────────────────── */
.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--muted);
  z-index: 90;
}
.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.app-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.app-footer-links a:hover {
  color: var(--text);
}
.app-footer-sep {
  color: var(--border);
}
.app-footer-copy {
  white-space: nowrap;
  color: var(--muted);
}

/* ── Doc pages (terms / privacy) back button ────────────────────────────────── */
.doc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.doc-back-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── Footer note ───────────────────────────────────────────────────────────── */
.footer-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.footer-note-links {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.footer-note-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-note-links a:hover {
  color: var(--text);
}
.footer-note-sep {
  color: var(--border);
}

/* ── View navigation tabs ──────────────────────────────────────────────────── */
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  /* Allow tabs to wrap on small screens */
  justify-content: center;
  /* Center tabs when they wrap */
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.view-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s ease-in-out;
}

.view-tab:hover {
  color: var(--text);
  background: var(--bg3);
}

.view-tab.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

/* ── Heatmap ───────────────────────────────────────────────────────────────── */
#heatmap-view {
  width: 100%;
}

/* ── Sector Performance Dashboard (desktop) ──────────────────────────────────── */
.dsp-wrap {
  padding: 14px 16px 4px;
}

.dsp-header {
  margin-bottom: 10px;
}

.dsp-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dsp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.dsp-tile {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: filter .15s, box-shadow .15s;
}

.dsp-tile:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 0 2px var(--accent);
}

.dsp-up {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.dsp-dn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .dsp-up {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .dsp-dn {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
}

.dsp-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.dsp-pct {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 7px;
}

.dsp-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.09);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

[data-theme="light"] .dsp-bar-track {
  background: rgba(0,0,0,0.1);
}

.dsp-bar {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

.dsp-bar-up { background: var(--green); }
.dsp-bar-dn { background: var(--red); }

.dsp-adec {
  font-size: 10px;
  font-weight: 600;
  display: flex;
  gap: 6px;
}

.heatmap-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.heatmap-sector {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  scroll-margin-top: 72px;
}

.heatmap-sector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.hs-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
}

.hs-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.hs-count {
  color: var(--muted);
}

.heatmap-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
}

.heatmap-tile {
  min-height: 88px;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: filter .12s, box-shadow .12s;
  border: 1px solid rgba(255,255,255,0.06);
  user-select: none;
}

/* Size-based widths */
.heatmap-tile-lg { width: 160px; min-height: 100px; }
.heatmap-tile-md { width: 130px; min-height: 94px; }
.heatmap-tile-sm { width: 105px; min-height: 88px; }

.heatmap-tile:hover {
  filter: brightness(1.25);
  box-shadow: 0 0 0 2px var(--accent);
}

/* Light mode: tiles stay dark but need a lift shadow */
[data-theme="light"] .heatmap-tile {
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .heatmap-tile:hover {
  box-shadow: 0 0 0 2px var(--accent), 0 4px 12px rgba(0,0,0,0.3);
}

/* Animated "burning" border for hot stocks with high volume ratio */
@keyframes tile-burn {
  0% {
    box-shadow: 0 0 2px rgba(245, 158, 11, 0.4), inset 0 0 2px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.6);
  }
  100% {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8), inset 0 0 5px rgba(239, 68, 68, 0.4);
    border-color: rgba(245, 158, 11, 0.9);
  }
}

.heatmap-tile-hot {
  animation: tile-burn 1.2s infinite alternate ease-in-out;
  z-index: 10;
}

.heatmap-tile-hot:hover {
  animation: none;
  box-shadow: 0 0 12px rgba(239, 68, 68, 1), 0 0 0 2px var(--accent) !important;
  border-color: rgba(239, 68, 68, 1) !important;
  filter: brightness(1.25);
}

[data-theme="light"] .heatmap-tile-hot {
  /* Override the light base shadow so the fire is visible above the drop shadow */
  animation: tile-burn-light 1.2s infinite alternate ease-in-out;
}

@keyframes tile-burn-light {
  0% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 2px rgba(245, 158, 11, 0.6), inset 0 0 2px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.7);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.28), 0 0 12px rgba(239, 68, 68, 0.9), inset 0 0 5px rgba(239, 68, 68, 0.4);
    border-color: rgba(245, 158, 11, 0.9);
  }
}

.ht-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  margin-bottom: 3px;
}

/* Color set by JS (symbolColor) */
.ht-symbol {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  line-height: 1.2;
}

.ht-size-badge {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.6;
}

.ht-name {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
  margin-bottom: 4px;
}

[data-theme="light"] .ht-name { color: rgba(255,255,255,0.75); }

.ht-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

/* Color set by JS (symbolColor) */
.ht-chg {
  font-size: 15px;
  font-weight: 700;
  font-family: "Consolas", monospace;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.ht-vol {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-align: right;
  white-space: nowrap;
}

.heatmap-tile-sm .ht-vol { display: none; }

[data-theme="light"] .ht-vol { color: rgba(255,255,255,0.70); }

/* Pulsing amber border for high-volume tiles */
.heatmap-tile-hot {
  box-shadow: 0 0 0 1.5px rgba(245, 158, 11, .6);
  animation: ht-vol-pulse 2.5s ease-in-out infinite;
}

@keyframes ht-vol-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 1.5px rgba(245, 158, 11, .5);
  }

  50% {
    box-shadow: 0 0 0 1.5px rgba(245, 158, 11, 1), 0 0 10px rgba(245, 158, 11, .3);
  }
}

.heatmap-tile-hot:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 0 0 3.5px rgba(245, 158, 11, .65);
}

/* ── Heatmap Breadth Banner ──────────────────────────────────────────────────── */
.hm-breadth {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.hm-breadth-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.hm-breadth-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
}

.hm-breadth-adv { color: var(--green); }
.hm-breadth-dec { color: var(--red); }
.hm-breadth-unch { color: var(--muted); }

.hm-breadth-bar-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255,255,255,0.07);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 10px rgba(16, 185, 129, 0.18),
    0 2px 6px rgba(0,0,0,0.4);
}

[data-theme="light"] .hm-breadth-bar-wrap {
  background: rgba(0,0,0,0.08);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.08),
    0 0 8px rgba(16, 185, 129, 0.14),
    0 2px 4px rgba(0,0,0,0.15);
}

.hm-breadth-bar-adv {
  height: 100%;
  background: var(--green);
  transition: width .4s ease;
}

.hm-breadth-bar-dec {
  height: 100%;
  background: var(--red);
  transition: width .4s ease;
}

.hm-breadth-total {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Heatmap Spotlight Filter ────────────────────────────────────────────────── */
.hm-spotlight-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.hm-spotlight-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  margin-right: 4px;
}

.hm-spt-btn {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.hm-spt-btn:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.hm-spt-btn.hm-spt-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Heatmap Color-By Toolbar Group ─────────────────────────────────────────── */
.hm-colorby-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.hm-cb-btn {
  background: var(--bg3);
  color: #8899bb;
  border: none;
  border-right: 1px solid var(--border);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}

.hm-cb-btn:last-child { border-right: none; }

.hm-cb-btn.hm-cb-active {
  background: #3b82f6;
  color: #fff;
}

/* ── Heatmap Sector Focus Mode ───────────────────────────────────────────────── */
.heatmap-sector {
  transition: opacity .25s ease;
}

.heatmap-sector-dimmed {
  opacity: 0.15;
  pointer-events: none;
}

.heatmap-sector-focused .heatmap-sector-header {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Back-to-overview button — hidden until the sector is focused */
.hs-back-btn {
  display: none;
  align-items: center;
  padding: 2px 9px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.hs-back-btn:hover {
  color: var(--text-bright);
  border-color: rgba(255,255,255,0.28);
}

.heatmap-sector-focused .hs-back-btn {
  display: inline-flex;
}

/* ── Reports UI ──────────────────────────────────────────────────────────────── */
#announcement-view,
#news-view {
  width: 100%;
  border-radius: var(--radius);
  background: transparent;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}

.sum-card {
  flex: 1;
  min-width: 160px;
  background: linear-gradient(145deg, var(--bg2) 0%, rgba(13, 17, 23, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  cursor: default;
}

.sum-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.sum-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.sum-card.col-green::before {
  background: linear-gradient(90deg, var(--green), #4ADE80);
}

.sum-card.col-blue::before {
  background: linear-gradient(90deg, var(--blue), #60A5FA);
}

.sum-card.col-orange::before {
  background: linear-gradient(90deg, var(--orange), #FBBF24);
}

.sum-card.col-purple::before {
  background: linear-gradient(90deg, #bc8cff, #D8B4FE);
}

.sum-card.col-gold::before {
  background: linear-gradient(90deg, var(--gold), #FDE047);
}

.sum-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.sum-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}


.report-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 25px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.report-section-count {
  margin-left: auto;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 400;
}

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.report-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.report-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.report-card.green::before {
  background: var(--green);
}

.report-card.blue::before {
  background: var(--blue);
}

.report-card.purple::before {
  background: #bc8cff;
}

.report-card.orange::before {
  background: #f0883e;
}

.report-card.gold::before {
  background: var(--gold);
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.report-card-co {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.report-card .stock-logo-wrap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
}

.report-co-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.report-co-code {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: #2dd4bf;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Consolas', monospace;
  white-space: nowrap;
}
[data-theme="light"] .report-co-code { color: #0f766e; }

.report-co-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-bright);
}

.report-card-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.report-card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 5px;
  margin-bottom: 10px;
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.45);
  box-shadow: 0 0 8px rgba(20, 184, 166, 0.18);
  text-shadow: 0 0 6px rgba(45, 212, 191, 0.35);
}

[data-theme="light"] .report-card-tag {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.3);
  box-shadow: none;
  text-shadow: none;
}

.report-card-tag.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.18);
  text-shadow: 0 0 6px rgba(52, 211, 153, 0.35);
}

.report-card-tag.blue {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.18);
  text-shadow: 0 0 6px rgba(96, 165, 250, 0.35);
}

.report-card-tag.purple {
  background: rgba(188, 140, 255, 0.2);
  color: #d8b4fe;
  border-color: rgba(188, 140, 255, 0.4);
  box-shadow: 0 0 8px rgba(188, 140, 255, 0.18);
  text-shadow: 0 0 6px rgba(216, 180, 254, 0.35);
}

.report-card-tag.orange {
  background: rgba(240, 136, 62, 0.2);
  color: #fb923c;
  border-color: rgba(240, 136, 62, 0.4);
  box-shadow: 0 0 8px rgba(240, 136, 62, 0.18);
  text-shadow: 0 0 6px rgba(251, 146, 60, 0.35);
}

.report-card-tag.gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.18);
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.35);
}

[data-theme="light"] .report-card-tag.green  { background: rgba(16, 185, 129, 0.12); color: #059669; border-color: rgba(16, 185, 129, 0.3); box-shadow: none; text-shadow: none; }
[data-theme="light"] .report-card-tag.blue   { background: rgba(37, 99, 235, 0.12);  color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3);  box-shadow: none; text-shadow: none; }
[data-theme="light"] .report-card-tag.purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; border-color: rgba(139, 92, 246, 0.3); box-shadow: none; text-shadow: none; }
[data-theme="light"] .report-card-tag.orange { background: rgba(234, 88, 12, 0.12);  color: #c2410c; border-color: rgba(234, 88, 12, 0.3);  box-shadow: none; text-shadow: none; }
[data-theme="light"] .report-card-tag.gold   { background: rgba(217, 119, 6, 0.12);  color: #b45309; border-color: rgba(217, 119, 6, 0.3);  box-shadow: none; text-shadow: none; }

.report-card-body {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.7;
}

.report-card-body strong {
  color: var(--text-bright);
  font-weight: 700;
}

.report-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.report-metric {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-metric-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.report-metric-val {
  font-weight: 600;
}

.report-metric-val.up {
  color: var(--green);
}

.report-metric-val.flat {
  color: var(--gold);
}

.report-metric-val.dn {
  color: var(--red);
}

.report-metric-val.hl {
  color: #fbbf24;
}
[data-theme="light"] .report-metric-val.hl { color: #d97706; }

.report-impact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 3px 8px;
  border-radius: 5px;
  float: right;
  margin-left: 8px;
}

.report-impact-high {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.report-impact-medium {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .report-impact-high   { background: rgba(16,185,129,0.12); color: #059669; border-color: rgba(16,185,129,0.3); }
[data-theme="light"] .report-impact-medium { background: rgba(217,119,6,0.12);  color: #b45309; border-color: rgba(217,119,6,0.3); }

/* ── Sentiment bar ──────────────────────────────────────────────────────────── */
.sentiment-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sentiment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.sentiment-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}

.sentiment-score-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}

.sentiment-track {
  position: relative;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(to right, #f85149 0%, #f85149 20%, #d29922 40%, #30363d 50%, #d29922 60%, #3fb950 80%, #3fb950 100%);
  overflow: visible;
}

[data-theme="light"] .sentiment-track {
  background: linear-gradient(to right, #f85149 0%, #f85149 20%, #d29922 40%, #e2e8f0 50%, #d29922 60%, #3fb950 80%, #3fb950 100%);
}

.sentiment-thumb {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--bg2);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  transition: left .3s ease;
}

[data-theme="light"] .sentiment-thumb {
  border-color: #fff;
}

.sentiment-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .2px;
}

/* ── Report pill filters ─────────────────────────────────────────────────── */
.report-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 2px;
}

.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}

.report-pill:hover {
  border-color: var(--blue);
  color: var(--text);
}

.report-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.report-pill .pill-count {
  font-size: 10px;
  opacity: 0.65;
}

/* ── Stats bar ────────────────────────────────────────────────────────────── */
.report-stats-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.report-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1;
}

.report-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

.report-stat-val.green { color: #3fb950; }
.report-stat-val.red   { color: #f85149; }
.report-stat-val.amber { color: #d29922; }

/* ── NEW badge ────────────────────────────────────────────────────────────── */
.new-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #3fb950, #26d979);
  color: #0d1117;
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.5);
  vertical-align: middle;
  margin-left: 6px;
  animation: newBadgePulse 2.5s ease-in-out infinite;
}

[data-theme="light"] .new-badge { color: #fff; }

@keyframes newBadgePulse {
  0%, 100% { box-shadow: 0 0 5px rgba(63,185,80,.35); }
  50%       { box-shadow: 0 0 14px rgba(63,185,80,.8); }
}

/* Deep-link card highlight — pulsing blue border ring */
@keyframes cardHighlightPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(59,130,246,.4); }
  50%       { box-shadow: 0 0 0 4px rgba(59,130,246,.85), 0 4px 20px rgba(59,130,246,.3); }
}
.card-highlight {
  animation: cardHighlightPulse 1.2s ease-in-out 2;
  border-color: #3b82f6 !important;
}

/* ── Share button ─────────────────────────────────────────────────────────── */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  padding: 0;
  gap: 6px;
}

.share-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(31,111,235,.1);
}

.share-btn-label {
  display: none;
  font-size: 13px;
  font-weight: 500;
}

@media (min-width: 600px) {
  .share-btn {
    width: auto;
    height: 32px;
    padding: 0 12px;
  }
  .share-btn-label {
    display: inline;
  }
}

/* ── Hero card ────────────────────────────────────────────────────────────── */
@media (min-width: 800px) {
  .report-card-hero {
    grid-column: span 2;
  }

  .report-card-hero .report-card-body {
    font-size: 14px;
    line-height: 1.8;
  }
}

.report-card-hero {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--bg2) 0%, rgba(31, 111, 235, 0.05) 100%);
}

.report-card-hero::before {
  background: linear-gradient(90deg, var(--blue), #60a5fa) !important;
  height: 4px !important;
}

/* ── Share card modal (desktop) ─────────────────────────────────────────────── */
.share-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.share-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.share-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.share-modal-preview {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: #161b22;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal-preview img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 9px;
}

.share-modal-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-platform-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.share-platform-btn:hover { background: var(--bg4, #21262d); border-color: #444c56; }

.share-platform-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.share-platform-tw  { color: var(--text); }
.share-platform-fb  { color: #1877f2; }
.share-platform-wa  { color: #25d366; }
.share-platform-tg  { color: #2aabee; }
.share-platform-th  { color: var(--text); }
.share-platform-copy { color: var(--text); }
.share-platform-dl  { color: var(--text); }

/* ── Report pagination bar ──────────────────────────────────────────────────── */
.pag-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.pag-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pag-num {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.pag-num:hover {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--blue);
}

.pag-num.pag-active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--text-bright);
  font-weight: 700;
  cursor: default;
}

.pag-arrow {
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.pag-arrow:hover:not(.pag-disabled) {
  background: var(--bg2);
  border-color: var(--blue);
}

.pag-arrow.pag-disabled,
.pag-arrow[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.pag-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 13px;
  user-select: none;
}

/* ── Report view pagination & filter ──────────────────────────────────────── */
.pag-btn {
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.pag-btn:hover:not([disabled]) {
  background: var(--bg2);
  color: var(--text);
  border-color: var(--blue);
}

.pag-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--text-bright);
  font-weight: 700;
  cursor: default;
}

.pag-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--blue);
}

/* ── About Me view ─────────────────────────────────────────────────────────── */
#about-view {
  width: 100%;
  background: transparent;
}

/* ── About view components ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, transparent 0%, rgba(22, 27, 34, 0.4) 40%, rgba(26, 39, 68, 0.6) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 0 0 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 70% 50%, rgba(88, 166, 255, .07) 0%, transparent 70%),
    radial-gradient(ellipse 400px 200px at 20% 80%, rgba(39, 174, 96, .05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 48px;
  display: flex;
  align-items: center;
  gap: 36px;
  position: relative;
}

.avatar-wrap {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  border: 3px solid var(--border);
  box-shadow: 0 0 0 4px rgba(88, 166, 255, .15), 0 8px 24px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.profile-title {
  font-size: 15px;
  color: var(--text-bright);
  font-weight: 500;
  margin-bottom: 8px;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.profile-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.profile-bio {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 16px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.tag.blue {
  background: rgba(88, 166, 255, .12);
  color: var(--blue);
  border-color: rgba(88, 166, 255, .3);
}

.tag.green {
  background: rgba(39, 174, 96, .12);
  color: var(--green);
  border-color: rgba(39, 174, 96, .3);
}

.tag.purple {
  background: rgba(188, 140, 255, .12);
  color: #bc8cff;
  border-color: rgba(188, 140, 255, .3);
}

.tag.orange {
  background: rgba(243, 156, 18, .12);
  color: var(--gold);
  border-color: rgba(243, 156, 18, .3);
}

.tag.gold {
  background: rgba(243, 156, 18, .12);
  color: var(--gold);
  border-color: rgba(243, 156, 18, .3);
}

.stats-row {
  background: rgba(26, 39, 68, 0.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

.section {
  margin-bottom: 40px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.about-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  line-height: 1.75;
  color: var(--muted);
}

.about-card p+p {
  margin-top: 12px;
}

.about-card strong {
  color: var(--text);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tech-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.source-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s;
}

.source-card:hover {
  border-color: rgba(88, 166, 255, .4);
}

.source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.source-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.source-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.badge-market {
  background: rgba(88, 166, 255, .12);
  color: var(--blue);
  border: 1px solid rgba(88, 166, 255, .25);
}

.badge-announce {
  background: rgba(39, 174, 96, .12);
  color: var(--green);
  border: 1px solid rgba(39, 174, 96, .25);
}

.badge-news {
  background: rgba(243, 156, 18, .12);
  color: var(--gold);
  border: 1px solid rgba(243, 156, 18, .25);
}

.badge-logo {
  background: rgba(188, 140, 255, .12);
  color: #bc8cff;
  border: 1px solid rgba(188, 140, 255, .25);
}

.source-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.source-url {
  font-size: 11px;
  color: var(--blue);
  opacity: .8;
  margin-top: 2px;
}

.source-url:hover {
  opacity: 1;
}

.disclaimer-box {
  background: rgba(243, 156, 18, .08);
  border: 1px solid rgba(243, 156, 18, .3);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}

.disclaimer-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.disclaimer-body ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disclaimer-body strong {
  color: var(--text);
}

@media (max-width: 640px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 20px 36px;
  }

  .avatar-wrap {
    width: 90px;
    height: 90px;
  }

  .profile-name {
    font-size: 22px;
  }

  .stat-item {
    padding: 12px 10px;
  }

  .stat-value {
    font-size: 18px;
  }

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


/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .panel {
    position: static;
  }
}

/* -- Responsive Design ------------------------------------------------------ */

/* For tablets and smaller desktops */
@media (max-width: 1200px) {
  .layout {
    padding: 15px;
    gap: 15px;
  }

  .sidebar {
    width: 220px;
  }

  .topbar-inner,
  .layout {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* For mobile devices */
@media (max-width: 800px) {
  .mobile-only {
    display: flex !important;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: center;
    /* Center items */
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 12px;
    padding: 12px 15px;
  }

  .topbar-right {
    display: none;
    /* Hide less critical info on mobile */
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 1000;
    background: var(--bg);
    transition: left 0.3s ease;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }

  .sidebar.open {
    left: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: none;
    backdrop-filter: blur(2px);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .panel {
    border: none;
    padding: 0;
    position: static;
    background: transparent;
  }

  .table-wrap {
    overflow-x: auto;
    max-height: none;
    /* Allow table to take full height */
  }

  /* Sticky first column on mobile */
  thead th:first-child,
  tbody td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg2);
    z-index: 2;
    border-right: 1px solid rgba(42, 63, 107, 0.5);
  }

  thead th:first-child {
    z-index: 12;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
    /* Push modal slightly up on mobile */
    overflow-y: auto;
  }

  .modal,
  .chart-modal {
    max-height: none;
    /* Let the overlay handle scrolling if needed, or set to 95vh */
    margin: auto;
  }

  .modal-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .modal-hero>div:last-child {
    text-align: left !important;
  }

  /* Compact padding for modal internals */
  .modal-head {
    padding: 14px 16px 10px;
  }

  .modal-hero,
  .modal-body,
  .modal-footer,
  .social-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chart-container {
    min-height: 280px;
  }

  /* TradingView widgets modal — single column on narrow screens */
  .tv-widgets-modal {
    max-height: none;
    overflow-y: auto;
    margin: auto;
  }

  .tv-body-grid {
    flex-direction: column;
    height: auto;
  }

  .tv-left-col {
    width: 100%;
  }

  .tv-left-cell:first-child {
    flex: none;
    height: 300px;
  }

  .tv-left-cell:last-child {
    flex: none;
    height: 380px;
  }

  .tv-right-col {
    height: 460px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 16px;
  }

  .view-tab {
    padding: 5px 12px;
    font-size: 11px;
  }

  .breadth-widget {
    grid-template-columns: 120px 1fr;
  }

  .breadth-history {
    display: none;
  }

  thead th,
  tbody td {
    padding: 8px 10px;
  }

  .stock-name {
    font-size: 12px;
  }
}

/* ── Markdown Content Styling ────────────────────────────────────────────────── */
.blog-full-content h1,
.blog-full-content h2,
.blog-full-content h3,
.blog-full-content h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text-bright);
  font-weight: 700;
}

.blog-full-content h1 {
  font-size: 22px;
}

.blog-full-content h2 {
  font-size: 18px;
}

.blog-full-content h3 {
  font-size: 16px;
}

.blog-full-content p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: var(--text);
}

.blog-full-content ul,
.blog-full-content ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

.blog-full-content li {
  margin-bottom: 6px;
  line-height: 1.5;
  color: var(--text);
}

.blog-full-content blockquote {
  border-left: 4px solid var(--blue);
  padding-left: 15px;
  margin: 15px 0;
  color: var(--muted);
  font-style: italic;
}

.blog-full-content code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  color: var(--accent);
}

.blog-full-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.4);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s, text-decoration-thickness 0.15s;
}

.blog-full-content a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

.blog-full-content strong,
.blog-full-content b {
  font-weight: 700;
  color: var(--text-bright);
}

.blog-full-content em,
.blog-full-content i {
  font-style: italic;
}

.blog-preview-content * {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: normal;
  display: inline;
}

/* ── Blog post tables ───────────────────────────────────────────────────────── */
.blog-full-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.blog-full-content th {
  background: var(--bg3);
  color: var(--text-bright);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--blue);
}

.blog-full-content td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.blog-full-content tr:last-child td {
  border-bottom: none;
}

.blog-full-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Blog post horizontal rules ─────────────────────────────────────────────── */
.blog-full-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 28px 0;
}

/* ── Blog post images ────────────────────────────────────────────────────────── */
.blog-full-content img,
.blog-preview-content img {
  max-width: 80%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 12px auto;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ── Settings page ───────────────────────────────────────────────────────────── */
.btn-settings {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-bright);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-settings:hover {
  background: var(--bg3);
  border-color: var(--accent);
  color: var(--accent);
}

.settings-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 0 0 24px;
}

.settings-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.settings-section-body {
  padding: 20px;
}

/* ── Profile account card ───────────────────────────────────────────────────── */
.profile-account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
}

.profile-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.settings-wip-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  color: #fbbf24;
}

/* ── Top Blog Posts Panel ───────────────────────────────────────────────────── */

/* Top row: indices+summary on left, community panel on right */
.screener-top-row {
  display: flex;
  gap: 14px;
  /* flex-start: each child only as tall as its own content.
     JS ResizeObserver then applies the left panel's height to the right,
     so the right panel is capped — not expanded — to match the left. */
  align-items: flex-start;
  margin-bottom: 6px;
}

.screener-top-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screener-top-right {
  width: 420px;
  flex-shrink: 0;
  /* must be a flex column so .top-blogs-panel can fill height: 100% */
  display: flex;
  flex-direction: column;
}

.top-blogs-panel {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: static;
  backdrop-filter: blur(20px);
  /* stretch to the full height given by .screener-top-right */
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Static (non-collapsible) header variant — no pointer, no hover shift */
.top-blogs-header--static {
  cursor: default;
  pointer-events: none;
}
.top-blogs-header--static:hover {
  background: linear-gradient(90deg, var(--bg2), var(--bg3));
  opacity: 1;
}

.top-blogs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  cursor: pointer;
  background: linear-gradient(90deg, var(--bg2), var(--bg3));
  border-bottom: 1px solid var(--border);
  user-select: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
}

.top-blogs-header:hover {
  background: var(--bg3);
  opacity: 0.9;
}

.top-blogs-list {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.25s ease;
}

.top-blogs-list.collapsed {
  max-height: 0;
}

.top-blog-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  position: relative;
}

.top-blog-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.2s;
}

.top-blog-item:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .top-blog-item:nth-child(even) {
  background: var(--bg3);
}

.top-blog-item:hover {
  background: rgba(59, 130, 246, 0.06);
  transform: translateX(4px);
}

.top-blog-item:hover::before {
  opacity: 1;
}

.top-blog-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  min-width: 24px;
  text-align: center;
  font-family: var(--mono);
}

.top-blog-item:nth-child(1) .top-blog-rank {
  color: #fbbf24;
  font-size: 16px;
}

/* Gold */
.top-blog-item:nth-child(2) .top-blog-rank {
  color: #d1d5db;
  font-size: 15px;
}

/* Silver */
.top-blog-item:nth-child(3) .top-blog-rank {
  color: #b45309;
  font-size: 14px;
}

/* Bronze */

.top-blog-info {
  flex: 1;
  min-width: 0;
}

.top-blog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.top-blog-item:hover .top-blog-title {
  color: var(--accent);
}

.top-blog-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-blog-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Top Public Watchlists Podium ──────────────────────────────────────────── */

/* Content area: grows to fill whatever height the panel has in side-by-side
   layout; shrinks to content height when the panel is stacked (see media query) */
.top-wl-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Right panel tab bar ─────────────────────────────────────────────────── */
.right-tab-bar {
  display: flex;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--bg2), var(--bg3));
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 3;
}
.right-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.right-tab-btn:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.04);
}
.right-tab-btn--active {
  color: var(--text-bright);
  border-bottom-color: #3b82f6;
}
.right-tab-btn + .right-tab-btn {
  border-left: 1px solid var(--border);
}

.right-tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.right-tab-pane--active {
  display: flex;
}

/* ── Top Watchlists pane — Futuristic Animated Background ───────────────── */

/* 1 ── Grid lines + animated border glow (on the whole panel when WL tab active) */
#tab-pane-wl {
  position: relative;
  background-color: var(--bg2);
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* 2 ── Colour orbs that breathe and gently drift (::before) */
#tab-pane-wl::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 140px  90px at 12% 22%, rgba(59,  130, 246, 0.26) 0%, transparent 70%),
    radial-gradient(ellipse  90px 120px at 84% 74%, rgba(139,  92, 246, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 110px  65px at 73% 10%, rgba(20,  184, 166, 0.18) 0%, transparent 70%),
    radial-gradient(ellipse  70px  85px at  6% 88%, rgba(245, 158,  11, 0.11) 0%, transparent 70%);
  animation: top-wl-orbs 8s ease-in-out infinite alternate;
}

@keyframes top-wl-orbs {
  0%   { opacity: 0.60; transform: translate(  0px,  0px) scale(1.00); }
  25%  { opacity: 0.90; transform: translate(  6px, -7px) scale(1.06); }
  50%  { opacity: 1.00; transform: translate( -4px,  5px) scale(0.95); }
  75%  { opacity: 0.80; transform: translate(  4px, -3px) scale(1.03); }
  100% { opacity: 0.70; transform: translate( -2px,  4px) scale(0.98); }
}

/* 3 ── Scan line that sweeps top → bottom (::after) */
#tab-pane-wl::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent                5%,
    rgba(59,  130, 246, 0.85) 35%,
    rgba(139,  92, 246, 0.70) 55%,
    rgba(20,  184, 166, 0.55) 75%,
    transparent               95%
  );
  filter: blur(1px);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
  z-index: 2;
  pointer-events: none;
  animation: top-wl-scan 6s ease-in-out infinite;
}

@keyframes top-wl-scan {
  0%   { transform: translateY(  0px); opacity: 0;   }
  5%   {                               opacity: 1;   }
  88%  {                               opacity: 0.7; }
  100% { transform: translateY(520px); opacity: 0;   }
}

/* 4 ── Keep content above the background layers */
#tab-pane-wl .top-wl-content {
  position: relative;
  z-index: 3;
}

/* 5 ── Light theme — tone down the effects */
[data-theme="light"] #tab-pane-wl {
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}
[data-theme="light"] #tab-pane-wl::before { opacity: 0.30; }
[data-theme="light"] #tab-pane-wl::after  { opacity: 0.40; }
[data-theme="light"] .right-tab-bar {
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.88), rgba(241, 245, 249, 0.88));
}

/* ── End futuristic background ───────────────────────────────────────────── */

/* ── Latest Blog Post card (inside blog tab pane) ───────────────────────── */
.latest-blog-cover {
  position: relative;
  height: 155px;
  overflow: hidden;
}
.latest-blog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.latest-blog-card:hover .latest-blog-cover img {
  transform: scale(1.03);
}
.latest-blog-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
}
.latest-blog-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-blog-body {
  padding: 12px 14px 14px;
}
.latest-blog-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.latest-blog-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid #3b82f6;
}
.latest-blog-avatar-init {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid #3b82f6;
}
.latest-blog-excerpt {
  font-size: 12px;
  color: var(--text);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 9px;
}
.latest-blog-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Podium row: cards align to a shared bottom baseline so rank-1 rises above.
   flex:1 fills the full content area so the podium always sits at the bottom. */
.top-wl-podium {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 12px 12px 0;
}

/* Base card — column flex, full-height click target */
.top-wl-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 0;
  border-radius: 10px 10px 0 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.top-wl-step:hover {
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Thin coloured top-edge accent per rank */
.top-wl-step::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}
.top-wl-step.rank-1::before { background: #fbbf24; }
.top-wl-step.rank-2::before { background: #94a3b8; }
.top-wl-step.rank-3::before { background: #b45309; }

/* Rank-1: taller card, stronger presence */
.top-wl-step.rank-1 {
  padding-top: 18px;
  background: rgba(251, 191, 36, 0.05);
  border-color: rgba(251, 191, 36, 0.2);
}

.top-wl-step.rank-1:hover {
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 6px 28px rgba(251, 191, 36, 0.15);
}

/* Medal emoji */
.top-wl-medal {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Owner avatar circle */
.top-wl-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.top-wl-step.rank-1 .top-wl-avatar {
  width: 44px;
  height: 44px;
  border-color: rgba(251, 191, 36, 0.5);
}

.top-wl-avatar-init {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg4);
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
}

/* Watchlist title */
.top-wl-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
  text-align: center;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  transition: color 0.2s;
}

.top-wl-step.rank-1 .top-wl-title {
  font-size: 12px;
}

.top-wl-step:hover .top-wl-title {
  color: var(--accent);
}

/* Owner name */
.top-wl-owner {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Stats row: upvotes | items | hit-rate */
.top-wl-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: nowrap;
}

.top-wl-stat {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.top-wl-hit {
  color: var(--green);
  font-weight: 700;
}

/* Platform bar — decorative podium step at the card bottom.
   Height differs by rank to create the staircase illusion.    */
.top-wl-platform {
  width: 100%;
  margin-top: 10px;
  flex-shrink: 0;
}

.top-wl-step.rank-1 .top-wl-platform {
  height: 36px;
  background: linear-gradient(180deg, rgba(251,191,36,0.25) 0%, rgba(251,191,36,0.08) 100%);
  border-top: 2px solid rgba(251,191,36,0.4);
}

.top-wl-step.rank-2 .top-wl-platform {
  height: 24px;
  background: linear-gradient(180deg, rgba(148,163,184,0.2) 0%, rgba(148,163,184,0.05) 100%);
  border-top: 2px solid rgba(148,163,184,0.35);
}

.top-wl-step.rank-3 .top-wl-platform {
  height: 16px;
  background: linear-gradient(180deg, rgba(180,83,9,0.2) 0%, rgba(180,83,9,0.05) 100%);
  border-top: 2px solid rgba(180,83,9,0.35);
}

/* Responsive: stack panel below indices on narrow screens */
@media (max-width: 1100px) {
  .screener-top-row {
    flex-direction: column;
  }

  /* When stacked, left panel must fill container width (not size to content) */
  .screener-top-left {
    width: 100%;
  }

  .screener-top-right {
    width: 100%;
    /* In stacked layout don't enforce a fixed height — let content decide.
       Also undo any JS-applied height from the side-by-side sync. */
    flex: none;
    height: auto !important;
    overflow: visible !important;
  }

  /* Panel reverts to content-driven height when stacked */
  .top-blogs-panel {
    flex: none;
    height: auto;
  }

  /* Content area wraps the podium naturally; bottom padding gives breathing room */
  .top-wl-content {
    flex: none;
    padding-bottom: 16px;
  }

  .top-blogs-list {
    max-height: 180px;
  }

  /* Collapse breadth history column earlier than 480px */
  .breadth-widget {
    grid-template-columns: 150px 190px 1fr;
  }

  .breadth-history {
    min-width: 0;
    overflow: hidden;
  }
}

/* ── Markdown Cheat-sheet Popup ──────────────────────────────────────────────── */
.md-cheatsheet {
  display: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  animation: fadeSlideIn 0.15s ease;
}

.md-cheatsheet.visible {
  display: block;
}

.md-cheatsheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text);
}

.md-cheatsheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.md-cheatsheet-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.md-cheatsheet-table td {
  padding: 5px 8px;
  color: var(--text);
  border-bottom: 1px solid rgba(42, 63, 107, 0.4);
  vertical-align: middle;
}

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

.md-cheatsheet-table code {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 11px;
  color: #93c5fd;
}

#md-info-btn:hover {
  background: rgba(59, 130, 246, 0.4) !important;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Comments -------------------------------------------------------------- */
.comment-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.comment-author {
  color: var(--text-bright);
  font-weight: 700;
  font-size: 13px;
}

.comment-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0 8px 0;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-bright);
  flex-shrink: 0;
  font-weight: 700;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-reply {
  margin-left: 40px;
  border-left: 2px solid var(--border);
}

.comment-thread-group {
  margin-bottom: 24px;
}

.comment-replies-container {
  margin-top: 2px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.comment-replies-container.collapsed {
  display: none;
}

.comment-toggle-btn {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0 44px;
  opacity: 0.8;
}

.comment-toggle-btn:hover {
  opacity: 1;
  text-decoration: underline;
}

.comment-toggle-btn svg {
  transition: transform 0.2s;
}

.comment-toggle-btn.active svg {
  transform: rotate(180deg);
}

/* ── Newsletter Switch ─────────────────────────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg3);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

input:checked+.slider:before {
  transform: translateX(22px);
}

/* ── Admin Dashboard ────────────────────────────────────────────────────────── */
.admin-tabs {
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.admin-tabs .view-tab {
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
}

.admin-tabs .view-tab.active {
  background: none;
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.history-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.history-item:hover {
  background: var(--bg);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.history-item-subject {
  color: var(--text-bright);
  font-weight: 600;
  font-size: 14px;
}

.history-item-meta {
  font-size: 11px;
  color: var(--muted);
}

.admin-search-wrap {
  position: relative;
}

.admin-search-input {
  width: 100%;
  padding: 12px 16px 12px 42px !important;
  font-size: 14px !important;
  background: var(--bg2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  color: var(--text-bright) !important;
  transition: all 0.2s ease;
}

.admin-search-input:focus {
  background: var(--bg3) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   ADVANCED PORTFOLIO MODULE
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Tab buttons ─────────────────────────────────────────────────────────── */
.pf-tab-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.pf-tab-btn:hover { border-color: var(--accent); color: var(--text); }
.pf-tab-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent);
  color: var(--text-bright);
}

/* ── Summary strip ───────────────────────────────────────────────────────── */
.pf-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.pf-summary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}
.pf-summary-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}
.pf-summary-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-bright);
  font-family: "SF Mono", Consolas, monospace;
  line-height: 1.2;
}
.pf-summary-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ── Section card ────────────────────────────────────────────────────────── */
.pf-section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.pf-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Toggle group ────────────────────────────────────────────────────────── */
.pf-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.pf-toggle {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg3);
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pf-toggle.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent);
  color: var(--text-bright);
}

/* ── P&L colours ─────────────────────────────────────────────────────────── */
.pf-pos { color: #10b981; }
.pf-neg { color: #ef4444; }

/* ── % pill ──────────────────────────────────────────────────────────────── */
.pf-pct-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}
.pf-pct-pos { background: rgba(16,185,129,0.15); color: #10b981; }
.pf-pct-neg { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* ── Lots badge ──────────────────────────────────────────────────────────── */
.pf-lots-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(59,130,246,0.18);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.35);
  white-space: nowrap;
}

/* ── Type badge (transactions) ───────────────────────────────────────────── */
.pf-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Holdings table ──────────────────────────────────────────────────────── */
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pf-table thead th {
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}
.pf-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  color: var(--text);
}
[data-theme="light"] .pf-table tbody td {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.pf-table tbody tr:last-child td { border-bottom: none; }
.pf-holding-row:hover td { background: rgba(255,255,255,0.03); }
[data-theme="light"] .pf-holding-row:hover td { background: rgba(0,0,0,0.03); }

/* ── Lot rows ────────────────────────────────────────────────────────────── */
.pf-lot-row td {
  background: rgba(59,130,246,0.04);
  font-size: 12px;
  padding: 8px 10px !important;
  border-bottom: 1px solid rgba(59,130,246,0.08) !important;
}

/* ── Expand button ───────────────────────────────────────────────────────── */
.pf-expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  padding: 4px 7px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-block;
}
.pf-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-expand-btn.expanded { transform: rotate(90deg); }

/* ── Add / action buttons ────────────────────────────────────────────────── */
.pf-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  white-space: nowrap;
}
.pf-add-btn:hover { filter: brightness(1.12); }

.pf-cancel-btn {
  padding: 8px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pf-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.pf-delete-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.pf-export-btn {
  padding: 7px 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pf-export-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Filter controls ─────────────────────────────────────────────────────── */
.pf-filter-select,
.pf-filter-input {
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  min-width: 140px;
}
.pf-filter-input { min-width: 130px; }

/* ── Cash balance chip ───────────────────────────────────────────────────── */
.pf-cash-balance-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.pf-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.pf-modal-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.pf-modal-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-bright);
  font-size: 13px;
}
.pf-modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ── Responsive: stack performance charts on small screens ───────────────── */
@media (max-width: 900px) {
  #pf-panel-performance [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  .pf-summary-grid { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px;
  }
}
@media (max-width: 400px) {
  .pf-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Public Watchlist Module ─────────────────────────────────────────────── */

.pw-rank-badge {
  font-size: 22px;
  font-weight: 800;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.pw-upvote-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.pw-upvote-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
}

/* Responsive: stack browse grid to single column on mobile */
@media (max-width: 680px) {
  #pw-browse-list {
    grid-template-columns: 1fr !important;
  }
  #pw-add-item-form > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Trade Ideas ─────────────────────────────────────────────────────────── */

.ti-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}

.ti-filter-group { display: flex; gap: 4px; }

.ti-dir-btn, .ti-status-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.ti-dir-btn.active, .ti-status-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
#ti-dir-bull.active { background: var(--green); border-color: var(--green); }
#ti-dir-bear.active { background: var(--red);   border-color: var(--red);   }

.ti-select, .ti-search {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.ti-search { min-width: 180px; }

.ti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ti-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.ti-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.ti-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 10px 10px 0 0;
}
.ti-card.bull::before { background: var(--green); }
.ti-card.bear::before { background: var(--red); }

.tag.red {
  background: rgba(239, 68, 68, .12);
  color: var(--red);
  border-color: rgba(239, 68, 68, .3);
}
.tag.dim {
  background: var(--bg3);
  color: var(--muted);
  border-color: var(--border);
}

.ti-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.ti-stock-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ti-stock-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ti-symbol     { font-size: 15px; font-weight: 700; color: var(--text-bright); line-height: 1.2; }
.ti-sym-code   { font-size: 12px; font-weight: 400; color: var(--muted); }
.ti-name       { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Logo in trade-idea cards/modal: override stock-logo-wrap fixed size with inline width/height */
.ti-logo-sized { overflow: hidden; flex-shrink: 0; }

.ti-price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.ti-price-cell  { font-size: 11px; }
.ti-price-label { color: var(--muted); display: block; margin-bottom: 2px; }
.ti-price-val   { font-weight: 700; font-size: 13px; color: var(--text-bright); }

.ti-upside-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.ti-upside-label { font-size: 11px; color: var(--muted); }
.ti-upside-val   { font-size: 14px; font-weight: 700; }
.ti-upside-val.positive { color: var(--green); }
.ti-upside-val.negative { color: var(--red); }

.ti-progress-track {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  margin-bottom: 4px;
  overflow: hidden;
}
.ti-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease;
}
.ti-card.bull .ti-progress-fill,
.ti-modal-bull .ti-progress-fill { background: var(--green); }
.ti-card.bear .ti-progress-fill,
.ti-modal-bear .ti-progress-fill { background: var(--red); }

.ti-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}

.ti-author-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ti-author-name { font-size: 12px; color: var(--muted); }
.ti-days-ago    { font-size: 11px; color: var(--muted); margin-left: auto; }

.ti-thesis-snippet {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mini chart inside trade idea detail modal */
.ti-mini-chart {
  height: 210px;
  margin: 10px -20px 0;          /* bleed past modal-body padding */
  border-bottom: 1px solid var(--border);
}

.ti-modal-price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.ti-modal-price-cell { text-align: center; }
.ti-modal-price-label { font-size: 10px; color: var(--muted); text-transform: uppercase; display: block; margin-bottom: 4px; }
.ti-modal-price-val   { font-size: 15px; font-weight: 700; color: var(--text-bright); }

.ti-modal-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 16px 0 8px;
}
.ti-modal-thesis { font-size: 13px; line-height: 1.7; color: var(--text); }

.ti-bullet-list { list-style: none; padding: 0; margin: 0; }
.ti-bullet-list li {
  font-size: 12px;
  color: var(--text);
  padding: 4px 0 4px 16px;
  position: relative;
}
.ti-bullet-list li::before {
  content: '\2022';
  position: absolute;
  left: 4px;
  color: var(--muted);
}

.ti-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}
.ti-action-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s;
}
.ti-action-btn:hover  { background: var(--accent); color: #fff; border-color: var(--accent); }
.ti-action-btn:disabled { opacity: .55; cursor: default; }

/* Branded social share buttons */
.ti-share-btn {
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: opacity .15s;
}
.ti-share-btn:hover    { opacity: .85; }
.ti-share-x            { background: #000;    color: #fff; border: 1px solid #333; }
.ti-share-threads      { background: #101010; color: #fff; border: 1px solid #444; font-size: 15px; }
.ti-share-facebook     { background: #1877f2; color: #fff; border: 1px solid #1566d6; }

/* Colored catalyst / risk sections */
.ti-section-green { color: var(--green) !important; }
.ti-section-red   { color: var(--red)   !important; }

.ti-tinted-block {
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.ti-tinted-green { background: rgba(39, 174, 96, .07); border-left: 3px solid var(--green); }
.ti-tinted-red   { background: rgba(239, 68, 68, .07); border-left: 3px solid var(--red);   }

.ti-bullet-list.ti-bullet-green li::before { color: var(--green); }
.ti-bullet-list.ti-bullet-red   li::before { color: var(--red);   }

.ti-upvote-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ti-upvote-btn.upvoted { color: var(--gold); border-color: var(--gold); }

.ti-avatar-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ti-empty-msg {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* ── Disclaimer styles ───────────────────────────────────────────────────── */

/* Small inline disclaimer at the bottom of each pick card */
.ti-disclaimer {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

/* Full disclaimer block in the detail modal, below risks */
.ti-modal-disclaimer {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg3, var(--bg2));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Analyst disclaimer banner below the page header / filter bar */
.ti-analyst-banner {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Submission form inputs */
.ti-form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ti-form-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg3, var(--bg2));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
}

.ti-form-input:focus {
  border-color: var(--accent);
}

/* Disclaimer checkbox row in submission form */
.ti-form-disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
  padding: 10px 12px;
  background: var(--bg3, var(--bg2));
  border: 1px solid var(--border);
  border-radius: 6px;
}

.ti-form-disclaimer-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

@media (max-width: 600px) {
  .ti-modal-price-grid { grid-template-columns: repeat(3, 1fr); }
  .ti-grid { grid-template-columns: 1fr; }
}

/* ── Google AdSense ─────────────────────────────────── */
.ad-unit {
  text-align: center;
  overflow: hidden;
}

.ad-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ad-leaderboard {
  width: 100%;
  margin-bottom: 14px;
  padding: 8px 0;
}

.ad-tab-banner {
  margin-bottom: 16px;
  padding: 8px 0;
}

.ad-blog-sidebar {
  margin-bottom: 12px;
  padding: 8px 0;
}

.ad-chart-modal {
  margin: 12px 0;
  padding: 8px 0;
}

/* ── Portfolio Sign-In Promo ─────────────────────────────────────────────────── */

@keyframes pf-promo-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pf-promo-float {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%       { transform: rotate(-1.5deg) translateY(-8px); }
}

@keyframes pf-promo-float-front {
  0%, 100% { transform: rotate(1deg) translateY(0); }
  50%       { transform: rotate(1deg) translateY(-5px); }
}

.pf-promo-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 28px 4px 24px;
  animation: pf-promo-fade-up 0.55s ease both;
}

/* ── Pitch panel ── */
.pf-promo-pitch {
  display: flex;
  flex-direction: column;
}

.pf-promo-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 16px;
  width: fit-content;
}

.pf-promo-headline {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-bright);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.pf-promo-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 26px;
  max-width: 38ch;
}

.pf-promo-features {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pf-promo-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}

.pf-promo-feature-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 6px;
  color: var(--green);
  font-size: 10px;
}

.pf-promo-cta {
  width: fit-content;
  font-size: 14px;
  padding: 10px 20px 10px 10px;
  margin-bottom: 12px;
}

.pf-promo-disclaimer {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.55;
}

/* ── Screenshot frames ── */
.pf-promo-screens {
  position: relative;
  height: 360px;
}

.pf-promo-frame {
  position: absolute;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.07),
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(59, 130, 246, 0.05);
}

.pf-promo-frame--back {
  width: 82%;
  top: 0;
  right: 0;
  opacity: 0.82;
  animation: pf-promo-float 7s ease-in-out infinite;
  z-index: 1;
}

.pf-promo-frame--front {
  width: 75%;
  bottom: 0;
  right: 0;
  animation: pf-promo-float-front 8s ease-in-out 1.5s infinite;
  z-index: 2;
}

.pf-promo-img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 900px) {
  .pf-promo-wrap {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .pf-promo-screens {
    height: 240px;
    order: -1;
  }

  .pf-promo-headline { font-size: 22px; }
}

[data-theme="light"] .pf-promo-frame {
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.10),
    0 10px 36px rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .pf-promo-frame--back { opacity: 0.88; }

/* ── Heatmap Treemap: adaptive content for small tiles ──────────────────────── */
/* ht-tiny  (w 65–89px): hide name + volume; show symbol + % change */
.heatmap-tile.ht-tiny .ht-name,
.heatmap-tile.ht-tiny .ht-vol  { display: none; }

/* ht-micro (w 40–64px): hide everything except the stock symbol */
.heatmap-tile.ht-micro .ht-name,
.heatmap-tile.ht-micro .ht-vol,
.heatmap-tile.ht-micro .ht-chg { display: none; }

/* ht-blank (w < 40 or h < 35): no children — just a coloured rectangle */

/* ── Heatmap Color Legend ────────────────────────────────────────────────────── */
.hm-legend-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.hml-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
}

.hml-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.hml-gradient {
  flex: 1;
  min-width: 0;
  height: 10px;
  border-radius: 5px;
}

.hml-note {
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
  flex-shrink: 0;
  font-style: italic;
}

/* ── Google AdSense — hidden pending approval ────────────────────────────────
   Remove this block once the account is approved and ads are ready to serve.  */
.adsbygoogle { display: none !important; }
.ad-label { display: none !important; }
.ad-leaderboard { display: none !important; }
.ad-tab-banner { display: none !important; }
.ad-blog-sidebar { display: none !important; }
.ad-chart-modal { display: none !important; }