/* ─────────────────────────────────────────────────────────────────────────────
   Alex Finance — minimal institutional stylesheet
   No decorative elements. Layout, readability, state signalling only.
───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:         #f4f4f4;
  --surface:    #ffffff;
  --border:     #d1d1d1;
  --border-lt:  #e8e8e8;
  --text:       #1a1a1a;
  --muted:      #6b6b6b;
  --accent:     #1d4ed8;
  --ok:         #15803d;
  --ok-bg:      #dcfce7;
  --err:        #b91c1c;
  --err-bg:     #fee2e2;
  --warn:       #a16207;
  --warn-bg:    #fef9c3;
  --disabled-opacity: 0.45;

  --font:       system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:       "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html, body, #app {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ── Typography helpers ──────────────────────────────────────────────────── */

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.mono { font-family: var(--mono); }

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

/* ── Form controls ───────────────────────────────────────────────────────── */

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

textarea { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: var(--accent);
  color: #fff;
}

button:hover:not(:disabled) { filter: brightness(1.08); }

button:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

button.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

button.ghost:hover:not(:disabled) { background: var(--bg); }

button.danger {
  background: var(--err-bg);
  color: var(--err);
  border-color: var(--err);
}

/* ── Status badges ───────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
}

.badge-ok   { background: var(--ok-bg);   color: var(--ok);   }
.badge-err  { background: var(--err-bg);  color: var(--err);  }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-none { background: var(--border);  color: var(--muted); }

/* ── Inline messages ─────────────────────────────────────────────────────── */

.msg-error { color: var(--err);  font-size: 12px; margin-top: 8px; }
.msg-warn  { color: var(--warn); font-size: 12px; margin-top: 6px; }
.msg-muted { color: var(--muted);font-size: 12px; margin-top: 6px; font-style: italic; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ════════════════════════════════════════════════════════════════════════════
   SESSION GATE
════════════════════════════════════════════════════════════════════════════ */

.gate-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
}

.gate-product {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.gate-heading {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 28px;
}

.gate-section { margin-bottom: 20px; }

.gate-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.gate-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.gate-row input { flex: 1; }

/* ════════════════════════════════════════════════════════════════════════════
   WORKSPACE
════════════════════════════════════════════════════════════════════════════ */

.workspace {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section { display: flex; flex-direction: column; gap: 8px; }

.sidebar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border-lt);
  padding-bottom: 5px;
}

.session-id-value {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.4;
}

.payload-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-lt);
}

.payload-row:last-child { border-bottom: none; }

.payload-check { font-weight: 700; color: var(--ok); }
.payload-dash  { color: var(--muted); }

.run-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-lt);
}

.run-row:last-child { border-bottom: none; }

.run-type { color: var(--muted); font-family: var(--mono); font-size: 10px; }

.sidebar-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }

/* ── Main content ────────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
}

.panel.panel-disabled {
  opacity: var(--disabled-opacity);
  pointer-events: none;
  user-select: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-lt);
  background: var(--bg);
}

.panel-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-body { padding: 16px; }

.panel-reason {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* ── Narrative block ─────────────────────────────────────────────────────── */

.narrative {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 3px solid var(--border);
  padding: 10px 14px;
  margin-top: 12px;
  background: var(--bg);
}

/* ── Warnings / errors list ──────────────────────────────────────────────── */

.warn-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.warn-item {
  font-size: 12px;
  color: var(--warn);
  padding: 4px 8px;
  background: var(--warn-bg);
}

/* ════════════════════════════════════════════════════════════════════════════
   SCAN VIEW
════════════════════════════════════════════════════════════════════════════ */

.scan-page {
  min-height: 100vh;
  padding: 0 24px 48px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.scan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

/* Brand — left side (stacked text + tagline) */
.scan-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1.2;
  gap: 1px;
}

.scan-brand-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.af-sub-tagline {
  font-size: 10px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
  display: block;
  margin-top: 1px;
}

/* Header nav — right side (regime chip + macro minis + auth) */
.scan-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Research dropdown wrapper */
.scan-research-wrap {
  position: relative;
}

/* Research button — ghost style */
.scan-research-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  color: #8b93aa;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.scan-research-btn:hover,
.scan-research-btn--open {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.30);
  color: #e6e9ef;
}

.scan-research-arrow {
  font-size: 9px;
  opacity: 0.55;
  display: inline-block;
  transition: transform 0.18s ease;
  line-height: 1;
}

/* Research dropdown menu */
.scan-research-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 196px;
  background: #0d1020;
  border: 1px solid #1e2230;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.52), 0 2px 8px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  z-index: 300;
  padding: 4px 0;
}

.scan-research-dropdown.open {
  display: block;
}

/* Research item */
.scan-research-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: #8b93aa;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.scan-research-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e6e9ef;
}

.scan-research-item-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.scan-research-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 6px 0;
}

/* Portfolio Simulator button — accent primary */
.scan-simulator-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  background: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.scan-simulator-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}

/* Clerk user button in app navbar */
.scan-clerk-user {
  display: flex;
  align-items: center;
  margin-left: 8px;
  flex-shrink: 0;
}
.scan-clerk-signin {
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.30);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.scan-clerk-signin:hover:not(:disabled) {
  background: rgba(59,130,246,.22);
  border-color: rgba(59,130,246,.5);
  filter: none;
}

/* Topbar auth slot aliases — same visual as .scan-clerk-signin */
.topbar-auth {
  margin-left: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.topbar-signin-btn {
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.3);
  color: #60a5fa;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.topbar-signin-btn:hover:not(:disabled) {
  background: rgba(59,130,246,.22);
  filter: none;
}

/* Legacy — kept for any remaining references */
.scan-branding { display: flex; flex-direction: column; gap: 4px; }
.scan-product  { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.scan-title    { font-size: 22px; font-weight: 600; color: var(--text); margin: 0; }
.scan-subtitle { font-size: 12px; color: var(--muted); margin: 0; }

/* ── Controls ────────────────────────────────────────────────────────────── */

.scan-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scan-mode-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.scan-mode-btn {
  font-size: 12px;
  padding: 4px 14px;
}

/* Active mode button — filled accent */
.scan-mode-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.scan-methodology-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: .03em;
  box-shadow: 0 2px 8px rgba(217,119,6,.35);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.scan-methodology-link:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(217,119,6,.5);
  transform: translateY(-1px);
}

.scan-opt-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.scan-opt-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.scan-run-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.scan-status-line {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── Proactive bar (post-scan) ───────────────────────────────────────────── */

.scan-proactive-bar {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: spb-fade-in 0.4s ease;
  flex-wrap: wrap;
}
@keyframes spb-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.spb-text {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.spb-text strong { color: #e2e8f0; }
.spb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.spb-actions button {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  color: #60a5fa;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.spb-actions button:hover { background: rgba(59,130,246,0.22); }

/* ── Results header ──────────────────────────────────────────────────────── */

.scan-results-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-lt);
}

.scan-count {
  font-size: 14px;
  font-weight: 600;
}

.scan-count-mode {
  font-size: 12px;
  color: var(--muted);
}

/* ── Results table ───────────────────────────────────────────────────────── */

.scan-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
}

.scan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.scan-table thead {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.scan-table th {
  padding: 6px 10px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.scan-table th:first-child,
.scan-table th.scan-th-ticker,
.scan-table th.scan-th-name { text-align: left; }

.scan-th-rank   { width: 38px; }
.scan-th-ticker { min-width: 72px; }
.scan-th-name   { min-width: 180px; }
.scan-th-score  { min-width: 58px; }
.scan-th-action { width: 150px; text-align: center !important; }

/* ── Sortable score column headers ───────────────────────────────────────── */

.scan-th-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s, background 0.12s;
}
.scan-th-sortable:hover {
  color: var(--accent);
  background: rgba(99, 179, 237, 0.06);
}
.scan-th-sorted {
  color: var(--accent);
}
.scan-sort-indicator {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--accent);
  margin-left: 1px;
  vertical-align: middle;
}

.scan-row {
  border-bottom: 1px solid var(--border-lt);
  transition: background 0.08s;
}

.scan-row:hover { background: var(--bg); }

.scan-table td { padding: 5px 10px; }

.scan-rank {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  min-width: 38px;
}

.scan-ticker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.scan-name   { color: var(--text); max-width: 220px; }
.scan-region { font-size: 11px; }
.scan-action { text-align: center; }

/* ── Score cells ─────────────────────────────────────────────────────────── */

.scan-score {
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
}

.scan-score-high    { color: var(--ok);   font-weight: 600; }
.scan-score-mid     { color: var(--text); }
.scan-score-low     { color: var(--muted); }
.scan-score-null    { color: var(--border); }

/* Primary sort column — subtle highlight */
.scan-score-primary { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* ── Output maps ─────────────────────────────────────────────────────────── */

.scan-maps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-top: 8px;
}

.scan-maps-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-lt);
}

.scan-map-section {
  border-bottom: 1px solid var(--border-lt);
}

.scan-map-section:last-child { border-bottom: none; }

.scan-map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 0;
}

.scan-map-table thead th {
  padding: 4px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border-lt);
}

/* ════════════════════════════════════════════════════════════════════════════
   SCAN v2 — Asymmetry Agent + Filter bar + Analyze button + Diagnostic panel
════════════════════════════════════════════════════════════════════════════ */

/* ── Asymmetry Agent note ─────────────────────────────────────────────────── */

.scan-agent-block {
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
}

.scan-agent-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.scan-agent-note {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

/* ── Filter bar ───────────────────────────────────────────────────────────── */

.scan-filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.scan-preset-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.scan-preset-btn {
  font-size: 11px;
  padding: 3px 11px;
  background: var(--bg);
  color: var(--muted);
  border-color: var(--border);
}

.scan-preset-btn.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.scan-preset-btn:hover:not(:disabled):not(.active) {
  color: var(--text);
  filter: none;
  background: var(--border-lt);
}

.scan-threshold-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-threshold-input {
  width: 72px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
}

.scan-clear-btn {
  font-size: 11px;
  padding: 3px 10px;
}

/* ── ⚙ Advanced Filters button ───────────────────────────────────────────── */

.scan-adv-btn {
  font-size: 11px;
  padding: 3px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #5a6080;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.scan-adv-btn:hover {
  background: var(--border-lt);
  color: var(--text);
  border-color: #2a3a60;
}
.scan-adv-btn--active {
  background: rgba(59,108,200,.12);
  border-color: #3b4f7a;
  color: #7aaaf0;
  font-weight: 600;
}
.scan-adv-btn--active:hover {
  background: rgba(59,108,200,.20);
  color: #a0c0ff;
}

/* ── Advanced filter dropdown panel ──────────────────────────────────────── */

.scan-filter-panel {
  background: rgba(7,12,28,.95);
  border: 1px solid #1a2340;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 14px 18px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  animation: fadeIn .14s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Filter section ──────────────────────────────────────────────────────── */

.scan-filter-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
}

.scan-filter-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #3a4060;
}

/* ── Sector select ───────────────────────────────────────────────────────── */

.scan-filter-select {
  background: rgba(255,255,255,.04);
  border: 1px solid #1a2340;
  border-radius: 5px;
  color: #c8cde0;
  font-size: 12px;
  font-family: inherit;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233a4060'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
  transition: border-color .15s;
}
.scan-filter-select:focus { border-color: #3b4f7a; }
.scan-filter-select option { background: #0c1220; }

/* ── Score range inputs ──────────────────────────────────────────────────── */

.scan-filter-score-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-filter-range-label {
  font-size: 11px;
  color: #4a5068;
}

.scan-filter-range-input {
  width: 64px !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid #1a2340 !important;
  border-radius: 4px !important;
  color: #c8cde0 !important;
  font-family: var(--mono, monospace) !important;
}
.scan-filter-range-input:focus { border-color: #3b4f7a !important; outline: none !important; }

.scan-filter-range-sep {
  font-size: 12px;
  color: #3a4060;
}

/* ── Earnings window radios ──────────────────────────────────────────────── */

.scan-filter-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-filter-radio-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #8a90a8;
  cursor: pointer;
  user-select: none;
}
.scan-filter-radio-label:hover { color: #c8cde0; }

.scan-filter-radio {
  accent-color: #3b6cc8;
  cursor: pointer;
  width: 13px;
  height: 13px;
}

/* ── Macro alignment checkbox ────────────────────────────────────────────── */

.scan-filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8a90a8;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}
.scan-filter-checkbox-label:hover { color: #c8cde0; }

.scan-filter-checkbox {
  accent-color: #3b6cc8;
  cursor: pointer;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.scan-filter-regime-hint {
  font-size: 10px;
  color: #3b6cc8;
  font-weight: 600;
}

/* ── Analyze button in table rows ─────────────────────────────────────────── */

.scan-analyze-btn {
  font-size: 11px;
  padding: 2px 10px;
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent);
  letter-spacing: 0.02em;
}

.scan-analyze-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  filter: none;
}

/* ── Simulate button in table rows ───────────────────────────────────────── */

.scan-simulate-btn {
  font-size: 10px;
  padding: 2px 9px;
  background: transparent;
  color: #4a5060;
  border: 1px solid #1e2230;
  border-radius: 4px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-left: 5px;
  font-family: var(--mono, monospace);
}

.scan-simulate-btn:hover {
  color: #4c7cff;
  border-color: #2a3560;
}

/* ── Diagnostic overlay ───────────────────────────────────────────────────── */

.scan-diag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.scan-diag-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Diagnostic panel ─────────────────────────────────────────────────────── */

.scan-diag-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.scan-diag-panel.open {
  transform: translateX(0);
}

/* ── Diagnostic header ────────────────────────────────────────────────────── */

.scan-diag-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.scan-diag-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.scan-diag-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-diag-ticker {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  line-height: 1.1;
}

.scan-diag-name {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}

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

.scan-diag-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 1px 8px 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.scan-diag-close:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
  filter: none;
}

/* ── Score chips ──────────────────────────────────────────────────────────── */

.scan-diag-scores {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.scan-diag-score-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  gap: 1px;
}

.scan-diag-score-chip--primary {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.chip-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.chip-high { color: var(--ok); }
.chip-mid  { color: var(--text); }
.chip-low  { color: var(--muted); }

/* ── Diagnostic body ──────────────────────────────────────────────────────── */

.scan-diag-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Company Agent block ──────────────────────────────────────────────────── */

.scan-diag-agent-block {
  border: 1px solid var(--border-lt);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  background: var(--bg);
}

.scan-diag-agent-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.scan-diag-agent-text {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Diagnostic sections ──────────────────────────────────────────────────── */

.scan-diag-sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-diag-section {
  border: 1px solid var(--border-lt);
}

.scan-diag-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.scan-diag-flags {
  margin-top: 4px;
}

.scan-diag-flags-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .scan-diag-panel { width: 100vw; }
  .scan-preset-group { gap: 3px; }
  .scan-preset-btn { font-size: 10px; padding: 2px 8px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC PANEL — polish pass
   Summary card · hero score · structural view · verdict · actions
════════════════════════════════════════════════════════════════════════════ */

/* ── Panel header — minimal chrome, close only ───────────────────────────── */

.scan-diag-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  min-height: 36px;
}

/* ── Diagnostic summary card ─────────────────────────────────────────────── */

.scan-diag-summary-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Top row: identity + hero score */
.scan-diag-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scan-diag-summary-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.scan-diag-summary-ticker {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
}

.scan-diag-summary-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-diag-summary-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Hero score — primary score for active mode, large display */
.scan-diag-score-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.scan-diag-score-hero-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.scan-diag-score-hero-value {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Secondary score chips below the top row */
.scan-diag-score-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ── Structural view / asymmetry framing ─────────────────────────────────── */

.scan-diag-structural-view {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  padding-top: 4px;
  border-top: 1px solid var(--border-lt);
}

.scan-diag-sv-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

/* ── Verdict line ─────────────────────────────────────────────────────────── */

.scan-diag-verdict {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

.scan-diag-verdict[data-state="loading"] .scan-diag-verdict-text {
  color: var(--muted);
  font-style: italic;
}

.scan-diag-verdict[data-state="loaded"] .scan-diag-verdict-text {
  color: var(--text);
}

.scan-diag-verdict[data-state="error"] .scan-diag-verdict-text {
  color: var(--err);
}

.scan-diag-verdict-text {
  /* text set by JS */
}

/* ── Actions row ──────────────────────────────────────────────────────────── */

.scan-diag-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  flex-wrap: wrap;
}

.scan-diag-report-btn {
  font-size: 12px;
  padding: 5px 14px;
  border-color: var(--border);
  color: var(--text);
}

.scan-diag-report-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  filter: none;
}

.scan-diag-report-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ── High-conviction row treatment ───────────────────────────────────────── */

.scan-row--high-conviction .scan-rank {
  color: var(--ok);
  font-weight: 700;
}

.scan-row--high-conviction .scan-ticker {
  color: var(--text);
}

.scan-row--high-conviction {
  border-left: 2px solid var(--ok);
}

/* ── Results signal count ─────────────────────────────────────────────────── */

.scan-results-signal {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--ok);
  letter-spacing: 0.02em;
  padding: 1px 8px;
  background: var(--ok-bg);
}

/* ── Diagnostic panel close — refined ────────────────────────────────────── */

.scan-diag-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 1px 8px 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.scan-diag-close:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
  filter: none;
}

@media (max-width: 600px) {
  .scan-diag-summary-ticker   { font-size: 22px; }
  .scan-diag-score-hero-value { font-size: 28px; }
  .scan-diag-summary-card     { padding: 12px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   MONETIZATION SURFACES
   Tier strip · upgrade modal · diagnostic workflow CTA · Pro badges
════════════════════════════════════════════════════════════════════════════ */

/* ── Pro badge (inline) ───────────────────────────────────────────────────── */

.scan-pro-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0px 5px;
  vertical-align: middle;
  line-height: 1.6;
}

/* ── Header Pro link ──────────────────────────────────────────────────────── */

.scan-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.scan-pro-link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.scan-pro-link:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  filter: none;
}

/* ── Tier strip ───────────────────────────────────────────────────────────── */

.scan-tier-strip {
  border: 1px solid var(--border);
  background: var(--surface);
  margin-top: 4px;
}

.scan-tier-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-lt);
  background: var(--bg);
}

.scan-tier-strip-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.scan-tier-upgrade-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 3px 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.scan-tier-upgrade-link:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  filter: none;
}

