/* ── PowerClaw Dashboard v2 — Synthwave Dark Theme ── */

:root {
  --bg-deep: #06060f;
  --bg-card: #0c0c1a;
  --bg-surface: #111128;
  --bg-hover: #161640;
  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --magenta: #ff00aa;
  --magenta-dim: rgba(255, 0, 170, 0.12);
  --green: #00ff41;
  --green-dim: rgba(0, 255, 65, 0.12);
  --red: #e53935;
  --red-dim: rgba(229, 57, 53, 0.12);
  --gold: #f0b400;
  --gold-dim: rgba(240, 180, 0, 0.12);
  --purple: #9d65ff;
  --purple-dim: rgba(157, 101, 255, 0.12);
  --text: #e8e8f0;
  --text-dim: #888899;
  --text-muted: #555577;
  --nav-height: 64px;
  --header-height: 52px;
  --radius: 12px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */

.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(6, 6, 15, 0.92);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 8px; }
.header-icon { font-size: 22px; }
.header-title {
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.header-score {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-surface);
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid rgba(0, 240, 255, 0.15);
}

.header-score-label { font-size: 10px; color: var(--text-dim); font-weight: 600; letter-spacing: 1px; }
.header-score-value { font-size: 16px; font-weight: 800; color: var(--cyan); font-family: 'JetBrains Mono', monospace; }

.header-badge {
  font-size: 13px;
  background: var(--bg-surface);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255, 0, 170, 0.15);
  cursor: pointer;
}

.header-btn {
  background: var(--bg-card); border: 1px solid rgba(0,240,255,0.1);
  padding: 4px 10px; border-radius: 16px; font-size: 14px;
  cursor: pointer; transition: all 0.2s;
}
.header-btn:hover { border-color: var(--cyan); }
.header-btn.active { background: var(--cyan-dim); border-color: var(--cyan); }

/* ── OLED Mode ── */
body.oled { --bg-deep: #000; --bg-surface: #0a0a0a; --bg-card: #050505; }
body.oled .header { background: rgba(0,0,0,0.95); }
body.oled .panel { border-color: rgba(0,240,255,0.03); }
body.oled .bottom-nav { background: rgba(0,0,0,0.95); }

.header-badge:hover { background: var(--bg-hover); }

/* ── Panels ── */

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  display: block;
  padding: calc(var(--header-height) + 16px) 16px 16px 16px;
  scroll-margin-top: calc(var(--header-height) + 10px);
  min-height: auto;
  background: var(--bg-surface);
  border: 1px solid rgba(0, 240, 255, 0.05);
  border-radius: var(--radius);
  animation: panelFadeIn 0.4s ease both;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.panel:hover {
  border-color: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.04);
}

.panel:nth-child(1) { animation-delay: 0s; }
.panel:nth-child(2) { animation-delay: 0.05s; }
.panel:nth-child(3) { animation-delay: 0.1s; }
.panel:nth-child(4) { animation-delay: 0.15s; }
.panel:nth-child(5) { animation-delay: 0.2s; }
.panel:nth-child(6) { animation-delay: 0.25s; }
.panel:nth-child(7) { animation-delay: 0.3s; }
.panel:nth-child(8) { animation-delay: 0.35s; }
.panel:nth-child(9) { animation-delay: 0.4s; }
.panel:nth-child(10) { animation-delay: 0.45s; }
.panel:nth-child(11) { animation-delay: 0.5s; }

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

.section-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--magenta), transparent) 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Score Panel ── */

.score-hero {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
}

.score-ring-container { position: relative; width: 200px; height: 200px; }

.score-ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none; stroke: var(--bg-surface); stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-size: 48px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan);
  transition: transform 0.2s;
}

.score-number.bump { transform: scale(1.15); }
.score-label { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; font-weight: 600; }

.score-stats {
  display: flex; gap: 24px; margin-top: 16px;
}

.stat-box { text-align: center; }

.stat-value {
  font-size: 22px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

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

/* ── History ── */

.history-list { display: flex; flex-direction: column; gap: 6px; }

.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  transition: background 0.15s;
}

.history-item:hover { background: var(--bg-surface); }
.history-item.positive { border-left-color: var(--green); }
.history-item.negative { border-left-color: var(--red); }

