:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #22263a;
  --border: #2e3348;
  --accent: #6c8cff;
  --accent-glow: rgba(108, 140, 255, 0.15);
  --text-primary: #e8eaf0;
  --text-secondary: #8892b0;
  --text-muted: #4a5070;
  --risk-critical: #ff4d6d;
  --risk-high: #ff8c42;
  --risk-medium: #ffd166;
  --risk-low: #06d6a0;
  --opp-very-high: #6c8cff;
  --opp-high: #4ecdc4;
  --opp-medium: #a8dadc;
  --opp-low: #8892b0;
  --radius: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  margin-bottom: 40px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.nav-logo span {
  color: var(--accent);
}
.nav-divider {
  color: var(--border);
  font-size: 18px;
}
.nav-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Page header ── */
.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Account grid ── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: pointer;
  display: block;
}
.account-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.card-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}
.card-industry {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.segment-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
}

.card-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.scores-row {
  display: flex;
  gap: 12px;
}

.score-block {
  flex: 1;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 14px;
}
.score-block-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.score-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.score-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.score-number {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.score-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Risk colors */
.risk-critical { color: var(--risk-critical); }
.risk-critical .score-bar { background: var(--risk-critical); }
.risk-high { color: var(--risk-high); }
.risk-high .score-bar { background: var(--risk-high); }
.risk-medium { color: var(--risk-medium); }
.risk-medium .score-bar { background: var(--risk-medium); }
.risk-low { color: var(--risk-low); }
.risk-low .score-bar { background: var(--risk-low); }

/* Opp colors */
.opp-very-high { color: var(--opp-very-high); }
.opp-very-high .score-bar { background: var(--opp-very-high); }
.opp-high { color: var(--opp-high); }
.opp-high .score-bar { background: var(--opp-high); }
.opp-medium { color: var(--opp-medium); }
.opp-medium .score-bar { background: var(--opp-medium); }
.opp-low { color: var(--opp-low); }
.opp-low .score-bar { background: var(--opp-low); }

/* ── Account detail ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }
.back-arrow { font-size: 16px; }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.detail-title h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}
.detail-title .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 14px;
}
.detail-title .subtitle span::before {
  content: "·";
  margin-right: 14px;
  color: var(--border);
}
.detail-title .subtitle span:first-child::before { content: ""; margin: 0; }

.header-scores {
  display: flex;
  gap: 16px;
}
.header-score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 110px;
  text-align: center;
}
.pill-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.pill-score {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}
.pill-tag {
  font-size: 11px;
  font-weight: 600;
}

/* Analysis loading / error */
.loading-box, .error-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
}
.error-box { border-color: var(--risk-high); }
.error-box p { color: var(--text-secondary); font-size: 14px; margin-top: 8px; }
.error-box strong { color: var(--risk-high); }

/* Analysis sections */
.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .analysis-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .header-scores { flex-wrap: wrap; }
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.section-card.full-width { grid-column: 1 / -1; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.section-headline {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.section-details {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.factors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.factors-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
}
.factors-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* Executive summary */
.exec-summary {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.75;
  padding: 20px;
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

/* Actions table */
.actions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.action-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.action-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.priority-urgent { background: var(--risk-critical); }
.priority-high { background: var(--risk-high); }
.priority-medium { background: var(--risk-medium); }
.action-body { flex: 1; }
.action-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}
.action-meta {
  display: flex;
  gap: 12px;
}
.action-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-secondary);
}

/* Key insights */
.insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insights-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
  line-height: 1.6;
}

/* Account meta strip */
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.meta-strip-item { display: flex; flex-direction: column; gap: 3px; }
.meta-strip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.meta-strip-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Sentiment badge */
.sentiment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid;
}
.sentiment-positive { color: var(--risk-low); border-color: var(--risk-low); background: rgba(6,214,160,0.08); }
.sentiment-neutral  { color: var(--text-secondary); border-color: var(--border); background: var(--surface-2); }
.sentiment-negative { color: var(--risk-medium); border-color: var(--risk-medium); background: rgba(255,209,102,0.08); }
.sentiment-critical { color: var(--risk-critical); border-color: var(--risk-critical); background: rgba(255,77,109,0.08); }