.scan-tier-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.scan-tier-step {
  padding: 16px;
  border-right: 1px solid var(--border-lt);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scan-tier-step:last-child { border-right: none; }

.scan-tier-step--pro {
  background: color-mix(in srgb, var(--accent) 3%, var(--surface));
}

.scan-tier-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scan-tier-step-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.scan-tier-step-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.scan-tier-step-desc {
  font-size: 12px;
  color: var(--muted-hi, var(--muted));
  line-height: 1.6;
  flex: 1;
}

.scan-tier-step-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.scan-tier-step-tag--pro {
  color: var(--accent);
}

.scan-tier-step-cta {
  font-size: 11px;
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
  align-self: flex-start;
  margin-top: 2px;
}

.scan-tier-step-cta:hover:not(:disabled) {
  text-decoration: underline;
  filter: none;
  background: transparent;
}

@media (max-width: 720px) {
  .scan-tier-steps { grid-template-columns: 1fr; }
  .scan-tier-step  { border-right: none; border-bottom: 1px solid var(--border-lt); }
  .scan-tier-step:last-child { border-bottom: none; }
}

/* ── Diagnostic panel workflow CTA ────────────────────────────────────────── */

.scan-diag-workflow {
  border: 1px solid var(--border-lt);
  border-top: 3px solid var(--border);
  background: var(--bg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-diag-workflow-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.scan-diag-workflow-step {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-lt);
}

.scan-diag-workflow-step:last-of-type { border-bottom: none; }

.scan-diag-workflow-indicator {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  width: 14px;
  flex-shrink: 0;
}

.scan-diag-workflow-step--done .scan-diag-workflow-indicator {
  color: var(--ok);
}

.scan-diag-workflow-step--next .scan-diag-workflow-indicator {
  color: var(--muted);
}

.scan-diag-workflow-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.scan-diag-workflow-note {
  width: 100%;
  font-size: 11px;
  color: var(--muted);
  padding-left: 20px;
  line-height: 1.5;
}

.scan-diag-workflow-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.scan-diag-workflow-open-btn {
  font-size: 12px;
  padding: 5px 14px;
}

.scan-diag-workflow-pro-note {
  font-size: 11px;
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
}

.scan-diag-workflow-pro-note:hover:not(:disabled) {
  text-decoration: underline;
  filter: none;
  background: transparent;
}

/* ── Upgrade modal ────────────────────────────────────────────────────────── */

.upgrade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.upgrade-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.upgrade-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.upgrade-panel.open {
  transform: translateY(0);
}

.upgrade-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.upgrade-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.upgrade-panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upgrade-tier {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-tier-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.upgrade-tier-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.upgrade-tier-price {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.upgrade-tier--pro {
  padding: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.upgrade-feature {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  display: flex;
  gap: 4px;
}

.upgrade-feature-bullet {
  color: var(--border);
  flex-shrink: 0;
}

.upgrade-divider {
  border: none;
  border-top: 1px solid var(--border-lt);
  margin: 0;
}

.upgrade-panel-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  font-style: italic;
}

.upgrade-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.upgrade-panel-actions button {
  font-size: 12px;
}

/* ── Archetype badges ──────────────────────────────────────────────────────── */
/* Institutional badge layer for opportunity type classification.
   Dark palette, uppercase mono, restrained. No emojis. */

.arch-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  white-space: nowrap;
  line-height: 1.5;
  vertical-align: middle;
}
.arch-badge--compact {
  font-size: 8px;
  padding: 1px 5px;
  letter-spacing: 0.05em;
}

/* Archetype colour palette — muted, institutional */
.arch-badge--true-asymmetry     { background: rgba(196,163,90,0.13); color: #c4a35a; border: 1px solid rgba(196,163,90,0.30); }
.arch-badge--quality-compounder { background: rgba(90,142,168,0.13); color: #6a9ab8; border: 1px solid rgba(90,142,168,0.30); }
.arch-badge--regime-muted       { background: rgba(176,122,79,0.13); color: #c08a5a; border: 1px solid rgba(176,122,79,0.30); }
.arch-badge--flow-driven        { background: rgba(122,110,168,0.13); color: #9a8ec8; border: 1px solid rgba(122,110,168,0.30); }
.arch-badge--fragile            { background: rgba(168,90,90,0.13);  color: #c07a7a; border: 1px solid rgba(168,90,90,0.30); }
.arch-badge--mixed              { background: rgba(100,100,116,0.10); color: #8a8a9a; border: 1px solid rgba(100,100,116,0.24); }

/* ── Signal / secondary badges ─────────────────────────────────────────────── */

.signal-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  white-space: nowrap;
  line-height: 1.5;
  vertical-align: middle;
}
.signal-badge--compact {
  font-size: 8px;
  padding: 1px 5px;
}

.signal-badge--high-conviction     { background: rgba(90,160,90,0.11);   color: #7ab87a; border: 1px solid rgba(90,160,90,0.24); }
.signal-badge--moderate-conviction { background: rgba(90,142,168,0.11);  color: #6a9ab8; border: 1px solid rgba(90,142,168,0.24); }
.signal-badge--low-clarity         { background: rgba(100,100,116,0.10); color: #7a7a8a; border: 1px solid rgba(100,100,116,0.20); }
.signal-badge--high-asymmetry      { background: rgba(196,163,90,0.11);  color: #c4a35a; border: 1px solid rgba(196,163,90,0.24); }
.signal-badge--moderate-asymmetry  { background: rgba(168,142,90,0.11);  color: #b09a6a; border: 1px solid rgba(168,142,90,0.24); }
.signal-badge--asymmetry-unclear   { background: rgba(100,100,116,0.08); color: #7a7a8a; border: 1px solid rgba(100,100,116,0.17); }

/* ── Badge placement containers ─────────────────────────────────────────────── */

/* Scanner table: compact badge cluster below name text */
.scan-row-badges {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
  align-items: center;
}

/* Diagnostic panel: prominent badge row below score chips */
.scan-diag-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border-lt);
  margin-top: 6px;
}

/* ── Premium diagnostic UI ──────────────────────────────────────────────────── */

/* Core reading — one-liner below summary card */
.diag-core-reading {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 6px 12px 4px;
  border-left: 2px solid var(--border-lt);
  margin: 6px 0 2px;
  line-height: 1.5;
}

/* ── Alex Interpretation block ──────────────────────────────────────────────── */

.diag-interpretation {
  border: 1px solid var(--border-lt);
  border-radius: 4px;
  margin: 10px 0;
  overflow: hidden;
}

.diag-interp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-lt);
}

.diag-interp-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  font-family: var(--mono);
}

.diag-interp-loading {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.diag-interp-content {
  padding: 10px 12px;
}

.diag-interp-section {
  margin-bottom: 12px;
}
.diag-interp-section:last-child {
  margin-bottom: 0;
}

.diag-interp-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 4px;
}

.diag-interp-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}

/* ── Score guide ─────────────────────────────────────────────────────────────── */

.diag-score-guide {
  border: 1px solid var(--border-lt);
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
}

.diag-score-guide-toggle {
  display: block;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 12px;
  background: var(--surface);
  user-select: none;
  list-style: none;
  letter-spacing: 0.03em;
}
.diag-score-guide-toggle::-webkit-details-marker { display: none; }
.diag-score-guide[open] .diag-score-guide-toggle {
  border-bottom: 1px solid var(--border-lt);
}

.diag-score-guide-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diag-score-def-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.diag-score-def-abbr {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  min-width: 36px;
  text-transform: uppercase;
}

.diag-score-def-text {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── Pro report block ────────────────────────────────────────────────────────── */

.diag-report-block {
  border: 1px solid var(--border-lt);
  border-radius: 4px;
  padding: 12px 14px;
  margin: 10px 0;
  background: var(--surface);
}

.diag-report-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.diag-report-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.diag-report-pro-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--mono);
  background: rgba(196,163,90,0.13);
  color: #c4a35a;
  border: 1px solid rgba(196,163,90,0.30);
  border-radius: 2px;
  padding: 1px 5px;
}

.diag-report-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 10px;
}

.diag-report-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border-lt);
  color: var(--text);
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s;
}
.diag-report-btn:hover {
  background: var(--hover, rgba(255,255,255,0.05));
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Technical sections container ───────────────────────────────────────────── */

.diag-tech-sections {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Debug section ───────────────────────────────────────────────────────────── */

.diag-debug {
  margin: 6px 0 2px;
  border: 1px solid var(--border-lt);
  border-radius: 3px;
  overflow: hidden;
  font-size: 11px;
}

.diag-debug-summary {
  cursor: pointer;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 10.5px;
  background: var(--surface);
  user-select: none;
  list-style: none;
}
.diag-debug-summary::-webkit-details-marker { display: none; }

.diag-debug-content {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diag-debug-subtitle {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 6px;
  margin-bottom: 2px;
}
.diag-debug-subtitle:first-child {
  margin-top: 0;
}

.diag-debug-flags {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.diag-debug-warn {
  font-size: 11px;
  color: var(--danger, #c07a7a);
  padding-left: 4px;
  border-left: 2px solid var(--danger, #c07a7a);
}

/* ── Pro report block — updated structure ───────────────────────────────────── */

.diag-report-preview {
  margin-bottom: 12px;
}

/* ── ALEX VIEW ───────────────────────────────────────────────────────────────── */
/* Page 1 equivalent, under Core Reading.
   Resolves the entire structural case into two sentences.
   Dominant force must be named. No hedging. No advice.       */

.diag-alex-view {
  border-left: 2px solid #4c7cff;
  padding: 10px 0 10px 14px;
  margin-bottom: 16px;
}

.diag-alex-view-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4c7cff;
  margin-bottom: 7px;
  font-family: var(--mono, monospace);
}

.diag-alex-view-text {
  font-size: 12.5px;
  line-height: 1.65;
  color: #cfd3dc;
  font-style: italic;
  letter-spacing: 0.01em;
}

/* Loading state — shown while API call is in flight */
.diag-alex-view-text:empty::before {
  content: "Generating view…";
  color: #4a5060;
  font-style: normal;
  font-size: 11px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   Portfolio Stress Simulator — Full Workspace
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Modal backdrop ───────────────────────────────────────────────────────── */

.sim-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.sim-modal.open {
  opacity: 1;
  pointer-events: all;
}
.sim-modal.open .sim-workspace {
  transform: translateY(0);
}

/* ── Workspace card ───────────────────────────────────────────────────────── */

.sim-workspace {
  background: #0f1117;
  border: 1px solid #1e2230;
  border-radius: 8px;
  width: 92vw;
  max-width: 1120px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1101;
}

/* ── Embedded (inline) workspace ─────────────────────────────────────────── */

.sim-embedded-outer {
  width: 100%;
}

.sim-workspace--embedded {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 680px;
  transform: none;
  transition: none;
  position: static;
  z-index: auto;
  border-radius: 6px;
}

.sim-workspace--embedded .sim-ws-body {
  height: 640px;  /* fixed body height for embedded mode */
}

/* Expand button (embedded mode — opens full-screen modal) */
.sim-expand-btn {
  background: transparent;
  border: 1px solid #1e2230;
  border-radius: 4px;
  color: #475569;
  font-size: 16px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
}
.sim-expand-btn:hover { color: #94A3B8; border-color: #3B82F6; }

/* ── Workspace header ─────────────────────────────────────────────────────── */

.sim-ws-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 16px;
  border-bottom: 1px solid #1a1f2e;
  background: #0d0f14;
}
.sim-ws-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sim-ws-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8eaf0;
  font-family: var(--mono, monospace);
}
.sim-ws-subtitle {
  font-size: 11px;
  color: #505870;
  letter-spacing: 0.04em;
}
.sim-ws-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── 2-column body ────────────────────────────────────────────────────────── */

.sim-ws-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.sim-ws-left {
  width: 360px;
  flex-shrink: 0;
  border-right: 1px solid #1a1f2e;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1e2230 transparent;
  background: #0d0f14;
}
.sim-ws-left::-webkit-scrollbar { width: 3px; }
.sim-ws-left::-webkit-scrollbar-track { background: transparent; }
.sim-ws-left::-webkit-scrollbar-thumb { background: #1e2230; }
.sim-ws-right {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1e2230 transparent;
}
.sim-ws-right::-webkit-scrollbar { width: 3px; }
.sim-ws-right::-webkit-scrollbar-track { background: transparent; }
.sim-ws-right::-webkit-scrollbar-thumb { background: #1e2230; }

/* ── Column heading ───────────────────────────────────────────────────────── */

.sim-col-heading {
  padding: 20px 22px 14px;
  border-bottom: 1px solid #141720;
}
.sim-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6b7390;
  font-family: var(--mono, monospace);
  margin-bottom: 5px;
}
.sim-col-sub {
  font-size: 12px;
  color: #4e5568;
}

/* ── Left / right sections ────────────────────────────────────────────────── */

.sim-left-section {
  padding: 18px 22px;
  border-bottom: 1px solid #141720;
}
.sim-left-section:last-child { border-bottom: none; }
.sim-right-section {
  padding: 22px 28px;
  border-bottom: 1px solid #1a1f2e;
}
.sim-right-section:last-child { border-bottom: none; }

/* ── Section labels ───────────────────────────────────────────────────────── */

.sim-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b7390;
  font-family: var(--mono, monospace);
  margin-bottom: 12px;
}
.sim-section-sub {
  font-size: 12px;
  color: #4e5568;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* ── Macro Regime Alignment section ─────────────────────────────────────── */

.sim-macro-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-macro-badge {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
}

.sim-macro-bar-label {
  font-size: 12px;
  color: #7a7d9a;
  margin-bottom: 4px;
}

.sim-macro-bar-wrap {
  height: 8px;
  background: #1e2235;
  border-radius: 4px;
  overflow: hidden;
}

.sim-macro-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.sim-macro-group {
  margin-top: 4px;
}

.sim-macro-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 5px;
}
.sim-macro-group-label--ok   { color: #3ecf8e; }
.sim-macro-group-label--warn { color: #e05a5a; }

.sim-macro-pos-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 12px;
}
.sim-macro-pos-row--ok   { background: rgba(62,207,142,.07); }
.sim-macro-pos-row--warn { background: rgba(224,90,90,.07); }

.sim-macro-ticker {
  font-family: var(--mono, monospace);
  font-weight: 600;
  font-size: 12px;
  min-width: 52px;
}

.sim-macro-sector {
  color: #5a5e78;
  font-size: 11px;
}

.sim-macro-interp {
  font-size: 12px;
  color: #7a7d9a;
  line-height: 1.6;
  padding: 8px 10px;
  background: #131625;
  border-left: 3px solid #2a2d4a;
  border-radius: 0 4px 4px 0;
}

/* ── Run button ───────────────────────────────────────────────────────────── */

.sim-run-btn {
  background: #4c7cff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  font-family: var(--mono, monospace);
}
.sim-run-btn:hover:not(:disabled) { background: #3a6ae8; }
.sim-run-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Close button ─────────────────────────────────────────────────────────── */

.sim-close {
  background: none;
  border: none;
  color: #3a4055;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}
.sim-close:hover { color: #cfd3dc; }

/* ── Weight mode bar ──────────────────────────────────────────────────────── */

.sim-weight-mode-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.sim-weight-mode-btn {
  flex: 1;
  background: #141720;
  border: 1px solid #1e2230;
  border-radius: 4px;
  color: #606880;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 8px;
  cursor: pointer;
  transition: all 0.14s;
  font-family: var(--mono, monospace);
  text-align: center;
}
.sim-weight-mode-btn:hover { color: #cfd3dc; border-color: #2a3050; }
.sim-weight-mode-btn.active {
  background: #0d1428;
  border-color: #4c7cff;
  color: #7a9fff;
}
.sim-weight-mode-desc {
  font-size: 12px;
  color: #505870;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ── Weight total indicator ───────────────────────────────────────────────── */

.sim-weight-total {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  margin-top: 8px;
}
.sim-weight-total-label { color: #606880; }
.sim-weight-total-val { font-weight: 700; }
.sim-weight-total-val--ok   { color: #3ecf8e; }
.sim-weight-total-val--warn { color: #e05a5a; }
.sim-weight-total-note { color: #8b4444; font-size: 11px; }
.sim-weight-normalize-btn {
  margin-left: 6px; padding: 1px 7px; font-size: 10px;
  border-radius: 3px; border: 1px solid rgba(59,130,246,.35);
  color: #60A5FA; background: rgba(59,130,246,.06);
  cursor: pointer; vertical-align: middle;
}
.sim-weight-normalize-btn:hover { background: rgba(59,130,246,.14); }

/* ── Positions table ──────────────────────────────────────────────────────── */

.sim-pos-table {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.sim-pos-thead {
  display: grid;
  grid-template-columns: 1fr 42px 36px 48px 54px 20px;
  gap: 4px;
  padding: 0 0 6px;
  border-bottom: 1px solid #1a1f2e;
  margin-bottom: 4px;
}
.sim-pos-th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #505870;
  font-family: var(--mono, monospace);
}
.sim-pos-th--center  { text-align: center; }
.sim-pos-th--right   { text-align: right; }
.sim-pos-th--action  { text-align: right; }
.sim-pos-th--metric  { font-size: 9px; color: #484e68; }
.sim-pos-row {
  display: grid;
  grid-template-columns: 1fr 42px 36px 48px 54px 20px;
  gap: 4px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #0d0f14;
  transition: background 0.1s;
}
/* ── DI / MDG metric cells ──────────────────────────────────────────────────── */
.sim-pos-metric-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-metric-val {
  font-size: 10px;
  font-family: var(--mono, monospace);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sim-metric-val--good  { color: #3ecf8e; }
.sim-metric-val--mid   { color: #c49a00; }
.sim-metric-val--warn  { color: #e05a5a; }
.sim-metric-val--empty { color: #353d52; font-weight: 400; }
.sim-pos-row:last-child { border-bottom: none; }
.sim-pos-row:hover { background: #111420; }
.sim-pos-identity { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sim-pos-ticker {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaf0;
  font-family: var(--mono, monospace);
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Score badge cell — centred in its fixed-width grid column */
.sim-pos-row .sim-score-badge,
.sim-pos-row .sim-score-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-pos-name {
  font-size: 11px;
  color: #545c78;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Score badges */
.sim-score-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--mono, monospace);
  border-radius: 3px;
  padding: 2px 5px;
  text-align: center;
}
.sim-score-badge--high { background: #0d2018; color: #3ecf8e; border: 1px solid #1a3828; }
.sim-score-badge--mod  { background: #1a1500; color: #c49a00; border: 1px solid #2a2200; }
.sim-score-badge--low  { background: #1a0f0f; color: #e05a5a; border: 1px solid #2a1818; }
.sim-score-badge--none { background: #141820; color: #505870; border: 1px solid #1e2230; font-style: italic; }

/* Weight cell */
.sim-pos-weight-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.sim-weight-input {
  width: 42px;
  background: #141720;
  border: 1px solid #1e2230;
  border-radius: 3px;
  color: #e8eaf0;
  font-size: 11px;
  font-family: var(--mono, monospace);
  padding: 3px 5px;
  text-align: right;
  outline: none;
  transition: border-color 0.12s;
}
.sim-weight-input:focus { border-color: #2a3560; }
.sim-weight-pct-label {
  font-size: 11px;
  color: #505870;
  font-family: var(--mono, monospace);
}
.sim-pos-weight-val {
  font-size: 11px;
  font-weight: 600;
  color: #8b92a5;
  font-family: var(--mono, monospace);
}
.sim-pos-remove {
  background: none;
  border: none;
  color: #404860;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.12s;
  text-align: right;
}
.sim-pos-remove:hover { color: #e05a5a; }
.sim-pos-empty {
  font-size: 12px;
  color: #4a5268;
  padding: 12px 0 6px;
  line-height: 1.6;
}

/* ── Active input pill ────────────────────────────────────────────────────── */

.sim-active-tag-row { margin: 8px 0 6px; min-height: 18px; }
.sim-active-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: var(--mono, monospace);
  border-radius: 3px;
  padding: 3px 8px;
}
.sim-active-pill--positions { background: #0d1428; color: #4c7cff; border: 1px solid #1e2a50; }
.sim-active-pill--upload    { background: #0d2018; color: #3ecf8e; border: 1px solid #1a3828; }

/* ── Inline add form ──────────────────────────────────────────────────────── */

.sim-add-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
.sim-add-input {
  background: #0d0f14;
  border: 1px solid #1e2230;
  border-radius: 4px;
  color: #e8eaf0;
  font-size: 12px;
  font-family: var(--mono, monospace);
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.14s;
}
.sim-add-input:focus { border-color: #2a3560; }
.sim-add-input::placeholder { color: #353d52; }
.sim-add-input--ticker { width: 76px; }
.sim-add-input--name   { flex: 1; min-width: 100px; }
.sim-add-confirm-btn {
  background: #4c7cff;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: background 0.14s;
}
.sim-add-confirm-btn:hover { background: #3a6ae8; }

/* ── Add position inline feedback ────────────────────────────────────────── */

.sim-add-feedback {
  flex-basis: 100%;
  font-size: 11px;
  font-family: var(--mono, monospace);
  color: #c07070;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sim-add-feedback--error { color: #c07070; }
.sim-add-suggest-btn {
  background: none;
  border: 1px solid #c07070;
  border-radius: 3px;
  color: #c07070;
  font-size: 10px;
  font-family: var(--mono, monospace);
  padding: 2px 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sim-add-suggest-btn:hover {
  background: #c07070;
  color: #0d0f14;
}

/* ── Ghost buttons ────────────────────────────────────────────────────────── */

.sim-ghost-btn {
  background: none;
  border: 1px solid #252a3a;
  border-radius: 4px;
  color: #606880;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.14s, border-color 0.14s;
  font-family: var(--mono, monospace);
}
.sim-ghost-btn:hover { color: #cfd3dc; border-color: #353d58; }

/* ── Reset button ─────────────────────────────────────────────────────────── */

.sim-reset-btn {
  background: none;
  border: none;
  color: #444c68;
  font-size: 11px;
  font-family: var(--mono, monospace);
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.14s;
  text-decoration: none;
}
.sim-reset-btn:hover { color: #c07070; }

/* ── Control row (add + reset) ────────────────────────────────────────────── */

.sim-pos-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

/* ── OR divider ───────────────────────────────────────────────────────────── */

.sim-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  margin: 2px 0;
}
.sim-or-line { flex: 1; height: 1px; background: #141720; }
.sim-or-text {
  font-size: 10px;
  color: #3e4560;
  letter-spacing: 0.12em;
  font-family: var(--mono, monospace);
  text-transform: uppercase;
}

/* ── Upload row ───────────────────────────────────────────────────────────── */

.sim-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sim-file-label {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #606880;
  border: 1px dashed #252a3a;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
  font-family: var(--mono, monospace);
}
.sim-file-label:hover { border-color: #3a4870; color: #cfd3dc; }
.sim-file-name {
  font-size: 11px;
  color: #4a5268;
  font-family: var(--mono, monospace);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Alex Portfolio Reading ───────────────────────────────────────────────── */

.sim-reading-section {
  background: linear-gradient(180deg, #0d1020 0%, #0f1117 100%);
  border-left: 3px solid #4c7cff;
}
.sim-reading-header { margin-bottom: 14px; }
.sim-reading-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4c7cff;
  font-family: var(--mono, monospace);
  margin-bottom: 4px;
}
.sim-reading-sub {
  font-size: 11px;
  color: #3e5080;
  letter-spacing: 0.02em;
}
.sim-reading-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sim-reading-para {
  font-size: 13px;
  line-height: 1.75;
  color: #8b93aa;
  margin: 0;
}
.sim-reading-para--lead {
  color: #bec5d6;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.7;
}

/* ── Diagnostic metrics grid ──────────────────────────────────────────────── */

.sim-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.sim-metric-block {
  background: #141720;
  border: 1px solid #1e2230;
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.15s ease;
}
.sim-metric-block:hover { border-color: #3a4060; }
.sim-metric-block--placeholder { opacity: 0.45; }
.sim-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #606880;
  font-family: var(--mono, monospace);
  margin-bottom: 7px;
}
.sim-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #e8eaf0;
  font-family: var(--mono, monospace);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.sim-metric-value--placeholder { color: #252a3a; }
.sim-metric-value--ok   { color: #3ecf8e; }
.sim-metric-value--mid  { color: #c49a00; }
.sim-metric-value--warn { color: #e05a5a; }
.sim-metric-interp {
  font-size: 11px;
  color: #545c78;
  line-height: 1.45;
}

/* Progress bar inside metric blocks */
.sim-metric-bar {
  height: 3px;
  background: #1e2230;
  border-radius: 2px;
  margin: 4px 0 6px;
  overflow: hidden;
}
.sim-metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Business structure vertical cards */
.sim-biz-card {
  background: #111420;
  border: 1px solid #1e2230;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.sim-biz-card:last-of-type { margin-bottom: 0; }
.sim-biz-card-key {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #545c78;
  margin-bottom: 4px;
}
.sim-biz-card-val {
  font-size: 12px;
  color: #bec5d6;
  line-height: 1.5;
}

/* Alex Reading mini-sections (Path 2 structured output) */
.sim-reading-mini-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1a1f2e;
}
.sim-reading-mini-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.sim-reading-mini-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3e5080;
  margin-bottom: 8px;
}

/* Structural risk plain text (no monospace bold) */
.sim-co-risk-text {
  font-size: 13px;
  color: #8892a4;
  line-height: 1.6;
  font-family: var(--font);
  font-weight: 400;
}

/* ── Sub-blocks ───────────────────────────────────────────────────────────── */

.sim-sub-block { margin-bottom: 16px; }
.sim-sub-block:last-child { margin-bottom: 0; }
.sim-sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #606880;
  font-family: var(--mono, monospace);
  margin-bottom: 10px;
}
.sim-data-group { margin-bottom: 8px; }
.sim-data-group:last-child { margin-bottom: 0; }
.sim-data-key {
  font-size: 11px;
  color: #545c78;
  font-family: var(--mono, monospace);
  margin-bottom: 3px;
}
.sim-data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #141720;
}
.sim-data-row:last-child { border-bottom: none; }
.sim-data-val {
  font-size: 11px;
  font-weight: 600;
  color: #cfd3dc;
  font-family: var(--mono, monospace);
}
.sim-data-val--warn   { color: #e05a5a; }
.sim-data-val--accent { color: #f0a500; }
.sim-stress-figure {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  color: #e05a5a;
}

/* ── Position market data grid (vol + drawdown per position) ─────────────── */

.sim-pos-mkt-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.sim-pos-mkt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid #141720;
}
.sim-pos-mkt-row:last-child { border-bottom: none; }
.sim-pos-mkt-ticker {
  font-size: 11px;
  font-weight: 700;
  color: #a0a8c0;
  font-family: var(--mono, monospace);
  letter-spacing: 0.05em;
}
.sim-pos-mkt-vals {
  font-size: 10px;
  color: #606880;
  font-family: var(--mono, monospace);
}

/* ── Structural Exploration ───────────────────────────────────────────────── */

.sim-expl-block { margin-bottom: 16px; }
.sim-expl-block:last-child { margin-bottom: 0; }
.sim-expl-sublabel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #606880;
  font-family: var(--mono, monospace);
  margin-bottom: 10px;
}
.sim-expl-row {
  padding: 9px 12px;
  background: #141720;
  border: 1px solid #1e2230;
  border-radius: 4px;
  margin-bottom: 6px;
}
.sim-expl-row:last-child { margin-bottom: 0; }
.sim-expl-row-title {
  font-size: 12px;
  font-weight: 600;
  color: #cfd3dc;
  font-family: var(--mono, monospace);
  margin-bottom: 6px;
}
.sim-expl-effects { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.sim-expl-effect { font-size: 11px; color: #5a6280; }
.sim-expl-effect--context {
  font-size: 10px;
  color: #414760;
  font-style: italic;
  border-top: 1px solid #1a1e2a;
  margin-top: 4px;
  padding-top: 4px;
}

/* Replacement row header: TICKER → CANDIDATE */
.sim-expl-row-header {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.sim-expl-ticker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: var(--mono, monospace);
}
.sim-expl-ticker--replaced   { color: #8b92a5; }
.sim-expl-ticker--candidate  { color: #3ecf8e; }
.sim-expl-arrow {
  font-size: 11px;
  color: #404560;
  font-family: var(--mono, monospace);
}
.sim-expl-cand-name {
  font-size: 10px;
  color: #5a6280;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Impact chips row */
.sim-expl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

/* ── Replacement impact chips ─────────────────────────────────────────────── */

.sim-repl-impact {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--mono, monospace);
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.sim-repl-impact--high {
  background: rgba(62, 207, 142, 0.12);
  color: #3ecf8e;
  border: 1px solid rgba(62, 207, 142, 0.25);
}
.sim-repl-impact--mid {
  background: rgba(196, 154, 0, 0.12);
  color: #c9a43a;
  border: 1px solid rgba(196, 154, 0, 0.25);
}
.sim-repl-impact--low {
  background: rgba(224, 90, 90, 0.10);
  color: #e05a5a;
  border: 1px solid rgba(224, 90, 90, 0.22);
}
.sim-repl-impact--neutral {
  background: rgba(96, 104, 128, 0.15);
  color: #606880;
  border: 1px solid rgba(96, 104, 128, 0.22);
}

/* ── WHAT WOULD ALEX CHANGE reconstruction block ──────────────────────────── */

.sim-recon-block {
  background: #0d1117;
  border: 1px solid #1e2a3a;
  border-radius: 6px;
  padding: 18px 20px;
}

.sim-recon-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.sim-recon-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.sim-recon-sub {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 18px;
}

.sim-recon-section {
  margin-bottom: 16px;
}

.sim-recon-section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1e2a3a;
}

.sim-recon-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #0f1923;
}

.sim-recon-row:last-child {
  border-bottom: none;
}

.sim-recon-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 52px;
  padding: 2px 6px;
  background: #161d27;
  border-radius: 3px;
  border: 1px solid #1e2a3a;
  text-align: center;
}

.sim-recon-ticker--reduce {
  color: #fca5a5;
  border-color: #3b1212;
  background: #1a0d0d;
}

.sim-recon-ticker--anchor {
  color: #86efac;
  border-color: #0f3320;
  background: #0a1e13;
}

.sim-recon-ticker--add {
  color: #93c5fd;
  border-color: #0f2040;
  background: #0a1525;
}

.sim-recon-ticker--missing {
  color: #c4b5fd;
  border-color: #2d1f4a;
  background: #150f2a;
}

.sim-recon-detail {
  flex: 1;
}

.sim-recon-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 2px;
}

.sim-recon-reason {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.5;
}

.sim-recon-delta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #475569;
  white-space: nowrap;
  padding-top: 3px;
}

.sim-recon-delta--pos { color: #4ade80; }
.sim-recon-delta--neg { color: #f87171; }

/* Projected effect table */
.sim-recon-effect {
  background: #080d14;
  border: 1px solid #1e2a3a;
  border-radius: 4px;
  padding: 12px 14px;
  margin-top: 14px;
}

.sim-recon-effect-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 10px;
}

.sim-recon-effect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sim-recon-effect-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sim-recon-effect-metric {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sim-recon-effect-before {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
}

.sim-recon-effect-after {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #93c5fd;
}

.sim-recon-effect-arrow {
  font-size: 9px;
  color: #334155;
  margin: 1px 0;
}

/* Interpretation line */
.sim-recon-interp {
  margin-top: 14px;
  padding: 10px 12px;
  background: #0a1020;
  border-left: 2px solid #1e3a5f;
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
  font-style: italic;
}

/* ── Stress Verdict card ─────────────────────────────────────────────────── */

.sim-verdict-card {
  border: 1px solid #1e2a3a;
  border-radius: 5px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #080e18;
  position: relative;
  overflow: hidden;
}

/* Left accent bar — colour driven by verdict class */
.sim-verdict-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 5px 0 0 5px;
}

.sim-verdict-card--concerning::before  { background: #dc2626; }
.sim-verdict-card--elevated::before    { background: #d97706; }
.sim-verdict-card--contained::before   { background: #16a34a; }
.sim-verdict-card--neutral::before     { background: #334155; }

/* Header row */
.sim-verdict-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.sim-verdict-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sim-verdict-subtitle {
  font-size: 10px;
  color: #334155;
}

/* Main verdict sentence */
.sim-verdict-main {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Worst-case + recovery stat row */
.sim-verdict-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 13px;
}

.sim-verdict-stat {
  background: #050c16;
  border: 1px solid #1a2236;
  border-radius: 4px;
  padding: 8px 12px;
  flex: 1;
}

.sim-verdict-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 5px;
}

.sim-verdict-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.sim-verdict-stat-value--warn    { color: #fca5a5; }
.sim-verdict-stat-value--caution { color: #fcd34d; }
.sim-verdict-stat-value--ok      { color: #86efac; }
.sim-verdict-stat-value--neutral { color: #94a3b8; }

.sim-verdict-stat-sub {
  font-size: 9.5px;
  color: #334155;
  margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
}

/* Recovery line is a full phrase — tighten font to prevent overflow */
.sim-verdict-stat--recovery .sim-verdict-stat-value {
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}

/* Memo explanation */
.sim-verdict-memo {
  font-size: 11px;
  color: #64748b;
  line-height: 1.65;
  border-top: 1px solid #0f1923;
  padding-top: 10px;
}

/* ── Monte Carlo stress section ──────────────────────────────────────────── */

.sim-mc-block {
  margin-top: 0;
}

.sim-mc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sim-mc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sim-mc-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: #4c7cff;
  border: 1px solid #1e2a50;
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
}

.sim-mc-note {
  font-size: 10px;
  color: #334155;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Regime tab strip */
.sim-mc-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid #1a2236;
  padding-bottom: 0;
}

.sim-mc-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  user-select: none;
  margin-bottom: -1px;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}

.sim-mc-tab:hover  { color: #64748b; }

.sim-mc-tab--active {
  color: #93c5fd;
  border-bottom-color: #3b6fd4;
}

/* Panel shown/hidden by JS */
.sim-mc-panel { display: none; }
.sim-mc-panel--active { display: block; }

/* Stats grid — 2-col layout */
.sim-mc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.sim-mc-stat-card {
  background: #080d14;
  border: 1px solid #1a2236;
  border-radius: 4px;
  padding: 10px 12px;
}

.sim-mc-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 6px;
}

.sim-mc-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 3px;
  line-height: 1;
}

.sim-mc-stat-value--warn  { color: #fca5a5; }
.sim-mc-stat-value--caution { color: #fcd34d; }
.sim-mc-stat-value--ok    { color: #86efac; }

.sim-mc-stat-range {
  font-size: 10px;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
}

/* Distribution band bar */
.sim-mc-band {
  margin: 12px 0 10px;
}

.sim-mc-band-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 6px;
}

.sim-mc-band-track {
  position: relative;
  height: 10px;
  background: #0d1520;
  border-radius: 3px;
  border: 1px solid #1a2236;
  overflow: hidden;
}

.sim-mc-band-iqr {
  position: absolute;
  top: 0;
  height: 100%;
  background: #1e3a5f;
  border-radius: 2px;
}

.sim-mc-band-median {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #93c5fd;
}

.sim-mc-band-ticks {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #334155;
  margin-top: 3px;
}

/* Tail risk row */
.sim-mc-tail {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.sim-mc-tail-chip {
  flex: 1;
  background: #0d1117;
  border: 1px solid #1a2236;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sim-mc-tail-label {
  font-size: 9.5px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
}

.sim-mc-tail-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fca5a5;
}

/* Recovery row */
.sim-mc-recovery {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #080d14;
  border: 1px solid #1a2236;
  border-radius: 4px;
  margin-bottom: 12px;
}

.sim-mc-recovery-label {
  font-size: 9.5px;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.sim-mc-recovery-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.sim-mc-recovery-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid;
}

.sim-mc-recovery-badge--short    { color: #86efac; border-color: #0f3320; background: #0a1e13; }
.sim-mc-recovery-badge--medium   { color: #fcd34d; border-color: #3d2e0a; background: #1e1700; }
.sim-mc-recovery-badge--prolonged{ color: #fca5a5; border-color: #3b1212; background: #1a0d0d; }

/* Regime comparison summary table */
.sim-mc-compare {
  margin-top: 14px;
  border-top: 1px solid #1a2236;
  padding-top: 12px;
}

.sim-mc-compare-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 8px;
}

.sim-mc-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.sim-mc-compare-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  text-align: left;
  padding: 4px 8px 6px;
  border-bottom: 1px solid #1a2236;
}

.sim-mc-compare-table td {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #94a3b8;
  padding: 6px 8px;
  border-bottom: 1px solid #0f1923;
}

.sim-mc-compare-table td:first-child {
  color: #64748b;
  font-size: 9.5px;
}

.sim-mc-compare-table tr:last-child td {
  border-bottom: none;
}

/* Model note footer */
.sim-mc-model-note {
  margin-top: 12px;
  padding: 8px 10px;
  background: #050a10;
  border-left: 2px solid #1e293b;
  font-size: 10px;
  color: #334155;
  line-height: 1.55;
  border-radius: 0 3px 3px 0;
}

/* ── Metric info icon + CSS tooltip ─────────────────────────────────────── */

/* Small ⓘ circle rendered after metric labels */
.sim-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #2d3a4e;
  color: #475569;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: default;
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  transition: border-color 0.12s, color 0.12s;
  flex-shrink: 0;
  line-height: 1;
}

.sim-info-icon:hover {
  border-color: #3b5280;
  color: #64748b;
}

/* Tooltip bubble — appears above the icon on hover */
.sim-info-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #060d18;
  border: 1px solid #1e293b;
  border-radius: 4px;
  padding: 8px 11px;
  font-size: 10.5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #94a3b8;
  white-space: normal;
  width: 230px;
  line-height: 1.55;
  pointer-events: none;
  opacity: 0;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  transition: opacity 0.12s 0.08s;
}

/* Caret pointing down toward the icon */
.sim-info-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s 0.08s;
}

.sim-info-icon:hover::after,
.sim-info-icon:hover::before {
  opacity: 1;
}

/* When the info icon is inside a tight header cell, anchor tooltip to the left
   so it doesn't bleed off-screen on the right edge */
.sim-pos-th .sim-info-icon::after {
  left: auto;
  right: 0;
  transform: none;
}
.sim-pos-th .sim-info-icon::before {
  left: auto;
  right: 4px;
  transform: none;
}

/* ── How to read — collapsible metric glossary ──────────────────────────── */

details.sim-howto {
  margin-top: 14px;
  border-top: 1px solid #1a2236;
}

.sim-howto-summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #334155;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 0 7px;
  user-select: none;
  transition: color 0.12s;
}

.sim-howto-summary::-webkit-details-marker { display: none; }
.sim-howto-summary::marker              { display: none; }

.sim-howto-caret {
  display: inline-block;
  transition: transform 0.15s;
  font-size: 10px;
  color: #2d3a4e;
}

details.sim-howto[open] .sim-howto-caret {
  transform: rotate(90deg);
}

.sim-howto-summary:hover,
details.sim-howto[open] .sim-howto-summary {
  color: #475569;
}

.sim-howto-body {
  padding: 4px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.sim-howto-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sim-howto-term {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #8a9ab5;
  letter-spacing: 0.06em;
}

.sim-howto-def {
  font-size: 10.5px;
  color: #475569;
  line-height: 1.55;
}

/* ── Pro block ────────────────────────────────────────────────────────────── */

.sim-pro-block {
  background: linear-gradient(135deg, #0d1428 0%, #0f0f14 100%);
  border: 1px solid #1e2a50;
  border-radius: 6px;
  padding: 20px 22px;
}
.sim-pro-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.sim-pro-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b92a5;
  font-family: var(--mono, monospace);
}
.sim-pro-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4c7cff;
  border: 1px solid #1e2a50;
  border-radius: 3px;
  padding: 2px 7px;
  font-family: var(--mono, monospace);
}
.sim-pro-manifest { margin-bottom: 16px; }
.sim-pro-manifest-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
}
.sim-pro-manifest-mark { color: #4c7cff; font-size: 11px; font-family: var(--mono, monospace); }
.sim-pro-manifest-text { font-size: 12px; color: #7a8299; }
.sim-pro-tier-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.sim-pro-tier-label { font-size: 13px; font-weight: 700; color: #cfd3dc; }
.sim-pro-tier-price { font-size: 11px; color: #606880; font-family: var(--mono, monospace); }
.sim-pro-cta {
  background: #4c7cff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--mono, monospace);
  margin-bottom: 14px;
  display: block;
}
.sim-pro-cta:hover { background: #3a6ae8; }
.sim-pro-report-btn {
  background: transparent;
  color: #4c7cff;
  border: 1px solid #2d3f7a;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: var(--mono, monospace);
  margin-bottom: 14px;
  display: block;
  width: 100%;
  text-align: left;
}
.sim-pro-report-btn:hover:not(:disabled) {
  background: rgba(76, 124, 255, 0.09);
  border-color: #4c7cff;
}
.sim-pro-report-btn:disabled {
  color: #3a4260;
  border-color: #222840;
  cursor: not-allowed;
}
.sim-pro-footer {
  font-size: 11px;
  color: #424860;
  line-height: 1.6;
}

/* ── Run button Pro tier note ─────────────────────────────────────────────── */
.sim-run-pro-note {
  font-size: 11px;
  color: #606880;
  font-family: var(--mono, monospace);
  align-self: center;
  margin-right: 8px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ── Loading / error / placeholder states ─────────────────────────────────── */

.sim-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 0;
}
.sim-loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #1e2230;
  border-top-color: #4c7cff;
  border-radius: 50%;
  animation: sim-spin 0.8s linear infinite;
}
@keyframes sim-spin { to { transform: rotate(360deg); } }
.sim-loading-text {
  font-size: 11px;
  color: #4a5060;
  font-family: var(--mono, monospace);
  letter-spacing: 0.08em;
}
.sim-loading-sub { font-size: 11px; color: #4a5268; }
.sim-error-state {
  padding: 16px;
  background: #1a0f0f;
  border: 1px solid #3a1a1a;
  border-radius: 4px;
}
.sim-error-title {
  font-size: 12px;
  color: #e05a5a;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: var(--mono, monospace);
}
.sim-error-detail { font-size: 11px; color: #8b4444; }
.sim-placeholder-text {
  font-size: 12px;
  color: #424860;
  font-style: italic;
  line-height: 1.65;
  padding: 8px 0;
}

/* ── Skeleton loading blocks — intentionally staged placeholder state ─────── */
.sim-co-skel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 10px;
}
.sim-co-skel-line {
  height: 9px;
  background: #1a1f2e;
  border-radius: 2px;
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════════════════
   SCANNER DARK THEME — visual alignment with Portfolio Simulator
   Override CSS variables within .scan-page so all nested rules inherit
   the dark palette without rewriting every selector.
══════════════════════════════════════════════════════════════════════════ */

.scan-page {
  --bg:        #0b0e14;
  --surface:   #0d0f14;
  --border:    #1e2230;
  --border-lt: #1a1f2e;
  --text:      #e6e9ef;
  --muted:     #606880;
  --accent:    #4c7cff;
  --ok:        #3ecf8e;
  --ok-bg:     rgba(62, 207, 142, 0.08);
  background:  #0b0e14;
  color:       #e6e9ef;
}

/* Header */
.scan-page .scan-header      { border-bottom-color: #1e2230; }
.scan-page .scan-brand-text  { color: #e8eaf0; }
/* Legacy theme overrides kept for any panels still using old classes */
.scan-page .scan-title    { color: #e8eaf0; }
.scan-page .scan-product  { color: #606880; }
.scan-page .scan-subtitle { color: #606880; }
.scan-page .ghost {
  background: transparent;
  color: #8b93aa;
  border-color: #1e2230;
}
.scan-page .ghost:hover:not(:disabled) {
  color: #e6e9ef;
  border-color: #2a3550;
  background: #131720;
  filter: none;
}

/* Asymmetry Agent block */
.scan-page .scan-agent-block {
  background: #0d0f14;
  border-color: #1e2230;
  border-left-color: #4c7cff;
}
.scan-page .scan-agent-label { color: #4c7cff; }
.scan-page .scan-agent-note  { color: #8b93aa; }

/* Controls card */
.scan-page .scan-controls {
  background: #0d0f14;
  border-color: #1e2230;
}
.scan-page .label {
  color: #606880;
}
.scan-page .scan-mode-btn {
  background: #131720;
  color: #606880;
  border-color: #1e2230;
}
.scan-page .scan-mode-btn.active {
  background: #1e2a45;
  color: #e6e9ef;
  border-color: #4c7cff;
}
.scan-page .scan-mode-btn:hover:not(.active):not(:disabled) {
  color: #e6e9ef;
  background: #1a1f2e;
  border-color: #2a3550;
  filter: none;
}
.scan-page .scan-opt-label { color: #8b93aa; }
.scan-page .scan-status-line { color: #606880; }
.scan-page .scan-run-row > button {
  background: #1e2a45;
  color: #e6e9ef;
  border-color: #4c7cff;
}
.scan-page .scan-run-row > button:hover:not(:disabled) {
  background: #26386a;
  border-color: #6b96ff;
  filter: none;
}

/* Filter bar */
.scan-page .scan-filter-bar {
  background: #0d0f14;
  border-color: #1e2230;
}
.scan-page .scan-filter-label { color: #606880; }
.scan-page .scan-preset-btn {
  background: #131720;
  color: #606880;
  border-color: #1e2230;
}
.scan-page .scan-preset-btn.active {
  background: #1e2a45;
  color: #e6e9ef;
  border-color: #4c7cff;
}
.scan-page .scan-preset-btn:hover:not(:disabled):not(.active) {
  color: #e6e9ef;
  background: #1a1f2e;
  border-color: #2a3550;
  filter: none;
}
.scan-page .scan-threshold-input {
  background: #131720;
  border-color: #1e2230;
  color: #e6e9ef;
}
.scan-page .scan-clear-btn {
  background: transparent;
  color: #606880;
  border-color: #1e2230;
}
.scan-page .scan-clear-btn:hover:not(:disabled) {
  color: #8b93aa;
  filter: none;
}

/* Results header */
.scan-page .scan-results-header { border-bottom-color: #1a1f2e; }
.scan-page .scan-count           { color: #e6e9ef; }
.scan-page .scan-count-mode      { color: #606880; }
.scan-page .scan-results-signal  {
  color: #3ecf8e;
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.2);
  border-radius: 3px;
  padding: 1px 7px;
}

/* Table wrap + table */
.scan-page .scan-table-wrap {
  border-color: #1e2230;
  background: #0f1117;
}
.scan-page .scan-table {
  background: transparent;
}
.scan-page .scan-table thead {
  background: #0d0f14;
}
.scan-page .scan-table th {
  color: #606880;
  border-bottom-color: #1e2230;
  background: #0d0f14;
  padding: 8px 10px;
}
.scan-page .scan-th-sortable:hover {
  color: #4c7cff;
  background: rgba(76, 124, 255, 0.06);
}
.scan-page .scan-th-sorted     { color: #4c7cff; }
.scan-page .scan-sort-indicator { color: #4c7cff; }
.scan-page .scan-row {
  border-bottom-color: #1a1f2e;
  transition: background 0.08s;
}
.scan-page .scan-row:hover { background: #131720; }
.scan-page .scan-table td  { padding: 10px 10px; }

/* Identity cell */
.scan-th-identity { text-align: left; min-width: 200px; }
.scan-identity    { vertical-align: top; padding-top: 8px !important; }

.scan-row-ticker {
  font-family: var(--mono, monospace);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #e8eaf0;
  line-height: 1.25;
}
.scan-row-name {
  font-size: 12px;
  color: #8b93aa;
  line-height: 1.3;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.scan-row-rationale {
  font-size: 11px;
  color: #475569;
  font-style: italic;
  line-height: 1.4;
  margin-top: 3px;
  max-width: 320px;
  white-space: normal;
}
.scan-row-meta {
  font-size: 10px;
  color: #606880;
  font-family: var(--mono, monospace);
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-top: 2px;
}

/* High-conviction row marker */
.scan-page .scan-row--high-conviction {
  border-left: 2px solid rgba(62, 207, 142, 0.5);
  background: rgba(62, 207, 142, 0.02);
}
.scan-page .scan-row--high-conviction .scan-row-ticker { color: #3ecf8e; }
.scan-page .scan-row--high-conviction:hover { background: #0e1a14; }

/* Score cells */
.scan-page .scan-score {
  text-align: center;
  vertical-align: middle;
  font-family: var(--mono, monospace);
  font-size: 12px;
}
.scan-page .scan-score-high { color: #3ecf8e; font-weight: 600; }
.scan-page .scan-score-mid  { color: #c9a43a; }
.scan-page .scan-score-low  { color: #e05a5a; }
.scan-page .scan-score-null { color: #2e3550; }
.scan-page .scan-score-primary { background: rgba(76, 124, 255, 0.07); }

/* Consensus badges */
.scan-consensus {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
  cursor: default;
}
.scan-consensus--high {
  background: rgba(234, 179, 8, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.scan-consensus--mid {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Action buttons */
.scan-page .scan-action { text-align: right; white-space: nowrap; }
.scan-page .scan-analyze-btn {
  font-size: 11px;
  padding: 3px 12px;
  background: transparent;
  color: #4c7cff;
  border: 1px solid #2a3560;
  letter-spacing: 0.04em;
  font-family: var(--mono, monospace);
}
.scan-page .scan-analyze-btn:hover:not(:disabled) {
  background: #1e2a45;
  color: #6b96ff;
  border-color: #4c7cff;
  filter: none;
}
.scan-page .scan-simulate-btn {
  font-size: 10px;
  padding: 2px 9px;
  background: transparent;
  color: #606880;
  border: 1px solid #1e2230;
  margin-left: 6px;
  font-family: var(--mono, monospace);
}
.scan-page .scan-simulate-btn:hover {
  color: #8b93aa;
  border-color: #2a3550;
  filter: none;
}

/* Rank cell */
.scan-page .scan-rank {
  color: #2e3550;
  font-family: var(--mono, monospace);
  font-size: 11px;
  text-align: right;
  padding-right: 14px !important;
}

/* Output maps */
.scan-page .scan-maps {
  border-color: #1e2230;
  background: #0d0f14;
  margin-top: 12px;
}
.scan-page .scan-maps-title {
  color: #606880;
  border-bottom-color: #1a1f2e;
}
.scan-page .scan-map-table thead th {
  background: #0b0e14;
  border-bottom-color: #1a1f2e;
  color: #606880;
}

/* Tier strip */
.scan-page .scan-tier-strip {
  background: #0d0f14;
  border: 1px solid #1e2230;
  border-radius: 4px;
  overflow: hidden;
}
.scan-page .scan-tier-strip-header {
  border-bottom-color: #1e2230;
}
.scan-page .scan-tier-strip-heading { color: #606880; }
.scan-page .scan-tier-upgrade-link  { color: #3ecf8e; }
.scan-page .scan-tier-upgrade-link:hover:not(:disabled) {
  color: #5de8a8;
  filter: none;
}
.scan-page .scan-tier-steps { border-top: none; }
.scan-page .scan-tier-step {
  border-right-color: #1e2230;
  background: transparent;
}
.scan-page .scan-tier-step--pro { background: rgba(62, 207, 142, 0.02); }
.scan-page .scan-tier-step-num  { color: #4c7cff; }
.scan-page .scan-tier-step-name { color: #e6e9ef; }
.scan-page .scan-tier-step-desc { color: #606880; }
.scan-page .scan-tier-step-tag  { color: #606880; background: #131720; border-color: #1e2230; }
.scan-page .scan-tier-step-tag--pro { color: #3ecf8e; background: rgba(62,207,142,0.08); border-color: rgba(62,207,142,0.25); }
.scan-page .scan-tier-step-cta {
  background: transparent;
  color: #3ecf8e;
  border-color: rgba(62,207,142,0.3);
}
.scan-page .scan-tier-step-cta:hover:not(:disabled) {
  background: rgba(62, 207, 142, 0.07);
  filter: none;
}

/* Pro badge inline */
.scan-page .scan-pro-badge {
  background: rgba(62, 207, 142, 0.1);
  color: #3ecf8e;
  border-color: rgba(62, 207, 142, 0.25);
}

/* Pro coverage note — quiet single-line beneath controls */
.scan-pro-coverage-line {
  font-size: 11px;
  color: #606880;
  font-style: italic;
  margin-top: 8px;
  padding: 0 2px;
  line-height: 1.5;
}

/* Error / status lines */
.scan-page .msg-error {
  color: #e05a5a;
  font-size: 12px;
}

/* ── Company Analysis Panel — single-asset simulator mode ────────────────── */

/* Company modal uses same .sim-modal base; differentiated by --company modifier */
.sim-modal--company .sim-ws-left {
  /* Slightly narrower left column for single-asset view — more reading space */
  width: 38%;
  min-width: 280px;
}

.sim-modal--company .sim-ws-right {
  flex: 1;
}

/* Identity block in company header */
.sim-co-identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sim-co-ticker-large {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e8eaf0;
}

.sim-co-name {
  font-size: 13px;
  color: #8b92a5;
  font-weight: 400;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-co-meta {
  font-size: 11px;
  color: #606880;
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

/* Generic body container for company panel sections */
.sim-co-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Company profile note — subdued text beneath business structure fields */
.sim-co-profile-note {
  font-size: 11px;
  color: #606880;
  line-height: 1.55;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #1a1f2e;
  font-style: italic;
}

/* Sub-note under a data row value */
.sim-data-interp {
  font-size: 11px;
  color: #606880;
  padding-left: 0;
  margin-top: 1px;
  line-height: 1.45;
}

/* Muted placeholder value */
.sim-data-val--muted {
  color: #606880;
  font-style: italic;
}

/* Structural risk block — one block per identified risk */
.sim-co-risk-block {
  border-left: 2px solid #2a3050;
  padding-left: 10px;
  margin-bottom: 10px;
}

.sim-co-risk-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b92a5;
  margin-bottom: 4px;
}

/* Improvement path item — numbered line */
.sim-co-path-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #1a1f2e;
}

.sim-co-path-item:last-child {
  border-bottom: none;
}

.sim-co-path-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #3ecf8e;
  min-width: 14px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sim-workspace { width: 98vw; height: 96vh; border-radius: 6px; }
  .sim-ws-body   { flex-direction: column; }
  .sim-ws-left   { width: 100%; border-right: none; border-bottom: 1px solid #1a1f2e; max-height: 40vh; }
  .sim-modal--company .sim-ws-left { width: 100%; min-width: unset; }
}


/* ── Ask Alex panel (Phase 3 bounded surfaces) ───────────────────────────── */

.alex-ask-section {
  padding: 0;
}

.alex-ask-header {
  margin-bottom: 10px;
}

.alex-ask-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.alex-ask-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

/* Suggested prompt chips */
.alex-ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.alex-ask-chip {
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.12s, background 0.12s;
  font-family: var(--font);
  line-height: 1.4;
}

.alex-ask-chip:hover:not(:disabled) {
  border-color: var(--accent);
  background: #eff6ff;
}

.alex-ask-chip:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

/* Input row */
.alex-ask-input-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.alex-ask-textarea {
  flex: 1;
  min-height: 60px;
  max-height: 120px;
  font-size: 13px;
  line-height: 1.5;
  padding: 7px 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  font-family: var(--font);
}

.alex-ask-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.alex-ask-textarea:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

.alex-ask-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  margin-bottom: 0;
  letter-spacing: 0.03em;
}

.alex-ask-btn:hover:not(:disabled) {
  background: #1e40af;
}

.alex-ask-btn:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

/* Disabled state notice */
.alex-ask-disabled-notice {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 8px;
}

/* Response card */
.alex-ask-response {
  border-left: 3px solid var(--accent);
  background: var(--bg);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  display: none;
}

.alex-ask-response.visible {
  display: block;
}

.alex-ask-response-mode {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.alex-ask-response-mode--speak    { color: var(--ok); }
.alex-ask-response-mode--silent   { color: var(--muted); }
.alex-ask-response-mode--constrained { color: var(--warn); }
.alex-ask-response-mode--redirect { color: var(--muted); }

.alex-ask-response-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin-bottom: 8px;
}

.alex-ask-response-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-lt);
}

.alex-ask-response-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.alex-ask-response-section-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
}

/* Loading state inside response card */
.alex-ask-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* Dev-only trace panel */
.alex-ask-trace {
  margin-top: 10px;
  font-size: 11px;
  border: 1px solid var(--border-lt);
  background: #f9f9f9;
}

.alex-ask-trace-toggle {
  width: 100%;
  text-align: left;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

.alex-ask-trace-toggle:hover {
  background: #efefef;
}

.alex-ask-trace-inner {
  display: none;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.alex-ask-trace-inner.open {
  display: block;
}

/* ── Phase 4 — Analyst feedback row ────────────────────────────────────────── */

.alex-ask-feedback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.alex-ask-feedback-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-right: 4px;
}

.alex-ask-feedback-btn {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.alex-ask-feedback-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text);
  background: var(--surface);
}

.alex-ask-feedback-btn:disabled {
  cursor: default;
}

/* ── Phase 4 — Dev trace absent notice ─────────────────────────────────────── */

.alex-ask-trace-disabled {
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
  opacity: 0.6;
}

/* ── Task 3 — Standalone company search block ───────────────────────────── */

.scan-company-search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.scan-company-search-label-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.scan-company-search-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.scan-company-search-sub {
  font-size: 12px;
  color: var(--muted);
}

.scan-company-search-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.scan-company-search-input {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
}

.scan-company-search-btn {
  white-space: nowrap;
}

.scan-company-search-error {
  width: 100%;
  font-size: 12px;
  color: var(--err);
  margin-top: 4px;
  padding: 4px 0;
}

/* ── Task 4 — On-demand score button in positions table ─────────────────── */

.sim-score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.sim-score-ondemand-btn {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.sim-score-ondemand-btn:hover {
  background: var(--accent);
  color: #fff;
}

.sim-score-ondemand-btn:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: var(--border);
  color: var(--muted);
  background: transparent;
}

/* ── Watchlist ─────────────────────────────────────────────────────────────── */

/* Watchlist button in simulator toolbar */
.sim-watchlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #2a3050;
  border-radius: 4px;
  color: #6b7699;
  font-size: 11px;
  font-family: var(--mono, monospace);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  position: relative;
}
.sim-watchlist-btn:hover { border-color: #4c7cff; color: #c8cfdf; }

/* Score-change badge on watchlist button */
.sim-watchlist-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #e05a5a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  line-height: 16px;
  text-align: center;
}

/* Watch button in company panel header */
.sim-co-watch-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #2a3050;
  border-radius: 4px;
  color: #6b7699;
  font-size: 11px;
  font-family: var(--mono, monospace);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.sim-co-watch-btn:hover { border-color: #c49a00; color: #e6c060; }
.sim-co-watch-btn--active { border-color: #c49a00; color: #e6c060; }

/* Watch button in scanner rows */
.scan-watch-btn {
  padding: 3px 8px;
  background: transparent;
  border: 1px solid #2a3050;
  border-radius: 3px;
  color: #4a5268;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.scan-watch-btn:hover { color: #c49a00; border-color: #c49a00; }
.scan-watch-btn--active { color: #c49a00; border-color: #c49a00; }

/* Watchlist modal — same base as other sim modals */
.sim-modal--watchlist .wl-card {
  max-width: 860px;
}

/* Watchlist body */
.wl-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.wl-empty,
.wl-error {
  padding: 32px 0;
  color: #4a5268;
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}
.wl-error { color: #e05a5a; }

/* Individual watchlist row */
.wl-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #151926;
}
.wl-row:last-child { border-bottom: none; }

.wl-row-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
.wl-ticker {
  font-size: 13px;
  font-weight: 700;
  color: #c8cfdf;
  font-family: var(--mono, monospace);
  letter-spacing: 0.05em;
}
.wl-name {
  font-size: 10px;
  color: #4a5268;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Score chips */
.wl-row-scores {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wl-score-chip {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-family: var(--mono, monospace);
  font-size: 11px;
}
.wl-score-label { color: #4a5268; }
.wl-score-val { font-weight: 600; }
.wl-score-val--good  { color: #3ecf8e; }
.wl-score-val--mid   { color: #c49a00; }
.wl-score-val--warn  { color: #e05a5a; }
.wl-score-val--empty { color: #2a3050; }

/* Score change indicator */
.wl-change {
  font-size: 11px;
  font-family: var(--mono, monospace);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
}
.wl-change--up   { color: #3ecf8e; background: rgba(62,207,142,0.08); }
.wl-change--down { color: #e05a5a; background: rgba(224,90,90,0.08); }

/* Sparkline */
.wl-sparkline-wrap {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wl-sparkline { display: block; }
.wl-sparkline-empty {
  color: #252a3a;
  font-size: 13px;
  text-align: center;
}

/* Row action buttons */
.wl-row-actions {
  display: flex;
  gap: 6px;
}
.wl-analyze-btn,
.wl-remove-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--mono, monospace);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.wl-analyze-btn {
  background: transparent;
  border: 1px solid #4c7cff;
  color: #4c7cff;
}
.wl-analyze-btn:hover { background: #4c7cff; color: #fff; }
.wl-remove-btn {
  background: transparent;
  border: 1px solid #2a3050;
  color: #4a5268;
}
.wl-remove-btn:hover { border-color: #e05a5a; color: #e05a5a; }
.wl-remove-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Seasonality ──────────────────────────────────────────────────────────── */

.season-summary {
  font-size: 11px;
  color: #8892a8;
  font-family: var(--mono, monospace);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #0e1118;
  border-left: 2px solid #2a3050;
  border-radius: 0 3px 3px 0;
  line-height: 1.5;
}

/* 12-month grid — 4 columns × 3 rows */
.season-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.season-month-cell {
  border-radius: 4px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid transparent;
  cursor: default;
  transition: filter 0.15s;
  background: #0d1017;
  min-width: 80px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.season-month-cell:hover { filter: brightness(1.2); }
.season-month-cell--current {
  border-color: #4c7cff !important;
  box-shadow: 0 0 0 1px #4c7cff44;
}
.season-month-cell--best   { border-color: #3ecf8e88; }
.season-month-cell--empty  { opacity: 0.3; }

.season-month-name {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono, monospace);
  color: #6b7699;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.season-return {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  letter-spacing: 0.03em;
}
.season-return--pos { color: #3ecf8e; }
.season-return--neg { color: #e05a5a; }

.season-winrate {
  font-size: 12px;
  color: #4a5268;
  opacity: 0.8;
  margin-top: 3px;
  font-family: var(--mono, monospace);
}

/* Q1–Q4 summary row */
.season-quarter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.season-quarter-cell {
  border-radius: 4px;
  padding: 12px 8px 10px;
  text-align: center;
  border: 1px solid transparent;
  background: #0d1017;
  cursor: default;
  min-width: 120px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.season-quarter-cell--current { border-color: #4c7cff !important; }
.season-quarter-cell--best    { border-color: #3ecf8e88; }
.season-quarter-cell .season-return { font-size: 22px; }

.season-q-label {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  color: #8892a8;
  margin-bottom: 4px;
}
.season-q-sub {
  font-size: 13px;
  color: #4a5268;
  margin-top: 4px;
  font-family: var(--mono, monospace);
}
.season-quarter-cell .season-winrate { font-size: 13px; opacity: 1; }

/* Legend */
.season-legend {
  font-size: 10px;
  color: #353d52;
  margin-top: 4px;
  font-family: var(--mono, monospace);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.season-legend-pos { color: #3ecf8e88; font-size: 13px; }
.season-legend-neg { color: #e05a5a88; font-size: 13px; }
.season-legend-note { color: #4c7cff; margin-left: 6px; }

/* ── scan.js Seasonality button ─────────────────────────────────────────── */
.scan-season-btn {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #7c5cfc55;
  background: transparent;
  color: #a48af0;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.scan-season-btn:hover { color: #c4aeff; border-color: #a48af0; }

/* ── Seasonality standalone modal panel ─────────────────────────────────── */
.season-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 9500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
  overflow-y: auto;
}
.season-card {
  background: #13151a;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  width: min(96vw, 860px);
  padding: 0 0 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  margin-bottom: 40px;
}
.season-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 10px;
  border-bottom: 1px solid #1e2030;
}
.season-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #e2e4f0;
  text-transform: uppercase;
}
.season-close-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.season-close-btn:hover { color: #e2e4f0; }
.season-subheader {
  font-size: 12px;
  color: #6b7280;
  padding: 6px 24px 0;
}
.season-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  color: #6b7280;
  font-size: 13px;
}
.season-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #2a2d3a;
  border-top-color: #7c5cfc;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.season-content {
  padding: 20px 24px 0;
}
.season-summary-banner {
  font-size: 14px;
  color: #c0c4d6;
  background: #1a1d28;
  border-left: 3px solid #7c5cfc;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
  line-height: 1.6;
}
.season-layer {
  margin-bottom: 16px;
}
.season-panel-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.season-panel-section-sub {
  font-size: 11px;
  color: #4a5068;
  margin-bottom: 10px;
}
.season-error {
  padding: 24px 20px;
  border-radius: 8px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.18);
  margin: 16px 0;
}
.season-error-title {
  font-size: 13px;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 6px;
}
.season-error-text {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}
.season-divider {
  border: none;
  border-top: 1px solid #1e2030;
  margin: 20px 0;
}
.season-unavailable {
  font-size: 12px;
  color: #4a5068;
  padding: 8px 0;
}

/* Worst-month/quarter highlight */
.season-month-cell--worst { border-color: #e05a5a88 !important; }
.season-quarter-cell--worst { border-color: #e05a5a88 !important; }

/* ── Earnings drift timeline ─────────────────────────────────────────────── */
.season-drift-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 14px;
}
.season-drift-events { color: #4a5068; }
.season-drift-next   { color: #7c5cfc; font-weight: 600; }
.season-drift-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.season-drift-connector {
  flex: 1;
  height: 2px;
  background: #2a2d3a;
  min-width: 20px;
}
.season-drift-node {
  flex-shrink: 0;
  width: 88px;
  min-height: 72px;
  background: #1a1d28;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color .15s;
}
.season-drift-node--day {
  border-width: 2px;
  background: #1e1a2e;
}
.season-drift-node-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #6b7280;
  text-transform: uppercase;
}
.season-drift-return {
  font-size: 16px;
  font-weight: 700;
}
.season-drift-return--pos { color: #3ecf8e; }
.season-drift-return--neg { color: #e05a5a; }
.season-drift-wr {
  font-size: 11px;
  color: #6b7280;
}

/* ── Peer comparison ────────────────────────────────────────────────────── */
.season-peer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.season-peer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #a0a4b8;
  width: 48px;
  flex-shrink: 0;
  text-align: right;
}
.season-peer-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  flex: 1;
}
.season-peer-cell {
  border-radius: 4px;
  padding: 3px 2px;
  text-align: center;
  min-width: 0;
}
.season-peer-month {
  font-size: 8px;
  color: #4a5068;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.season-peer-ret--pos,
.season-peer-ret--neg {
  font-size: 9px;
  font-weight: 600;
}
.season-peer-ret--pos { color: #3ecf8e; }
.season-peer-ret--neg { color: #e05a5a; }

/* ══════════════════════════════════════════════════════════════════════════════
   MACRO REGIME ENGINE
   ══════════════════════════════════════════════════════════════════════════ */

/* Header "⬡ Macro" button */
.scan-macro-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #4c7cff55;
  background: rgba(76,124,255,.08);
  color: #7c9fff;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .03em;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.scan-macro-btn:hover {
  background: rgba(76,124,255,.18);
  border-color: #4c7cff99;
  color: #aabfff;
}

/* Overlay */
.macro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 9600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 36px;
  overflow-y: auto;
}

/* Card */
.macro-card {
  background: #13151a;
  border: 1px solid #2a2d3a;
  border-radius: 14px;
  width: min(96vw, 820px);
  padding: 0 0 36px;
  box-shadow: 0 28px 72px rgba(0,0,0,.65);
  margin-bottom: 40px;
}

/* Card header */
.macro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px 12px;
  border-bottom: 1px solid #1e2030;
}
.macro-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .10em;
  color: #e2e4f0;
  text-transform: uppercase;
}
.macro-close-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.macro-close-btn:hover { color: #e2e4f0; }
.macro-subheader {
  font-size: 11px;
  color: #4a5068;
  padding: 6px 26px 0;
  line-height: 1.5;
}

/* Loading state */
.macro-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 36px 26px;
  color: #6b7280;
  font-size: 13px;
}
.macro-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #2a2d3a;
  border-top-color: #4c7cff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* Content */
.macro-content {
  padding: 24px 26px 0;
}
.macro-divider {
  border: none;
  border-top: 1px solid #1e2030;
  margin: 22px 0;
}
.macro-section {
  margin-bottom: 4px;
}
.macro-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Regime badge */
.macro-regime-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.macro-regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 14px 24px;
  border-radius: 10px;
  border: 1px solid;
  text-transform: uppercase;
  align-self: flex-start;
}

/* Confidence bar */
.macro-conf-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.macro-conf-label {
  font-size: 13px;
  color: #8892a8;
  white-space: nowrap;
  min-width: 110px;
}
.macro-conf-bar-wrap {
  flex: 1;
  height: 8px;
  background: #1e2030;
  border-radius: 4px;
  overflow: hidden;
  max-width: 340px;
}
.macro-conf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* Timestamp */
.macro-timestamp {
  font-size: 11px;
  color: #3d4460;
}

/* Indicator grid */
.macro-indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.macro-indicator-card {
  background: #0d1017;
  border: 1px solid #1e2030;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .15s;
}
.macro-indicator-card--ok   { border-left: 3px solid #3ecf8e88; }
.macro-indicator-card--warn { border-left: 3px solid #ffb13c88; }
.macro-indicator-card--bad  { border-left: 3px solid #e05a5a88; }
.macro-indicator-card--neutral { border-left: 3px solid #2a2d3a; }

.macro-ind-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.macro-ind-label {
  font-size: 11px;
  font-weight: 600;
  color: #8892a8;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.macro-ind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.macro-ind-dot--ok      { background: #3ecf8e; }
.macro-ind-dot--warn    { background: #ffb13c; }
.macro-ind-dot--bad     { background: #e05a5a; }
.macro-ind-dot--neutral { background: #3d4460; }

.macro-ind-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  color: #e2e4f0;
  letter-spacing: -.01em;
}
.macro-ind-desc {
  font-size: 10px;
  color: #3d4460;
}

/* Extra raw values row (DXY level, Oil, Gold) */
.macro-extra-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 2px;
  margin-bottom: 4px;
  padding: 8px 12px;
  background: #0a0c10;
  border-radius: 6px;
  border: 1px solid #1e2030;
}
.macro-extra-item {
  font-size: 11px;
  color: #4a5068;
  font-family: var(--mono, monospace);
}

/* Regime prose */
.macro-prose {
  font-size: 14px;
  color: #c0c4d6;
  line-height: 1.7;
  margin: 0;
}

/* Portfolio alignment */
.macro-align-row {
  margin-bottom: 10px;
}
.macro-align-pct {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--mono, monospace);
}
.macro-align-label {
  font-size: 13px;
  color: #6b7280;
  margin-left: 6px;
}
.macro-align-detail {
  font-size: 12px;
  margin-top: 5px;
  padding: 6px 10px;
  border-radius: 5px;
}
.macro-align-detail--ok   { background: rgba(62,207,142,.08); color: #3ecf8e; }
.macro-align-detail--warn { background: rgba(224,90,90,.08);  color: #e05a5a; }

/* Macro: regime score breakdown chips */
.macro-score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.macro-score-chip {
  font-size: 10px;
  font-family: var(--mono, monospace);
  color: #4a5068;
  background: #0d1017;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.macro-score-chip--active {
  color: #c0c4d6;
  background: #1a1d28;
  font-weight: 700;
}

/* Macro: unemployment direction badge */
.macro-ind-direction {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

/* ── Seasonality insight banner (bottom of panel) ───────────────────────── */
.season-insight-wrap {
  margin-top: 4px;
}
.season-insight-banner {
  font-size: 14px;
  color: #c8ccdc;
  background: linear-gradient(135deg, #161929 0%, #1a1d2e 100%);
  border: 1px solid #2a2d4a;
  border-left: 3px solid #7c5cfc;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  line-height: 1.7;
  margin-top: 10px;
}

/* ── Pattern Divergence paragraph ─────────────────────────────────────── */

.season-divergence {
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 16px;
  border-radius: 0 7px 7px 0;
  border: 1px solid transparent;
  border-left-width: 3px;
  border-left-style: solid;
  margin-top: 10px;
}

.season-divergence--lagging {
  color: #f2b8b8;
  background: rgba(224, 90, 90, 0.07);
  border-color: rgba(224, 90, 90, 0.18);
  border-left-color: #e05a5a;
}

.season-divergence--leading {
  color: #b8f2d0;
  background: rgba(62, 207, 142, 0.07);
  border-color: rgba(62, 207, 142, 0.18);
  border-left-color: #3ecf8e;
}

.season-divergence--confirming {
  color: #b8c8f2;
  background: rgba(76, 124, 255, 0.06);
  border-color: rgba(76, 124, 255, 0.15);
  border-left-color: #4c7cff;
}

/* ── Near-term Windows section ──────────────────────────────────────────── */

.season-ntw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Banner base */
.season-ntw-banner {
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.season-ntw-banner--bull {
  background: linear-gradient(135deg, rgba(62,207,142,.08) 0%, rgba(62,207,142,.03) 100%);
  border-color: rgba(62,207,142,.28);
}
.season-ntw-banner--bear {
  background: linear-gradient(135deg, rgba(224,90,90,.08) 0%, rgba(224,90,90,.03) 100%);
  border-color: rgba(224,90,90,.28);
}
/* Glow for active windows */
.season-ntw-banner--active {
  box-shadow: 0 0 0 1px rgba(255,213,79,.25);
  border-color: rgba(255,213,79,.38) !important;
}

/* Top row */
.season-ntw-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

/* Signal badge */
.season-ntw-signal {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.season-ntw-signal--bull {
  background: rgba(62,207,142,.18);
  color: #3ecf8e;
  border: 1px solid rgba(62,207,142,.35);
}
.season-ntw-signal--bear {
  background: rgba(224,90,90,.18);
  color: #e05a5a;
  border: 1px solid rgba(224,90,90,.35);
}

/* Status chip */
.season-ntw-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
}
.season-ntw-status--active {
  background: rgba(255,213,79,.18);
  color: #ffd54f;
  border: 1px solid rgba(255,213,79,.35);
}
.season-ntw-status--upcoming {
  background: rgba(100,149,237,.15);
  color: #8ab4f8;
  border: 1px solid rgba(100,149,237,.28);
}
.season-ntw-status--recent {
  background: rgba(160,160,180,.12);
  color: #9e9eb8;
  border: 1px solid rgba(160,160,180,.22);
}

/* Date range */
.season-ntw-dates {
  font-size: 12px;
  color: #7a7d9a;
  font-family: var(--mono, monospace);
  margin-left: auto;
}

/* Middle row — big return number */
.season-ntw-mid {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.season-ntw-return {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  line-height: 1;
}
.season-ntw-return--pos { color: #3ecf8e; }
.season-ntw-return--neg { color: #e05a5a; }
.season-ntw-meta {
  font-size: 12px;
  color: #7a7d9a;
}

/* Yearly minibar timeline */
.season-ntw-timeline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
  padding: 4px 0 0;
}
.season-ntw-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}
.season-ntw-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 5px;
  transition: opacity .15s;
}
.season-ntw-bar--pos { background: rgba(62,207,142,.55); }
.season-ntw-bar--neg { background: rgba(224,90,90,.55); }
.season-ntw-bar-year {
  font-size: 9px;
  color: #5a5e78;
  text-align: center;
  white-space: nowrap;
}
.season-ntw-bar-val {
  font-size: 9px;
  font-family: var(--mono, monospace);
  text-align: center;
  white-space: nowrap;
}
.season-ntw-bar-val--pos { color: #3ecf8e; }
.season-ntw-bar-val--neg { color: #e05a5a; }

/* ── Portfolio Optimization section ─────────────────────────────────────── */

.sim-optim-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Loading state */
.sim-optim-loading {
  color: #606880;
  font-size: 12px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Section block */
.sim-optim-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sim-optim-sub {
  font-size: 11px;
  color: #505870;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* HRP weights bar chart */
.sim-optim-chart {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sim-optim-row {
  display: grid;
  grid-template-columns: 48px 1fr 100px;
  align-items: center;
  gap: 6px;
}
.sim-optim-ticker {
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: #cfd3dc;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-optim-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sim-optim-bar-wrap {
  height: 7px;
  background: #1a1e30;
  border-radius: 3px;
  overflow: hidden;
}
.sim-optim-bar-cur {
  height: 100%;
  background: rgba(76,124,255,.5);
  border-radius: 3px;
  transition: width .4s ease;
}
.sim-optim-bar-hrp {
  height: 100%;
  background: rgba(62,207,142,.6);
  border-radius: 3px;
  transition: width .4s ease;
}
.sim-optim-vals {
  font-family: var(--mono, monospace);
  font-size: 10px;
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}
.sim-optim-cur   { color: #4c7cff; }
.sim-optim-hrp   { color: #3ecf8e; }
.sim-optim-delta { font-size: 10px; margin-left: 2px; }
.sim-optim-delta--pos  { color: #3ecf8e; }
.sim-optim-delta--neg  { color: #e05a5a; }
.sim-optim-delta--flat { color: #606880; }

/* Legend dots */
.sim-optim-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: #606880;
}
.sim-optim-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}
.sim-optim-dot--cur      { background: rgba(76,124,255,.7); }
.sim-optim-dot--hrp      { background: rgba(62,207,142,.7); }
.sim-optim-dot--cloud    { background: rgba(148,163,184,.35); }
.sim-optim-dot--current  { background: #4c7cff; }
.sim-optim-dot--maxsharpe{ background: #f59e0b; }
.sim-optim-dot--minvol   { background: #3ecf8e; }

/* Apply HRP Weights button */
.sim-optim-apply-btn {
  align-self: flex-start;
  background: #162a14;
  border: 1px solid #2e5a2a;
  color: #3ecf8e;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 7px 16px;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: background .15s, border-color .15s;
  margin-top: 2px;
}
.sim-optim-apply-btn:hover:not(:disabled) { background: #1e3d1b; border-color: #3ecf8e; }
.sim-optim-apply-btn:disabled { opacity: .35; cursor: default; }

/* Efficient Frontier canvas wrapper + canvas */
.sim-ef-wrap {
  width: 100%;
  max-height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}
.sim-optim-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 280px;
  border-radius: 4px;
  background: #0c0f1c;
}
.sim-optim-axis-row {
  text-align: center;
  margin-top: 4px;
}
.sim-optim-axis-label {
  font-size: 10px;
  color: #3a3f5a;
  font-family: var(--mono, monospace);
}

/* Summary comparison grid */
.sim-optim-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sim-optim-summary-cell {
  background: #0f1220;
  border: 1px solid #1e2235;
  border-radius: 6px;
  padding: 10px 12px;
}
.sim-optim-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6b7390;
  font-family: var(--mono, monospace);
  margin-bottom: 5px;
}
.sim-optim-summary-val {
  font-family: var(--mono, monospace);
  font-size: 18px;
  font-weight: 700;
  color: #cfd3dc;
}
.sim-optim-summary-val--pos { color: #3ecf8e; }
.sim-optim-summary-note {
  font-size: 10px;
  color: #505870;
  margin-top: 3px;
}

/* Warning text */
.sim-optim-warn {
  font-size: 11px;
  color: #a16207;
  background: rgba(161,98,7,.08);
  border-left: 3px solid #a16207;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Company vs Company Comparison Panel
══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay + Card ─────────────────────────────────────────────────────── */

.cmp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px;
  overflow-y: auto;
}

.cmp-card {
  background: #0d1020;
  border: 1px solid #1e2235;
  border-radius: 10px;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #1a1f2e;
  flex-shrink: 0;
}

.cmp-title {
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6b7390;
}

.cmp-close {
  background: none;
  border: none;
  color: #3a4055;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color .15s;
}
.cmp-close:hover { color: #cfd3dc; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.cmp-body {
  flex: 1;
  overflow-y: auto;
}

/* ── Input Phase ─────────────────────────────────────────────────────────── */

.cmp-input-wrap {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.cmp-input-sub {
  font-size: 14px;
  color: #6b7390;
  line-height: 1.6;
}

.cmp-input-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.cmp-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmp-input-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #505870;
  font-family: var(--mono, monospace);
}

.cmp-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: #0a0d18;
  border: 1px solid #1e2235;
  border-radius: 6px;
  color: #e8eaf0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color .15s;
}
.cmp-input::placeholder { color: #3a4055; font-weight: 400; }
.cmp-input:focus { border-color: #4c7cff; }

/* Positioned wrapper so autocomplete dropdown anchors correctly */
.cmp-input-ticker-wrap {
  position: relative;
  width: 100%;
}

.cmp-vs-divider {
  font-size: 13px;
  font-weight: 700;
  color: #3a4055;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.cmp-input-err {
  font-size: 12px;
  color: #e05a5a;
}

.cmp-run-btn {
  height: 42px;
  padding: 0 28px;
  background: #4c7cff;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: background .15s;
  flex-shrink: 0;
  align-self: flex-end;
}
.cmp-run-btn:hover { background: #3a6ae8; }

/* ── Loading ─────────────────────────────────────────────────────────────── */

.cmp-loading {
  padding: 60px 32px;
  text-align: center;
  font-size: 14px;
  color: #6b7390;
  line-height: 1.8;
}

.cmp-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #1e2235;
  border-top-color: #4c7cff;
  border-radius: 50%;
  animation: cmp-spin .7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes cmp-spin { to { transform: rotate(360deg); } }

.cmp-error {
  padding: 40px 32px;
  text-align: center;
  color: #e05a5a;
  font-size: 14px;
  line-height: 1.7;
}

/* ── Top action bar ───────────────────────────────────────────────────────── */

.cmp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #1a1f2e;
  flex-shrink: 0;
}

.cmp-compare-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #e8eaf0;
  font-family: var(--mono, monospace);
}

.cmp-topbar-btns { display: flex; gap: 8px; }

.cmp-change-btn {
  background: #141720;
  border: 1px solid #1e2235;
  color: #8b93aa;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: all .14s;
}
.cmp-change-btn:hover { border-color: #4c7cff; color: #7a9fff; }

/* ── Aligned comparison table ────────────────────────────────────────────── */

.cmp-table {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #1a1f2e;
}

/* Identity header row — ticker | vs | ticker */
.cmp-identity-row {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #1a1f2e;
}

.cmp-ident-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmp-ident-cell--left  { text-align: right;  align-items: flex-end; }
.cmp-ident-cell--right { text-align: left;   align-items: flex-start; }

.cmp-ident-center {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #3a4055;
  letter-spacing: .08em;
}

/* Identity text shared classes */
.cmp-col-ticker {
  font-family: var(--mono, monospace);
  font-size: 20px;
  font-weight: 700;
  color: #e8eaf0;
  letter-spacing: -.01em;
}

.cmp-col-name {
  font-size: 12px;
  color: #8b93aa;
}

.cmp-col-sector {
  font-size: 10px;
  color: #505870;
  font-family: var(--mono, monospace);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Section header — spans the full table width */
.cmp-section-hdr {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #3a4055;
  font-family: var(--mono, monospace);
  padding: 14px 24px 5px;
  border-bottom: 1px solid #141720;
}

.cmp-section-hdr--verdict {
  color: #6b7390;
  font-size: 10px;
}

/* ── Metric row: left-value | label | right-value ─────────────────────────── */

.cmp-row {
  display: grid;
  grid-template-columns: 1fr 148px 1fr;
  align-items: center;
  padding: 5px 24px;
  border-bottom: 1px solid rgba(20,23,32,.6);
  min-height: 36px;
}

.cmp-row-left {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding-right: 12px;
}

.cmp-row-lbl {
  font-size: 11px;
  color: #6b7390;
  text-align: center;
  padding: 0 4px;
  line-height: 1.3;
  white-space: nowrap;
}

.cmp-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding-left: 12px;
}

/* Value text */
.cmp-row-val {
  font-family: var(--mono, monospace);
  font-size: 13px;
  font-weight: 600;
  color: #c8ccdc;
}
.cmp-row-val--win  { color: #3ecf8e; }
.cmp-row-val--warn { color: #f59e0b; }
.cmp-row-val--ok   { color: #3ecf8e; }

/* Winner badge under value */
.cmp-row-badge {
  font-size: 9px;
  font-weight: 700;
  color: #3ecf8e;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Score bar under value */
.cmp-row-bar {
  width: 72px;
  height: 3px;
  background: #1a1e2e;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.cmp-row-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

/* Unavailable / season note rows */
.cmp-unavail-row {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmp-unavailable {
  font-size: 13px;
  color: #e05a5a;
}

.cmp-season-note-row {
  padding: 10px 24px;
}
.cmp-season-note {
  font-size: 12px;
  color: #3a4055;
  font-style: italic;
}

/* ── Verdict bar ─────────────────────────────────────────────────────────── */

.cmp-verdict {
  padding: 20px 24px 28px;
}

.cmp-verdict-scores {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cmp-verdict-card {
  background: #0f1220;
  border: 1px solid #1e2235;
  border-radius: 7px;
  padding: 12px 20px;
  text-align: center;
  flex: 1;
  min-width: 120px;
}
.cmp-verdict-card--lead {
  border-color: #3ecf8e;
  background: rgba(62,207,142,.05);
}

.cmp-verdict-ticker {
  font-family: var(--mono, monospace);
  font-size: 15px;
  font-weight: 700;
  color: #e8eaf0;
  margin-bottom: 4px;
}

.cmp-verdict-wins { font-size: 12px; color: #6b7390; }
.cmp-verdict-card--lead .cmp-verdict-wins { color: #3ecf8e; }

.cmp-verdict-vs {
  font-size: 13px;
  font-weight: 700;
  color: #3a4055;
  flex-shrink: 0;
}

.cmp-verdict-narr {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cmp-verdict-line {
  font-size: 13px;
  color: #8b93aa;
  line-height: 1.65;
  padding-left: 10px;
  border-left: 2px solid #1e2235;
}

/* ── Scanner vs button ───────────────────────────────────────────────────── */

.scan-vs-btn {
  background: #0f1425;
  border: 1px solid #2a2f4a;
  border-radius: 4px;
  color: #7a9fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 4px 8px;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: all .14s;
}
.scan-vs-btn:hover { background: #141c38; border-color: #4c7cff; }

/* ── Institutional Report button ─────────────────────────────────────────── */

/* ── Ask Alex button (scanner row) ──────────────────────────────────────── */

.scan-alex-btn {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 4px;
  color: #34d399;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .14s;
}
.scan-alex-btn:hover { background: rgba(16,185,129,.18); border-color: #10B981; }

.scan-report-btn {
  background: transparent;
  border: 1px solid rgba(16,185,129,.35);
  border-radius: 4px;
  color: #34d399;
  cursor: pointer;
  font-size: 11px;
  padding: 4px 8px;
  font-family: var(--mono, monospace);
  transition: all .14s;
}
.scan-report-btn:hover { background: rgba(16,185,129,.08); border-color: #10B981; }

/* ── Simulator compare button ────────────────────────────────────────────── */

.sim-compare-btn {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  background: #0d1428;
  border: 1px solid #2a3050;
  border-radius: 4px;
  color: #7a9fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  font-family: var(--mono, monospace);
  transition: all .14s;
}
.sim-compare-btn:hover { background: #111d40; border-color: #4c7cff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .cmp-cols { grid-template-columns: 1fr; }
  .cmp-col:first-child { border-right: none; border-bottom: 1px solid #1a1f2e; }
  .cmp-input-row { flex-direction: column; }
  .cmp-compare-title { font-size: 14px; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   Sector Rotation Panel (.sec-*)
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Overlay + panel ─────────────────────────────────────────────────────── */

.sec-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.sec-panel {
  background: #0b0f1a;
  border: 1px solid #1a2035;
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.sec-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid #1a2035;
  position: relative;
}

.sec-title {
  font-size: 16px;
  font-weight: 700;
  color: #e8eaf2;
  letter-spacing: 0.02em;
  flex: 1 1 100%;
}

.sec-subtitle {
  font-size: 12px;
  color: #5a6080;
  flex: 1 1 100%;
  margin-top: 2px;
}

.sec-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #5a6080;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.14s;
}
.sec-close:hover { color: #e8eaf2; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.sec-body {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.sec-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 0;
}

.sec-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #1a2035;
  border-top-color: #4c7cff;
  border-radius: 50%;
  animation: sec-spin 0.8s linear infinite;
}

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

.sec-loading-text {
  font-size: 13px;
  color: #5a6080;
}

/* ── Error ───────────────────────────────────────────────────────────────── */

.sec-error {
  background: rgba(224, 90, 90, 0.08);
  border: 1px solid rgba(224, 90, 90, 0.25);
  border-radius: 8px;
  padding: 20px 24px;
}

.sec-error-title {
  font-size: 14px;
  font-weight: 600;
  color: #e05a5a;
  margin-bottom: 8px;
}

.sec-error-msg {
  font-size: 12px;
  color: #a07070;
}

/* ── Regime banner ───────────────────────────────────────────────────────── */

.sec-regime-banner {
  border: 1px solid;
  border-radius: 8px;
  padding: 16px 20px;
}

.sec-regime-badge-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.sec-regime-badge {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sec-confidence-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sec-confidence-label {
  font-size: 11px;
  color: #5a6080;
  white-space: nowrap;
}

.sec-confidence-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  min-width: 80px;
}

.sec-confidence-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Scan data callout ───────────────────────────────────────────────────── */

.sec-scan-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  background: rgba(255,177,60,.06);
  border: 1px solid rgba(255,177,60,.22);
  border-radius: 7px;
  font-size: 12px;
  color: #a08050;
}

.sec-scan-callout--live {
  background: rgba(62,207,142,.06);
  border-color: rgba(62,207,142,.22);
  color: #4a9070;
}

.sec-scan-callout-icon {
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
  color: #ffb13c;
}

.sec-scan-callout--live .sec-scan-callout-icon {
  color: #3ecf8e;
}

.sec-scan-callout-text {
  line-height: 1.55;
}

/* ── No-scan banner ──────────────────────────────────────────────────────── */

.sec-noscan-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255,177,60,.07);
  border: 1px solid rgba(255,177,60,.30);
  border-radius: 8px;
}

.sec-noscan-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  color: #ffb13c;
  padding-top: 2px;
}

.sec-noscan-body {
  flex: 1;
  min-width: 0;
}

.sec-noscan-title {
  font-size: 13px;
  font-weight: 700;
  color: #e0a040;
  margin-bottom: 4px;
}

.sec-noscan-text {
  font-size: 12px;
  color: #a08050;
  line-height: 1.55;
}

.sec-noscan-btn {
  flex-shrink: 0;
  align-self: center;
  background: rgba(255,177,60,.12);
  border: 1px solid rgba(255,177,60,.35);
  color: #ffb13c;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s;
}
.sec-noscan-btn:hover { background: rgba(255,177,60,.24); }

/* ── Signal legend ───────────────────────────────────────────────────────── */

.sec-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid #1a2035;
  border-radius: 6px;
}

.sec-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.sec-legend-label {
  font-size: 11px;
  color: #8a90a8;
  letter-spacing: 0.05em;
  font-weight: 600;
  text-transform: uppercase;
}

/* ── Sector grid ─────────────────────────────────────────────────────────── */

.sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.sec-card {
  border-left: 3px solid;
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.14s, transform 0.14s, box-shadow 0.14s;
  cursor: pointer;
}

.sec-card:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

.sec-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sec-card-name {
  font-size: 12px;
  font-weight: 600;
  color: #c8cde0;
  line-height: 1.3;
}

.sec-card-signal {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 2px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Signal bar ──────────────────────────────────────────────────────────── */

.sec-card-bar-wrap {
  width: 100%;
}

.sec-card-bar-track {
  height: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
}

.sec-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Stats row ───────────────────────────────────────────────────────────── */

.sec-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.sec-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sec-stat-label {
  font-size: 9px;
  color: #4a5060;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

.sec-stat-value {
  font-size: 11px;
  color: #8a90a8;
  font-family: var(--mono, monospace);
  font-weight: 600;
}

/* ── Methodology ─────────────────────────────────────────────────────────── */

.sec-methodology {
  border-top: 1px solid #12172a;
  padding-top: 16px;
}

.sec-methodology-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #4a5060;
  margin-bottom: 6px;
}

.sec-methodology-text {
  font-size: 11px;
  color: #3a4060;
  line-height: 1.6;
}

/* ── Header button ───────────────────────────────────────────────────────── */

.scan-sectors-btn {
  background: rgba(255,177,60,.06);
  border: 1px solid rgba(255,177,60,.25);
  color: #ffb13c;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
  white-space: nowrap;
}
.scan-sectors-btn:hover {
  background: rgba(255,177,60,.14);
  border-color: rgba(255,177,60,.50);
}

/* ── Click hint ──────────────────────────────────────────────────────────── */

.sec-click-hint {
  font-size: 11px;
  color: #3a4060;
  margin: 2px 0 4px;
  font-style: italic;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Sector Deep-Dive (.sec-deep-*)
   ───────────────────────────────────────────────────────────────────────────── */

.sec-deep-back {
  background: none;
  border: 1px solid #1e2640;
  color: #5a6080;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.14s, color 0.14s;
}
.sec-deep-back:hover {
  border-color: #4c7cff;
  color: #4c7cff;
}

.sec-deep-header {
  margin-bottom: 22px;
}

.sec-deep-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.sec-deep-name {
  font-size: 18px;
  font-weight: 700;
  color: #e8ecf8;
}

.sec-deep-signal-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 4px;
  padding: 3px 8px;
}

.sec-deep-ctx-line {
  font-size: 12px;
  color: #5a6080;
  margin: 0 0 6px;
}

.sec-deep-signal-val {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono, monospace);
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.sec-deep-section {
  background: rgba(255,255,255,.02);
  border: 1px solid #12172a;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.sec-deep-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a5060;
  margin-bottom: 4px;
}

.sec-deep-section-sub {
  font-size: 11px;
  color: #3a4060;
  margin: 0 0 12px;
}

.sec-deep-empty {
  font-size: 12px;
  color: #3a4060;
  line-height: 1.6;
}

/* ── Deep-dive empty state ───────────────────────────────────────────────── */

.sec-deep-empty-wrap {
  padding: 18px 16px;
  background: rgba(255,177,60,.05);
  border: 1px solid rgba(255,177,60,.18);
  border-radius: 6px;
}

.sec-deep-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: #c89040;
  margin-bottom: 6px;
}

.sec-deep-empty-sub {
  font-size: 12px;
  color: #8a7040;
  margin-bottom: 14px;
  line-height: 1.5;
}

.sec-deep-empty-btns {
  display: flex;
  gap: 8px;
}

/* ── Company list (Section 1) ────────────────────────────────────────────── */

.sec-deep-company-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sec-deep-company-row {
  display: grid;
  grid-template-columns: 22px 1fr 52px 80px auto;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.03);
  border-radius: 5px;
  padding: 8px 10px;
  min-height: 46px;
}

.sec-deep-rank {
  font-size: 10px;
  color: #3a4060;
  font-family: var(--mono, monospace);
  text-align: right;
}

.sec-deep-company-info {
  min-width: 0;
}

.sec-deep-ticker {
  font-size: 12px;
  font-weight: 700;
  color: #c8cde0;
  font-family: var(--mono, monospace);
}

.sec-deep-company-name {
  font-size: 10px;
  color: #4a5060;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sec-deep-score {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  text-align: center;
}

.sec-deep-qbadge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  padding: 2px 5px;
  white-space: nowrap;
  font-family: var(--mono, monospace);
}
.sec-deep-qbadge--pos  { color: #3ecf8e; background: rgba(62,207,142,.10); }
.sec-deep-qbadge--neg  { color: #e05a5a; background: rgba(224,90,90,.10);  }
.sec-deep-qbadge--none { color: #3a4060; background: rgba(255,255,255,.03); }

.sec-deep-btn-group {
  display: flex;
  gap: 4px;
}

.sec-deep-btn {
  background: rgba(76,124,255,.10);
  border: 1px solid rgba(76,124,255,.25);
  color: #4c7cff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.14s;
  white-space: nowrap;
}
.sec-deep-btn:hover { background: rgba(76,124,255,.22); }

.sec-deep-btn--ghost {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: #5a6080;
}
.sec-deep-btn--ghost:hover {
  background: rgba(255,255,255,.10);
  color: #c8cde0;
}

/* ── Seasonal leaders (Section 2) ────────────────────────────────────────── */

.sec-deep-leader-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sec-deep-leader-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,.02);
  border-radius: 4px;
}

.sec-deep-leader-rank {
  font-size: 10px;
  color: #3a4060;
  font-family: var(--mono, monospace);
}

.sec-deep-leader-vals {
  text-align: right;
}

.sec-deep-qval--pos  { font-size: 12px; font-weight: 700; color: #3ecf8e; font-family: var(--mono, monospace); }
.sec-deep-qval--neg  { font-size: 12px; font-weight: 700; color: #e05a5a; font-family: var(--mono, monospace); }

.sec-deep-qval-wr {
  font-size: 10px;
  color: #5a6080;
}

/* ── Q1-Q4 bars (Section 3) ──────────────────────────────────────────────── */

.sec-deep-qbars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.sec-deep-qbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sec-deep-qbar-label {
  font-size: 11px;
  font-weight: 700;
  color: #4a5060;
  text-align: center;
}

.sec-deep-qbar-label--current {
  color: #ffb13c;
}

.sec-deep-qbar-track {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}

.sec-deep-qbar-fill--pos {
  height: 100%;
  background: #3ecf8e;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.sec-deep-qbar-fill--neg {
  height: 100%;
  background: #e05a5a;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.sec-deep-qbar-val--pos  { font-size: 11px; font-weight: 700; color: #3ecf8e; font-family: var(--mono, monospace); text-align: center; }
.sec-deep-qbar-val--neg  { font-size: 11px; font-weight: 700; color: #e05a5a; font-family: var(--mono, monospace); text-align: center; }
.sec-deep-qbar-val--none { font-size: 11px; color: #3a4060; text-align: center; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .sec-grid { grid-template-columns: 1fr; }
  .sec-body { padding: 16px; }
  .sec-regime-badge-row { flex-direction: column; align-items: flex-start; }
  .sec-deep-company-row { grid-template-columns: 22px 1fr 40px; }
  .sec-deep-company-row .sec-deep-qbadge,
  .sec-deep-company-row .sec-deep-btn-group { display: none; }
  .sec-deep-qbars { grid-template-columns: repeat(2, 1fr); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   Earnings Tracker (.earn-*)
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Overlay + panel ─────────────────────────────────────────────────────── */

.earn-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 40px;
  overflow-y: auto;
}

.earn-panel {
  background: #0b0f1a;
  border: 1px solid #1a2035;
  border-radius: 10px;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.earn-header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid #1a2035;
  position: relative;
}

.earn-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #e8eaf2;
  font-family: var(--mono, monospace);
  margin-bottom: 3px;
}

.earn-subtitle {
  font-size: 11px;
  color: #4a5068;
}

.earn-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  color: #4a5068;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .14s;
}
.earn-close:hover { color: #e8eaf2; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.earn-body {
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.earn-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0;
}

.earn-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #1a2035;
  border-top-color: #4c7cff;
  border-radius: 50%;
  animation: earn-spin .8s linear infinite;
}

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

.earn-loading-text {
  font-size: 12px;
  color: #4a5068;
}

/* ── Error ───────────────────────────────────────────────────────────────── */

.earn-error {
  background: rgba(224,90,90,.07);
  border: 1px solid rgba(224,90,90,.22);
  border-radius: 8px;
  padding: 18px 22px;
}
.earn-error-title { font-size: 13px; font-weight: 600; color: #e05a5a; margin-bottom: 7px; }
.earn-error-msg   { font-size: 12px; color: #a07070; }

/* ── Summary ─────────────────────────────────────────────────────────────── */

.earn-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.earn-summary-count {
  font-size: 13px;
  font-weight: 600;
  color: #c8cde0;
}
.earn-summary-date {
  font-size: 12px;
  color: #4a5068;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */

.earn-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.earn-filter-btn {
  background: rgba(255,255,255,.04);
  border: 1px solid #1e2438;
  color: #6a7090;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  cursor: pointer;
  transition: all .13s;
}
.earn-filter-btn:hover { border-color: #4c7cff; color: #8aaeff; }
.earn-filter-btn--active {
  background: rgba(76,124,255,.12);
  border-color: rgba(76,124,255,.40);
  color: #7aaaff;
}

.earn-conviction-hint {
  font-size: 11px;
  color: #3ecf8e;
  margin-top: -4px;
}

/* ── Cards grid ──────────────────────────────────────────────────────────── */

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

/* ── Single card ─────────────────────────────────────────────────────────── */

.earn-card {
  border-left: 3px solid;
  border-radius: 7px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity .13s;
}
.earn-card:hover { opacity: .90; }

/* Top row */
.earn-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.earn-card-company { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.earn-card-ticker  { font-family: var(--mono,monospace); font-size: 16px; font-weight: 700; color: #e8eaf0; }
.earn-card-name    { font-size: 12px; color: #8090aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.earn-card-date-block { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.earn-card-date   { font-size: 13px; font-weight: 600; color: #c8cde0; font-family: var(--mono,monospace); }
.earn-card-days   { font-size: 11px; color: #6a7090; font-family: var(--mono,monospace); }
.earn-card-days--soon { color: #ffb13c; font-weight: 700; }

/* Meta row */
.earn-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.earn-card-sector {
  font-size: 10px;
  color: #4a5068;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-family: var(--mono,monospace);
}
.earn-card-score {
  font-size: 11px;
  color: #8090aa;
  display: flex;
  align-items: center;
  gap: 5px;
}
.earn-card-score-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Drift section ───────────────────────────────────────────────────────── */

.earn-drift {
  background: rgba(255,255,255,.025);
  border: 1px solid #141820;
  border-radius: 5px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.earn-drift-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #3a4055;
  font-family: var(--mono,monospace);
}

.earn-drift-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.earn-drift-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.earn-drift-val {
  font-family: var(--mono,monospace);
  font-size: 13px;
  font-weight: 700;
  color: #6a7090;
}
.earn-drift-val--pos { color: #3ecf8e; }
.earn-drift-val--neg { color: #e05a5a; }

.earn-drift-label {
  font-size: 9px;
  color: #3a4055;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.earn-drift-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.earn-drift-wr        { font-size: 11px; color: #6a7090; font-weight: 600; }
.earn-drift-wr--good  { color: #3ecf8e; }
.earn-drift-wr--bad   { color: #e05a5a; }
.earn-drift-events    { font-size: 10px; color: #3a4055; }

.earn-no-drift {
  font-size: 11px;
  color: #2e3448;
  font-style: italic;
  padding: 4px 0;
}

/* ── Structural context row ──────────────────────────────────────────────── */

.earn-card-ctx {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.earn-ctx-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 2px 6px;
}
.earn-ctx-desc {
  font-size: 11px;
  color: #4a5068;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */

.earn-card-btns {
  display: flex;
  gap: 8px;
}
.earn-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .13s;
  background: rgba(76,124,255,.12);
  border: 1px solid rgba(76,124,255,.30);
  color: #7aaaff;
  flex: 1;
}
.earn-btn:hover { background: rgba(76,124,255,.22); border-color: rgba(76,124,255,.55); }
.earn-btn--ghost {
  background: rgba(255,255,255,.04);
  border-color: #1e2438;
  color: #6a7090;
}
.earn-btn--ghost:hover { border-color: #3a4455; color: #8090aa; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.earn-empty {
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.earn-empty-title { font-size: 14px; font-weight: 600; color: #4a5068; }
.earn-empty-text  { font-size: 12px; color: #2e3448; max-width: 440px; line-height: 1.6; }

/* ── Prominent empty state (no scan yet) ─────────────────────────────────── */

.earn-empty--prominent {
  align-items: flex-start;
  text-align: left;
  padding: 24px 28px;
  background: rgba(100,130,255,.05);
  border: 1px solid rgba(100,130,255,.16);
  border-radius: 10px;
  margin-top: 8px;
}

.earn-empty--prominent .earn-empty-title {
  font-size: 16px;
  color: #7090e0;
  margin-bottom: 14px;
}

.earn-empty-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.earn-empty-step {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.earn-empty-step-num {
  font-size: 12px;
  font-weight: 700;
  color: #4c7cff;
  font-family: var(--mono, monospace);
  flex-shrink: 0;
  width: 16px;
}

.earn-empty-step-text {
  font-size: 13px;
  color: #8a90b8;
  line-height: 1.5;
}

.earn-empty-note {
  font-size: 11px;
  color: #3a4060;
  line-height: 1.6;
  margin-bottom: 18px;
  border-left: 2px solid #2a3050;
  padding-left: 10px;
}

.earn-empty-scan-btn {
  background: rgba(76,124,255,.12);
  border: 1px solid rgba(76,124,255,.30);
  color: #4c7cff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.14s;
}
.earn-empty-scan-btn:hover { background: rgba(76,124,255,.24); }

/* ── Methodology ─────────────────────────────────────────────────────────── */

.earn-methodology {
  border-top: 1px solid #0e1220;
  padding-top: 14px;
}
.earn-methodology-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #2e3448;
  margin-bottom: 5px;
}
.earn-methodology-text {
  font-size: 11px;
  color: #2e3448;
  line-height: 1.6;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */

.earn-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px 0;
  flex-shrink: 0;
}

.earn-search-input {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid #1a2340;
  border-radius: 6px;
  color: #c8cde0;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s;
}
.earn-search-input::placeholder { color: #3a4060; }
.earn-search-input:focus { border-color: #3b4f7a; }

.earn-search-btn {
  height: 34px;
  padding: 0 16px;
  background: #1a2d52;
  border: 1px solid #2a3f72;
  border-radius: 6px;
  color: #8aaae0;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.earn-search-btn:hover { background: #213468; color: #b0c8f0; }

.earn-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid #1a2340;
  border-radius: 50%;
  color: #3a4060;
  font-size: 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.earn-search-clear:hover { color: #8a90a8; border-color: #2a3040; }

/* ── Search result area ──────────────────────────────────────────────────── */

.earn-search-result-area {
  padding: 0 24px;
  flex-shrink: 0;
}
.earn-search-result-area:empty { display: none; }

.earn-search-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 4px;
}
.earn-search-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #1a2340;
  border-top-color: #3b6cc8;
  border-radius: 50%;
  animation: earn-spin .7s linear infinite;
  flex-shrink: 0;
}
.earn-search-loading-text {
  font-size: 12px;
  color: #3a4060;
}

.earn-search-empty {
  padding: 12px 0 4px;
  font-size: 12px;
  color: #3a4060;
}

.earn-search-error {
  padding: 10px 0 4px;
}
.earn-search-error-msg {
  font-size: 12px;
  color: #e05a5a;
}

/* ── Search result card wrapper ──────────────────────────────────────────── */

.earn-search-result-wrap {
  margin-top: 12px;
  margin-bottom: 4px;
}

.earn-search-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
}
.earn-search-badge--in {
  background: rgba(62,207,142,.10);
  color: #3ecf8e;
  border: 1px solid rgba(62,207,142,.25);
  border-bottom: none;
}
.earn-search-badge--out {
  background: rgba(224,90,90,.08);
  color: #e07070;
  border: 1px solid rgba(224,90,90,.20);
  border-bottom: none;
}

.earn-search-date-note {
  font-size: 11px;
  color: #4a5068;
  padding: 4px 0 6px;
}

/* ── Header button ───────────────────────────────────────────────────────── */

.scan-earnings-btn {
  background: rgba(62,207,142,.06);
  border: 1px solid rgba(62,207,142,.22);
  color: #3ecf8e;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  white-space: nowrap;
}
.scan-earnings-btn:hover {
  background: rgba(62,207,142,.13);
  border-color: rgba(62,207,142,.45);
}

.scan-ecal-btn {
  background: rgba(99,179,237,.07);
  border: 1px solid rgba(99,179,237,.25);
  color: #63b3ed;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  padding: 4px 11px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  white-space: nowrap;
}
.scan-ecal-btn:hover {
  background: rgba(99,179,237,.15);
  border-color: rgba(99,179,237,.48);
}

.scan-today-btn {
  background: linear-gradient(135deg, rgba(122,170,240,.10), rgba(62,207,142,.08));
  border: 1px solid rgba(122,170,240,.30);
  color: #a0c8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.scan-today-btn:hover {
  background: linear-gradient(135deg, rgba(122,170,240,.20), rgba(62,207,142,.14));
  border-color: rgba(122,170,240,.55);
  color: #c0d8ff;
}

/* ── Seasonal Opportunities nav button ───────────────────────────────────── */
.scan-seasonal-btn {
  background: linear-gradient(135deg, rgba(62,207,142,.10), rgba(62,207,142,.06));
  border: 1px solid rgba(62,207,142,.28);
  color: #5dd6a0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.scan-seasonal-btn:hover {
  background: linear-gradient(135deg, rgba(62,207,142,.20), rgba(62,207,142,.12));
  border-color: rgba(62,207,142,.55);
  color: #80e8b8;
}

/* ── Analyst Estimates section ───────────────────────────────────────────── */

.earn-est {
  border-top: 1px solid #0e1220;
  padding-top: 10px;
  margin-top: 10px;
}

.earn-est-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 8px;
}

.earn-est-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.earn-est-cell {
  background: rgba(255,255,255,.03);
  border: 1px solid #111827;
  border-radius: 5px;
  padding: 7px 6px 5px;
  text-align: center;
}

.earn-est-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono, monospace);
  color: #8a90a8;
  line-height: 1.2;
}
.earn-est-val--pos { color: #3ecf8e; }
.earn-est-val--neg { color: #e05a5a; }

.earn-est-label {
  font-size: 9px;
  color: #3a4055;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Earnings History table ───────────────────────────────────────────────── */

.earn-hist {
  border-top: 1px solid #0e1220;
  padding-top: 10px;
  margin-top: 10px;
}

.earn-hist-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 7px;
}

.earn-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.earn-hist-th {
  text-align: left;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #3a4055;
  padding: 3px 6px 5px;
  border-bottom: 1px solid #0e1220;
}

.earn-hist-row:hover { background: rgba(255,255,255,.02); }

.earn-hist-td {
  padding: 5px 6px;
  color: #6a708a;
  font-family: var(--mono, monospace);
  border-bottom: 1px solid #080d18;
  font-size: 11px;
}

.earn-hist-quarter {
  color: #4a5068;
  font-family: inherit;
  font-size: 11px;
}

.earn-hist-pos { color: #3ecf8e; }
.earn-hist-neg { color: #e05a5a; }

/* ── Peer Context ─────────────────────────────────────────────────────────── */

.earn-peer {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(76,124,255,.05);
  border: 1px solid rgba(76,124,255,.14);
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 10px;
}

.earn-peer-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.earn-peer-msg {
  font-size: 11px;
  color: #7090c0;
  line-height: 1.4;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 620px) {
  .earn-grid { grid-template-columns: 1fr; }
  .earn-body { padding: 14px; }
  .earn-drift-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .earn-est-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEASONAL OPPORTUNITIES PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header button ───────────────────────────────────────────────────────── */

.scan-opportunities-btn {
  background: rgba(167,139,250,.08);
  border: 1px solid rgba(167,139,250,.28);
  color: #a78bfa;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  white-space: nowrap;
}
.scan-opportunities-btn:hover {
  background: rgba(167,139,250,.16);
  border-color: rgba(167,139,250,.50);
}

/* ════════════════════════════════════════════════════════════════════════════
   ALEX TODAY PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.at-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.at-panel {
  background: #060c18;
  border-left: 1px solid #1a2340;
  width: min(620px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight .22s ease;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.at-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #0e1220;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(10,18,40,.9), rgba(6,12,24,.95));
}

.at-header-left { flex: 1; min-width: 0; }

.at-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #a0c8f0, #3ecf8e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.at-subtitle {
  font-size: 11px;
  color: #3a4060;
  margin: 0;
}

.at-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.at-refresh-btn {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid #1a2340;
  border-radius: 5px;
  color: #4a5068;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.at-refresh-btn:hover { color: #8a90a8; border-color: #2a3040; }

.at-close-btn {
  background: transparent;
  border: none;
  color: #3a4060;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color .15s;
}
.at-close-btn:hover { color: #8a90b8; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.at-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.at-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  gap: 14px;
}
.at-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid #1a2340;
  border-top-color: #7aaaf0;
  border-radius: 50%;
  animation: earn-spin .7s linear infinite;
}
.at-loading-text { font-size: 12px; color: #3a4055; margin: 0; }

/* ── Error ───────────────────────────────────────────────────────────────── */

.at-error {
  background: rgba(224,90,90,.07);
  border: 1px solid rgba(224,90,90,.20);
  border-radius: 8px;
  padding: 16px;
}
.at-error-title { font-size: 13px; font-weight: 600; color: #e05a5a; margin-bottom: 6px; }
.at-error-msg   { font-size: 12px; color: #5a3a3a; margin: 0; }

/* ── Macro Briefing (.at-mb-*) ───────────────────────────────────────────── */
.at-macro-briefing {
  margin: 0 0 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #3b82f6;
}
.at-mb-regime { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.at-mb-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.at-mb-risk-on     { background: rgba(34,197,94,0.15);   color: #4ade80; }
.at-mb-risk-off    { background: rgba(239,68,68,0.15);   color: #f87171; }
.at-mb-stagflation { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.at-mb-reflation   { background: rgba(122,170,240,0.15); color: #7aaaf0; }
.at-mb-contraction { background: rgba(160,90,200,0.15);  color: #c084fc; }
.at-mb-conf        { font-size: 11px; color: rgba(255,255,255,0.3); }
.at-mb-headline    { font-size: 14px; font-weight: 500; color: #e2e8f0; margin-bottom: 6px; }
.at-mb-impl        { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.6; }

/* ── Idea card: WHY TODAY / FAILS IF / Consensus ─────────────────────────── */
.at-idea-why { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.05); }
.at-idea-why-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: #3b82f6; margin-bottom: 4px;
}
.at-idea-why-text  { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.5; }
.at-idea-fails     { margin-top: 4px; }
.at-idea-fails-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: #f87171; margin-bottom: 4px; margin-top: 8px;
}
.at-idea-fails-text  { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.5; }
.at-idea-consensus   { font-size: 11px; color: #fbbf24; margin-top: 8px; }

/* ── Regime banner ───────────────────────────────────────────────────────── */

.at-regime-banner {
  border: 1px solid;
  border-radius: 10px;
  padding: 14px 18px;
}
.at-regime-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.at-regime-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.at-regime-conf {
  font-size: 11px;
  color: #4a5068;
  margin-left: auto;
}
.at-regime-desc {
  font-size: 12px;
  color: #5a6888;
  line-height: 1.5;
  margin: 0;
}

/* ── No scan notice ──────────────────────────────────────────────────────── */

.at-no-scan {
  background: rgba(255,255,255,.02);
  border: 1px dashed #1a2340;
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.at-no-scan-title { font-size: 13px; font-weight: 600; color: #5a6080; }
.at-no-scan-sub   { font-size: 11px; color: #3a4060; margin: 0; }
.at-no-scan-btn {
  align-self: flex-start;
  font-size: 11px;
  padding: 4px 14px;
  background: rgba(122,170,240,.10);
  border: 1px solid rgba(122,170,240,.28);
  border-radius: 5px;
  color: #7aaaf0;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.at-no-scan-btn:hover { background: rgba(122,170,240,.20); }

/* ── Section ─────────────────────────────────────────────────────────────── */

.at-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.at-section-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #2e3448;
  padding-bottom: 6px;
  border-bottom: 1px solid #0e1220;
}

/* ── Idea card ───────────────────────────────────────────────────────────── */

.at-idea-card {
  background: rgba(255,255,255,.025);
  border: 1px solid #111827;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: box-shadow .18s;
}
.at-idea-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.35); }

.at-idea-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.at-idea-rank {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #4a5068;
}

/* Confluence badge */
.at-conf-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  font-family: var(--mono, monospace);
}
.at-conf-badge--high { background: rgba(62,207,142,.15); color: #3ecf8e; }
.at-conf-badge--mid  { background: rgba(224,168,58,.12); color: #e0a83a; }
.at-conf-badge--low  { background: rgba(90,96,128,.10);  color: #5a6080; }

.at-idea-company {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.at-idea-ticker {
  font-size: 18px;
  font-weight: 800;
  color: #c8cde0;
  font-family: var(--mono, monospace);
}
.at-idea-name {
  font-size: 12px;
  color: #4a5068;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.at-idea-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.at-idea-archetype {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #7aaaf0;
  text-transform: uppercase;
}
.at-idea-score {
  font-size: 11px;
  color: #3ecf8e;
  font-family: var(--mono, monospace);
}

.at-idea-reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.at-idea-reason {
  font-size: 12px;
  color: #8a90a8;
  line-height: 1.4;
  padding-left: 16px;
  position: relative;
}
.at-idea-reason::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #3ecf8e;
  font-size: 11px;
}

.at-idea-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.at-idea-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  background: rgba(122,170,240,.08);
  border: 1px solid rgba(122,170,240,.20);
  color: #7aaaf0;
  padding: 2px 8px;
  border-radius: 3px;
}

.at-idea-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Generic buttons ─────────────────────────────────────────────────────── */

.at-btn {
  font-size: 11px;
  padding: 4px 12px;
  background: rgba(122,170,240,.10);
  border: 1px solid rgba(122,170,240,.28);
  border-radius: 5px;
  color: #7aaaf0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background .15s;
}
.at-btn:hover { background: rgba(122,170,240,.20); }
.at-btn--ghost {
  background: transparent;
  border-color: #1a2340;
  color: #4a5068;
}
.at-btn--ghost:hover { background: rgba(255,255,255,.04); color: #8a90a8; }
.at-btn--sm { font-size: 10px; padding: 3px 10px; }

/* ── Seasonal pick card ──────────────────────────────────────────────────── */

.at-seasonal-card {
  background: rgba(167,139,250,.04);
  border: 1px solid rgba(167,139,250,.15);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.at-sc-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.at-sc-ticker {
  font-size: 15px;
  font-weight: 800;
  color: #c8cde0;
  font-family: var(--mono, monospace);
}
.at-sc-name  { font-size: 11px; color: #4a5068; flex: 1; }
.at-sc-score {
  font-size: 13px;
  font-weight: 700;
  color: #a78bfa;
  font-family: var(--mono, monospace);
}
.at-sc-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6a50c8;
}
.at-sc-summary { font-size: 12px; color: #5a6080; line-height: 1.4; margin: 0; }

.at-sc-months {
  display: flex;
  gap: 8px;
}
.at-sc-chip {
  background: rgba(255,255,255,.03);
  border: 1px solid #111827;
  border-radius: 5px;
  padding: 5px 10px;
  text-align: center;
  min-width: 48px;
}
.at-sc-chip-month { font-size: 9px; color: #3a4060; text-transform: uppercase; letter-spacing: .06em; }
.at-sc-chip-ret   { font-size: 13px; font-weight: 700; font-family: var(--mono, monospace); }
.at-sc-chip-ret--pos { color: #3ecf8e; }
.at-sc-chip-ret--neg { color: #e05a5a; }

/* ── Sector signal ───────────────────────────────────────────────────────── */

.at-sector-box {
  background: rgba(99,179,237,.04);
  border: 1px solid rgba(99,179,237,.14);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.at-sector-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.at-sector-name {
  font-size: 14px;
  font-weight: 700;
  color: #c8cde0;
  flex: 1;
}
.at-sector-signal {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(90,96,128,.12);
  color: #5a6080;
}
.at-sector-signal--ow   { background: rgba(62,207,142,.12); color: #3ecf8e; }
.at-sector-signal--tilt { background: rgba(122,170,240,.12); color: #7aaaf0; }
.at-sector-sub { font-size: 11px; color: #3a4060; }

.at-sector-company {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #0e1220;
  flex-wrap: wrap;
}
.at-sector-co-label  { font-size: 10px; color: #3a4060; }
.at-sector-co-ticker { font-size: 13px; font-weight: 700; color: #c8cde0; font-family: var(--mono, monospace); }
.at-sector-co-name   { font-size: 11px; color: #4a5068; flex: 1; }
.at-sector-co-score  { font-size: 11px; color: #3ecf8e; font-family: var(--mono, monospace); }

/* ── Timeline ────────────────────────────────────────────────────────────── */

.at-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.at-tl-row {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #0a0f1e;
  align-items: flex-start;
}
.at-tl-row:last-child { border-bottom: none; }

.at-tl-date {
  min-width: 72px;
  flex-shrink: 0;
}
.at-tl-date-label {
  font-size: 12px;
  font-weight: 600;
  color: #5a6080;
  font-family: var(--mono, monospace);
}
.at-tl-days {
  font-size: 10px;
  color: #2e3448;
}

.at-tl-event { flex: 1; min-width: 0; }
.at-tl-icon  { font-size: 13px; flex-shrink: 0; }

.at-tl-earn-row, .at-tl-macro-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.at-tl-earn-name  { font-size: 13px; font-weight: 700; color: #c8cde0; }
.at-tl-earn-co    { font-size: 11px; color: #4a5068; }
.at-tl-macro-name { font-size: 13px; font-weight: 700; color: #c8cde0; }
.at-tl-impact     { font-size: 9px; font-weight: 700; color: #e0a83a; background: rgba(224,168,58,.10); border: 1px solid rgba(224,168,58,.22); padding: 1px 7px; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase; }
.at-tl-context    { font-size: 11px; color: #3a4060; margin: 4px 0 0; line-height: 1.4; }

/* ── Dislocation card ────────────────────────────────────────────────────── */

.at-disloc-card {
  background: rgba(224,90,90,.05);
  border: 1px solid rgba(224,90,90,.15);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.at-disloc-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.at-disloc-ticker   { font-size: 18px; font-weight: 800; color: #e07070; font-family: var(--mono, monospace); }
.at-disloc-name     { font-size: 12px; color: #5a4040; }
.at-disloc-meta     { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.at-disloc-score    { font-size: 12px; font-weight: 700; color: #e05a5a; font-family: var(--mono, monospace); }
.at-disloc-archetype{ font-size: 10px; font-weight: 700; color: #5a4040; letter-spacing: .06em; text-transform: uppercase; }
.at-disloc-alex     { font-size: 11px; color: #3a3a50; font-family: var(--mono, monospace); }
.at-disloc-desc     { font-size: 12px; color: #4a3a3a; line-height: 1.45; margin: 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.at-footer { border-top: 1px solid #0e1220; padding-top: 12px; }
.at-footer-text { font-size: 10px; color: #2e3448; line-height: 1.5; margin: 0; }

/* ── Today Synthesis box ─────────────────────────────────────────────────── */
.ts-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid #3b82f6;
  border-radius: 0 8px 8px 0;
}
.ts-loading { font-size: 11px; color: rgba(255,255,255,0.25); font-style: italic; }
.ts-label { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: rgba(255,255,255,0.25); text-transform: uppercase; margin-bottom: 8px; }
.ts-text { font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.7; margin-bottom: 6px; }
.ts-meta { font-size: 10px; color: rgba(255,255,255,0.2); }

/* ════════════════════════════════════════════════════════════════════════════
   ECONOMIC CALENDAR PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay & panel ─────────────────────────────────────────────────────── */

.ecal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.ecal-panel {
  background: #070d1a;
  border-left: 1px solid #1a2340;
  width: min(560px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight .22s ease;
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.ecal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #0e1220;
  flex-shrink: 0;
}

.ecal-header-text { flex: 1; min-width: 0; }

.ecal-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #63b3ed;
  margin-bottom: 4px;
}

.ecal-subtitle {
  font-size: 11px;
  color: #3a4060;
  margin: 0;
}

.ecal-close {
  background: transparent;
  border: none;
  color: #3a4060;
  font-size: 16px;
  cursor: pointer;
  padding: 0 0 0 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s;
}
.ecal-close:hover { color: #8a90b8; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.ecal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.ecal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0;
  gap: 14px;
}

.ecal-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #1a2340;
  border-top-color: #63b3ed;
  border-radius: 50%;
  animation: earn-spin .7s linear infinite;
}

.ecal-loading-text { font-size: 12px; color: #3a4055; margin: 0; }

/* ── Error ───────────────────────────────────────────────────────────────── */

.ecal-error {
  background: rgba(224,90,90,.07);
  border: 1px solid rgba(224,90,90,.20);
  border-radius: 8px;
  padding: 16px;
}
.ecal-error-title {
  font-size: 13px;
  font-weight: 600;
  color: #e05a5a;
  margin-bottom: 6px;
}
.ecal-error-msg {
  font-size: 12px;
  color: #5a3a3a;
  margin: 0;
}

/* ── Notice (non-fatal warning) ──────────────────────────────────────────── */

.ecal-notice {
  background: rgba(224,168,58,.06);
  border: 1px solid rgba(224,168,58,.20);
  border-radius: 6px;
  padding: 10px 14px;
}
.ecal-notice-text {
  font-size: 11px;
  color: #e0a83a;
  margin: 0;
}

/* ── Regime banner ───────────────────────────────────────────────────────── */

.ecal-regime-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(99,179,237,.05);
  border: 1px solid rgba(99,179,237,.15);
  border-radius: 6px;
  padding: 8px 14px;
}
.ecal-regime-prefix {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3a4060;
}
.ecal-regime-label {
  font-size: 12px;
  font-weight: 700;
  color: #63b3ed;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ecal-regime-date {
  font-size: 10px;
  color: #3a4060;
  margin-left: auto;
}

/* ── Summary ─────────────────────────────────────────────────────────────── */

.ecal-summary { font-size: 11px; color: #3a4060; }
.ecal-summary-count { font-weight: 600; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */

.ecal-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ecal-filter-btn {
  font-size: 11px;
  padding: 3px 11px;
  background: rgba(255,255,255,.03);
  border: 1px solid #1a2340;
  border-radius: 4px;
  color: #4a5068;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s, color .14s;
}
.ecal-filter-btn:hover { background: rgba(255,255,255,.07); color: #8a90a8; }
.ecal-filter-btn--active {
  background: rgba(99,179,237,.12);
  border-color: rgba(99,179,237,.35);
  color: #63b3ed;
  font-weight: 600;
}

/* ── Event list ──────────────────────────────────────────────────────────── */

.ecal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Event card ──────────────────────────────────────────────────────────── */

.ecal-card {
  background: rgba(255,255,255,.022);
  border: 1px solid #111827;
  border-left: 3px solid #1a2340;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .18s;
}
.ecal-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.3); }

/* Top row */
.ecal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ecal-impact-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ecal-card-date {
  font-size: 11px;
  color: #4a5068;
  font-family: var(--mono, monospace);
  white-space: nowrap;
}

/* Event name */
.ecal-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #c8cde0;
  line-height: 1.3;
}

.ecal-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.ecal-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #8a90a8;
  background: rgba(138,144,168,.10);
  border: 1px solid rgba(138,144,168,.20);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .04em;
}

.ecal-card-country {
  font-size: 10px;
  color: #3a4060;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ecal-card-description {
  font-size: 11px;
  color: #5a6080;
  margin: 4px 0 0;
  line-height: 1.4;
}

/* ── Data row: Prev / Est / Actual ───────────────────────────────────────── */

.ecal-data-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid #0e1220;
  border-bottom: 1px solid #0e1220;
}

.ecal-data-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 64px;
}

.ecal-data-val {
  font-size: 14px;
  font-weight: 700;
  color: #5a6080;
  font-family: var(--mono, monospace);
}
.ecal-data-val--actual {
  color: #3ecf8e;
}

.ecal-data-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2e3448;
}

/* ── Regime relevance pill ───────────────────────────────────────────────── */

.ecal-relev-row { display: flex; }

.ecal-relev-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 3px;
  padding: 2px 8px;
}

/* ── Regime context box ──────────────────────────────────────────────────── */

.ecal-context-box {
  background: rgba(99,179,237,.05);
  border: 1px solid rgba(99,179,237,.12);
  border-radius: 6px;
  padding: 10px 12px;
}

.ecal-context-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #3a5070;
  margin-bottom: 5px;
}

.ecal-context-text {
  font-size: 12px;
  color: #7090b0;
  line-height: 1.55;
  margin: 0;
}

/* ── Empty states ────────────────────────────────────────────────────────── */

.ecal-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
}
.ecal-empty-text {
  font-size: 13px;
  color: #3a4060;
}

.ecal-empty--prominent {
  flex-direction: column;
  gap: 12px;
  padding: 48px 0;
}
.ecal-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #3a4060;
}
.ecal-empty-note {
  font-size: 12px;
  color: #2e3448;
  max-width: 380px;
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

/* ── Data source note ────────────────────────────────────────────────────── */

.ecal-note {
  border-top: 1px solid #0e1220;
  padding-top: 12px;
  margin-top: 4px;
}
.ecal-note-text {
  font-size: 10px;
  color: #2e3448;
  line-height: 1.5;
  margin: 0;
}

/* ── Overlay & panel ─────────────────────────────────────────────────────── */

.opp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,4,12,.72);
  backdrop-filter: blur(4px);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
}

.opp-panel {
  background: #070d1a;
  border: 1px solid #1a2340;
  border-radius: 14px;
  width: 100%;
  max-width: 760px;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.opp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #0d1526;
  flex-shrink: 0;
}

.opp-header-text { flex: 1; }

.opp-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 4px;
}

.opp-subtitle {
  font-size: 12px;
  color: #4a5068;
  line-height: 1.5;
  margin: 0;
}

.opp-close {
  background: transparent;
  border: none;
  color: #3a4055;
  font-size: 18px;
  cursor: pointer;
  padding: 0 0 0 16px;
  transition: color .14s;
  flex-shrink: 0;
}
.opp-close:hover { color: #8a90b8; }

/* ── Body ────────────────────────────────────────────────────────────────── */

.opp-body {
  flex: 1;
  padding: 20px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */

.opp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0;
}

.opp-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #1a2340;
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.opp-loading-text { font-size: 13px; color: #3a4055; margin: 0; }

/* ── Meta bar ────────────────────────────────────────────────────────────── */

.opp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.opp-meta-count {
  font-size: 13px;
  font-weight: 600;
  color: #6a708a;
}

.opp-meta-date, .opp-meta-scored {
  font-size: 11px;
  color: #3a4055;
}

/* ── Legend ──────────────────────────────────────────────────────────────── */

.opp-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.opp-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.opp-legend-dot  { font-size: 12px; }
.opp-legend-label { font-size: 11px; color: #3a4055; }

/* ── Card list ───────────────────────────────────────────────────────────── */

.opp-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Regional section header ────────────────────────────────────────────── */
.opp-region-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #8892a4);
  padding: 16px 0 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
  margin-top: 4px;
}
.opp-region-header:first-child {
  padding-top: 4px;
  margin-top: 0;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.opp-card {
  background: rgba(255,255,255,.025);
  border: 1px solid #111827;
  border-left: 3px solid transparent;
  border-radius: 10px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .18s;
}
.opp-card:hover { box-shadow: 0 4px 22px rgba(0,0,0,.35); }

/* Top row */
.opp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.opp-card-company { flex: 1; min-width: 0; }

.opp-card-ticker {
  font-size: 16px;
  font-weight: 800;
  color: #c8d0f0;
  letter-spacing: .02em;
}

.opp-card-name {
  font-size: 11px;
  color: #4a5068;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opp-card-score-block {
  text-align: right;
  flex-shrink: 0;
}

.opp-card-score {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--mono, monospace);
  line-height: 1.1;
}

.opp-card-tier {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Type badge */
.opp-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 4px;
  padding: 3px 8px;
  align-self: flex-start;
}

/* Divergence section */
.opp-div-sec {
  background: rgba(224,90,90,.06);
  border: 1px solid rgba(224,90,90,.16);
  border-radius: 6px;
  padding: 9px 12px;
}

.opp-div-headline {
  font-size: 12px;
  font-weight: 600;
  color: #e07070;
  margin-bottom: 5px;
}

.opp-div-sub {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.opp-div-detail {
  font-size: 11px;
  color: #5a6080;
  font-family: var(--mono, monospace);
}

/* Seasonal section */
.opp-season-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opp-season-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4a5568;
}

.opp-month-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.opp-month-chip {
  background: rgba(255,255,255,.03);
  border: 1px solid #111827;
  border-radius: 6px;
  padding: 7px 10px 6px;
  text-align: center;
  min-width: 60px;
}

.opp-month-label {
  font-size: 10px;
  color: #4a5068;
  font-weight: 600;
  margin-bottom: 3px;
}

.opp-month-ret {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono, monospace);
}
.opp-month-ret--pos { color: #3ecf8e; }
.opp-month-ret--neg { color: #e05a5a; }

.opp-month-wr {
  font-size: 10px;
  color: #3a4055;
  margin-top: 2px;
}

/* Near-term window */
.opp-ntw {
  font-size: 11px;
  color: #5a7090;
  background: rgba(76,124,255,.05);
  border: 1px solid rgba(76,124,255,.12);
  border-radius: 5px;
  padding: 6px 10px;
}

.opp-ntw-label {
  font-weight: 600;
  color: #4a6080;
}

.opp-ntw-detail {
  color: #7090c0;
  font-family: var(--mono, monospace);
}

/* Alex Score row */
.opp-alex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opp-alex-label { font-size: 11px; color: #3a4055; }
.opp-alex-val   { font-size: 12px; font-weight: 700; color: #6a80c0; font-family: var(--mono, monospace); }

/* Score breakdown chips */
.opp-break-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.opp-break-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.03);
  border: 1px solid #111827;
  border-radius: 4px;
  padding: 3px 8px;
}

.opp-break-label { font-size: 9px; color: #3a4055; text-transform: uppercase; letter-spacing: .05em; }
.opp-break-val   { font-size: 10px; font-weight: 700; color: #a78bfa; font-family: var(--mono, monospace); }

/* Summary */
.opp-summary {
  font-size: 12px;
  color: #5a6080;
  line-height: 1.55;
  margin: 0;
  font-style: italic;
}

/* Action buttons */
.opp-card-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.opp-btn {
  background: rgba(167,139,250,.10);
  border: 1px solid rgba(167,139,250,.28);
  border-radius: 6px;
  color: #a78bfa;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .14s;
}
.opp-btn:hover { background: rgba(167,139,250,.20); }

.opp-btn--ghost {
  background: rgba(255,255,255,.04);
  border-color: #1e2438;
  color: #6a7090;
}
.opp-btn--ghost:hover { border-color: #3a4455; color: #8090aa; }

/* ── Error ───────────────────────────────────────────────────────────────── */

.opp-error {
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opp-error-title { font-size: 14px; font-weight: 600; color: #e05a5a; }
.opp-error-msg   { font-size: 12px; color: #4a5068; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.opp-empty {
  padding: 24px 28px;
  background: rgba(167,139,250,.04);
  border: 1px solid rgba(167,139,250,.14);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.opp-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #a78bfa;
}

.opp-empty-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opp-empty-step {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.opp-empty-step-num {
  font-size: 12px;
  font-weight: 700;
  color: #a78bfa;
  font-family: var(--mono, monospace);
  flex-shrink: 0;
  width: 16px;
}

.opp-empty-step-text {
  font-size: 13px;
  color: #8a90b8;
  line-height: 1.5;
}

.opp-empty-scan-btn {
  background: rgba(167,139,250,.10);
  border: 1px solid rgba(167,139,250,.28);
  color: #a78bfa;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  cursor: pointer;
  transition: background .14s;
}
.opp-empty-scan-btn:hover { background: rgba(167,139,250,.22); }

/* ── Methodology ─────────────────────────────────────────────────────────── */

.opp-methodology {
  border-top: 1px solid #0e1220;
  padding-top: 14px;
  flex-shrink: 0;
}
.opp-methodology-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #2e3448;
  margin-bottom: 5px;
}
.opp-methodology-text {
  font-size: 11px;
  color: #2e3448;
  line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 620px) {
  .opp-overlay { padding: 0; align-items: flex-end; }
  .opp-panel   { border-radius: 14px 14px 0 0; max-width: 100%; }
  .opp-body    { padding: 16px; }
  .opp-card-score { font-size: 16px; }
}


/* ── Ticker Autocomplete Dropdown ────────────────────────────────────────── */

.ca-autocomplete {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #0d1020;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
}
.ca-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.ca-autocomplete-item:hover,
.ca-autocomplete-item--active {
  background: rgba(255,255,255,0.06);
}
.ca-ac-ticker {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 60px;
  font-family: monospace;
}
.ca-ac-name {
  font-size: 12px;
  color: #8892a4;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-ac-region {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* Simulator add-row ticker wrapper (positions dropdown correctly) */
.sim-add-ticker-wrap {
  position: relative;
  flex-shrink: 0;
}

/* ── Company Quick Brief Panel ──────────────────────────────────────────────── */

/* Score source badge in diagnostic hero block */
.scan-diag-score-source {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(167, 139, 250, 0.6);
  text-transform: uppercase;
  margin-top: 0.2rem;
  cursor: default;
}

/* Clickable company name in scanner table */
.scan-row-name--clickable {
  cursor: pointer;
  transition: color 0.15s;
}
.scan-row-name--clickable:hover {
  color: #a78bfa;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Overlay backdrop */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

/* Slide-in panel */
.cb-panel {
  position: relative;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  background: #1a1a2e;
  border-left: 1px solid rgba(167, 139, 250, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.cb-panel--open {
  transform: translateX(0);
}

/* Header */
.cb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.2rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.cb-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.cb-ticker {
  font-size: 1.25rem;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.04em;
}
.cb-name {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  transition: color 0.15s;
  flex-shrink: 0;
}
.cb-close-btn:hover { color: #fff; }

/* Brief header actions + expand button */
.brief-header-actions { display: flex; gap: 6px; align-items: center; }
.brief-btn-expand {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.brief-btn-expand:hover { background: rgba(255,255,255,0.12); color: white; }

/* Brief fullscreen mode */
.brief-fullscreen {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
}

/* Body */
.cb-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Loading state */
.cb-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Price + perf row */
.cb-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.cb-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f0f0f0;
}
.cb-perf {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.cb-perf--pos { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.cb-perf--neg { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* ALEX score badge */
.cb-alex-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  align-self: flex-start;
}
.cb-alex-badge--high { background: rgba(167, 139, 250, 0.18); color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }
.cb-alex-badge--mid  { background: rgba(251, 191, 36, 0.12);  color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); }

/* Sections */
.cb-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cb-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.cb-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(167, 139, 250, 0.7);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.cb-section-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  white-space: pre-wrap;
}

/* Alex Structural View — subtle accent */
.cb-section--alex {
  border-color: rgba(167, 139, 250, 0.2);
  background: rgba(167, 139, 250, 0.05);
}

/* Bull vs Bear 2-column grid */
.cb-bull-bear {
  padding: 0.75rem 0.9rem;
}
.cb-bb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.cb-bb-side {
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}
.cb-bb-bull {
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.cb-bb-bear {
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.cb-bb-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.cb-bb-bull .cb-bb-label { color: #34d399; }
.cb-bb-bear .cb-bb-label { color: #f87171; }
.cb-bb-item {
  font-size: 0.79rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  padding-left: 0.8rem;
  position: relative;
  margin-bottom: 0.25rem;
}
.cb-bb-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.35);
}

/* Error state */
.cb-error {
  font-size: 0.82rem;
  color: #f87171;
  padding: 0.5rem;
}

/* Footer */
.cb-footer {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}
.cb-analyze-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 8px;
  color: #a78bfa;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cb-analyze-btn:hover {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.55);
}
.cb-alex-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cb-alex-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
}

/* ── TradingView chart (inside company brief) ───────────────────────────────── */

.cb-chart-section {
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}
.cb-chart-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cb-tv-chart {
  width: 100%;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

/* ── Analyst Consensus (inside company brief) ───────────────────────────────── */

.cb-consensus-box {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}
.cb-cons-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cb-cons-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.06em;
}
.cb-cons-green      { background: rgba(34, 197, 94, 0.15);  color: #4ade80; }
.cb-cons-lightgreen { background: rgba(134, 239, 172, 0.12); color: #86efac; }
.cb-cons-yellow     { background: rgba(251, 191, 36, 0.12);  color: #fbbf24; }
.cb-cons-red        { background: rgba(239, 68, 68, 0.12);   color: #f87171; }
.cb-cons-count  { font-size: 11px; color: rgba(255, 255, 255, 0.35); }
.cb-cons-period { font-size: 10px; color: rgba(255, 255, 255, 0.2); margin-left: auto; }

.cb-cons-bar-wrap { margin-bottom: 4px; }
.cb-cons-bar {
  height: 5px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}
.cb-bar-b { background: #4ade80; }
.cb-bar-h { background: rgba(255, 255, 255, 0.12); }
.cb-bar-s { background: #f87171; }
.cb-cons-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 10px;
}
.cb-cons-target {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}
.cb-cons-target-label { font-size: 11px; color: rgba(255, 255, 255, 0.3); }
.cb-cons-target-price { font-size: 15px; font-weight: 700; color: #e2e8f0; font-family: monospace; }
.cb-upside { font-size: 12px; font-weight: 600; }
.cb-up     { color: #4ade80; }
.cb-down   { color: #f87171; }
.cb-cons-range {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
}
.cb-cons-vs {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.5;
}

/* ── First-time Onboarding Overlay ─────────────────────────────────────────── */

.onb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
  /* entrance transition */
  opacity: 0;
  transition: opacity 0.3s ease;
}
.onb-overlay--visible {
  opacity: 1;
}

.onb-card {
  background: #13131f;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(167,139,250,0.08);
  /* entrance: card scales up */
  transform: scale(0.94) translateY(8px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onb-overlay--visible .onb-card {
  transform: scale(1) translateY(0);
}

.onb-logo {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 1rem;
}

.onb-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f0f0f0;
  margin: 0 0 1.75rem;
  line-height: 1.3;
}

/* Steps */
.onb-steps {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 2rem;
}
.onb-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.onb-step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #a78bfa;
  margin-top: 0.05rem;
}
.onb-step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e8e8f0;
  margin-bottom: 0.25rem;
}
.onb-step-desc {
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.5);
}

/* CTA button */
.onb-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.12s;
  margin-bottom: 0.9rem;
}
.onb-btn:hover  { opacity: 0.88; }
.onb-btn:active { transform: scale(0.98); }

/* Skip link */
.onb-skip {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  margin: 0;
  transition: color 0.15s;
}
.onb-skip:hover {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Mobile adjustment */
@media (max-width: 480px) {
  .onb-card {
    padding: 2rem 1.4rem 1.6rem;
    border-radius: 12px;
  }
  .onb-title { font-size: 1.15rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Alex Suggested Portfolio — button, panel, thesis badges
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Left-column button ────────────────────────────────────────────────────── */
.sim-ap-section {
  text-align: center;
}

.sim-ap-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(139,92,246,0.18));
  border: 1px solid rgba(99,155,255,0.35);
  border-radius: 8px;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
  width: 100%;
  justify-content: center;
}
.sim-ap-btn:hover {
  background: linear-gradient(135deg, rgba(59,130,246,0.28), rgba(139,92,246,0.28));
  border-color: rgba(99,155,255,0.6);
  color: #bfdbfe;
  transform: translateY(-1px);
}
.sim-ap-btn:active { transform: translateY(0); }

/* ── Right-column panel ────────────────────────────────────────────────────── */
.sim-ap-panel {
  border-left: 2px solid rgba(99,155,255,0.3);
}

.sim-ap-loading {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  padding: 0.6rem 0;
  font-style: italic;
}

.sim-ap-error {
  color: #f87171;
  font-size: 0.82rem;
  padding: 0.5rem 0;
}

/* Narrative */
.sim-ap-narrative {
  font-size: 0.84rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border-left: 3px solid rgba(99,155,255,0.4);
}

/* Positions grid */
.sim-ap-pos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.2rem;
}

.sim-ap-pos-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  background: rgba(255,255,255,0.03);
  transition: background 0.12s;
}
.sim-ap-pos-row:hover { background: rgba(255,255,255,0.06); }

.sim-ap-pos-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sim-ap-pos-ticker {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}
.sim-ap-pos-name {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-ap-pos-weight {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  min-width: 3.2rem;
  text-align: right;
}

/* ── Thesis badges ─────────────────────────────────────────────────────────── */
.sim-thesis-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: default;
}
.sim-thesis--compounder {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.sim-thesis--asymmetry {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}
.sim-thesis--regime {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.sim-thesis--defensive {
  background: rgba(148,163,184,0.15);
  color: #94a3b8;
}

/* ── Crisis scenarios grid ─────────────────────────────────────────────────── */
.sim-ap-scenarios-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.6rem;
  margin-top: 0.2rem;
}

.sim-ap-scen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sim-ap-scen-card {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255,255,255,0.06);
}

.sim-ap-scen-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.2rem;
}

.sim-ap-scen-impact {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}
.sim-ap-scen-neg { color: #f87171; }
.sim-ap-scen-pos { color: #4ade80; }

.sim-ap-scen-desc {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.4;
}

/* Footer note */
.sim-ap-footer {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sim-ap-footer-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⚡ Alex button in main scanner nav header
   ═══════════════════════════════════════════════════════════════════════════ */
.scan-alex-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.scan-alex-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
}

/* ── Alex Fund nav button ────────────────────────────────────────────────── */
.scan-fund-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.scan-fund-btn:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Alex Chat — FAB + slide-in panel (.alex-chat-* / .ac-*)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Floating action button */
.alex-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998 !important;
  padding: 10px 18px;
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: all 0.15s;
  white-space: nowrap;
}
.alex-chat-fab:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: rgba(168, 85, 247, 0.6);
  transform: translateY(-1px);
}

/* Slide-in panel */
.alex-chat-panel {
  position: fixed;
  bottom: 76px;
  right: 24px;
  z-index: 99999 !important;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: #0f1623;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.alex-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.ac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ac-title {
  font-size: 14px;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.04em;
}
.ac-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}
.ac-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.ac-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Messages */
.ac-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.ac-msg--user {
  align-self: flex-end;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #e2e8f0;
}
.ac-msg--assistant {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: #cbd5e1;
}
.ac-msg--thinking {
  color: rgba(255,255,255,0.35);
  font-style: italic;
  animation: acPulse 1.2s ease-in-out infinite;
}
.ac-msg--error {
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}
@keyframes acPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1;   }
}

/* Input row */
.ac-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ac-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  padding: 8px 10px;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
}
.ac-input:focus { border-color: rgba(168, 85, 247, 0.4); }
.ac-input::placeholder { color: rgba(255,255,255,0.2); }
.ac-send-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  align-self: flex-end;
  white-space: nowrap;
}
.ac-send-btn:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.25);
}
.ac-send-btn:disabled { opacity: 0.45; cursor: default; }

/* ═══════════════════════════════════════════════════════════════════════════
   Alex Fund panel (.af-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.af-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
}
.af-overlay.open { display: flex; }
.af-card {
  background: #0f1623;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: min(900px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.af-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.af-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #4ade80;
}
.af-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.af-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
}

.af-hrp-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.af-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.af-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.af-how-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 8px;
  align-self: center;
}
.af-how-btn:hover { border-color: rgba(59,130,246,0.4); color: #60a5fa; }
.af-strategy-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.af-strategy-inner {
  background: #0a0e1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  width: 520px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}
.af-strategy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  background: #0a0e1a;
  z-index: 1;
}
.af-strategy-title { font-size: 14px; font-weight: 700; color: #e2e8f0; }
.af-strategy-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
}
.af-strategy-body { padding: 20px; }
.af-strategy-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.af-strategy-section:last-of-type { border-bottom: none; }
.af-strategy-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.af-strategy-text { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.7; }
.af-strategy-formula {
  font-family: monospace;
  font-size: 12px;
  color: #60a5fa;
  background: rgba(59,130,246,0.08);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.af-strategy-table { display: flex; flex-direction: column; gap: 6px; }
.af-st-row { display: flex; gap: 10px; font-size: 12px; }
.af-st-key { font-family: monospace; font-weight: 700; color: #fbbf24; min-width: 35px; }
.af-st-val { color: rgba(255,255,255,0.45); }
.af-strategy-rules { display: flex; flex-direction: column; gap: 8px; }
.af-rule { display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgba(255,255,255,0.5); }
.af-rule-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
}
.af-rule-add .af-rule-icon { background: rgba(34,197,94,0.15); color: #4ade80; }
.af-rule-close .af-rule-icon { background: rgba(239,68,68,0.15); color: #f87171; }
.af-strategy-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  margin-top: 16px;
}
.af-body {
  overflow-y: auto;
  padding: 20px 24px 24px;
  flex: 1;
}
.af-loading, .af-error, .af-empty {
  padding: 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}
.af-error { color: #f87171; }
/* Performance bar */
.af-perf-bar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}
.af-stat { display: flex; flex-direction: column; gap: 3px; }
.af-stat-label { font-size: 10px; color: rgba(255,255,255,0.3); letter-spacing: 0.06em; text-transform: uppercase; }
.af-stat-value { font-size: 18px; font-weight: 700; font-family: monospace; color: #e2e8f0; }
.af-pos { color: #4ade80; }
.af-neg { color: #f87171; }
/* Return breakdown row (open + closed split) */
.af-return-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  padding: 6px 0 2px;
}
.af-bd-label { color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.05em; }
.af-bd-item { font-family: monospace; font-weight: 600; }
.af-bd-sep  { color: rgba(255,255,255,0.25); }
/* Auto-managed badge */
.af-auto-badge {
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 20px;
  padding: 5px 14px;
  display: inline-block;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
/* Decision log */
.af-log { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.af-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.af-log-date   { color: rgba(255,255,255,0.3); font-size: 11px; min-width: 44px; }
.af-log-action {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  min-width: 46px;
  text-align: center;
}
.af-log-hold  { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
.af-log-close { background: rgba(248,113,113,0.12); color: #f87171; }
.af-log-add   { background: rgba(74,222,128,0.12);  color: #4ade80; }
.af-log-ticker { font-family: monospace; font-weight: 700; color: #f1f5f9; min-width: 50px; }

/* Seasonal badges in decision log */
.af-log-seas    { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.af-seas-bull   { background: rgba(34, 197, 94, 0.10); color: #4ade80; }
.af-seas-bear   { background: rgba(239, 68, 68, 0.10); color: #f87171; }
.af-seas-neutral{ background: rgba(255,255,255, 0.05); color: rgba(255,255,255,0.3); }
.af-log-reason { color: rgba(255,255,255,0.35); flex: 1; font-size: 11px; }
.af-log-ret    { font-family: monospace; font-weight: 600; font-size: 12px; }
/* Rebalance button (kept for legacy) */
.af-btn-row { margin-bottom: 16px; }
.af-rebalance-btn {
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.1);
  color: #4ade80;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.af-rebalance-btn:hover:not(:disabled) { background: rgba(34,197,94,0.2); }
.af-rebalance-btn:disabled { opacity: 0.55; cursor: default; }
/* Section label */
.af-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  margin: 16px 0 8px;
}
/* Positions table */
.af-table { display: flex; flex-direction: column; gap: 2px; }
.af-thead {
  display: grid;
  grid-template-columns: 75px 82px 72px 72px 85px 55px 65px 105px 1fr;
  gap: 6px;
  padding: 4px 8px;
}
.af-th {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.af-tr {
  display: grid;
  grid-template-columns: 75px 82px 72px 72px 85px 55px 65px 105px 1fr;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 5px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.af-tr:hover { background: rgba(255,255,255,0.05); }
.af-td { font-size: 12px; color: #e2e8f0; display: flex; align-items: center; }
.af-ticker { font-family: monospace; font-weight: 700; color: #93c5fd; }
.af-entry-date { color: rgba(255,255,255,0.4); font-size: 11px; }
.af-entry-price { font-family: monospace; font-size: 12px; color: rgba(255,255,255,0.4); }
.af-current-price { font-family: monospace; font-size: 12px; color: #e2e8f0; }
.af-pos-target { font-family: monospace; font-size: 12px; color: #e2e8f0; padding-right: 8px; }
.af-upside { font-size: 10px; color: #4ade80; font-weight: 600; }
.af-pos-contrib {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-family: sans-serif;
  font-weight: 400;
  margin-top: 3px;
  line-height: 1.4;
  white-space: normal;
  max-width: 200px;
}
.af-ret { font-family: monospace; font-weight: 600; }
.af-thesis { font-size: 11px; color: rgba(255,255,255,0.5); }
.af-sector { font-size: 11px; color: rgba(255,255,255,0.35); }
/* Transaction log */
.af-tx-log {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.af-disclaimer {
  margin-top: 16px;
  padding: 10px 14px;
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  line-height: 1.6;
}
.af-tx-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.af-tx-row {
  display: grid;
  grid-template-columns: 90px 52px 70px 68px 48px 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 11px;
  align-items: center;
}
.af-tx-date { color: rgba(255,255,255,0.25); font-size: 10px; }
.af-tx-action {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-align: center;
}
.af-tx-buy  { background: rgba(34,197,94,0.15); color: #4ade80; }
.af-tx-sell { background: rgba(239,68,68,0.15); color: #f87171; }
.af-tx-hold { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.3); }
.af-tx-ret  { font-weight: 700; font-size: 11px; margin-left: 2px; }
.af-tx-pos  { color: #4ade80; }
.af-tx-neg  { color: #f87171; }
.af-tx-ticker { font-family: monospace; font-weight: 600; color: #e2e8f0; }
.af-tx-price { font-family: monospace; color: rgba(255,255,255,0.5); }
.af-tx-weight { color: rgba(255,255,255,0.35); }
.af-tx-reason {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Rebalance log */
.af-rebal-section { margin-bottom: 10px; }
.af-rebal-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.af-rebal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.af-rebal-reason { color: rgba(255,255,255,0.35); flex: 1; font-size: 11px; }
.af-rebal-score  { color: rgba(255,255,255,0.4);  font-size: 11px; }
.af-ret-sm { font-family: monospace; font-weight: 600; font-size: 12px; }

/* Backtest badge */
.af-bt-badge {
  margin: 10px 0;
  padding: 10px 14px;
  background: rgba(16,185,129,0.04);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 8px;
}
.af-bt-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.af-bt-metrics { display: flex; align-items: center; gap: 10px; }
.af-bt-m { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.af-bt-val { font-size: 14px; font-weight: 700; font-family: monospace; color: white; }
.af-bt-lbl { font-size: 8px; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 0.06em; }
.af-bt-sep { font-size: 9px; color: rgba(255,255,255,0.2); }
.af-bt-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.08); margin: 0 4px; }

/* Position cards grid */
.af-pos-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  margin-bottom: 6px;
  margin-top: 16px;
}
.af-pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.af-pos-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 14px;
  transition: border-color 0.2s;
  cursor: default;
}
.af-pos-card:hover { border-color: rgba(59,130,246,0.25); }
.af-pc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.af-pc-left { display: flex; flex-direction: column; gap: 2px; }
.af-pc-ticker { font-size: 15px; font-weight: 700; color: white; cursor: pointer; transition: color 0.15s; }
.af-pc-ticker:hover { color: #60a5fa; }
.af-pc-name   { font-size: 10px; color: rgba(255,255,255,0.35); }
.af-pc-sector { font-size: 9px;  color: rgba(255,255,255,0.2); }
.af-pc-ret    { font-size: 17px; font-weight: 700; font-family: monospace; }
.af-pc-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 6px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  margin-bottom: 10px;
}
.af-pc-m  { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.af-pc-ml { font-size: 8px; color: rgba(255,255,255,0.2); text-transform: uppercase; letter-spacing: 0.05em; }
.af-pc-mv { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,0.75); font-family: monospace; }
.af-pc-foot { display: flex; justify-content: space-between; align-items: center; }
.af-pc-thesis { font-size: 9.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.af-pc-date { font-size: 9px; color: rgba(255,255,255,0.18); }

/* Hedge sleeve section */
.af-hedge-sleeve { margin-top: 16px; }
.af-hedge-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.af-hedge-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.5fr 0.6fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(245,158,11,0.04);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 8px;
}
.af-ht-symbol { font-size: 13px; font-weight: 700; color: #F59E0B; display: block; }
.af-ht-name   { font-size: 10px; color: rgba(255,255,255,0.4); display: block; }
.af-ht-type   { font-size: 9px; color: rgba(255,255,255,0.2); display: block; }
.af-ht-entry, .af-ht-now { font-size: 10px; font-family: monospace; color: rgba(255,255,255,0.5); display: block; }
.af-hedge-weight { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.6); font-family: monospace; text-align: center; }
.af-hedge-return { font-size: 13px; font-weight: 700; font-family: monospace; text-align: center; }
.af-hedge-role   { font-size: 9px; color: rgba(255,255,255,0.25); text-align: right; }

/* Hedge sleeve bar */
.af-hedge-bar {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 8px;
}
.af-hedge-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.af-hedge-lbl { font-size: 9px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.08em; }
.af-hedge-val { font-size: 14px; font-weight: 700; color: #e2e8f0; font-family: monospace; }
.af-hedge-gold .af-hedge-val { color: #F59E0B; }
.af-hedge-short .af-hedge-val { color: #EF4444; }

/* Alex Fund — positions list (.af-pos-*) */
.af-positions { margin-top: 16px; }
.af-pos-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.af-pos-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.af-pos-ticker {
  font-family: monospace;
  font-weight: 700;
  color: #f1f5f9;
  min-width: 55px;
}
.af-pos-name {
  color: #8892a4;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.af-pos-weight {
  color: rgba(255,255,255,0.4);
  min-width: 40px;
  text-align: right;
}
.af-pos-entry { color: rgba(255,255,255,0.3); font-size: 11px; }
.af-pos-current { color: #e2e8f0; font-size: 11px; }
.af-pos-ret { font-family: monospace; font-weight: 600; font-size: 12px; }
.af-pos-ret--pos { color: #4ade80; }
.af-pos-ret--neg { color: #f87171; }

/* ═══════════════════════════════════════════════════════════════════════════
   Alex Suggested Portfolio — standalone overlay (.ap-*)
   ═══════════════════════════════════════════════════════════════════════════ */

.ap-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  overflow-y: auto;
}
.ap-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.ap-card {
  background: #0f1117;
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.ap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(168, 85, 247, 0.05);
}
.ap-title-wrap { flex: 1; min-width: 0; }
.ap-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #c084fc;
  margin-bottom: 0.25rem;
}
.ap-subtitle {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.35);
}
.ap-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.ap-close:hover { color: rgba(255, 255, 255, 0.75); }

/* Body */
.ap-body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 6rem);
}

/* Loading / error */
.ap-loading {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.84rem;
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}
.ap-error {
  color: #f87171;
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 1.5rem 0;
  text-align: center;
}

/* Regime pill */
.ap-regime-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
}

/* Narrative */
.ap-narrative {
  font-size: 0.85rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid rgba(168, 85, 247, 0.4);
}

/* Two-column layout */
.ap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
  .ap-cols { grid-template-columns: 1fr; }
}

.ap-col-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 0.65rem;
}

/* Positions */
.ap-pos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ap-pos-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.5rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.12s;
}
.ap-pos-row:hover { background: rgba(255, 255, 255, 0.06); }
.ap-pos-header {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ap-pos-meta {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.ap-pos-region {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: #93bbfd;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.ap-pos-sector {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* Diversity grid */
.ap-diversity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ap-div-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 10px;
}
.ap-div-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ap-div-name {
  font-size: 11px;
  color: #e2e8f0;
  min-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-div-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ap-div-bar {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.ap-div-pct {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  min-width: 32px;
  text-align: right;
}
/* Track Record */
.ap-track-record {
  margin: 16px 0;
  padding: 14px 16px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 8px;
}
.ap-tr-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.ap-tr-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ap-tr-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ap-tr-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}
.ap-tr-value {
  font-size: 20px;
  font-weight: 700;
  font-family: monospace;
}
.ap-tr-pos { color: #4ade80; }
.ap-tr-neg { color: #f87171; }
.ap-tr-change {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ap-tr-change-header {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ap-tr-closed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.ap-tr-ticker {
  font-family: monospace;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 60px;
}
.ap-tr-held {
  color: rgba(255, 255, 255, 0.3);
  min-width: 30px;
}
.ap-tr-ret {
  font-weight: 600;
  font-family: monospace;
}
.ap-tr-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 10px;
}
.ap-pos-ticker {
  font-size: 0.79rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}
.ap-pos-name {
  font-size: 0.71rem;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-conviction {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}
.ap-conviction--high {
  background: rgba(250, 204, 21, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(250, 204, 21, 0.3);
}
.ap-conviction--confirmed {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.ap-pos-weight {
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  min-width: 3rem;
  text-align: right;
}

/* Crisis scenarios */
.ap-scen-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ap-scen-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ap-scen-name {
  font-size: 0.73rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.18rem;
}
.ap-scen-impact {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.18rem;
}
.ap-scen-desc {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.4;
}

/* Footer CTA */
.ap-footer {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}
.ap-disclaimer {
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  line-height: 1.6;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
}
.ap-disclaimer-icon {
  color: rgba(255,255,255,0.3);
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.ap-sim-btn {
  padding: 0.6rem 1.6rem;
  border-radius: 7px;
  border: 1px solid rgba(99, 155, 255, 0.35);
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.ap-sim-btn:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(99, 155, 255, 0.55);
  transform: translateY(-1px);
}
.ap-sim-btn:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════════════════
   Universal ticker search — dropdown + scan search bar + result card
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.ticker-dropdown {
  background: #0d1020;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.ticker-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.ticker-dropdown-item:hover,
.ticker-dropdown-item--active {
  background: rgba(59, 130, 246, 0.12);
}

.td-ticker {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: monospace;
  min-width: 65px;
}
.td-name {
  font-size: 12px;
  color: #8892a4;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-region {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  white-space: nowrap;
}

/* ── Scan search bar ───────────────────────────────────────────────────────── */
.scan-search-bar {
  padding: 8px 16px 0;
}

.scan-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  color: #e2e8f0;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.scan-search-input::placeholder { color: rgba(255, 255, 255, 0.28); }
.scan-search-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Search result card (ticker not in scan) ───────────────────────────────── */
.scan-search-result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 4px;
  flex-wrap: wrap;
  /* Sits between topbar and dashboard grid */
  margin-bottom: 4px;
}

.ssr-left { flex: 1; min-width: 0; }
.ssr-ticker {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: monospace;
  line-height: 1.2;
}
.ssr-name {
  font-size: 13px;
  color: #8892a4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssr-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

.ssr-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ssr-actions button {
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  transition: background 0.12s, border-color 0.12s;
}
.ssr-actions button:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}
/* ⚡ Ask Alex — last button in search card gets green tint */
.ssr-actions button:last-child {
  background: rgba(16,185,129,.07);
  border-color: rgba(16,185,129,.25);
  color: #34d399;
}
.ssr-actions button:last-child:hover {
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.45);
}

.ssr-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.12s;
  flex-shrink: 0;
}
.ssr-close:hover { color: rgba(255, 255, 255, 0.6); }

/* ── Row highlight animation ───────────────────────────────────────────────── */
.scan-row-highlight {
  animation: rowFlash 2s ease;
}
@keyframes rowFlash {
  0%, 100% { background: transparent; }
  20%, 80%  { background: rgba(59, 130, 246, 0.12); }
}

/* ── News Panel ──────────────────────────────────────────────────────────── */
.news-overlay {
  position: fixed;
  inset: 0;
  background: #060a14;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.news-panel {
  width: 100%;
  height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.news-header {
  padding: 14px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 24px;
  background: #040810;
  flex-shrink: 0;
}
.news-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.news-tabs {
  display: flex;
  gap: 4px;
}
.news-tab {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.news-tab:hover { color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.2); }
.news-tab.active {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.4);
  color: #60a5fa;
}
.news-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}
.news-close:hover { color: rgba(255,255,255,0.7); }
.news-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 40px;
}
/* Section */
.news-section {
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
}
.news-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.22);
  text-transform: uppercase;
  padding: 20px 0 12px;
}
/* Featured article — full width, 2-col split */
.news-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 16px 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: opacity 0.15s;
}
.news-featured:hover { opacity: 0.85; }
.news-featured-cat {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #3b82f6;
  text-transform: uppercase;
  margin-bottom: 0;
}
.news-featured-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}
.news-featured-summary {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}
.news-featured-meta {
  grid-column: 1 / -1;
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  margin-top: -16px;
}
/* Grid of regular articles — 3 columns */
.news-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.05);
  margin-top: 1px;
}
.news-item {
  background: #060a14;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.news-item:hover { background: rgba(255,255,255,0.03); }
.news-item-source {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.news-source-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.38);
}
.news-source-primary {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}
.news-ticker-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  font-family: monospace;
}
.news-item-time {
  font-size: 10px;
  color: rgba(255,255,255,0.18);
  margin-left: auto;
}
.news-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.4;
}
.news-item-summary {
  font-size: 12px;
  color: rgba(255,255,255,0.32);
  line-height: 1.5;
  margin-top: 4px;
}
.news-loading, .news-empty, .news-error {
  padding: 60px 0;
  text-align: center;
  color: rgba(255,255,255,0.28);
  font-size: 13px;
}

/* ── Onboarding Wizard ───────────────────────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.ob-fade-out {
  opacity: 0;
  transition: opacity 0.4s;
}
.ob-modal {
  background: #0a0e1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 520px;
  max-width: 95vw;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}
.ob-progress {
  height: 3px;
  background: rgba(255,255,255,0.08);
}
.ob-progress-bar {
  height: 100%;
  background: #3b82f6;
  transition: width 0.4s ease;
}
.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 0;
}
.ob-step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
}
.ob-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.ob-skip:hover { color: rgba(255,255,255,0.5); }
.ob-body {
  padding: 24px 24px 8px;
  min-height: 280px;
}
.ob-step-title {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
  line-height: 1.3;
}
.ob-step-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  margin-bottom: 20px;
}
.ob-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 16px;
}
.ob-btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ob-btn-primary:hover { background: #2563eb; }
.ob-btn-secondary {
  background: none;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.ob-btn-secondary:hover { color: rgba(255,255,255,0.7); }
/* Watchlist */
.ob-watchlist-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ob-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f1f5f9;
  font-size: 14px;
  outline: none;
}
.ob-input:focus { border-color: rgba(59,130,246,0.5); }
.ob-add-btn {
  background: rgba(59,130,246,0.2);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60a5fa;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.ob-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 32px;
}
.ob-tag {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60a5fa;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ob-tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
}
.ob-tag-remove:hover { opacity: 1; }
.ob-suggestions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ob-sug-label {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}
.ob-sug {
  font-size: 12px;
  font-family: monospace;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  transition: all 0.15s;
}
.ob-sug:hover { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
/* Upload */
.ob-upload-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.ob-upload-zone:hover, .ob-upload-drag {
  border-color: rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.05);
}
.ob-upload-icon { font-size: 32px; margin-bottom: 8px; }
.ob-upload-text {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}
.ob-upload-sub { font-size: 12px; color: rgba(255,255,255,0.3); }
.ob-upload-status {
  font-size: 13px;
  margin-bottom: 8px;
  min-height: 20px;
}
.ob-upload-format {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  line-height: 1.6;
}
.ob-format-ex {
  font-family: monospace;
  color: rgba(255,255,255,0.35);
}
/* Options */
.ob-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.ob-option:hover {
  border-color: rgba(59,130,246,0.3);
  background: rgba(59,130,246,0.05);
}
.ob-option-selected {
  border-color: rgba(59,130,246,0.5) !important;
  background: rgba(59,130,246,0.1) !important;
}
.ob-option-icon { font-size: 22px; min-width: 32px; }
.ob-option-label {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 2px;
}
.ob-option-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}
/* Portfolio tabs */
.ob-portfolio-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.ob-ptab {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.ob-ptab.active {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.4);
  color: #60a5fa;
}
.ob-manual-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ob-input-sm {
  flex: 1;
  min-width: 0;
}
.ob-positions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.ob-pos-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 13px;
}
.ob-pos-ticker {
  font-family: monospace;
  font-weight: 700;
  color: #60a5fa;
  min-width: 60px;
}
.ob-pos-shares { color: rgba(255,255,255,0.5); flex: 1; }
.ob-pos-price  { color: rgba(255,255,255,0.4); }
.ob-pos-remove {
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  font-size: 16px;
  margin-left: auto;
}
.ob-pos-remove:hover { color: #f87171; }
/* Watchlist badge in navbar */
.ob-watchlist-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.25);
  padding: 3px 9px;
  border-radius: 20px;
  cursor: default;
  letter-spacing: 0.03em;
}
/* Toast */
.ob-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: ob-slide-in 0.3s ease;
}
@keyframes ob-slide-in {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Backtest Panel ──────────────────────────────────────────────────────────── */

.bt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.80);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.bt-overlay.open { opacity: 1; }

.bt-panel {
  background: #0f1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: min(960px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.bt-overlay.open .bt-panel { transform: translateY(0); }

.bt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.bt-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.bt-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 3px;
}

.bt-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.bt-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.bt-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
}

.bt-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.bt-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 12px 14px;
}

.bt-metric-highlight {
  background: rgba(96, 165, 250, 0.07);
  border-color: rgba(96, 165, 250, 0.2);
}

.bt-metric-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.bt-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.02em;
}

.bt-pos { color: #4ade80; }
.bt-neg { color: #f87171; }

.bt-chart-wrap {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 16px;
  height: 300px;
  position: relative;
  margin-bottom: 16px;
}

.bt-chart-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 8px;
}

#bt-chart {
  width: 100% !important;
  height: calc(100% - 24px) !important;
}

.bt-disclaimer {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
  margin-top: 4px;
}

/* ── Analysis dashboard PDF button ──────────────────────── */
.ad-pdf-btn {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  color: #60a5fa;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  margin-right: 8px;
}
.ad-pdf-btn:hover { background: rgba(59,130,246,0.22); border-color: rgba(59,130,246,0.5); }
.ad-pdf-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Generic section wrapper ─────────────────────────────── */
.bt-section {
  margin-bottom: 28px;
}
.bt-section-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

/* ── Monthly distribution stats ──────────────────────────── */
.bt-dist-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.bt-dist-cell {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.bt-dist-label {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
.bt-dist-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

/* ── Best/Worst month grid ────────────────────────────────── */
.bt-bw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bt-bw-col { display: flex; flex-direction: column; }
.bt-bw-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px 6px 0 0;
}
.bt-bw-bull { background: rgba(52,211,153,0.12); color: #34d399; }
.bt-bw-bear { background: rgba(248,113,113,0.12); color: #f87171; }
.bt-bw-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 10px;
  font-size: 0.77rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}
.bt-bw-rank { color: rgba(255,255,255,0.3); min-width: 14px; }
.bt-bw-date { color: rgba(255,255,255,0.55); min-width: 54px; }
.bt-bw-ret  { font-weight: 600; min-width: 54px; }
.bt-bw-spy  { color: rgba(255,255,255,0.35); min-width: 70px; font-size: 0.72rem; }
.bt-bw-tag  { font-size: 0.6rem; color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.05); border-radius: 3px; padding: 1px 4px; }

/* ── Rolling Sharpe grid ─────────────────────────────────── */
.bt-rolling-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.bt-rolling-cell {
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  border: 1px solid rgba(255,255,255,0.08);
}
.bt-rs-high { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.2); }
.bt-rs-mid  { background: rgba(250,204,21,0.06); border-color: rgba(250,204,21,0.2); }
.bt-rs-low  { background: rgba(248,113,113,0.06); border-color: rgba(248,113,113,0.2); }
.bt-rolling-date { font-size: 0.6rem; color: rgba(255,255,255,0.35); margin-bottom: 3px; }
.bt-rolling-val  { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.8); }

/* ── Robustness cards ─────────────────────────────────────── */
.bt-robust-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bt-robust-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
}
.bt-robust-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
}
.bt-robust-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}
.bt-robust-rows { display: flex; flex-direction: column; gap: 4px; }
.bt-robust-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.77rem;
  color: rgba(255,255,255,0.55);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bt-robust-highlight {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.bt-robust-val { color: rgba(167,139,250,0.9); font-weight: 600; }

/* ── Audit flags ─────────────────────────────────────────── */
.bt-audit-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.bt-audit-sev {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-width: 50px;
  margin-top: 2px;
}
.bt-audit-body { flex: 1; }
.bt-audit-finding {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  margin-bottom: 3px;
}
.bt-audit-detail {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin-bottom: 4px;
}
.bt-audit-fix {
  font-size: 0.7rem;
  color: rgba(167,139,250,0.6);
  font-style: italic;
}

/* Research findings */
.bt-findings {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}
.bt-findings-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.bt-finding {
  font-size: 11px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  line-height: 1.5;
}
.bt-finding-reject { color: rgba(255, 255, 255, 0.35); }
.bt-finding-accept { color: #4ade80; font-weight: 600; }
.bt-finding-note {
  color: #60a5fa;
  font-style: italic;
  border-bottom: none;
  padding-top: 8px;
}
.bt-philosophy {
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: rgba(251, 191, 36, 0.7);
  margin-top: 16px;
  padding: 8px;
}

.bt-philosophy-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 8px;
  text-align: center;
}
.bt-phil-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bt-phil-line {
  font-size: 12px;
  font-style: italic;
  color: rgba(139, 92, 246, 0.8);
  line-height: 1.6;
}

/* Annual returns table */
.bt-annual-wrap {
  margin: 16px 0 12px;
}

.bt-annual-table {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.bt-annual-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 60px;
}

.bt-annual-cell.bt-pos { border-color: rgba(52, 211, 153, 0.25); }
.bt-annual-cell.bt-neg { border-color: rgba(248, 113, 113, 0.25); }

.bt-annual-yr {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bt-annual-ret {
  font-size: 13px;
  font-weight: 700;
}

.bt-annual-cell.bt-pos .bt-annual-ret { color: #34d399; }
.bt-annual-cell.bt-neg .bt-annual-ret { color: #f87171; }

.bt-annual-spy {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 1px;
}

/* Strategy comparison table */
.bt-sc-wrap {
  margin: 16px 0 12px;
}

.bt-sc-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

.bt-sc-table th {
  text-align: right;
  padding: 5px 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.bt-sc-table th:first-child { text-align: left; }

.bt-sc-table td {
  text-align: right;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

.bt-sc-table td.bt-sc-metric {
  text-align: left;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.bt-sc-table tr:last-child td { border-bottom: none; }
.bt-sc-table tr:hover td { background: rgba(255, 255, 255, 0.03); }

.bt-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
}

.bt-loading-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.bt-loading-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  max-width: 480px;
  line-height: 1.6;
}

.bt-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 13px;
  margin: 20px 0;
}

/* ── Alex Fund — Run Backtest button ─────────────────────────────────────────── */

.af-backtest-btn {
  background: none;
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: rgba(96, 165, 250, 0.6);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 8px;
  align-self: center;
}
.af-backtest-btn:hover {
  border-color: rgba(96, 165, 250, 0.6);
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

/* ── Score cell — 0-100 number + colored bar ─────────────────────────────────── */
.score-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.score-num {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.score-bar-bg {
  width: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Why Now? — narrative tags in the scanner row ────────────────────────────── */
.why-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.why-dislocated { background: rgba(239, 68, 68, 0.15);  color: #f87171; }
.why-quality    { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.why-reversion  { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.why-momentum   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.why-asymmetry  { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.why-neutral    { background: rgba(255, 255, 255, 0.05); color: rgba(255, 255, 255, 0.4); }

/* ── Asset cell — whole block is a clickable link to the company brief ──────── */
.scan-asset-wrap {
  cursor: pointer;
}
.scan-asset-wrap .scan-ticker,
.scan-asset-wrap .scan-name {
  transition: color 0.15s;
}
.scan-asset-wrap:hover .scan-ticker {
  color: #60a5fa;
}
.scan-asset-wrap:hover .scan-name {
  color: rgba(255, 255, 255, 0.7);
}

/* ═══ FULL ANALYSIS DASHBOARD ═══ */

/* Currency mismatch banner — shown when financials ≠ price currency (e.g. CNY/USD ADRs) */
.fad-currency-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.fad-currency-ok {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.35);
  color: #6ee7b7;
}
.fad-currency-warn {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.4);
  color: #fcd34d;
}
.fad-currency-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.fad-root {
    background: #0A0A0F;
    color: #F1F5F9;
    font-family: 'Inter', -apple-system, sans-serif;
    padding: 0;
    width: 92vw;
    max-width: 1120px;
    height: 90vh;
    border: 1px solid #2A2A33;
    border-radius: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1101;
}
.fad-header {
    background: #141419;
    border-bottom: 1px solid #2A2A33;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fad-title-block { flex: 1; }
.fad-ticker { font-size: 11px; color: #94A3B8; letter-spacing: .12em; margin-bottom: 2px; }
.fad-company { font-size: 18px; font-weight: 700; color: white; }
.fad-subtitle { font-size: 11px; color: #3B82F6; margin-top: 2px; }
.fad-header-actions { display: flex; gap: 8px; align-items: center; }
.fad-pdf-btn {
    background: rgba(37,99,235,.15);
    border: 1px solid rgba(37,99,235,.4);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.fad-pdf-btn:hover { background: rgba(37,99,235,.28); }
.fad-close-btn {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: #94A3B8;
    width: 30px; height: 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.fad-close-btn:hover { color: white; }

/* Tabs */
.fad-tabs {
    display: flex;
    gap: 0;
    background: #0A0A0F;
    border-bottom: 1px solid #2A2A33;
    overflow-x: auto;
    padding: 0 20px;
}
.fad-tabs::-webkit-scrollbar { height: 3px; }
.fad-tabs::-webkit-scrollbar-thumb { background: #2A2A33; }
.fad-tab {
    padding: 10px 16px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all .15s;
    font-weight: 500;
}
.fad-tab:hover { color: #94A3B8; }
.fad-tab.active { color: #60a5fa; border-bottom-color: #3B82F6; }

/* Content */
.fad-content { padding: 20px; }
.fad-panel { display: none; }
.fad-panel.active { display: block; }

/* Section label */
.fad-sec-label {
    font-size: 10px;
    letter-spacing: .12em;
    color: #3B82F6;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2A2A33;
    text-transform: uppercase;
}

/* Metric cards */
.fad-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.fad-metric {
    background: #141419;
    border: 1px solid #2A2A33;
    border-radius: 10px;
    padding: 12px 14px;
}
.fad-m-label { font-size: 10px; color: #64748b; margin-bottom: 4px; }
.fad-m-value { font-size: 20px; font-weight: 700; color: white; line-height: 1.2; }
.fad-m-sub { font-size: 10px; color: #475569; margin-top: 3px; }
.fad-m-pos { color: #10B981 !important; }
.fad-m-neg { color: #EF4444 !important; }
.fad-m-gold { color: #F59E0B !important; }

/* Score bars */
.fad-score-bar-wrap { margin-bottom: 10px; }
.fad-score-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 44px;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.fad-score-bar-label { font-size: 11px; color: #94A3B8; }
.fad-score-bar-track {
    background: #2A2A33;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}
.fad-score-bar-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.fad-score-bar-val { font-size: 13px; font-weight: 700; text-align: right; }
.fad-score-bar-desc { font-size: 10px; color: #475569; margin: -4px 0 8px 150px; }

/* Chart wrapper */
.fad-chart-wrap {
    background: #141419;
    border: 1px solid #2A2A33;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.fad-chart-title { font-size: 11px; color: #64748b; margin-bottom: 12px; letter-spacing: .06em; }
.fad-chart-canvas-wrap { position: relative; width: 100%; }

/* Tables */
.fad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 16px;
}
.fad-table th {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #2A2A33;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.fad-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(42,42,51,.5);
    color: #CBD5E1;
}
.fad-table tr:last-child td { border-bottom: none; }
.fad-table tr:hover td { background: rgba(42,42,51,.3); }
.fad-table .fad-td-label { color: #94A3B8; font-weight: 500; }
.fad-table .fad-td-pos { color: #10B981; font-weight: 600; }
.fad-table .fad-td-neg { color: #EF4444; font-weight: 600; }
.fad-table .fad-td-right { text-align: right; }
.fad-table .fad-td-center { text-align: center; }

/* Scenario cards */
.fad-scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.fad-scenario-card {
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.fad-sc-bear { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); }
.fad-sc-base { background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.25); }
.fad-sc-bull { background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25); }
.fad-sc-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; margin-bottom: 6px; text-transform: uppercase; }
.fad-sc-bear .fad-sc-label { color: #EF4444; }
.fad-sc-base .fad-sc-label { color: #3B82F6; }
.fad-sc-bull .fad-sc-label { color: #10B981; }
.fad-sc-price { font-size: 22px; font-weight: 700; color: white; margin-bottom: 2px; }
.fad-sc-ret { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.fad-sc-bear .fad-sc-ret { color: #EF4444; }
.fad-sc-base .fad-sc-ret { color: #3B82F6; }
.fad-sc-bull .fad-sc-ret { color: #10B981; }
.fad-sc-thesis { font-size: 10px; color: #64748b; line-height: 1.5; }

/* Risk grid */
.fad-risk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.fad-risk-card {
    background: #141419;
    border: 1px solid #2A2A33;
    border-radius: 8px;
    padding: 10px 12px;
}
.fad-risk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fad-risk-name { font-size: 11px; font-weight: 600; color: #CBD5E1; }
.fad-risk-indicator { width: 8px; height: 8px; border-radius: 50%; }
.fad-risk-high { background: #EF4444; }
.fad-risk-med { background: #F59E0B; }
.fad-risk-low { background: #10B981; }
.fad-risk-track { background: #2A2A33; border-radius: 3px; height: 4px; overflow: hidden; margin-bottom: 4px; }
.fad-risk-fill { height: 100%; border-radius: 3px; }
.fad-risk-label { font-size: 10px; color: #475569; }

/* Verdict box */
.fad-verdict {
    background: linear-gradient(135deg, #141419 0%, #0A0A0F 100%);
    border: 1px solid #2A2A33;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}
.fad-verdict-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.fad-verdict-badge {
    background: rgba(37,99,235,.2);
    border: 1px solid rgba(37,99,235,.4);
    color: #60a5fa;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    margin-top: 2px;
}
.fad-verdict-title { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; }
.fad-verdict-sub { font-size: 12px; color: #64748b; line-height: 1.6; }
.fad-action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.fad-action-card {
    background: rgba(255,255,255,.03);
    border: 1px solid #2A2A33;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}
.fad-action-label { font-size: 10px; color: #475569; margin-bottom: 4px; }
.fad-action-val { font-size: 13px; font-weight: 700; color: #CBD5E1; }

/* Ask Alex btn */
.fad-ask-btn {
    width: 100%;
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.3);
    color: #34d399;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all .15s;
}
.fad-ask-btn:hover { background: rgba(16,185,129,.18); }

/* Brief section */
.fad-brief-section { margin-bottom: 16px; }
.fad-brief-label { font-size: 10px; color: #3B82F6; font-weight: 700; letter-spacing: .1em; margin-bottom: 8px; text-transform: uppercase; }
.fad-brief-text { font-size: 13px; color: #94A3B8; line-height: 1.8; }
.fad-bull-bear { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.fad-bull-card {
    background: rgba(16,185,129,.06);
    border-left: 3px solid #10B981;
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
}
.fad-bear-card {
    background: rgba(239,68,68,.06);
    border-left: 3px solid #EF4444;
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
}
.fad-bb-title { font-size: 10px; font-weight: 700; letter-spacing: .08em; margin-bottom: 6px; }
.fad-bull-card .fad-bb-title { color: #10B981; }
.fad-bear-card .fad-bb-title { color: #EF4444; }
.fad-bb-item { font-size: 11px; line-height: 1.6; margin-bottom: 3px; }
.fad-bull-card .fad-bb-item { color: #6ee7b7; }
.fad-bear-card .fad-bb-item { color: #fca5a5; }

/* Analyst consensus */
.fad-consensus { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.fad-cons-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.fad-cons-buy { background: rgba(16,185,129,.15); color: #34d399; }
.fad-cons-hold { background: rgba(245,158,11,.15); color: #fbbf24; }
.fad-cons-sell { background: rgba(239,68,68,.15); color: #f87171; }

/* Timeline */
.fad-timeline { display: flex; flex-direction: column; }
.fad-tl-item { display: grid; grid-template-columns: 80px 14px 1fr; gap: 0 12px; }
.fad-tl-date { font-size: 11px; color: #475569; padding: 8px 0; text-align: right; }
.fad-tl-line { display: flex; flex-direction: column; align-items: center; }
.fad-tl-dot { width: 10px; height: 10px; border-radius: 50%; background: #3B82F6; margin-top: 9px; flex-shrink: 0; }
.fad-tl-vert { flex: 1; width: 1px; background: #2A2A33; }
.fad-tl-content { padding: 6px 0 14px; }
.fad-tl-event { font-size: 12px; font-weight: 600; color: #CBD5E1; margin-bottom: 2px; }
.fad-tl-detail { font-size: 11px; color: #475569; }
.fad-tl-item:last-child .fad-tl-vert { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   HOMEPAGE DASHBOARD — 2-column layout
   Dark-theme-aware: all colours use CSS vars overridden by .scan-page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Scanner section — strip inner borders so controls sit flush ─────────── */

.dash-section--scanner .scan-controls,
.dash-section--scanner .scan-search-bar input,
.dash-section--scanner .scan-filter-bar {
  border-left: none;
  border-right: none;
  border-radius: 0;
}

.dash-section--scanner .scan-controls {
  border-top: none;
}

.dash-section--scanner .scan-search-bar {
  padding: 0;
}

.dash-section--scanner .scan-search-bar .scan-search-input {
  border-left: none;
  border-right: none;
  border-radius: 0;
}

/* ── Main grid ─────────────────────────────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 8px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* DEPRECATED — kept for safety, replaced by dash-top-cards-row */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Top cards row: Seasonal (50%) + Alex Ideas (50%) */
.dash-top-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Full-width rows — span both dashboard-grid columns */
.dash-sim-full-row,
.dash-news-full-row,
.dash-arena-row,
.dash-options-row {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.dash-arena-row--full {
  /* Full Arena section — no max-width constraint */
}

/* ── Portfolio Arena teaser card ───────────────────────────────────────────── */
.dash-arena-card {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dash-arena-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.dash-arena-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dash-arena-badge {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  color: #F59E0B;
  letter-spacing: .4px;
}
.dash-arena-btn {
  background: #3B82F6;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.dash-arena-btn:hover:not(:disabled) { background: #2563EB; }
.dash-arena-btn:disabled { opacity: .8; cursor: default; }

/* ── Section shell ─────────────────────────────────────────────────────────── */

.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  /* No overflow:hidden — lets dropdowns (adv-filter, etc.) escape bounds */
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-lt);
  background: rgba(255,255,255,0.025);
  gap: 8px;
}

.dash-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ── See-more button ───────────────────────────────────────────────────────── */

.see-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.see-more-btn:hover:not(:disabled) {
  background: rgba(76, 124, 255, 0.08);
  border-color: var(--accent);
  filter: none;
}

/* ── Shared loading / empty / error states ─────────────────────────────────── */

.dash-loading,
.dash-empty,
.dash-error {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.dash-error { color: var(--err); }

/* ── Tabs ──────────────────────────────────────────────────────────────────── */

.dash-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dash-tab {
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 3px;
  cursor: pointer;
}
.dash-tab--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.dash-tab:hover:not(.dash-tab--active):not(:disabled) {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  filter: none;
}

/* ── Market Regime widget ──────────────────────────────────────────────────── */

.regime-widget-body { padding: 10px 12px 12px; }

.regime-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.regime-chip--risk-on     { background: rgba(62,207,142,0.14); color: #3ecf8e; }
.regime-chip--risk-off    { background: rgba(239,68,68,0.14);  color: #f87171; }
.regime-chip--stagflation { background: rgba(234,179,8,0.14);  color: #fbbf24; }
.regime-chip--reflation   { background: rgba(76,124,255,0.14); color: #7ba4ff; }
.regime-chip--contraction { background: rgba(168,85,247,0.14); color: #c084fc; }
.regime-chip--unknown     { background: rgba(255,255,255,0.05); color: var(--muted); }

.regime-conf {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.regime-conf-label { font-size: 11px; color: var(--muted); min-width: 68px; }
.regime-conf-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.regime-conf-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.regime-conf-val { font-size: 11px; color: var(--text); font-weight: 600; min-width: 28px; text-align: right; }

.regime-sectors { font-size: 11px; margin-bottom: 6px; color: var(--muted); }
.regime-sectors-label { font-weight: 600; }
.regime-sector-chip {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(76,124,255,0.10);
  border: 1px solid rgba(76,124,255,0.25);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}

.regime-narrative {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  border-top: 1px solid var(--border-lt);
  padding-top: 8px;
  margin-top: 6px;
}

/* ── Compact News widget ───────────────────────────────────────────────────── */

.news-widget-body { padding: 4px 0; }

.news-widget-item {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.news-widget-item:last-child { border-bottom: none; }

.news-widget-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 2px;
}
.news-widget-title:hover { color: var(--accent); }

.news-widget-meta {
  font-size: 10px;
  color: var(--muted);
}

/* ── Key Events widget ─────────────────────────────────────────────────────── */

.events-widget-body { padding: 4px 0; }

.event-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.event-row:last-child { border-bottom: none; }
/* Earnings + econ rows wrap to show meta line */
.event-row--earnings,
.event-row--econ { flex-wrap: wrap; align-items: center; }

.event-ticker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  min-width: 36px;
  flex-shrink: 0;
}
.event-ticker--link { cursor: pointer; text-decoration: none; }
.event-ticker--link:hover { text-decoration: underline; }

/* EPS meta (earnings) */
.event-eps-meta {
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 2px 0 3px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
}
.event-eps-prev { }
.event-eps-est  { color: var(--accent); }

/* Economic calendar meta (previous + estimate + impact) */
.event-econ-meta {
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 2px 0 3px;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted);
  align-items: center;
}
.event-econ-prev { }
.event-econ-est  { color: var(--accent); }
.event-impact    { font-family: var(--font); font-size: 9px; font-weight: 700;
                   letter-spacing: 0.05em; text-transform: uppercase; padding: 1px 5px;
                   border-radius: 2px; }
.event-impact--high { background: rgba(239,68,68,0.12); color: #EF4444; }
.event-impact--med  { background: rgba(245,158,11,0.12); color: #F59E0B; }
.event-impact--low  { background: rgba(100,116,139,0.12); color: var(--muted); }
.event-name {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.event-name--full { min-width: 0; }
.event-date {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
/* Hover state for clickable event rows */
.event-row--earnings:hover,
.event-row--econ[style*="cursor"]:hover {
  background: rgba(30,58,95,0.25);
  border-radius: 4px;
}

/* ── Key Events popover ────────────────────────────────────────────────────── */

.kv-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.kv-popover {
  position: absolute;
  z-index: 9001;
  width: 310px;
  background: #0F1E35;
  border: 1px solid #1E3A5F;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
  overflow: hidden;
}

.kv-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 10px;
  border-bottom: 1px solid #1E3A5F;
}

.kv-pop-title {
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
  letter-spacing: 0.02em;
}

.kv-pop-close {
  background: none;
  border: none;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.kv-pop-close:hover { color: #CBD5E1; }

.kv-pop-sub {
  font-size: 11px;
  color: #64748b;
  padding: 7px 14px 0;
}

.kv-pop-nums {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
}

.kv-pop-num {
  background: rgba(255,255,255,0.04);
  border: 1px solid #1E3A5F;
  border-radius: 6px;
  padding: 8px 12px;
  flex: 1;
  text-align: center;
}

.kv-pop-num-label {
  font-size: 9px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.kv-pop-num-val {
  font-size: 14px;
  font-weight: 700;
  color: #CBD5E1;
  font-family: var(--mono);
}

.kv-pop-ctx {
  margin: 0 14px 12px;
  background: rgba(30,58,95,0.4);
  border: 1px solid #1E3A5F;
  border-radius: 6px;
  padding: 9px 11px;
}

.kv-pop-ctx-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 5px;
}

.kv-pop-ctx-text {
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.5;
}

.kv-pop-loading,
.kv-pop-empty {
  font-size: 12px;
  color: #475569;
  padding: 20px 14px;
  text-align: center;
}

/* Earnings history table */
.kv-earn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--mono);
  margin-top: 2px;
}

.kv-earn-table th {
  font-size: 9px;
  font-family: var(--font);
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 6px 10px 5px;
  text-align: right;
  border-bottom: 1px solid #1E3A5F;
  background: rgba(15,30,53,0.7);
}

.kv-earn-table th:first-child { text-align: left; }

.kv-earn-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(30,58,95,0.5);
  color: #94A3B8;
  text-align: right;
}

.kv-earn-table tr:last-child td { border-bottom: none; }
.kv-earn-table td:first-child { text-align: left; color: #64748b; }

.kv-et-date { color: #64748b; }
.kv-et-val  { color: #CBD5E1; }
.kv-earn-beat { color: #10B981 !important; font-weight: 600; }
.kv-earn-miss { color: #EF4444 !important; font-weight: 600; }

/* ── Alex Fund widget ──────────────────────────────────────────────────────── */

.fund-widget-body { padding: 10px 12px 12px; }

.fund-kpi-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.fund-kpi {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-lt);
  border-radius: 3px;
}
.fund-kpi--up .fund-kpi-val { color: var(--ok); }
.fund-kpi--dn .fund-kpi-val { color: var(--err); }
.fund-kpi-val  { font-size: 14px; font-weight: 700; line-height: 1.2; color: var(--text); }
.fund-kpi-label { font-size: 10px; color: var(--muted); margin-top: 2px; }

.fund-pos-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.fund-pos-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-lt);
}
.fund-pos-row:last-child { border-bottom: none; }
.fund-pos-ticker { font-size: 12px; font-weight: 700; color: var(--text); min-width: 36px; flex-shrink: 0; }
.fund-pos-ticker--link:hover { color: var(--accent); text-decoration: underline; }
.fund-pos-name   { font-size: 11px; color: var(--muted); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fund-pos-ret    { font-size: 12px; font-weight: 600; flex-shrink: 0; color: var(--text); }
.fund-pos-up     { color: var(--ok)  !important; }
.fund-pos-dn     { color: var(--err) !important; }

/* ── Ask Alex widget ───────────────────────────────────────────────────────── */

.ask-alex-body { padding: 10px 12px 12px; }

.ask-alex-input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.ask-alex-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  width: auto;
}
.ask-alex-input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.ask-alex-input::placeholder { color: var(--muted); }

.ask-alex-submit {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.ask-alex-submit:hover:not(:disabled) { filter: brightness(1.12); }

.ask-alex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ask-alex-chip {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(76,124,255,0.08);
  border: 1px solid rgba(76,124,255,0.22);
  color: var(--accent);
  border-radius: 12px;
  cursor: pointer;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}
.ask-alex-chip:hover:not(:disabled) {
  background: rgba(76,124,255,0.14);
  border-color: var(--accent);
  filter: none;
}

/* ── Seasonal Signals widget ───────────────────────────────────────────────── */

.seasonal-widget-body { padding: 10px 12px 12px; }

.seasonal-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
/* Single-column stacked variant — used when card is half-width */
.seasonal-cols--stack {
  grid-template-columns: 1fr;
  gap: 8px;
}

.seasonal-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.seasonal-col-label--bull { color: var(--ok); }
.seasonal-col-label--bear { color: var(--err); }

.seasonal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-lt);
}
.seasonal-row:last-child { border-bottom: none; }
.seasonal-row:hover .seasonal-row-acts { opacity: 1; }

/* Left section: ticker + return + win-rate */
.seasonal-row-left {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

/* Right section: action buttons (same as scanner rows) */
.seasonal-row-acts {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.25;
  transition: opacity .15s;
}
.seasonal-row:hover .seasonal-row-acts,
.seasonal-row:focus-within .seasonal-row-acts { opacity: 1; }

/* Compact report button variant */
.sct-report-btn--xs {
  font-size: 9px;
  padding: 2px 5px;
  height: 18px;
  line-height: 1;
}

.seasonal-ticker {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
  flex-shrink: 0;
}
.seasonal-ticker--link:hover { color: var(--accent); text-decoration: underline; }
.seasonal-ret {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.seasonal-ret--bull { color: var(--ok); }
.seasonal-ret--bear { color: var(--err); }
.seasonal-wr {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Portfolio Simulator teaser ────────────────────────────────────────────── */

.sim-widget-body { padding: 10px 12px 14px; }
.sim-widget-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
}
.sim-widget-btn {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  justify-content: center;
}
.sim-widget-btn:hover:not(:disabled) { filter: brightness(1.1); }

/* ── Alex Ideas widget ─────────────────────────────────────────────────────── */

.ideas-widget-body { padding: 6px 0 8px; }

.ideas-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border-lt);
}
.ideas-row:last-child { border-bottom: none; }

.ideas-rank   { font-size: 10px; color: var(--muted); min-width: 14px; flex-shrink: 0; }
.ideas-ticker { font-size: 12px; font-weight: 700; color: var(--accent); min-width: 34px; flex-shrink: 0; }
.ideas-name   { font-size: 11px; color: var(--muted); flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ideas-weight { font-size: 11px; font-weight: 600; color: var(--text); flex-shrink: 0; }

/* ── Alex Ideas interactive enhancements ───────────────────────────────────── */

/* Wrapper that stacks the row + why-box vertically */
.ai-idea-row {
  display: flex;
  flex-direction: column;
}

/* Clickable ticker links */
.ai-ticker-link {
  cursor: pointer;
  transition: opacity .12s;
}
.ai-ticker-link:hover {
  text-decoration: underline;
  opacity: 0.80;
}

/* Why? toggle button */
.ai-why-btn {
  background: transparent;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 3px;
  color: #3B82F6;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, border-color .12s;
  line-height: 1.4;
}
.ai-why-btn:hover {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.45);
}

/* Explanation box that appears below the row */
.ai-why-box {
  width: 100%;
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: 5px;
  padding: 8px 12px;
  margin-top: 5px;
  font-size: 11px;
  color: #94A3B8;
  line-height: 1.6;
}

@keyframes ai-why-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.ai-why-box--loading {
  animation: ai-why-pulse 1.2s ease infinite;
  color: #475569;
}

.ideas-narrative {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  padding: 8px 12px 0;
  border-top: 1px solid var(--border-lt);
  margin-top: 4px;
}

/* ── Compact scanner table (dashboard card view) ──────────────────────────── */

.scan-compact-wrap {
  overflow-x: auto;
  width: 100%;
}

.scan-compact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.scan-compact-table thead {
  background: rgba(255,255,255,0.02);
}

.scan-compact-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sct-th-rank  { width: 24px; text-align: center; }
.sct-th-asset { width: auto; }
.sct-th-score { width: 60px; text-align: center; }
.sct-th-sig   { width: 38px; text-align: center; }
.sct-th-act   { width: 165px; text-align: right; }

.sct-row {
  border-bottom: 1px solid var(--border-lt);
  transition: background 0.08s;
}
.sct-row:hover { background: rgba(255,255,255,0.035); }
.sct-row--high { }
.sct-row--high .sct-ticker { color: var(--ok); }

.sct-row td { padding: 6px 8px; vertical-align: middle; }

.sct-rank {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  width: 24px;
}

/* sct-asset cell — top-align so strips don't push other cells */
.sct-asset { vertical-align: top !important; padding-top: 6px !important; }
.sct-asset-wrap { cursor: pointer; }
.sct-ticker {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.sct-name {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 1px;
}

.sct-score { text-align: center; }
.sct-score-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 3px;
}
.sct-score-bar-wrap {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.sct-score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.sct-score-bar--hi { background: var(--ok); }
.sct-score-bar--md { background: #f59e0b; }
.sct-score-bar--lo { background: var(--err); }

.sct-sig { text-align: center; }
.sct-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}
.sct-badge--hi { color: var(--ok); background: var(--ok-bg); }
.sct-badge--md { color: var(--muted); background: rgba(255,255,255,0.06); }

.sct-act {
  text-align: right;
  white-space: nowrap;
}

/* ── Action toolbar buttons (★ ≈ vs ⚡) — always visible ─────────────────── */
.sct-hov-btn {
  opacity: 1;
  pointer-events: auto;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 3px;
  transition: background .12s, color .12s;
  vertical-align: middle;
}
.sct-hov-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #e2e8f0;
}
/* Star — gold when watching */
.sct-hov-btn--watched {
  color: #f59e0b;
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.08);
}
.sct-hov-btn--watched:hover {
  background: rgba(245,158,11,0.16);
}
/* Alex — green tint */
.sct-hov-btn--alex {
  color: #34d399;
  border-color: rgba(16,185,129,0.25);
  background: rgba(16,185,129,0.07);
}
.sct-hov-btn--alex:hover {
  background: rgba(16,185,129,0.16);
}

.sct-report-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(76,124,255,0.10);
  border: 1px solid rgba(76,124,255,0.25);
  color: var(--accent);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
}
.sct-report-btn:hover:not(:disabled) {
  background: rgba(76,124,255,0.18);
  filter: none;
}

/* "See all N results" button below compact table */
.scanner-full-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.03);
  border: none;
  border-top: 1px solid var(--border-lt);
  color: var(--accent);
  cursor: pointer;
  border-radius: 0 0 4px 4px;
  letter-spacing: 0.03em;
}
.scanner-full-btn:hover:not(:disabled) {
  background: rgba(76,124,255,0.08);
  filter: none;
}

/* ── Full-scan overlay ─────────────────────────────────────────────────────── */

.scan-full-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 4000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.scan-full-panel {
  /* Re-declare dark-theme CSS variables so nested scan-table rules
     inherit the same palette as .scan-page even though this overlay
     is mounted on <body> (outside .scan-page). */
  --bg:        #0b0e14;
  --surface:   #0d0f14;
  --border:    #1e2230;
  --border-lt: #1a1f2e;
  --text:      #e6e9ef;
  --muted:     #606880;
  --accent:    #4c7cff;
  --ok:        #3ecf8e;
  --ok-bg:     rgba(62, 207, 142, 0.08);
  --err:       #e05a5a;
  --err-bg:    rgba(224, 90, 90, 0.08);
  color:       #e6e9ef;
  background: #0d0f14;
  border: 1px solid #1e2230;
  border-radius: 8px;
  width: 100%;
  max-width: 1300px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.scan-full-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #1e2230;
  flex-shrink: 0;
}

.scan-full-title {
  font-size: 14px;
  font-weight: 700;
  color: #e6e9ef;
  letter-spacing: 0.03em;
}

.scan-full-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid #1e2230;
  color: #8b93aa;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.scan-full-close:hover:not(:disabled) {
  background: rgba(255,255,255,0.10);
  color: #e6e9ef;
  filter: none;
}

.scan-full-body {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0 0 16px;
  max-height: calc(100vh - 120px);
}

/* ── Responsive: collapse to single column on narrow screens ───────────────── */

/* dashboard-grid and dash-bottom-row collapse handled at 960px below */

@media (max-width: 600px) {
  .seasonal-cols {
    grid-template-columns: 1fr;
  }
}

/* ── Alex Fund LIVE badge (IBKR connected) ─────────────────────────────────── */

.fund-live-badge-row {
  padding: 4px 12px 2px;
}

.fund-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.30);
  border-radius: 3px;
  padding: 2px 7px;
}

/* ── Regime narrative box ──────────────────────────────────────────────────── */

.regime-narrative-box {
  background: rgba(7, 13, 26, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 4px;
  padding: 5px 8px;
  margin-top: 5px;
  font-size: 10px;
  color: #94A3B8;
  line-height: 1.5;
}

/* ── Regime indicator grid ─────────────────────────────────────────────────── */

.regime-ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0 6px;
}

.regime-ind {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-lt);
  border-radius: 4px;
  padding: 5px 7px;
  text-align: center;
}

.regime-ind-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
  white-space: nowrap;
}

.regime-ind-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.regime-ind--ok   { color: var(--ok); }
.regime-ind--warn { color: var(--err); }

/* ── News auth prompt ──────────────────────────────────────────────────────── */

.news-auth-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 16px 12px;
}

/* ── Topbar compact search ─────────────────────────────────────────────────── */

.topbar-search-wrap {
  flex: 1;
  max-width: 380px;
  min-width: 0;
  position: relative;
  margin: 0 16px;
}

.topbar-search-input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  font-size: 12px;
  font-weight: 400;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.topbar-search-input::placeholder { color: var(--muted); }
.topbar-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(76,124,255,0.06);
}

/* Search icon (via ::before on the wrapper) */
.topbar-search-wrap::before {
  content: "🔍";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  pointer-events: none;
  opacity: 0.5;
}

/* Autocomplete dropdown anchored to topbar search */
.topbar-search-wrap .ticker-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 3000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  max-height: 260px;
  overflow-y: auto;
}

/* Hide topbar search on very small screens */
@media (max-width: 680px) {
  .topbar-search-wrap { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — Topbar regime chip + macro minis
════════════════════════════════════════════════════════════════════════════ */

/* Regime chip in topbar */
.topbar-regime-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Regime colour variants */
.topbar-regime-chip.regime-risk-on {
  background: rgba(16, 185, 129, 0.13);
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.28);
}
.topbar-regime-chip.regime-risk-off {
  background: rgba(239, 68, 68, 0.13);
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.28);
}
.topbar-regime-chip.regime-stagflation {
  background: rgba(245, 158, 11, 0.13);
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.28);
}
.topbar-regime-chip.regime-reflation {
  background: rgba(99, 102, 241, 0.13);
  color: #818CF8;
  border-color: rgba(99, 102, 241, 0.28);
}
.topbar-regime-chip.regime-contraction {
  background: rgba(107, 114, 128, 0.13);
  color: #9CA3AF;
  border-color: rgba(107, 114, 128, 0.28);
}

/* VIX / 10Y / HY macro mini displays */
.topbar-macro-mini {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
  padding: 0 6px;
  border-left: 1px solid rgba(255,255,255,0.07);
}

.topbar-macro-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

.topbar-macro-val {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
  letter-spacing: 0.02em;
}

/* Hide macro minis on narrow screens */
@media (max-width: 820px) {
  .topbar-macro-mini { display: none; }
}
@media (max-width: 960px) {
  .topbar-regime-chip { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — Sidebar card shell (.s-card)
════════════════════════════════════════════════════════════════════════════ */

.s-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.s-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border-lt);
  background: rgba(255,255,255,0.02);
  gap: 6px;
}

.s-card-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.s-card-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.s-card-link:hover { opacity: 1; }

.s-card-body {
  padding: 10px 11px;
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — Unified section label + link
════════════════════════════════════════════════════════════════════════════ */

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-lt);
  background: rgba(255,255,255,0.025);
}

.section-label-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.section-label-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.8;
  border: none;
  background: none;
  padding: 0;
  transition: opacity 0.15s;
}
.section-label-link:hover { opacity: 1; filter: none; }

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — Scanner row quiet action buttons
════════════════════════════════════════════════════════════════════════════ */

/* Base quiet action button */
.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1;
}
.ab-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
  filter: none;
}

.ab-report { color: var(--accent); border-color: rgba(29,78,216,0.25); }
.ab-report:hover:not(:disabled) {
  background: rgba(29,78,216,0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.ab-sim { }

.ab-vs { }

.ab-star {
  padding: 0 6px;
  font-size: 13px;
}
.ab-star.active {
  color: #F59E0B;
  border-color: rgba(245,158,11,0.30);
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — News widget as "Today's Intelligence" in main column
════════════════════════════════════════════════════════════════════════════ */

/* When news is in the left (wider) column, show a 2-col grid on larger screens */
@media (min-width: 961px) {
  .news-intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  /* Left column items get a right border as divider */
  .news-intel-grid .news-widget-item:nth-child(odd) {
    border-right: 1px solid var(--border-lt);
  }
  /* Remove bottom border from last two items (bottom row of 2-col grid) */
  .news-intel-grid .news-widget-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   REDESIGN — Responsive sidebar breakpoint update
════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dash-bottom-row {
    grid-template-columns: 1fr;
  }
  .dash-top-cards-row {
    grid-template-columns: 1fr;
  }
  .sim-workspace--embedded .sim-ws-body {
    height: auto;
    min-height: 400px;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   Anti-Asymmetry Scanner tab — short-side / overvaluation signals
════════════════════════════════════════════════════════════════════════════ */

/* Tab button — red tint, distinct from normal modes */
.scan-page .scan-mode-btn--anti {
  color: #f87171;
  border-color: rgba(239, 68, 68, .25);
}
.scan-page .scan-mode-btn--anti.active {
  background: rgba(239, 68, 68, .12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, .40);
}
.scan-page .scan-mode-btn--anti:hover:not(.active):not(:disabled) {
  background: rgba(239, 68, 68, .07);
  color: #f87171;
  border-color: rgba(239, 68, 68, .35);
  filter: none;
}

/* ── Warning banner ──────────────────────────────────────────────────────── */
.anti-warning-bar {
  background: rgba(239, 68, 68, .06);
  border: 1px solid rgba(239, 68, 68, .18);
  border-radius: 4px;
  padding: 5px 10px;
  margin-bottom: 8px;
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
}

/* ── Result rows ─────────────────────────────────────────────────────────── */
.anti-row {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) 42px 68px 90px 46px minmax(0,1fr);
  gap: 4px;
  align-items: center;
  padding: 5px 4px;
  border-radius: 4px;
}
.anti-hdr {
  padding-bottom: 4px;
  border-bottom: 1px solid #1e2230;
  margin-bottom: 2px;
}
.anti-hdr .anti-col {
  font-size: 9px;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.anti-data-row {
  border-bottom: 1px solid rgba(239, 68, 68, .08);
  cursor: pointer;
}
.anti-data-row:hover { background: rgba(239, 68, 68, .05); }

.anti-col--rank  { color: #475569; font-size: 10px; }
.anti-col--score { text-align: center; }
.anti-col--price { text-align: right; font-size: 11px; color: #e2e8f0; }
.anti-col--down  { display: flex; align-items: center; gap: 5px; }
.anti-col--pover { text-align: right; font-size: 11px; color: #ef4444; font-weight: 600; }
.anti-col--why   { font-size: 9px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.anti-ticker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  cursor: pointer;
}
.anti-ticker:hover { color: #ef4444; text-decoration: underline; }
.anti-company {
  display: block;
  font-size: 9px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anti-score-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(239, 68, 68, .10);
}

.anti-down-pct {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  min-width: 32px;
  text-align: right;
}
.anti-bar-wrap {
  flex: 1;
  height: 3px;
  background: #1e2230;
  border-radius: 2px;
  overflow: hidden;
}
.anti-bar-fill {
  height: 100%;
  background: #ef4444;
  border-radius: 2px;
  transition: width .3s ease;
}

/* ⚡ Ask Alex button inside anti-asymmetry rows */
.anti-alex-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 4px;
  color: #34d399;
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.anti-data-row { position: relative; }
.anti-data-row:hover .anti-alex-btn { opacity: 1; }
.anti-alex-btn:hover { background: rgba(16,185,129,.2); }

/* ════════════════════════════════════════════════════════════════════════════
   Conviction strips — real signal numbers under each scanner ticker
════════════════════════════════════════════════════════════════════════════ */

.conviction-strips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.conviction-strip {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: default;
  white-space: nowrap;
  line-height: 1.5;
  opacity: 0.92;
  transition: opacity .12s;
}

.conviction-strip:hover { opacity: 1; }

/* Dark theme overrides for scan-page */
.scan-page .conviction-strip {
  font-size: 9px;
}

/* Compact table — sct-ticker in dark theme */
.scan-page .sct-ticker {
  color: #e2e8f0;
}
.scan-page .sct-name {
  color: #606880;
}


/* =============================================================================
   Redesigned Portfolio Simulator — mockup-matching CSS (sim- prefix)
   ============================================================================= */

/* Left panel — 340px gives the positions grid enough room for the ticker 1fr column */
.sim-ws-left { width: 340px !important; background: #0A1628 !important; }
.sim-lps { padding: 11px 14px; border-bottom: 1px solid #1E3A5F; }
.sim-lps:last-child { border-bottom: none; }
.sim-lps--flex { flex: 1; display: flex; flex-direction: column; }
.sim-lpl {
  font-size: 9px; font-weight: 700; color: #3B82F6;
  letter-spacing: .7px; text-transform: uppercase; margin-bottom: 7px;
}
.sim-alloc-tabs { display: flex; gap: 2px; margin-bottom: 6px; }
.sim-at {
  padding: 3px 8px; font-size: 10px; font-weight: 500;
  border-radius: 3px; cursor: pointer; border: 1px solid transparent;
  color: #475569; background: transparent;
}
.sim-at.active { background: rgba(59,130,246,.1); color: #3B82F6; border-color: rgba(59,130,246,.2); }
.sim-at:hover { color: #94A3B8; }
.sim-alloc-desc { font-size: 9px; color: #334155; margin-top: 4px; line-height: 1.4; }
.sim-add-pos {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; padding: 6px; margin-top: 6px;
  background: transparent;
  border: 1px dashed rgba(59,130,246,.4);
  border-radius: 4px;
  color: #60A5FA;
  font-size: 10px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  box-sizing: border-box;
}
.sim-add-pos:hover {
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.6);
  color: #93C5FD;
}
.sim-wbar-wrap { margin-top: 4px; }
.sim-wbar { height: 7px; border-radius: 4px; display: flex; gap: 1px; overflow: hidden; margin: 6px 0; }
.sim-wseg { height: 100%; border-radius: 2px; transition: width .3s; }
.sim-wleg { display: flex; flex-wrap: wrap; gap: 4px; }
.sim-wi { display: flex; align-items: center; gap: 3px; font-size: 9px; color: #64748B; }
.sim-wdot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sim-upload-drop {
  border: 1px dashed rgba(30,58,95,.8); border-radius: 5px; padding: 9px;
  text-align: center; cursor: pointer; transition: border-color .15s; display: block;
}
.sim-upload-drop:hover { border-color: #3B82F6; }
.sim-ul { font-size: 10px; color: #475569; }
.sim-us { font-size: 9px; color: #334155; margin-top: 2px; }

/* Alex reading box */
.sim-alex-box-wrap {
  margin: 12px 16px 10px;
  background: #070d1a; border: 1px solid rgba(59,130,246,.2);
  border-radius: 6px; padding: 10px 14px;
}
.sim-ab-hdr { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.sim-ab-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3B82F6; flex-shrink: 0;
  animation: sim-ab-pulse 2s infinite;
}
@keyframes sim-ab-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.sim-ab-title { font-size: 10px; font-weight: 700; color: #3B82F6; letter-spacing: .4px; }
.sim-ab-txt { font-size: 10px; color: #94A3B8; line-height: 1.55; }
.sim-ab-txt p { margin-bottom: 6px; }
.sim-ab-txt p:last-child { margin-bottom: 0; }

/* Verdict card */
.sim-verdict-section { margin: 0; }
.sim-verdict { margin: 12px 16px; background: #0A1628; border: 1px solid #1E3A5F; border-radius: 7px; overflow: hidden; }
.sim-vt { background: rgba(239,68,68,.04); border-bottom: 1px solid rgba(239,68,68,.1); padding: 12px 16px; display: flex; gap: 14px; align-items: flex-start; }
.sim-vt-lbl { font-size: 9px; font-weight: 700; color: #EF4444; letter-spacing: .7px; margin-bottom: 3px; }
.sim-vt-txt { font-size: 12px; font-weight: 500; color: #F1F5F9; line-height: 1.5; flex: 1; }
.sim-vg { flex-shrink: 0; background: #0F1E35; border: 1px solid #1E3A5F; border-radius: 5px; padding: 9px 14px; text-align: center; }
.sim-vg-n { font-size: 24px; font-weight: 700; line-height: 1; }
.sim-vg-n-pos { color: #10B981; }
.sim-vg-n-am  { color: #F59E0B; }
.sim-vg-n-neg { color: #EF4444; }
.sim-vg-l { font-size: 9px; color: #475569; margin-top: 2px; }
.sim-vb { display: grid; grid-template-columns: repeat(4,1fr); }
.sim-vbi { padding: 7px 10px; border-right: 1px solid #1E3A5F; text-align: center; }
.sim-vbi:last-child { border-right: none; }
.sim-vbl { font-size: 9px; color: #475569; margin-bottom: 2px; }
.sim-vbv { font-size: 11px; font-weight: 600; }

/* Truth row */
.sim-truth-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 0 16px 12px; }
.sim-tc { background: #0A1628; border-radius: 5px; padding: 9px 11px; border-top: 2px solid; }
.sim-tc-type { font-size: 9px; font-weight: 700; letter-spacing: .4px; margin-bottom: 3px; }
.sim-tc-title { font-size: 10px; font-weight: 600; color: #F1F5F9; margin-bottom: 2px; line-height: 1.3; }
.sim-tc-body { font-size: 9px; color: #475569; line-height: 1.4; }

/* Metrics strip */
.sim-metrics-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 0 16px 12px; }
.sim-mc { background: #0A1628; border: 1px solid #1E3A5F; border-radius: 5px; padding: 8px 10px; }
.sim-mc-l { font-size: 9px; color: #475569; margin-bottom: 2px; }
.sim-mc-v { font-size: 15px; font-weight: 700; color: #F1F5F9; margin-bottom: 1px; }
.sim-mc-s { font-size: 9px; }

/* Divider */
.sim-divider { height: 1px; background: #1E3A5F; margin: 0 16px 12px; }

/* Section wrapper */
.sim-sec { margin: 0 16px 12px; }
.sim-sl { font-size: 9px; font-weight: 700; color: #3B82F6; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 7px; display: flex; justify-content: space-between; align-items: baseline; }
.sim-ss { font-size: 9px; color: #475569; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Position breakdown table (right panel) — table element only, avoids conflict with div-based left panel */
table.sim-pos-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* Col 1: Ticker — fixed, truncate long names */
table.sim-pos-table th:nth-child(1),
table.sim-pos-table td:nth-child(1) { width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Col 2: Weight */
table.sim-pos-table th:nth-child(2),
table.sim-pos-table td:nth-child(2) { width: 44px; text-align: center; }
/* Col 3: Alex Score badge (LOW/MOD/HIGH + value) — needs enough room */
table.sim-pos-table th:nth-child(3),
table.sim-pos-table td:nth-child(3) { width: 84px; overflow: hidden; }
/* Col 4: Vol */
table.sim-pos-table th:nth-child(4),
table.sim-pos-table td:nth-child(4) { width: 50px; }
/* Col 5: Max DD */
table.sim-pos-table th:nth-child(5),
table.sim-pos-table td:nth-child(5) { width: 50px; }
/* Col 6: DI */
table.sim-pos-table th:nth-child(6),
table.sim-pos-table td:nth-child(6) { width: 38px; }
/* Col 7: MDG+5% */
table.sim-pos-table th:nth-child(7),
table.sim-pos-table td:nth-child(7) { width: 52px; }
/* Col 8: Role — takes remaining width */
table.sim-pos-table th { font-size: 9px; color: #475569; font-weight: 500; padding: 4px 7px; border-bottom: 1px solid #1E3A5F; text-align: left; }
table.sim-pos-table td { padding: 6px 7px; border-bottom: 1px solid rgba(30,58,95,.25); font-size: 10px; color: #94A3B8; }
table.sim-pos-table tr:last-child td { border-bottom: none; }
table.sim-pos-table tr:hover td { background: rgba(30,58,95,.2); }

/* Color utilities for redesigned sections */
.sim-pos { color: #10B981; }
.sim-neg { color: #EF4444; }
.sim-am  { color: #F59E0B; }
.sim-bl  { color: #60A5FA; }
.sim-mu  { color: #475569; }

/* Score badge (right panel position table) */
.sim-score-badge { padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 600; display: inline-block; white-space: nowrap; }
.sim-score-badge--high { background: rgba(16,185,129,.1); color: #10B981; }
.sim-score-badge--mod  { background: rgba(245,158,11,.1); color: #F59E0B; }
.sim-score-badge--low  { background: rgba(239,68,68,.1); color: #EF4444; }
.sim-score-badge--none { background: rgba(71,85,105,.1); color: #64748B; }

/* Correlation heatmap */
.sim-hm-grid { display: grid; gap: 2px; }
.sim-hm-cell { border-radius: 3px; padding: 6px 4px; text-align: center; font-size: 9px; font-weight: 600; }
.sim-hm-cell--header { background: rgba(59,130,246,.15); color: #93C5FD; }
.sim-hm-legend { margin-top: 5px; font-size: 9px; color: #334155; display: flex; gap: 10px; flex-wrap: wrap; }
.sim-hm-leg-box { display: inline-block; width: 8px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }

/* Risk heatmap */
.sim-risk-hm { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.sim-rh-cell { border-radius: 4px; padding: 7px 8px; text-align: center; }
.sim-rh-l { font-size: 9px; opacity: .8; margin-bottom: 2px; }
.sim-rh-v { font-size: 11px; font-weight: 700; }

/* Dollar impact */
.sim-dc-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.sim-dc { background: #0A1628; border: 1px solid #1E3A5F; border-radius: 5px; padding: 9px 11px; }
.sim-dc-s { font-size: 9px; color: #475569; margin-bottom: 4px; }
.sim-dc-a { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.sim-dc-p { font-size: 9px; font-weight: 600; }
.sim-dc-b { height: 3px; border-radius: 2px; margin-top: 5px; background: #1E3A5F; }
.sim-dc-bar-fill { height: 100%; border-radius: 2px; }

/* Stress scenarios */
.sim-stress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sim-st-card { background: #0A1628; border: 1px solid #1E3A5F; border-radius: 5px; padding: 9px 11px; }
.sim-sbl { font-size: 9px; color: #3B82F6; font-weight: 700; letter-spacing: .4px; margin-bottom: 7px; }
.sim-sb-row { margin-bottom: 6px; }
.sim-sb-hdr { display: flex; justify-content: space-between; margin-bottom: 3px; }
.sim-sb-nm { font-size: 9px; color: #94A3B8; }
.sim-sb-vl { font-size: 9px; font-weight: 600; }
.sim-sb-tr { height: 5px; background: #1E3A5F; border-radius: 3px; overflow: hidden; }
.sim-sb-fi { height: 100%; border-radius: 3px; }
.sim-sb-prob { font-size: 9px; }
.sim-sb-tail { margin-top: 2px; }
.sim-dist-lbl { font-size: 9px; color: #475569; margin-bottom: 2px; }
.sim-dist-val { font-size: 14px; font-weight: 700; }
.sim-dist-sub { font-size: 9px; color: #475569; margin-top: 2px; }

/* What Alex would change */
.sim-changes { display: flex; flex-direction: column; gap: 4px; }
.sim-cr { background: #0A1628; border-radius: 4px; padding: 7px 10px; display: flex; align-items: flex-start; gap: 8px; }
.sim-cr-act { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap; width: 58px; text-align: center; flex-shrink: 0; }
.sim-cr-r { background: rgba(239,68,68,.1); color: #EF4444; }
.sim-cr-g { background: rgba(16,185,129,.1); color: #10B981; }
.sim-cr-tk { font-size: 11px; font-weight: 600; color: #F1F5F9; flex-shrink: 0; min-width: 50px; max-width: 80px; word-break: break-all; }
.sim-cr-re { font-size: 9px; color: #475569; flex: 1; line-height: 1.35; }
.sim-cr-im { font-size: 10px; font-weight: 600; flex-shrink: 0; }
.sim-recon-none { font-size: 9px; color: #475569; padding: 4px 0; }
.sim-recon-interp { font-size: 9px; color: #475569; }

/* Missing exposure */
.sim-miss { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.sim-ms { background: #0A1628; border: 1px dashed rgba(59,130,246,.2); border-radius: 4px; padding: 7px 9px; text-align: center; }
.sim-ms-s { font-size: 10px; color: #60A5FA; font-weight: 600; margin-bottom: 2px; }
.sim-ms-n { font-size: 9px; color: #334155; }

/* PDF CTA banner */
.sim-pdf-cta {
  margin: 0 16px 16px;
  background: rgba(16,185,129,.04);
  border: 1px solid rgba(16,185,129,.15);
  border-radius: 5px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sim-pdf-cta-title { font-size: 11px; font-weight: 600; color: #F1F5F9; margin-bottom: 2px; }
.sim-pdf-cta-sub { font-size: 10px; color: #475569; }
.sim-pdf-cta-left { flex: 1; }
.sim-pdf-dl-btn { background: #10B981 !important; border-color: #10B981 !important; white-space: nowrap; flex-shrink: 0; }

/* Responsive for redesigned sections */
@media (max-width: 720px) {
  .sim-ws-left { width: 100% !important; border-right: none !important; }
  .sim-truth-row { grid-template-columns: 1fr; }
  .sim-metrics-strip { grid-template-columns: repeat(2,1fr); }
  .sim-vb { grid-template-columns: repeat(2,1fr); }
  .sim-dc-cards { grid-template-columns: 1fr; }
  .sim-stress-grid { grid-template-columns: 1fr; }
  .sim-miss { grid-template-columns: repeat(2,1fr); }
  .sim-risk-hm { grid-template-columns: repeat(2,1fr); }
}

/* HRP bar rows — matching mockup .hrp-row pattern */
.sim-hrp-card { background:#0A1628; border:1px solid #1E3A5F; border-radius:5px; padding:10px 12px; }
.sim-hrp-card-lbl { font-size:9px; color:#3B82F6; font-weight:700; letter-spacing:.4px; margin-bottom:8px; }
.sim-hrp-rows { display:flex; flex-direction:column; gap:6px; }
.hrp-row { display:grid; grid-template-columns:48px 1fr 40px 60px; gap:5px; align-items:center; }
.hrp-tk { font-size:10px; font-weight:600; color:#F1F5F9; }
.hrp-bar { position:relative; height:5px; background:#1E3A5F; border-radius:3px; }
.hrp-cur { position:absolute; top:0; left:0; height:100%; border-radius:3px; transition:width .4s; }
.hrp-target { position:absolute; top:-2px; height:9px; width:2px; background:#10B981; border-radius:1px; }
.sim-hrp-cur-val { font-size:9px; color:#475569; text-align:right; }
.sim-hrp-hrp-val { font-size:9px; color:#10B981; text-align:right; }

/* HRP Optimization Summary grid — matching mockup 3-cell inline grid */
.sim-hrp-sum-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-top:10px; padding-top:8px; border-top:1px solid #1E3A5F; }
.sim-hrp-sum-cell { background:#0F1E35; border-radius:4px; padding:7px; text-align:center; }
.sim-hrp-sum-lbl { font-size:9px; color:#475569; margin-bottom:2px; }
.sim-hrp-sum-val { font-size:14px; font-weight:700; }
.sim-hrp-sum-val--amber { color:#F59E0B; }
.sim-hrp-sum-val--green { color:#10B981; }
.sim-hrp-sum-val--blue  { color:#60A5FA; }
.sim-hrp-sum-note { font-size:9px; color:#475569; }
.sim-optim-interp { font-size:9px; color:#475569; margin-top:6px; line-height:1.4; }

/* Macro regime bar — matching mockup .regime-bar / .rb-* pattern */
.regime-bar { background:#0A1628; border:1px solid rgba(16,185,129,.2); border-radius:5px; padding:10px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.rb-left { flex:1; }
.rb-badge { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
.rb-dot { width:7px; height:7px; border-radius:50%; background:#10B981; }
.rb-label { font-size:11px; font-weight:700; color:#10B981; }
.rb-text { font-size:10px; color:#475569; line-height:1.4; }
.rb-right { background:#0F1E35; border:1px solid #1E3A5F; border-radius:4px; padding:7px 12px; text-align:center; flex-shrink:0; }
.rb-num { font-size:16px; font-weight:700; color:#10B981; }
.rb-lbl { font-size:9px; color:#475569; }

/* ── Fix My Portfolio button ─────────────────────────────────────────────── */
.sim-fix-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(59,130,246,.08));
  border: 1px solid rgba(16,185,129,.35);
  border-radius: 6px;
  padding: 10px 16px;
  color: #10B981;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .2s, border-color .2s;
  display: block;
}
.sim-fix-btn:hover {
  background: rgba(16,185,129,.2);
  border-color: rgba(16,185,129,.55);
}

/* ── Before / After comparison panel ────────────────────────────────────── */
.sim-ba-panel {
  margin: 0 0 10px;
  background: #0A1628;
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 7px;
  overflow: hidden;
  font-size: 10px;
}
.sim-ba-hdr {
  background: rgba(16,185,129,.06);
  border-bottom: 1px solid rgba(16,185,129,.15);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-ba-title { font-size: 9px; font-weight: 700; color: #10B981; letter-spacing: .5px; }
.sim-ba-note  { font-size: 9px; color: #475569; margin-left: auto; }
.sim-ba-body  {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: start;
}
.sim-ba-col   { padding: 10px 14px; }
.sim-ba-col--after { border-left: 1px solid #1E3A5F; }
.sim-ba-side-label { font-size: 8px; font-weight: 700; letter-spacing: .6px; margin-bottom: 6px; text-transform: uppercase; }
.sim-ba-row   { color: #94A3B8; padding: 2px 0; }
.sim-ba-row--after { color: #F1F5F9; font-weight: 600; display: flex; justify-content: space-between; }
.sim-ba-row--after span { color: #475569; font-weight: 400; }
.sim-ba-metric { margin-top: 8px; padding-top: 6px; border-top: 1px solid #1E3A5F; font-size: 10px; font-weight: 600; }
.sim-ba-arrow  { display: flex; align-items: center; justify-content: center; color: #3B82F6; font-size: 16px; padding-top: 28px; }

/* ── Portfolio Health Radar ──────────────────────────────────────────────── */
.sim-radar-sec { margin-bottom: 10px; }
.sim-sl--radar { color: #3B82F6 !important; }
.sim-radar-wrap {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Compact news widget (sidebar mode) ─────────────────────────────────── */
.news-widget-body--compact { padding: 2px 0; }
.news-widget-item--compact {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(30,58,95,.3);
}
.news-widget-item--compact:last-child { border-bottom: none; }
.news-widget-item--compact .news-widget-title { font-size: 11px; }
.news-widget-item--compact .news-widget-meta  { font-size: 9px; margin-top: 2px; }

/* ── Fix My Portfolio preview panel ────────────────────────────────────── */
.sim-fix-preview {
  margin-top: 8px;
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 6px;
  overflow: hidden;
  background: #0A1628;
}
.sim-fp-hdr {
  background: rgba(16,185,129,.06);
  border-bottom: 1px solid rgba(16,185,129,.15);
  padding: 7px 12px;
  display: flex; align-items: center; gap: 7px;
}
.sim-fp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10B981; flex-shrink: 0; display: inline-block;
}
.sim-fp-title { font-size: 10px; font-weight: 700; color: #10B981; letter-spacing: .4px; }
.sim-fp-sub   { font-size: 9px; color: #475569; margin-left: auto; }
.sim-fp-body  { padding: 10px 12px; }
.sim-fp-changes { margin-bottom: 8px; }
.sim-fp-row {
  display: flex; align-items: baseline; gap: 7px;
  padding: 4px 0; border-bottom: 1px solid rgba(30,58,95,.3); font-size: 10px;
}
.sim-fp-row:last-child { border-bottom: none; }
.sim-fp-act {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 3px; white-space: nowrap; flex-shrink: 0;
}
.sim-fp-act--r { background: rgba(239,68,68,.1);  color: #EF4444; }
.sim-fp-act--g { background: rgba(16,185,129,.1); color: #10B981; }
.sim-fp-tk   { font-weight: 700; color: #F1F5F9; font-size: 11px; min-width: 55px; flex-shrink: 0; }
.sim-fp-from { color: #475569; font-weight: 400; font-size: 9px; }
.sim-fp-re   { color: #64748B; font-size: 9px; }
.sim-fp-ba {
  display: flex; gap: 8px; align-items: stretch; margin: 8px 0;
}
.sim-fp-ba-col {
  flex: 1; background: #0F1E35; border-radius: 5px; padding: 7px 9px;
}
.sim-fp-ba-col--after  { border: 1px solid rgba(16,185,129,.2); }
.sim-fp-ba-arr {
  color: #3B82F6; font-size: 18px;
  display: flex; align-items: center; flex-shrink: 0;
}
.sim-fp-ba-lbl {
  font-size: 9px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; margin-bottom: 5px;
}
.sim-fp-ba-lbl--before { color: #EF4444; }
.sim-fp-ba-lbl--after  { color: #10B981; }
.sim-fp-ba-stat {
  display: flex; justify-content: space-between;
  font-size: 9px; padding: 2px 0; color: #64748B;
}
.sim-fp-ba-stat span:last-child { font-weight: 600; color: #CBD5E1; }
.sim-fp-delta { font-size: 9px; color: #10B981; margin-bottom: 6px; }
.sim-fp-disc  { font-size: 9px; color: #334155; margin: 4px 0 8px; line-height: 1.4; }
.sim-fix-btn--confirm {
  width: 100%; padding: 8px; margin-top: 0;
  background: #10B981; color: #050F1C;
  border: none; border-radius: 5px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.sim-fix-btn--confirm:hover { background: #0EA572; }
.sim-fp-cancel {
  background: none; border: none; color: #475569;
  font-size: 9px; cursor: pointer;
  padding: 5px 0; display: block; margin: 4px auto 0;
}
.sim-fp-cancel:hover { color: #94A3B8; }

/* ── HRP preview panel ───────────────────────────────────────────────────── */
.sim-hrp-preview {
  margin-top: 8px;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 6px;
  overflow: hidden;
  background: #0A1628;
}
.sim-hrp-preview-hdr { border-bottom-color: rgba(59,130,246,.15); background: rgba(59,130,246,.06); }
.sim-fp-dot--blue     { background: #3B82F6; }
.sim-fp-title--blue   { color: #3B82F6; }
.sim-hrp-expl {
  background: #070d1a;
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 10px; color: #94A3B8; line-height: 1.5;
}
.sim-hrp-expl-lbl {
  display: block;
  font-size: 9px; font-weight: 700; color: #3B82F6;
  letter-spacing: .4px; margin-bottom: 3px;
}
.sim-hrp-expl strong { color: #F1F5F9; font-weight: 600; }
.sim-hrp-tbl-lbl {
  font-size: 9px; font-weight: 700; color: #3B82F6;
  letter-spacing: .5px; text-transform: uppercase;
  margin-bottom: 6px;
}
.sim-hrp-diff-tbl { margin-bottom: 10px; }
.sim-hrp-diff-tbl th {
  font-size: 9px; color: #475569; font-weight: 500;
  padding: 3px 5px; border-bottom: 1px solid #1E3A5F;
}
.sim-hrp-diff-tbl td { padding: 5px 5px; border-bottom: 1px solid rgba(30,58,95,.25); }
.sim-hrp-diff-tbl tr:last-child td { border-bottom: none; }
.sim-hrp-tk-cell   { font-size: 11px; font-weight: 700; color: #F1F5F9; }
.sim-hrp-arr-cell  { color: #3B82F6; font-size: 13px; text-align: center; }
.sim-hrp-hrp-val-cell { font-size: 10px; font-weight: 600; color: #F1F5F9; }
.sim-hrp-delta-cell   { font-size: 10px; font-weight: 700; }
/* Sharpe strip reuses sim-fp-ba-* — only override the "after" border colour */
.sim-hrp-preview .sim-fp-ba-col--after { border-color: rgba(59,130,246,.2); }
.sim-hrp-preview .sim-fp-ba-lbl--after { color: #3B82F6; }
.sim-hrp-warn {
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 4px;
  padding: 7px 10px; margin-bottom: 8px;
  font-size: 9px; color: #F59E0B; line-height: 1.5;
}
.sim-hrp-warn strong { font-weight: 700; }
.sim-fix-btn--hrp {
  width: 100%; padding: 8px; margin-top: 0;
  background: rgba(59,130,246,.12);
  color: #60A5FA;
  border: 1px solid rgba(59,130,246,.35);
  border-radius: 5px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sim-fix-btn--hrp:hover { background: rgba(59,130,246,.22); border-color: rgba(59,130,246,.55); }
/* HRP card header — flex row so the _infoIcon chip sits inline with the label */
.sim-hrp-card-hdr { display: flex; align-items: center; gap: 5px; }


/* ═══════════════════════════════════════════════════════════════════════════
   PRICING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay shell */
.pricing-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #080D14;
  overflow-y: auto;
}

.pricing-back-btn {
  position: sticky;
  top: 0;
  z-index: 10;
  display: block;
  width: 100%;
  background: rgba(8,13,20,.92);
  backdrop-filter: blur(8px);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 10px 24px;
  text-align: left;
  cursor: pointer;
  transition: color .15s;
}
.pricing-back-btn:hover { color: #F1F5F9; }

/* Page wrapper */
.pricing-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.pr-hero {
  text-align: center;
  margin-bottom: 52px;
}
.pr-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent, #38BDF8);
  margin-bottom: 14px;
}
.pr-hero-h1 {
  font-size: 36px;
  font-weight: 800;
  color: #F1F5F9;
  line-height: 1.2;
  letter-spacing: -.02em;
  white-space: pre-line;
  margin-bottom: 16px;
}
.pr-hero-sub {
  font-size: 15px;
  color: #64748B;
  line-height: 1.65;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Plans grid ───────────────────────────────────────────────────────────── */
.pr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 64px;
}
@media (max-width: 620px) {
  .pr-grid { grid-template-columns: 1fr; }
}

/* Cards */
.pr-card {
  border-radius: 12px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
.pr-card--free {
  background: #0F1823;
  border: 1px solid rgba(255,255,255,.07);
}
.pr-card--pro {
  background: #080D14;
  border: 1.5px solid rgba(56,189,248,.35);
  box-shadow: 0 0 40px rgba(56,189,248,.06);
}

/* Popular badge */
.pr-popular-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent, #38BDF8);
  color: #080D14;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Card top section */
.pr-card-top { margin-bottom: 20px; }

.pr-card-tier {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 10px;
}
.pr-card-tier--pro { color: var(--accent, #38BDF8); }

.pr-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}
.pr-price {
  font-size: 40px;
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: -.03em;
  line-height: 1;
}
.pr-price-period {
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.pr-card-desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.55;
}

/* Divider */
.pr-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 0 0 18px;
}

/* Feature rows */
.pr-features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 24px;
}
.pr-feat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pr-feat-icon {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.pr-feat-icon--yes { color: #22C55E; }
.pr-feat-icon--no  { color: #334155; }

.pr-feat-lbl {
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.45;
}
.pr-feat-lbl--no { color: #475569; }

/* CTA */
.pr-cta { margin-top: auto; }

.pr-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  border: none;
  text-align: center;
}
.pr-btn--free {
  background: rgba(255,255,255,.06);
  color: #94A3B8;
  border: 1px solid rgba(255,255,255,.1);
}
.pr-btn--free:hover {
  background: rgba(255,255,255,.1);
  color: #F1F5F9;
}
.pr-btn--pro {
  background: var(--accent, #38BDF8);
  color: #080D14;
  font-weight: 800;
}
.pr-btn--pro:hover {
  background: #7DD3FC;
  box-shadow: 0 4px 20px rgba(56,189,248,.35);
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.pr-faq {
  max-width: 600px;
  margin: 0 auto 48px;
}
.pr-faq-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #475569;
  text-align: center;
  margin-bottom: 24px;
}
.pr-faq-item {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 18px 0;
}
.pr-faq-item:last-child { border-bottom: 1px solid rgba(255,255,255,.06); }
.pr-faq-q {
  font-size: 13px;
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 7px;
}
.pr-faq-a {
  font-size: 12px;
  color: #64748B;
  line-height: 1.6;
}

/* ── Disclaimer ───────────────────────────────────────────────────────────── */
.pr-disclaimer {
  text-align: center;
  font-size: 10px;
  color: #334155;
  line-height: 1.6;
  letter-spacing: .02em;
}


/* ── Portfolio source toggle row (simulator left panel) ───────────────────── */
.sim-load-toggle-row {
  display: flex;
  gap: 4px;
  padding: 8px 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  margin-bottom: 4px;
}
.sim-load-toggle {
  flex: 1;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px;
  color: #64748B;
  cursor: pointer;
  text-align: center;
  transition: background .13s, color .13s, border-color .13s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sim-load-toggle:hover {
  background: rgba(255,255,255,.08);
  color: #CBD5E1;
}
.sim-load-toggle--active {
  background: rgba(56,189,248,.12);
  border-color: rgba(56,189,248,.35);
  color: var(--accent, #38BDF8);
}

/* ── Crypto Report Template ──────────────────────────────────────────────── */

.rs-crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.rs-crypto-metric {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rs-cm-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  color: #64748B;
  text-transform: uppercase;
}

.rs-cm-value {
  font-size: 18px;
  font-weight: 700;
  color: #E2E8F0;
  line-height: 1.2;
}

.rs-cm-sub {
  font-size: 10px;
  color: #94A3B8;
}

.rs-crypto-note {
  margin-top: 10px;
  font-size: 11px;
  color: #64748B;
  line-height: 1.6;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border-left: 2px solid rgba(99,102,241,0.4);
}

.rs-risk-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.5;
}

.rs-risk-row:last-child {
  border-bottom: none;
}

.rs-risk-icon {
  flex-shrink: 0;
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.rs-risk-text strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 2px;
}

.rs-crypto-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.35);
  color: #A5B4FC;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Profile Dashboard ────────────────────────────────────────────────────── */

.pf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.pf-overlay--visible { opacity: 1; }

.pf-card {
  background: #0B0E14;
  border: 1px solid #1E3A5F;
  border-radius: 14px;
  width: min(680px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}

/* ── Header ── */
.pf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(30,58,95,.5);
  flex-shrink: 0;
}
.pf-title {
  font-size: 18px;
  font-weight: 700;
  color: #F1F5F9;
}
.pf-subtitle {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
}
.pf-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pf-edit-btn {
  background: transparent;
  border: 1px solid rgba(30,58,95,.6);
  border-radius: 5px;
  padding: 5px 12px;
  color: #64748B;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pf-edit-btn:hover { border-color: #3B82F6; color: #93C5FD; }

.pf-close-btn {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.pf-close-btn:hover { background: rgba(255,255,255,.06); color: #CBD5E1; }

/* ── Body ── */
.pf-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Strip: Style · Risk · Positions ── */
.pf-strip {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}
.pf-strip-cell {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 8px;
  padding: 12px 14px;
}
.pf-strip-label {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
  font-weight: 600;
}
.pf-strip-value {
  font-size: 14px;
  font-weight: 600;
  color: #CBD5E1;
}

/* ── Portfolio card ── */
.pf-port-card {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 10px;
  overflow: hidden;
}
.pf-port-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1E3A5F;
}
.pf-port-title {
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
}
.pf-port-actions { display: flex; gap: 8px; }

.pf-port-add-btn {
  background: transparent;
  border: 1px solid rgba(30,58,95,.6);
  border-radius: 4px;
  padding: 4px 10px;
  color: #475569;
  font-size: 10px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pf-port-add-btn:hover { border-color: #3B82F6; color: #93C5FD; }

.pf-port-stress-btn {
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 4px;
  padding: 4px 10px;
  color: #60A5FA;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.pf-port-stress-btn:hover { background: rgba(59,130,246,.18); }

.pf-port-empty {
  padding: 28px;
  text-align: center;
  color: #334155;
  font-size: 12px;
}
.pf-port-empty-link {
  color: #3B82F6;
  cursor: pointer;
  text-decoration: underline;
}
.pf-port-empty-link:hover { color: #60A5FA; }

/* ── Position rows ── */
.pf-pos-list { padding: 0; }
.pf-pos-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
}
.pf-pos-row--border { border-bottom: 1px solid rgba(30,58,95,.2); }

.pf-pos-ticker {
  font-size: 13px;
  font-weight: 600;
  color: #60A5FA;
  cursor: pointer;
  transition: opacity .12s;
}
.pf-pos-ticker:hover { opacity: .75; }
.pf-pos-shares { font-size: 11px; color: #334155; }
.pf-pos-price  { font-size: 11px; color: #475569; }
.pf-pos-right  { text-align: right; }
.pf-pos-pct    { font-size: 12px; font-weight: 600; color: #CBD5E1; }
.pf-pos-of     { font-size: 10px; color: #334155; }

/* ── Colour bar ── */
.pf-bar-wrap { padding: 10px 16px 14px; border-top: 1px solid rgba(30,58,95,.2); }
.pf-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
}
.pf-bar-seg { border-radius: 2px; }
.pf-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pf-legend-item { display: flex; align-items: center; gap: 4px; }
.pf-legend-dot  {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.pf-legend-label { font-size: 10px; color: #475569; }

/* ── Quick actions ── */
.pf-actions {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}
.pf-action-cell {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pf-action-cell:hover {
  border-color: #3B82F6;
  background: rgba(59,130,246,.05);
}
.pf-action-title {
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  margin-bottom: 4px;
}
.pf-action-sub { font-size: 11px; color: #475569; }

@media (max-width: 520px) {
  .pf-strip   { grid-template-columns: 1fr 1fr; }
  .pf-actions { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Portfolio Arena — full interactive section
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Wrapper */
.arena-section-wrap {
  background: #0A1628;
  border: 1px solid #1E3A5F;
  border-radius: 10px;
  padding: 20px 24px;
  width: 100%;
  box-sizing: border-box;
}

/* Header */
.arena-section-header { margin-bottom: 16px; }
.arena-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.arena-section-title { font-size: 14px; font-weight: 700; color: #F1F5F9; }
.arena-beta-badge {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  color: #F59E0B;
  letter-spacing: .5px;
}
.arena-section-sub { font-size: 11px; color: #475569; line-height: 1.5; }

/* Tab bar */
.arena-tab-bar {
  display: flex;
  border-bottom: 1px solid rgba(30,58,95,.5);
  margin-bottom: 18px;
}
.arena-tab {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.arena-tab:hover { color: #94A3B8; }
.arena-tab.active { color: #3B82F6; border-bottom-color: #3B82F6; }

/* Tab panes */
.arena-tab-pane { animation: arenaPaneFade .15s ease; }
@keyframes arenaPaneFade { from { opacity: 0; } to { opacity: 1; } }

/* Leaderboard table */
.arena-lb-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.arena-lb-table th {
  font-size: 10px; color: #475569; font-weight: 600;
  padding: 6px 10px; border-bottom: 1px solid rgba(30,58,95,.4);
  text-align: left; text-transform: uppercase; letter-spacing: .4px;
}
.arena-lb-table td { padding: 9px 10px; border-bottom: 1px solid rgba(30,58,95,.2); }
.arena-lb-table tbody tr:last-child td { border-bottom: none; }
.arena-lb-table tbody tr:hover td { background: rgba(30,58,95,.15); }
.arena-lb-rank { font-size: 13px; text-align: center; width: 36px; }
.arena-lb-investor { display: flex; align-items: center; gap: 10px; }
.arena-lb-name-wrap { display: flex; flex-direction: column; gap: 1px; }
.arena-lb-name   { font-size: 12px; font-weight: 600; color: #CBD5E1; }
.arena-lb-handle { font-size: 10px; color: #475569; }
.arena-lb-pds { font-size: 12px; color: #94A3B8; text-align: right; }
.arena-lb-wc  { font-size: 12px; color: #EF4444; text-align: right; }
.arena-lb-view { text-align: right; }

/* Avatar */
.arena-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.arena-avatar--top     { background: rgba(245,158,11,.15); color: #F59E0B; border: 1px solid rgba(245,158,11,.3); }
.arena-avatar--default { background: rgba(30,58,95,.4);    color: #475569; border: 1px solid rgba(30,58,95,.6); }

/* View button */
.arena-view-btn {
  background: transparent;
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 4px; padding: 4px 10px;
  font-size: 11px; color: #3B82F6;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.arena-view-btn:hover { background: rgba(59,130,246,.08); border-color: #3B82F6; }
.arena-view-btn--me { border-color: rgba(16,185,129,.3); color: #10B981; }
.arena-view-btn--me:hover { background: rgba(16,185,129,.08); border-color: #10B981; }

/* My position teaser row */
.arena-my-teaser {
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; padding: 10px 14px;
  background: rgba(59,130,246,.06);
  border: 1px dashed rgba(59,130,246,.25);
  border-radius: 6px; font-size: 12px;
}
.arena-my-rank  { font-size: 14px; font-weight: 700; color: #3B82F6; min-width: 28px; }
.arena-my-label { color: #94A3B8; flex: 1; }
.arena-my-score { font-weight: 700; color: #F59E0B; }
.arena-my-gap   { font-size: 11px; color: #475569; }

/* Score chips */
.arena-score-bar {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.arena-score-hi { background: rgba(16,185,129,.15);  color: #10B981; }
.arena-score-md { background: rgba(59,130,246,.15);  color: #3B82F6; }
.arena-score-lo { background: rgba(245,158,11,.15);  color: #F59E0B; }

/* Portfolio cards */
.arena-portfolio-card {
  background: rgba(30,58,95,.15);
  border: 1px solid rgba(30,58,95,.4);
  border-radius: 8px; padding: 16px 20px; margin-bottom: 16px;
}
.arena-portfolio-card:last-child { margin-bottom: 0; }

.arena-pc-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.arena-pc-nameblock { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.arena-pc-name   { font-size: 13px; font-weight: 700; color: #F1F5F9; }
.arena-pc-handle { font-size: 10px; color: #475569; }
.arena-pc-score-wrap { margin-left: auto; }
.arena-pc-rank {
  font-size: 11px; font-weight: 700; color: #475569;
  background: rgba(30,58,95,.4); border: 1px solid rgba(30,58,95,.6);
  border-radius: 4px; padding: 2px 8px; margin-left: 8px;
}

.arena-pc-metrics {
  display: flex; margin-bottom: 14px;
  border: 1px solid rgba(30,58,95,.4); border-radius: 6px; overflow: hidden;
}
.arena-pc-metric {
  flex: 1; padding: 8px 12px;
  border-right: 1px solid rgba(30,58,95,.3); text-align: center;
}
.arena-pc-metric:last-child { border-right: none; }
.arena-pc-mval   { font-size: 13px; font-weight: 700; color: #F1F5F9; margin-bottom: 2px; }
.arena-pc-mlabel { font-size: 9px; color: #475569; text-transform: uppercase; letter-spacing: .3px; }

/* Position table */
.arena-pos-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.arena-pos-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.arena-pos-table th {
  font-size: 10px; color: #475569; font-weight: 600;
  padding: 6px 8px; border-bottom: 1px solid rgba(30,58,95,.3);
  text-align: left; text-transform: uppercase; letter-spacing: .4px;
}
.arena-pos-table td { padding: 7px 8px; border-bottom: 1px solid rgba(30,58,95,.2); color: #94A3B8; }
.arena-pos-table tr:last-child td { border-bottom: none; }
.arena-pos-table tr:hover td { background: rgba(30,58,95,.2); }
.arena-pos-ticker { font-weight: 600; }
.arena-ticker-link { color: #3B82F6; cursor: pointer; }
.arena-ticker-link:hover { text-decoration: underline; }
.arena-pos-weight { color: #CBD5E1; font-weight: 600; }
.arena-pos-sector { color: #64748B; font-size: 11px; }
.arena-pos-private { font-size: 11px; color: #475569; padding: 10px 0; font-style: italic; }

/* Fit box */
.arena-fit-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(16,185,129,.06); border: 1px solid rgba(16,185,129,.2);
  border-radius: 6px; padding: 10px 14px;
}
.arena-fit-txt { font-size: 11px; color: #94A3B8; }
.arena-fit-btn {
  background: transparent; border: 1px solid rgba(16,185,129,.3);
  border-radius: 4px; padding: 5px 12px;
  font-size: 11px; color: #10B981;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.arena-fit-btn:hover { background: rgba(16,185,129,.1); }

/* My ranking */
.arena-me-score-card {
  display: flex; align-items: center; gap: 32px;
  background: rgba(30,58,95,.2); border: 1px solid rgba(30,58,95,.4);
  border-radius: 8px; padding: 16px 20px; margin-bottom: 14px;
}
.arena-me-score-block { text-align: center; }
.arena-me-big-score {
  font-size: 40px; font-weight: 800; color: #F59E0B;
  line-height: 1; margin-bottom: 4px;
}
.arena-me-score-lbl { font-size: 10px; color: #475569; text-transform: uppercase; letter-spacing: .4px; }
.arena-me-meta-block { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.arena-me-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.arena-me-meta-key { font-size: 11px; color: #475569; }
.arena-me-meta-val { font-size: 13px; font-weight: 600; color: #CBD5E1; }
.arena-wc-bad { color: #EF4444 !important; }

.arena-me-gap-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: rgba(239,68,68,.05); border: 1px solid rgba(239,68,68,.15);
  border-radius: 6px; margin-bottom: 14px; font-size: 12px;
}
.arena-me-gap-label { color: #94A3B8; flex: 1; }
.arena-me-gap-val   { font-weight: 700; color: #EF4444; }
.arena-me-gap-pds   { font-size: 11px; color: #475569; }

.arena-me-imp-hdr {
  font-size: 11px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.arena-me-imp-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: rgba(30,58,95,.15); border: 1px solid rgba(30,58,95,.3);
  border-radius: 6px; margin-bottom: 8px;
}
.arena-me-imp-num {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(59,130,246,.15); color: #3B82F6;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.arena-me-imp-body  { flex: 1; min-width: 0; }
.arena-me-imp-action { font-size: 12px; font-weight: 700; color: #F1F5F9; margin-bottom: 2px; }
.arena-me-imp-detail { font-size: 11px; color: #3B82F6; margin-bottom: 3px; }
.arena-me-imp-reason { font-size: 11px; color: #475569; }
.arena-me-apply-btn {
  background: transparent; border: 1px solid rgba(59,130,246,.3);
  border-radius: 4px; padding: 5px 10px;
  font-size: 11px; color: #3B82F6;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s;
}
.arena-me-apply-btn:hover { background: rgba(59,130,246,.1); }

.arena-me-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 10px 14px;
  background: rgba(245,158,11,.05); border: 1px solid rgba(245,158,11,.15);
  border-radius: 6px; font-size: 11px; color: #64748B;
}
.arena-waitlist-btn {
  background: #F59E0B; border: none; border-radius: 4px;
  padding: 6px 12px; font-size: 11px; font-weight: 700; color: #050F1C;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: filter .15s;
}
.arena-waitlist-btn:hover { filter: brightness(1.1); }