.history-delta {
  font-size: 16px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  min-width: 36px; text-align: center;
}

.history-item.positive .history-delta { color: var(--green); }
.history-item.negative .history-delta { color: var(--red); }

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

.history-law {
  font-size: 12px; font-weight: 600; color: var(--cyan);
  display: flex; align-items: center; gap: 6px;
}

.history-reason {
  font-size: 13px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}

.history-time {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

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

.source-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.source-tag.sam {
  background: var(--magenta-dim);
  color: var(--magenta);
  border: 1px solid rgba(255, 0, 170, 0.2);
}

/* ── Mind Map ── */

.map-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}

.legend-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-dim);
}

.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid;
}

.legend-dot.person { background: var(--cyan-dim); border-color: var(--cyan); }
.legend-dot.concept { background: var(--gold-dim); border-color: var(--gold); }
.legend-dot.goal { background: var(--green-dim); border-color: var(--green); }
.legend-dot.asset { background: var(--purple-dim); border-color: var(--purple); }
.legend-dot.law { background: var(--magenta-dim); border-color: var(--magenta); }

.map-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 240, 255, 0.06);
  height: 50vh;
  min-height: 350px;
  overflow: hidden;
  position: relative;
}

#mindMapSvg { width: 100%; height: 100%; }

.map-detail {
  position: fixed; bottom: var(--nav-height);
  left: 8px; right: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-bottom: none;
  padding: 16px;
  z-index: 50;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.map-detail-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}

.map-detail-icon { font-size: 20px; }
.map-detail-name { font-size: 16px; font-weight: 700; flex: 1; }

.map-detail-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}

.map-detail-close:hover { color: var(--text); }
.map-detail-body { font-size: 13px; }
.map-detail-row { margin-bottom: 6px; color: var(--text-dim); }

.law-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px;
  background: var(--magenta-dim);
  color: var(--magenta);
  border: 1px solid rgba(255, 0, 170, 0.2);
  margin: 2px 2px;
}

/* ── Reminders ── */

.reminders-list { display: flex; flex-direction: column; gap: 8px; }

.reminder-item {
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--cyan);
  transition: background 0.15s;
}

.reminder-item:hover { background: var(--bg-surface); }
.reminder-item.read { opacity: 0.6; }
.reminder-item.law-of-the-day { border-left-color: var(--magenta); }
.reminder-item.alert { border-left-color: var(--red); }
.reminder-item.observation { border-left-color: var(--gold); }

.reminder-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}

.reminder-icon { font-size: 16px; }

.reminder-time {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  flex: 1;
}

.reminder-text {
  font-size: 13px; color: var(--text);
  line-height: 1.5;
}

.tts-btn {
  background: none; border: 1px solid rgba(0, 240, 255, 0.15);
  color: var(--text-dim); font-size: 14px;
  padding: 2px 8px; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}

.tts-btn:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--cyan);
}

/* ── Feed ── */

.feed-description {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 12px;
}

.feed-list { display: flex; flex-direction: column; gap: 8px; }

.feed-item {
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}

.feed-item.positive { border-left-color: var(--green); }
.feed-item.negative { border-left-color: var(--red); }

.feed-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}

.feed-delta {
  font-size: 14px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.feed-delta.positive { color: var(--green); }
.feed-delta.negative { color: var(--red); }

.feed-law { font-size: 12px; color: var(--cyan); font-weight: 600; flex: 1; }

.feed-time {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.feed-reason { font-size: 13px; color: var(--text-dim); }

/* ── Revenue Panel ── */

.revenue-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; padding: 16px 0;
}

.revenue-balance-card {
  text-align: center;
  padding: 24px 32px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(0, 255, 65, 0.15);
  position: relative;
  overflow: hidden;
}

.revenue-balance-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.revenue-balance-label {
  font-size: 10px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 2px; margin-bottom: 6px;
}

.revenue-balance-amount {
  font-size: 36px; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
}

.revenue-pending {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}

.revenue-stats {
  display: flex; gap: 32px;
}

.payment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  margin-bottom: 4px;
}

.payment-item.positive { border-left-color: var(--green); }
.payment-item.negative { border-left-color: var(--red); }

.payment-amount {
  font-size: 14px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  min-width: 60px;
}

