/* ── Investor Dashboard Styles ──────────────────────────────────────── */

:root, [data-theme="dark"] {
  --bg: #0d0d0d;
  --card: #171717;
  --card-alt: #1e1e1e;
  --border: #2e2e2e;
  --text: #e0e0e0;
  --text-dim: #888888;
  --green: #00c853;
  --red: #ff1744;
  --yellow: #ffd600;
  --blue: #448aff;
  --purple: #b388ff;
  --accent: #00b0ff;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --card: #ffffff;
  --card-alt: #fafafa;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-dim: #666666;
  --green: #00873c;
  --red: #d50000;
  --yellow: #c49000;
  --blue: #1565c0;
  --purple: #7b1fa2;
  --accent: #0077b6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
}

header .meta { font-size: 12px; color: var(--text-dim); }

/* ── Notification Bar ── */

.notification-bar {
  background: var(--card-alt);
  border-bottom: 1px solid var(--border);
  padding: 6px 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.notification-bar:hover { background: #222; }

.notification-bar .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-bar .status-dot.ok { background: var(--green); }
.notification-bar .status-dot.warning { background: var(--yellow); }
.notification-bar .status-dot.error { background: var(--red); animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.notification-bar .summary {
  flex: 1;
  color: var(--text-dim);
}

.notification-bar .timestamp {
  color: var(--text-dim);
  font-size: 11px;
  opacity: 0.7;
}

.notification-bar .expand-icon {
  color: var(--text-dim);
  font-size: 10px;
  transition: transform 0.2s;
}

.notification-bar.expanded .expand-icon { transform: rotate(180deg); }

.notification-detail {
  display: none;
  background: var(--card-alt);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px 12px;
  font-size: 12px;
}

.notification-detail.show { display: block; }

.notification-detail .job-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.notification-detail .job-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}

.notification-detail .job-chip.complete { border-color: rgba(0,200,83,0.3); }
.notification-detail .job-chip.failed { border-color: rgba(255,23,68,0.4); color: var(--red); }
.notification-detail .job-chip.running { border-color: rgba(0,176,255,0.4); color: var(--accent); }

.notification-detail .todo-list { margin-top: 4px; }

.notification-detail .todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.notification-detail .todo-item:last-child { border-bottom: none; }

.notification-detail .todo-action { flex: 1; color: var(--text); }

.notification-detail .todo-deadline { color: var(--text-dim); font-size: 11px; }

.notification-detail .todo-resolve-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.notification-detail .todo-resolve-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ── Navigation: section groups + subtabs ── */

.nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
}

.section-bar {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

.section-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.15s, border-color 0.15s;
}

.section-btn:hover { color: var(--text); }
.section-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--card);
  border-bottom: 2px solid var(--border);
  padding: 0 16px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 20px 24px; max-width: 1400px; margin: 0 auto; }
.tab-panel.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.stat-box {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 20px;
  flex: 1;
  min-width: 140px;
}

.stat-box .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.stat-box .value { font-size: 22px; font-weight: 700; margin-top: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
}

td {
  padding: 7px 12px;
  border-bottom: 1px solid #1e2d4a;
}

tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:hover td { background: rgba(255,255,255,0.05); }