/* ── Index card: header right side ── */
.card-arr {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-arr span { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.card-renewal { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Usage signals strip on index card ── */
.card-signals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
}
.signal-item { display: flex; flex-direction: column; gap: 3px; }
.signal-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}
.signal-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.delta { font-size: 11px; font-weight: 600; }
.delta-up   { color: var(--risk-low); }
.delta-down { color: var(--risk-critical); }
.delta-flat { color: var(--text-muted); }
.ticket-open { color: var(--risk-high); }

/* ── Account detail: 3-column layout ── */
.data-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
  align-items: start;
}
@media (max-width: 960px) {
  .data-columns { grid-template-columns: 1fr 1fr; }
  .analysis-col { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .data-columns { grid-template-columns: 1fr; }
}

.data-col-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.analysis-col { border-color: var(--accent); }

/* ── Activity list (CRM, tickets, emails) ── */
.activity-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.activity-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.activity-type {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.activity-date { font-size: 11px; color: var(--text-muted); }
.activity-author { font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; }
.activity-note { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ── Ticket status badges ── */
.ticket-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
}
.status-resolved { background: rgba(6,214,160,0.12); color: var(--risk-low); }
.status-open     { background: rgba(255,77,109,0.12); color: var(--risk-critical); }
.status-pending  { background: rgba(255,209,102,0.12); color: var(--risk-medium); }

/* ── Sentiment dot (inline, small) ── */
.sentiment-dot {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.sentiment-dot.sentiment-positive { color: var(--risk-low); border: none; background: none; padding: 0; border-radius: 0; }
.sentiment-dot.sentiment-neutral  { color: var(--text-muted); border: none; background: none; padding: 0; border-radius: 0; }
.sentiment-dot.sentiment-negative { color: var(--risk-medium); border: none; background: none; padding: 0; border-radius: 0; }

/* ── Email direction badge ── */
.email-dir {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
}
.dir-inbound  { background: rgba(108,140,255,0.12); color: var(--accent); }
.dir-outbound { background: var(--surface-2); color: var(--text-muted); }

/* ── AI badge ── */
.ai-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(108,140,255,0.3);
}

/* ── Inline analysis sections (inside analysis col) ── */
.inline-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.inline-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.inline-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.inline-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* ── Account list table ── */
.account-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 60px;
}
.account-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0 16px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.account-table thead th:last-child { text-align: right; }
.account-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.account-table tbody tr:last-child { border-bottom: none; }
.account-table tbody tr:hover { background: var(--surface); }
.account-table tbody td {
  padding: 18px 16px;
  vertical-align: middle;
}
.col-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.col-industry {
  font-size: 13px;
  color: var(--text-secondary);
}
.col-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.col-value span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.col-action { text-align: right; }
.btn-view {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 7px 16px;
  border: 1px solid rgba(108,140,255,0.35);
  border-radius: 6px;
  background: var(--accent-glow);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-view:hover {
  background: rgba(108,140,255,0.25);
  border-color: var(--accent);
}

/* ── Empty state ── */
.empty-state {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

/* ── Confidence badge ── */
.confidence-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
}
.confidence-high   { color: var(--risk-low);    border-color: var(--risk-low);    background: rgba(6,214,160,0.08); }
.confidence-medium { color: var(--risk-medium);  border-color: var(--risk-medium);  background: rgba(255,209,102,0.08); }
.confidence-low    { color: var(--text-muted);   border-color: var(--border);       background: var(--surface-2); }

.confidence-reason {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 4px;
  line-height: 1.5;
}

/* ── Health score coloring (1–10) ── */
.health-9, .health-10 { color: var(--risk-low); }
.health-7, .health-8  { color: #4ecdc4; }
.health-5, .health-6  { color: var(--risk-medium); }
.health-3, .health-4  { color: var(--risk-high); }
.health-1, .health-2  { color: var(--risk-critical); }

/* ── Key Signals list ── */
.signals-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.signal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.signal-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.type-positive { background: var(--risk-low); }
.type-negative { background: var(--risk-critical); }
.type-neutral  { background: var(--text-muted); }
.signal-body { display: flex; flex-direction: column; gap: 2px; }
.signal-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.signal-source {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* ── Risk Factors list ── */
.risk-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.risk-row {
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border-left: 3px solid transparent;
}
.severity-high   { border-left-color: var(--risk-critical); }
.severity-medium { border-left-color: var(--risk-medium); }
.severity-low    { border-left-color: var(--text-muted); }
.risk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.risk-text { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.severity-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sev-high   { background: rgba(255,77,109,0.15);  color: var(--risk-critical); }
.sev-medium { background: rgba(255,209,102,0.15); color: var(--risk-medium); }
.sev-low    { background: var(--border);           color: var(--text-muted); }
.risk-evidence { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Expansion Opportunities list ── */
.opp-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.opp-row {
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
}
.opp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.opp-text { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.conf-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.conf-high   { background: rgba(6,214,160,0.15);   color: var(--risk-low); }
.conf-medium { background: rgba(108,140,255,0.15); color: var(--accent); }
.conf-low    { background: var(--border);           color: var(--text-muted); }
.opp-rationale { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Next action urgency dot colours ── */
.urgency-this-week  { background: var(--risk-critical); }
.urgency-this-month { background: var(--risk-medium); }
.urgency-monitor    { background: var(--text-muted); }

/* ════════════════════════════════════════
   INDEX PAGE — light theme
   All rules scoped to body.page-index
   ════════════════════════════════════════ */
body.page-index {
  background: #f0f2f5;
  color: #0f1c2e;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Header ── */
.site-header {
  background: #0f1c2e;
  border-bottom: 1px solid #1a2d45;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.header-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #6b8db8;
  letter-spacing: 0.1px;
}
.header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: #4a7fa5;
  letter-spacing: 0.3px;
}
.powered-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.6);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Main shell ── */
.index-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}
.section-label-row { margin-bottom: 24px; }
.section-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #7a8fa8;
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 700px) {
  .cards-grid { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ── Account card ── */
.account-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e4e8ef;
  box-shadow: 0 1px 4px rgba(15,28,46,0.06), 0 4px 16px rgba(15,28,46,0.04);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: box-shadow 0.18s, transform 0.15s;
}
.account-card:hover {
  box-shadow: 0 4px 12px rgba(15,28,46,0.1), 0 12px 32px rgba(15,28,46,0.08);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card-company {
  font-size: 18px;
  font-weight: 700;
  color: #0f1c2e;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.industry-pill {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4a6f96;
  background: #e8f0f8;
  border: 1px solid #c8d8ea;
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  margin-top: 3px;
}

.card-meta-row {
  display: flex;
  gap: 28px;
}
.card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-mono-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9aaabb;
}
.meta-value {
  font-size: 20px;
  font-weight: 800;
  color: #0f1c2e;
  letter-spacing: -0.5px;
  line-height: 1;
}
.meta-value .meta-per {
  font-size: 12px;
  font-weight: 500;
  color: #9aaabb;
  letter-spacing: 0;
}
.meta-mono-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: #7a8fa8;
}

/* ── CTA button ── */
.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 18px;
  background: #0f1c2e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.1px;
  transition: background 0.15s;
  text-decoration: none;
}
.card-cta:hover { background: #1a2d45; }
.cta-arrow {
  font-size: 15px;
  transition: transform 0.15s;
}
.account-card:hover .cta-arrow { transform: translateX(3px); }

/* ════════════════════════════════════════
   ACCOUNT DETAIL PAGE — light theme
   Scoped to body.page-account
   ════════════════════════════════════════ */
body.page-account {
  background: #f0f2f5;
  color: #0f1c2e;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.acct-header {
  background: #0f1c2e;
  border-bottom: 1px solid #1a2d45;
  flex-shrink: 0;
}
.acct-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.acct-header-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.back-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: #4a7fa5;
  letter-spacing: 0.2px;
  transition: color 0.15s;
  text-decoration: none;
}
.back-btn:hover { color: #7ab8d8; }
.acct-header-company {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.acct-company-name {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
}
.acct-header-right {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.acct-header-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 24px;
  text-align: right;
}
.acct-header-field:first-child { padding-left: 0; }
.acct-field-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a7fa5;
}
.acct-field-value {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}
.acct-header-divider {
  width: 1px;
  height: 36px;
  background: #1e3555;
}

/* ── Main shell ── */
.profile-shell {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 32px 48px;
  flex: 1;
}

/* ── Error card ── */
.error-card {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 28px 32px;
}
.error-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #be123c;
  margin-bottom: 8px;
}
.error-card-body {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: #9f1239;
  line-height: 1.6;
}

/* ── Hero card ── */
.hero-card {
  background: #ffffff;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15,28,46,0.06), 0 4px 16px rgba(15,28,46,0.04);
  padding: 32px;
  display: flex;
  gap: 40px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .hero-card { flex-direction: column; gap: 28px; }
  .acct-header-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .acct-header-right { flex-direction: column; align-items: flex-start; gap: 16px; }
  .sections-grid { grid-template-columns: 1fr; }
}
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  min-width: 160px;
}
.hero-right { flex: 1; }

/* Health score */
.health-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9aaabb;
  display: block;
  margin-bottom: 8px;
}
.health-num {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}
.health-denom {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  opacity: 0.5;
}
.health-green { color: #16a34a; }
.health-amber { color: #d97706; }
.health-red   { color: #dc2626; }

/* Confidence */
.conf-block { display: flex; flex-direction: column; gap: 6px; }
.conf-pill {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid;
  width: fit-content;
}
.conf-high   { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.conf-medium { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.conf-low    { color: #6b7280; border-color: #d1d5db; background: #f9fafb; }
.conf-reasoning {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  line-height: 1.5;
  max-width: 180px;
}

/* Narrative */
.narrative-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9aaabb;
  margin-bottom: 12px;
}
.narrative-text {
  font-size: 16px;
  line-height: 1.75;
  color: #1e293b;
  font-weight: 400;
}

/* ── Sections 2×2 grid ── */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.section-card {
  background: #ffffff;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(15,28,46,0.06), 0 4px 16px rgba(15,28,46,0.04);
  padding: 24px 28px;
}
.section-card-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7a8fa8;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f4f8;
}
.section-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-empty {
  font-size: 13px;
  color: #9aaabb;
  font-style: italic;
}

/* Key Signals */
.sig-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.sig-icon {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sig-pos { color: #16a34a; background: #f0fdf4; }
.sig-neg { color: #dc2626; background: #fff1f2; }
.sig-neu { color: #6b7280; background: #f3f4f6; }
.sig-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sig-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
}
.src-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #4a6f96;
  background: #e8f0f8;
  border: 1px solid #c8d8ea;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}

/* Expansion Opportunities */
.opp-item {
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f4f8;
}
.opp-item:last-child { padding-bottom: 0; border-bottom: none; }
.opp-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.opp-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}
.opp-conf-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.opp-conf-pill.conf-high   { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.opp-conf-pill.conf-medium { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.opp-conf-pill.conf-low    { color: #6b7280; border-color: #d1d5db; background: #f9fafb; }
.opp-rationale {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* Risk Factors */
.risk-item {
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f4f8;
}
.risk-item:last-child { padding-bottom: 0; border-bottom: none; }
.risk-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.risk-text {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}
.sev-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.sev-high   { color: #dc2626; border-color: #fca5a5; background: #fff1f2; }
.sev-medium { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.sev-low    { color: #6b7280; border-color: #d1d5db; background: #f9fafb; }
.risk-evidence {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* Next Actions */
.act-item {
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f4f8;
}
.act-item:last-child { padding-bottom: 0; border-bottom: none; }
.act-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.owner-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #c8d8ea;
  background: #e8f0f8;
  color: #4a6f96;
}
.urg-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
}
.urg-badge.urg-this-week  { color: #dc2626; border-color: #fca5a5; background: #fff1f2; }
.urg-badge.urg-this-month { color: #d97706; border-color: #fcd34d; background: #fffbeb; }
.urg-badge.urg-monitor    { color: #6b7280; border-color: #d1d5db; background: #f9fafb; }
.act-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
}

/* ── Footer ── */
.page-footer {
  background: #0f1c2e;
  border-top: 1px solid #1a2d45;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #3d5a78;
  flex-shrink: 0;
}
.footer-dot { color: #1e3555; }
.footer-cached {
  color: #2dd4bf;
  font-weight: 600;
}

/* ════════════════════════════════════════
   LOADING OVERLAY — page-index
   ════════════════════════════════════════ */
.profile-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 28, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.profile-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.profile-loading-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 440px;
  width: calc(100% - 48px);
}

/* Animated equaliser bars */
.loading-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 36px;
  margin-bottom: 8px;
}
.lbar {
  display: block;
  width: 6px;
  border-radius: 3px;
  background: #0f1c2e;
  animation: lbar-bounce 1.1s ease-in-out infinite;
}
.lbar:nth-child(1) { animation-delay: 0s;    }
.lbar:nth-child(2) { animation-delay: 0.15s; }
.lbar:nth-child(3) { animation-delay: 0.30s; }
.lbar:nth-child(4) { animation-delay: 0.15s; }
.lbar:nth-child(5) { animation-delay: 0s;    }
@keyframes lbar-bounce {
  0%,  100% { height: 8px;  opacity: 0.35; }
  50%        { height: 32px; opacity: 1;    }
}

.loading-company-name {
  font-size: 22px;
  font-weight: 800;
  color: #0f1c2e;
  letter-spacing: -0.4px;
  line-height: 1.2;
  min-height: 1.2em;
}
.loading-headline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #7a8fa8;
}
.loading-status {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  min-height: 1.5em;
  transition: opacity 0.3s ease;
}
.loading-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #aab8c8;
  margin-top: 4px;
}