.payment-desc {
  font-size: 12px; color: var(--text-dim);
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.payment-time {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* ── Market Panel ── */

.market-hero {
  display: flex; align-items: center;
  gap: 24px; padding: 16px 0;
}

.regime-badge {
  font-size: 28px; font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  padding: 16px 28px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 3px;
  border: 2px solid;
}

.regime-fear {
  color: var(--red);
  background: var(--red-dim);
  border-color: var(--red);
  text-shadow: 0 0 20px rgba(229, 57, 53, 0.4);
}

.regime-greed {
  color: var(--green);
  background: var(--green-dim);
  border-color: var(--green);
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.regime-neutral, .regime-unknown, .regime-offline {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--gold);
}

.market-stats {
  display: flex; flex-direction: column; gap: 12px;
}

.market-context {
  font-size: 13px; color: var(--text-dim);
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
  margin-bottom: 8px;
  line-height: 1.5;
}

.pick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 4px;
  transition: background 0.15s;
}

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

.pick-medal { font-size: 18px; min-width: 24px; text-align: center; }

.pick-ticker {
  font-size: 15px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan);
  min-width: 60px;
}

.pick-score {
  font-size: 14px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  min-width: 30px; text-align: right;
}

.pick-quality {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Substack Panel ── */

.substack-hero {
  display: flex; gap: 24px; justify-content: center;
  padding: 16px 0;
}

.substack-updated {
  font-size: 11px; color: var(--text-muted);
  text-align: center; margin-top: 8px;
}

.substack-post-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 4px;
  border-left: 3px solid var(--purple);
}