.pos { color: var(--green); }
.neg { color: var(--red); }
.warn { color: var(--yellow); }
.neutral { color: var(--text-dim); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-new { background: rgba(0,200,83,0.2); color: var(--green); }
.badge-exit { background: rgba(255,23,68,0.2); color: var(--red); }
.badge-recent { background: rgba(255,214,0,0.2); color: var(--yellow); }
.badge-held { background: rgba(68,138,255,0.2); color: var(--blue); }
.badge-buy { background: rgba(0,200,83,0.2); color: var(--green); }
.badge-sell { background: rgba(255,23,68,0.2); color: var(--red); }
.badge-active { background: rgba(0,176,255,0.2); color: var(--accent); }
.badge-weakening { background: rgba(255,214,0,0.2); color: var(--yellow); }
.badge-playing { background: rgba(0,200,83,0.2); color: var(--green); }
.badge-emerging { background: rgba(179,136,255,0.2); color: var(--purple); }
.badge-not-positioned { background: rgba(136,146,168,0.2); color: var(--text-dim); }
.badge-quant { background: rgba(68,138,255,0.2); color: var(--blue); }
.badge-macro { background: rgba(255,145,0,0.2); color: #ff9100; }
.badge-valuation { background: rgba(179,136,255,0.2); color: var(--purple); }
.badge-data { background: rgba(0,200,83,0.2); color: var(--green); }

.theme-card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.theme-header {
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  user-select: none;
  transition: background 0.15s;
}

.theme-header:hover { background: rgba(255,255,255,0.03); }

.theme-chevron {
  font-size: 11px;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.theme-card.expanded .theme-chevron { transform: rotate(90deg); }

.theme-header h4 {
  font-size: 15px;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.theme-header-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.theme-header-tags .tag {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(136,146,168,0.12);
  white-space: nowrap;
}

.theme-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.theme-card.expanded .theme-body { max-height: 2000px; }

.theme-body-inner {
  padding: 0 20px 16px;
  border-top: 1px solid var(--border);
}

.theme-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin: 12px 0 10px;
}

.theme-meta span { white-space: nowrap; }

.theme-stale-indicator {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,23,68,0.15);
  color: var(--red);
  margin-left: 8px;
}

.theme-thesis {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 12px;
}

.theme-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 6px;
}

.theme-triggers {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.theme-triggers li { margin-bottom: 4px; }

.theme-signals {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.theme-signals li {
  margin-bottom: 4px;
}

.theme-signals .signal-date {
  color: var(--text-dim);
  font-size: 11px;
  margin-left: 4px;
}

.theme-signals .signal-source {
  color: var(--blue);
  font-size: 11px;
}

.theme-invalidation {
  font-size: 12px;
  color: var(--red);
  opacity: 0.8;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

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

.research-card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  transition: border-color 0.15s;
}

.research-card:hover { border-color: var(--accent); }

.research-card h4 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 6px;
}

.research-card h4 a {
  color: var(--accent);
  text-decoration: none;
}

.research-card h4 a:hover { text-decoration: underline; }

.research-card p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.status-ok { color: var(--green); }
.status-drift { color: var(--yellow); }
.status-alert { color: var(--red); font-weight: 700; }

.chart-container {
  position: relative;
  height: 320px;
  margin: 12px 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.refresh-btn {
  background: var(--card-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.15s;
}

.refresh-btn:hover { background: var(--border); color: var(--text); }
.suggestion-filter.active { background: var(--border); color: var(--accent); border-color: var(--accent); }

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
}

.error-msg {
  background: rgba(255,23,68,0.1);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--red);
  font-size: 13px;
  margin: 12px 0;
}

.brief-content {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  font-family: inherit;
}

.brief-content h1, .brief-content h2, .brief-content h3 {
  color: var(--accent);
  margin: 16px 0 8px;
}

.brief-content strong { color: #fff; }
.brief-content code { background: var(--card-alt); padding: 2px 6px; border-radius: 3px; font-size: 12px; }

.funnel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 16px;
  font-size: 13px;
}

.funnel-step {
  background: var(--card-alt);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  text-align: center;
}

.funnel-step .count { font-size: 20px; font-weight: 700; color: var(--accent); }
.funnel-step .label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.funnel-arrow { color: var(--text-dim); font-size: 18px; }

/* Rendered markdown styling for dark theme */
.brief-content h1, .brief-content h2, .brief-content h3, .brief-content h4 {
  color: var(--accent); margin: 16px 0 8px 0; font-family: inherit;
}
.brief-content h1 { font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.brief-content h2 { font-size: 15px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.brief-content h3 { font-size: 13px; }
.brief-content table {
  width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px;
}
.brief-content th {
  background: var(--card-alt); color: var(--accent); text-align: left;
  padding: 6px 10px; border: 1px solid var(--border); font-weight: 600;
}
.brief-content td {
  padding: 5px 10px; border: 1px solid var(--border); color: var(--text);
}
.brief-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.brief-content code {
  background: var(--card-alt); color: var(--green); padding: 1px 5px;
  border-radius: 3px; font-size: 12px; font-family: 'Fira Code', 'Consolas', monospace;
}
.brief-content pre {
  background: #0d1117; border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; overflow-x: auto; margin: 10px 0;
}
.brief-content pre code {
  background: none; padding: 0; color: var(--text); font-size: 12px;
  line-height: 1.5;
}
.brief-content ul, .brief-content ol { padding-left: 20px; margin: 6px 0; }
.brief-content li { margin: 3px 0; font-size: 13px; }
.brief-content blockquote {
  border-left: 3px solid var(--accent); padding: 4px 12px; margin: 8px 0;
  color: var(--text-dim); background: rgba(0,176,255,0.05);
}
.brief-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.brief-content p { margin: 6px 0; }
.brief-content a { color: var(--accent); text-decoration: none; }
.brief-content a:hover { text-decoration: underline; }
.brief-content strong { color: var(--text); }

/* ── Utility classes ──────────────────────────────────────── */
.info-text { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.card-info { border-left: 3px solid var(--yellow); }
.card-accent { border-left: 3px solid var(--accent); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-header h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
.text-dim-sm { font-size: 11px; color: var(--text-dim); }
.subtitle { color: var(--text-dim); font-size: 12px; }
.flex-wrap-gap { display: flex; gap: 12px; flex-wrap: wrap; }
.hidden { display: none; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-bold { font-size: 13px; font-weight: 700; }
.demo-banner { background: rgba(255,23,68,0.12); border: 1px solid rgba(255,23,68,0.3); border-radius: 6px; padding: 8px 14px; margin-bottom: 12px; font-size: 12px; color: var(--red); }

/* ── Tablet (large) ── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tab-btn { padding: 10px 12px; font-size: 12px; }
  .tab-panel { padding: 12px; }
}

/* ── Tablet (small) / Large phone ── */
@media (max-width: 768px) {
  header { padding: 10px 16px; }
  header h1 { font-size: 16px; }

  .tab-bar {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn { flex-shrink: 0; }

  .section-bar {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .section-bar::-webkit-scrollbar { display: none; }
  .section-btn { flex-shrink: 0; }

  .card { padding: 16px; margin-bottom: 12px; }
  .card h3 { font-size: 13px; }

  .notification-bar {
    flex-wrap: wrap;
    padding: 6px 16px;
    gap: 6px;
  }
  .notification-bar .summary {
    min-width: 0;
    word-break: break-word;
  }
  .notification-detail { padding: 8px 16px 12px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

  .funnel { flex-wrap: wrap; gap: 6px; }
  .funnel-step { min-width: 70px; padding: 6px 10px; }
  .funnel-step .count { font-size: 17px; }

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

/* ── Mobile ── */
@media (max-width: 600px) {
  header {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 4px;
  }
  header h1 { font-size: 14px; }
  header .meta { font-size: 10px; }

  .section-bar {
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .section-bar::-webkit-scrollbar { display: none; }
  .section-btn {
    padding: 8px 12px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .tab-bar {
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    touch-action: pan-x;
  }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-btn {
    padding: 6px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .tab-panel { padding: 8px; }
  .grid-2 { grid-template-columns: 1fr; gap: 8px; }

  .card { padding: 12px; margin-bottom: 8px; }
  .card h3 { font-size: 14px; }
  .card-header { flex-direction: column; gap: 8px; }

  .stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .stat-box {
    min-width: 0;
    padding: 8px 10px;
    overflow: hidden;
  }
  .stat-box .value {
    font-size: 14px;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .stat-box .label { font-size: 9px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; }
  th, td { padding: 4px 6px; }

  .chart-container { height: 200px !important; }

  .refresh-btn { font-size: 11px; padding: 6px 10px; }

  .card-info .info-text { font-size: 11px; }

  /* Research note readability on mobile */
  #research-note-content { font-size: 13px; line-height: 1.6; }
  #research-note-content h1 { font-size: 18px; }
  #research-note-content h2 { font-size: 16px; }
  #research-note-content h3 { font-size: 14px; }
  #research-note-content table { font-size: 10px; }

  /* Prevent any flex container from overflowing viewport */
  [style*="display:flex"], [style*="display: flex"] {
    flex-wrap: wrap !important;
  }
  [style*="display:grid"] {
    overflow-x: auto !important;
  }

  /* Badge sizing */
  .badge { font-size: 9px; padding: 2px 5px; }

  /* Inline grids that use fixed columns */
  [style*="grid-template-columns: repeat(auto-fill"] {
    grid-template-columns: 1fr 1fr !important;
  }
  [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Suggestion cards */
  [style*="border-radius:6px;padding:14px 18px"] {
    padding: 10px 12px !important;
  }

  /* 401k / retirement card */
  #k401-summary [style*="font-size:36px"] {
    font-size: 22px !important;
  }
  #k401-summary [style*="padding:24px"] {
    padding: 12px 0 !important;
  }
  #k401-summary [style*="gap:24px"] {
    gap: 8px !important;
  }
  #k401-summary [style*="padding:10px 20px"] {
    padding: 6px 10px !important;
  }
  #k401-summary [style*="font-size:18px"] {
    font-size: 14px !important;
  }

  /* NAV chart smaller on mobile */
  #navChart { max-height: 200px !important; }
  [style*="height:380px"] { height: 200px !important; }

  /* Green card timeline: make scrollable horizontally on mobile */
  #fire-gc-timeline > div:first-child {
    overflow-x: auto !important;
    touch-action: pan-x !important;
    -webkit-overflow-scrolling: touch;
    height: auto !important;
    min-height: 60px;
  }
  #fire-gc-timeline [style*="flex:1"] {
    min-width: 60px !important;
    flex-shrink: 0 !important;
    padding: 6px 4px !important;
  }
  #fire-gc-timeline [style*="font-size:14px"] {
    font-size: 12px !important;
  }
  #fire-gc-timeline [style*="font-size:10px"] {
    font-size: 8px !important;
  }

  /* FIRE destinations table */
  #fire-destinations-table { font-size: 10px; }
  #fire-destinations-table th,
  #fire-destinations-table td { padding: 3px 4px; }

  /* Architecture / Optimizations readability */
  #arch-content, #opt-content {
    font-size: 12px !important;
    line-height: 1.5 !important;
    word-break: break-word;
  }
  #arch-content pre, #opt-content pre,
  #arch-content code, #opt-content code {
    font-size: 10px !important;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }
  #arch-content table, #opt-content table {
    font-size: 10px;
    display: block;
    overflow-x: auto;
  }

  /* Position table — hide less important columns */
  #roth-positions-table th:nth-child(5),
  #roth-positions-table td:nth-child(5),
  #roth-positions-table th:nth-child(9),
  #roth-positions-table td:nth-child(9) {
    display: none;
  }
}

/* ── Extra-small phones ── */
@media (max-width: 480px) {
  header h1 { font-size: 13px; letter-spacing: 0.5px; }
  header .meta { font-size: 9px; }

  .section-btn { padding: 7px 10px; font-size: 10px; }
  .tab-btn { padding: 5px 8px; font-size: 10px; }

  .tab-panel { padding: 6px; }

  .card { padding: 10px; margin-bottom: 6px; border-radius: 6px; }
  .card h3 { font-size: 12px; margin-bottom: 8px; }

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .stat-box {
    padding: 6px 8px;
    border-radius: 4px;
  }
  .stat-box .value { font-size: 13px; }
  .stat-box .label { font-size: 8px; }

  .notification-bar { padding: 5px 10px; font-size: 11px; }
  .notification-bar .summary { font-size: 11px; }
  .notification-bar .timestamp { font-size: 9px; }
  .notification-detail { padding: 6px 10px 10px; }
  .notification-detail .job-chip { font-size: 10px; padding: 2px 6px; }

  table { font-size: 10px; }
  th, td { padding: 3px 4px; }

  .research-grid { grid-template-columns: 1fr; gap: 8px; }
  .research-card { padding: 12px 14px; }
  .research-card h4 { font-size: 13px; }
  .research-card p { font-size: 11px; }

  .funnel-step { min-width: 56px; padding: 5px 6px; }
  .funnel-step .count { font-size: 15px; }
  .funnel-step .label { font-size: 9px; }
  .funnel-arrow { font-size: 14px; }

  .badge { font-size: 8px; padding: 1px 4px; }

  .theme-header { padding: 10px 14px; gap: 6px; }
  .theme-header h4 { font-size: 13px; }
  .theme-header-tags .tag { font-size: 9px; padding: 1px 6px; }
  .theme-body-inner { padding: 0 14px 12px; }
  .theme-meta { font-size: 11px; gap: 10px; }
  .theme-thesis { font-size: 12px; }

  .chart-container { height: 160px !important; }

  .brief-content { font-size: 12px; line-height: 1.6; }
  .brief-content h1 { font-size: 15px; }
  .brief-content h2 { font-size: 13px; }
  .brief-content h3 { font-size: 12px; }
  .brief-content li { font-size: 12px; }
  .brief-content table { font-size: 10px; }
}