.post-title {
  font-size: 13px; color: var(--text);
  flex: 1; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

.post-views {
  font-size: 11px; color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.post-likes {
  font-size: 11px; color: var(--text-dim);
}

/* ── Law Insight (shared) ── */

.law-insight {
  font-size: 12px; color: var(--text-dim);
  padding: 10px 12px;
  background: var(--magenta-dim);
  border-radius: var(--radius);
  border-left: 3px solid var(--magenta);
  margin-top: 8px;
  line-height: 1.5;
}

.law-insight strong { color: var(--magenta); }
.law-insight em { color: var(--text); font-style: normal; }

/* ── Context Panel ── */
.context-grid { display: grid; gap: 12px; }
.context-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px; background: var(--bg-card);
  border-radius: var(--radius); border-left: 3px solid var(--gold);
}
.context-icon { font-size: 24px; line-height: 1; }
.context-details { flex: 1; }
.context-label { font-size: 11px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; letter-spacing: 0.5px; }
.context-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* ── CRM Panel ── */
.crm-list { display: flex; flex-direction: column; gap: 8px; }
.crm-item {
  padding: 12px; background: var(--bg-card); border-radius: var(--radius);
  border-left: 3px solid var(--cyan);
}
.crm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.crm-name { font-size: 15px; font-weight: 700; color: var(--cyan); }
.crm-leverage { font-size: 11px; font-family: 'JetBrains Mono', monospace; background: var(--cyan-dim); padding: 2px 6px; border-radius: 4px; color: var(--cyan); }
.crm-notes { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.crm-time { font-size: 11px; margin-top: 6px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ── Campaigns Panel ── */
.campaigns-list { display: flex; flex-direction: column; gap: 12px; }
.campaign-item { padding: 16px; background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--purple); }
.campaign-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.campaign-name { font-size: 15px; font-weight: 700; color: var(--purple); }
.campaign-status { font-size: 18px; }
.campaign-progress { height: 6px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.campaign-progress-bar { height: 100%; background: var(--purple); transition: width 0.3s; }

/* ── Logs Panel ── */
.logs-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { padding: 16px; background: var(--bg-card); border-radius: var(--radius); border-left: 3px solid var(--text); }
.log-time { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.log-text { font-size: 14px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

/* ── Sam's Mind Panel ── */
.sam-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.sam-tab {
  background: var(--bg-card); border: 1px solid rgba(0, 240, 255, 0.1);
  color: var(--text-dim); padding: 6px 14px; border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.sam-tab:hover { color: var(--text); border-color: rgba(0, 240, 255, 0.3); }
.sam-tab.active { color: var(--cyan); background: var(--cyan-dim); border-color: var(--cyan); }
.sam-content {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  line-height: 1.7; color: var(--text-dim);
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px; max-height: 500px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
}
.sam-content h1, .sam-content h2, .sam-content h3 { color: var(--cyan); margin: 12px 0 6px; font-family: 'Outfit', sans-serif; }
.sam-content h1 { font-size: 18px; }
.sam-content h2 { font-size: 15px; color: var(--magenta); }
.sam-content h3 { font-size: 13px; color: var(--gold); }
.sam-content strong { color: var(--text); }
.sam-content em { color: var(--purple); font-style: normal; }
.sam-content ul, .sam-content ol { padding-left: 20px; margin: 6px 0; }
.sam-content li { margin-bottom: 4px; }
.sam-content code { background: rgba(0,240,255,0.08); padding: 1px 5px; border-radius: 4px; color: var(--cyan); font-size: 12px; }


/* ── Bottom Nav ── */

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(6, 6, 15, 0.95);
  backdrop-filter: blur(20px);
  display: flex; align-items: center;
  border-top: 1px solid rgba(0, 240, 255, 0.08);
  z-index: 100;
  overflow-x: auto; scroll-behavior: smooth;
  padding: 0 8px;
  -webkit-overflow-scrolling: touch;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 12px;
  color: var(--text-muted);
  transition: color 0.15s;
  min-width: 64px; flex-shrink: 0;
}

.nav-btn:hover { color: var(--text-dim); }
.nav-btn.active { color: var(--cyan); }

.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Responsive ── */

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .dashboard-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); 
    grid-auto-rows: max-content;
    gap: 20px; 
    padding: calc(var(--header-height) + 24px) 24px 40px; 
    max-width: 1600px; 
    margin: 0 auto; 
    align-items: start;
    width: 100%;
    box-sizing: border-box;
  }
  .panel { 
    display: flex !important; 
    flex-direction: column;
    padding: 24px; 
    min-width: 0;
    min-height: 0; 
    background: var(--bg-surface);
    border: 1px solid rgba(0, 240, 255, 0.05);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    height: auto;
    animation: none;
    scroll-margin-top: 0;
    overflow: hidden;
    word-break: break-word;
  }
  .map-container { height: 400px; }
  .map-detail { position: absolute; bottom: 0; left: 0; right: 0; margin: 12px; border: 1px solid rgba(0, 240, 255, 0.12); border-radius: var(--radius); }
  .score-hero { flex-direction: row; justify-content: center; gap: 40px; }
  .revenue-hero { flex-direction: column; gap: 16px; }
  .market-hero { flex-direction: column; gap: 16px; text-align: center; }
  .section-title { font-size: 18px; margin-bottom: 20px; }
  
  /* Make feed/logs scrollable inside grid cell */
  .history-list, .feed-list, .reminders-list, .crm-list, .logs-list { max-height: 350px; overflow-y: auto; padding-right: 8px; }
  .history-list::-webkit-scrollbar, .feed-list::-webkit-scrollbar, .reminders-list::-webkit-scrollbar, .crm-list::-webkit-scrollbar, .logs-list::-webkit-scrollbar { width: 4px; }
  .history-list::-webkit-scrollbar-thumb, .feed-list::-webkit-scrollbar-thumb, .reminders-list::-webkit-scrollbar-thumb, .crm-list::-webkit-scrollbar-thumb, .logs-list::-webkit-scrollbar-thumb { background: rgba(0, 240, 255, 0.2); border-radius: 4px; }
}


/* ── Sparkline ── */
.sparkline-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 8px 12px;
  background: var(--bg-card); border-radius: 8px;
}
.sparkline-label { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* ── Substack Links ── */
a.post-title {
  color: var(--cyan); text-decoration: none; transition: color 0.2s;
}
a.post-title:hover { color: var(--text); text-decoration: underline; }

/* ── Sam Assessment Modal ── */
.sam-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.sam-modal {
  background: var(--bg-surface); border: 1px solid rgba(0,240,255,0.15);
  border-radius: 16px; padding: 24px; max-width: 500px; width: 90%;
  max-height: 70vh; overflow-y: auto;
}
.sam-modal-header {
  font-size: 18px; font-weight: 700; color: var(--cyan);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--magenta), transparent) 1;
}
.sam-modal-body {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  line-height: 1.7; color: var(--text-dim); white-space: pre-wrap;
}
.sam-modal-close {
  margin-top: 16px; background: var(--cyan-dim); color: var(--cyan);
  border: 1px solid var(--cyan); padding: 8px 20px; border-radius: 8px;
  cursor: pointer; font-family: 'Outfit', sans-serif; font-weight: 600;
  transition: all 0.2s;
}
.sam-modal-close:hover { background: var(--cyan); color: var(--bg-deep); }

/* ── Sonification Status Bar ── */
.sono-bar {
  position: fixed; top: var(--header-height); left: 0; right: 0; z-index: 90;
  background: linear-gradient(180deg, rgba(6,6,15,0.96), rgba(6,6,15,0.88));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, var(--cyan), var(--magenta), var(--cyan)) 1;
  padding: 10px 16px 8px;
  animation: sonoSlideIn 0.3s ease;
}
@keyframes sonoSlideIn { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sono-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sono-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}
.sono-toggle {
  background: none; border: 1px solid rgba(0,240,255,0.15); color: var(--text-dim);
  padding: 2px 8px; border-radius: 8px; font-size: 10px; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.sono-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

.sono-wave {
  flex: 1; max-width: 200px; height: 28px;
  border-radius: 4px; background: rgba(255,255,255,0.03);
}

.sono-meters { display: flex; gap: 16px; flex-wrap: wrap; }
.sono-meter { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; }
.sono-meter-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; min-width: 32px;
}
.sono-meter-bar {
  flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden;
}
.sono-meter-fill {
  height: 100%; border-radius: 3px; transition: width 3s ease, background 3s ease;
  background: linear-gradient(90deg, #00f0ff, #ff00aa);
}
.sono-meter-fill.vvix {
  background: linear-gradient(90deg, #f0b400, #ff4444);
}
.sono-meter-val {
  font-size: 12px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace;
  min-width: 30px; text-align: right;
}
.sono-meter-map { font-size: 9px; color: var(--text-dim); font-style: italic; }
.sono-meter-mood {
  font-size: 12px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  padding: 1px 8px; border-radius: 8px; border: 1px solid;
}

.sono-codec {
  margin-top: 8px; overflow: hidden; max-height: 200px; transition: max-height 0.3s ease;
  border-top: 1px solid rgba(0,240,255,0.06); padding-top: 8px;
}
.sono-codec.collapsed { max-height: 0; padding-top: 0; margin-top: 0; }
.sono-codec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.sono-codec-item { display: flex; flex-direction: column; gap: 2px; }
.sono-key {
  font-size: 10px; font-weight: 700; color: var(--cyan);
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.5px;
}
.sono-desc { font-size: 10px; color: var(--text-dim); line-height: 1.3; }

/* Adjust panel padding when sono bar is showing */
body.sono-active .panel:first-child { padding-top: calc(var(--header-height) + 130px); }

/* ── Trade Signal Banner ── */
.trade-signal {
  position: fixed; top: var(--header-height); left: 0; right: 0; z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: rgba(6,6,15,0.92); backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255,255,255,0.04);
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.5s;
}
.trade-signal.go { border-bottom-color: #00ff41; }
.trade-signal.careful { border-bottom-color: #f0b400; }
.trade-signal.sitout { border-bottom-color: #ff4444; }

.trade-signal-verdict {
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  padding: 3px 10px; border-radius: 6px;
  min-width: 80px; text-align: center;
}
.trade-signal.go .trade-signal-verdict { background: rgba(0,255,65,0.12); color: #00ff41; }
.trade-signal.careful .trade-signal-verdict { background: rgba(240,180,0,0.12); color: #f0b400; }
.trade-signal.sitout .trade-signal-verdict { background: rgba(255,68,68,0.12); color: #ff4444; }

.trade-signal-reason {
  font-size: 11px; color: var(--text-dim); flex: 1;
}

/* Push sono bar + panels down when trade signal is showing */
.sono-bar { top: calc(var(--header-height) + 42px) !important; }

/* ── Market Weather Badge ── */
.header-weather {
  font-size: 18px; padding: 0 4px; cursor: default;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.2));
  transition: filter 0.5s;
}
