/* ── Font demo (Space Grotesk headings / JetBrains Mono numerals) ──
   To back out: delete this block, delete the two font-family rules
   below that reference these variables (search "--font-heading" and
   "--font-mono"), and revert the Google Fonts <link> in index.html/
   detail.html back to just Inter. Nothing else depends on this. */
:root {
  --font-heading: 'Space Grotesk', 'Inter', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'Inter', monospace;
}

/* Wraps every dynamically-inserted numeric value across both pages
   (app.js/detail.js) — search ".num" in either file to find them all. */
.num { font-family: var(--font-mono); }

/* ── shadcn/ui token retrofit ──
   Phase 1 (this block): adopt shadcn's semantic vocabulary — background/
   foreground/card/primary/secondary/muted/accent/destructive/border/
   input/ring/radius, plus its --chart-1..5 convention for categorical
   data colors — mapped onto the colors this project already settled on
   through iteration, not shadcn's stock slate palette. Purely additive:
   every existing variable below (--bg, --accent-deep, --radius-lg, etc.)
   is untouched and still drives 100% of the current CSS, so this can't
   cause a visual regression. New components should be built against
   these tokens directly; migrating existing rules to consume them
   (instead of the legacy names) would be a natural phase 2.

   Two of our existing tokens don't map 1:1 onto a shadcn slot and were
   deliberately left alone rather than force-fit: --accent (a saturated
   brand blue-grey used for active/focus states — closest to --ring,
   not --accent, which in shadcn means a subtle hover background) and
   --accent-deep (our emphasis-text color, distinct from --primary,
   which corresponds to the solid dark CTA button background/text
   instead). Tier colors (green/amber/rose) and the per-source palette
   also stay as their own extension, same as shadcn's own docs do for
   product-specific colors beyond the core set. */
:root {
  /* Aliased via var() (not duplicated hex) since the consolidation pass —
     these can't go stale the way the old hardcoded copies did. */
  --background:         var(--bg);
  --foreground:         var(--text-primary);
  --card:                var(--surface);
  --card-foreground:    var(--text-primary);
  --popover:             var(--surface);
  --popover-foreground: var(--text-primary);
  --primary:             var(--text-primary); /* the solid dark CTA button */
  --primary-foreground: #ffffff;
  --secondary:           var(--bg); /* no separate surface-alt anymore */
  --secondary-foreground: var(--text-primary);
  --muted:               var(--accent-tint);
  --muted-foreground:   var(--text-secondary);
  /* No separate --accent slot: shadcn's "accent" (a subtle hover bg) would
     be the same value as --muted above, and this project already has an
     unrelated --accent (brand blue-grey, #607d8b) declared below — reusing
     the name here would silently shadow one or the other depending on
     source order. --muted covers shadcn's accent role instead. */
  --accent-foreground:  var(--accent-deep);
  --destructive:         var(--rose-deep);
  --destructive-foreground: #ffffff;
  --border:              var(--border);
  --input:               var(--border-input);
  --ring:                var(--accent); /* used for focus rings below */
  --radius:              0.625rem; /* = --radius-lg (10px) — sm/md/lg/xl below derive from this */

  /* shadcn chart-color convention — same hues as our per-source tokens */
  --chart-1: #bf635e; /* = --news-color */
  --chart-2: #5e864d; /* = --reddit-red */
  --chart-3: #4c6c91; /* = --linkedin-blue */
  --chart-4: #955d94; /* = --github-color */
  --chart-5: #ac7847; /* = --hn-color */
  --chart-6: #267069; /* = --exec-hire-color */
  --chart-7: #9a8541; /* = --funding-color */
}

/* Real accessibility win from adopting --ring, not just a decorative
   token: a visible focus indicator for keyboard navigation. */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── Design tokens ──
   Consolidated 2026-07-16: everything below derives from 10 core colors
   (bg / surface / border / text-primary / text-secondary / accent /
   accent-deep / green / amber / rose). Every "-deep" is that color mixed
   ~30% toward black; every "-tint" is mixed ~85% toward white — not an
   independently hand-picked hex. Dropped as redundant near-duplicates in
   this pass: --surface-alt, --row-bg, --control-bg, --accent-light,
   --text-muted, and the separate --gauge-accent* hue (folded into
   --accent). The 7 --news-color..--funding-color source colors are the
   deliberate exception — a categorical data-viz palette where 7-way
   distinguishability is the actual requirement, so they keep their own
   hues rather than deriving from the core 10. */
:root {
  --bg:              #eff3f6;
  --surface:         #fdfeff;
  --border:          #d3dee4;
  --border-input:    var(--border);

  --text-primary:    #0d1219;
  --text-secondary:  #838ba0;

  --accent:          #607d8b;
  --accent-deep:     #455a64;
  --accent-tint:     #e7ecee;
  --callout-tint:    var(--bg);

  --green:           #6f9d6a;
  --green-deep:      #4e6e4a;
  --green-tint:      #e9f0e9;

  --amber:           #f59e0b;
  --amber-deep:      #ac6f08;
  --amber-tint:      #fef0da;

  --rose:            #f87171;
  --rose-deep:       #ae4f4f;
  --rose-tint:       #feeaea;

  --news-color:      #bf635e;
  --linkedin-blue:   #4c6c91;
  --reddit-red:      #5e864d;
  --github-color:    #955d94;
  --hn-color:        #ac7847;
  --exec-hire-color: #267069;
  --funding-color:   #9a8541;
  --trend-accent:    var(--green);
  --peer-muted-dot:  var(--text-secondary);

  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   10px;
  --radius-xl:   12px;
  --radius-full: 9999px;

  --shadow-xs:  0 1px 2px 0 rgba(0, 0, 0, 0.1);
  --shadow-btn: 0 1px 1px 0 rgba(0, 0, 0, 0.1);

  --header-h:     128px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   Header
───────────────────────────────────────── */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.header-eyebrow {
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.header-title {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Font demo — see the --font-heading/--font-mono block near the top of
   this file for how to back this out. */
.header-title,
.company-row-name,
.inspector-company-name,
.detail-company-name {
  font-family: var(--font-heading);
}

.header-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 18px;
  white-space: nowrap;
}

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

/* ─────────────────────────────────────────
   Buttons
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-outline {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

/* The one exception to the site-wide neutral button treatment — the
   primary CTA on Suggested Contact stays a solid dark button. */
.btn-dark {
  background: var(--text-primary);
  color: #ffffff;
}

.btn-full { width: 100%; }

/* ─────────────────────────────────────────
   Filter bar
───────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.filter-search-wrap {
  position: relative;
  flex: 1 0 0;
  min-width: 0;
  max-width: 360px;
}

.filter-search {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  padding: 0 12px 0 34px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
}

.filter-search::placeholder { color: var(--text-secondary); }

.filter-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.pill-btn svg { flex-shrink: 0; transition: transform 0.15s; }
.pill-btn.sort-asc svg { transform: rotate(180deg); }

.pill-btn[aria-pressed="true"] {
  background: var(--accent-tint);
  border-color: var(--border);
  color: var(--accent-deep);
}

.pill-btn-clear {
  background: var(--accent-tint);
}

/* ─────────────────────────────────────────
   Body: 3-column layout
───────────────────────────────────────── */
.dashboard-body {
  position: relative;
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  gap: 28px;
  align-items: start;
  flex: 1 0 0;
  padding: 24px 32px 48px;
  min-height: 300px;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.loading-overlay p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.loading-overlay[hidden] { display: none; }

.fallback-banner {
  padding: 10px 32px;
  background: var(--amber-tint);
  color: var(--amber-deep);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.fallback-banner[hidden] { display: none; }

.card-eyebrow {
  padding-left: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-deep);
}


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

/* Flex items don't collapse margins — without this, a divider's own
   margin-bottom stacks with the label's margin-top instead of merging,
   leaving an oversized gap. */
.divider + .section-label { margin-top: 8px; }

.section-label {
  margin: 18px 0 10px;
  padding-left: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.fine-print {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.tier-badge.tier-green { background: var(--green-tint); color: var(--green-deep); }
.tier-badge.tier-amber { background: var(--amber-tint); color: var(--amber-deep); }
.tier-badge.tier-rose  { background: var(--rose-tint);  color: var(--rose-deep); }

.discovery-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.discovery-badge[hidden] { display: none; }

.callout-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--callout-tint);
  border: 1px solid var(--border);
}

.callout-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 5px;
}

.callout-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   Radar column
───────────────────────────────────────── */
.radar-column {
  display: flex;
  flex-direction: column;
}

.radar-scope {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.radar-caption {
  margin: 16px 0 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}


.job-signals-card,
.inspector-card,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

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

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

.gauge-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}

.gauge-visual {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.gauge-visual svg {
  transform: rotate(-90deg);
}

.gauge-center-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.gauge-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gauge-info .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.gauge-momentum-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gauge-momentum-row .stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────
   Ranked list (middle column)
───────────────────────────────────────── */
.list-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.list-hint {
  margin: 4px 0 12px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.tier-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.tier-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tier-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.tier-group-dot.green { background: var(--green); }
.tier-group-dot.amber { background: var(--amber); }
.tier-group-dot.rose  { background: var(--rose); }

.tier-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-deep);
}

.tier-group-label.green { color: var(--green-deep); }
.tier-group-label.amber { color: var(--amber-deep); }
.tier-group-label.rose  { color: var(--rose-deep); }

.company-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.company-row:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.company-row.selected {
  background: var(--surface);
  border-color: var(--accent);
}

.company-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.company-row-name-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.company-row-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.company-row-name:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.company-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Font demo — see the --font-heading/--font-mono block near the top of
   this file for how to back this out. */
.company-row-index,
.inspector-index,
.detail-index,
.gauge-center-value {
  font-family: var(--font-mono);
}

.company-row-index {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
}

.company-row-index.amber { color: var(--amber-deep); }
.company-row-index.rose  { color: var(--rose-deep); }

.momentum-delta {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.5;
}

.momentum-delta.momentum-up   { color: var(--green-deep); }
.momentum-delta.momentum-down { color: var(--rose-deep); }
.momentum-delta.momentum-flat { color: var(--text-secondary); }

.company-row-blurb {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progressive disclosure: the per-source breakdown stays collapsed
   until you hover a row, so the list stays calm at rest but the "where
   does this number come from" detail is one hover away instead of
   locked behind a click into Company Inspector. */
.company-row-detail {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.22s ease;
}

.company-row:hover .company-row-detail,
.company-row:focus-within .company-row-detail {
  grid-template-rows: 1fr;
  opacity: 1;
}

.company-row-detail-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  gap: 14px;
  padding-top: 0;
  transition: padding-top 0.3s ease;
}

.company-row:hover .company-row-detail-inner,
.company-row:focus-within .company-row-detail-inner {
  padding-top: 12px;
}

.row-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
}

.row-detail-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-detail-label.source-news       { color: var(--news-color); }
.row-detail-label.source-reddit     { color: var(--reddit-red); }
.row-detail-label.source-linkedin   { color: var(--linkedin-blue); }
.row-detail-label.source-github     { color: var(--github-color); }
.row-detail-label.source-hn         { color: var(--hn-color); }
.row-detail-label.source-exec_hire  { color: var(--exec-hire-color); }
.row-detail-label.source-funding    { color: var(--funding-color); }

.row-detail-cap-flag {
  display: inline-block;
  margin-left: 5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--amber-deep);
  background: var(--amber-tint);
  padding: 1px 5px;
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.row-detail-value {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-detail-cap {
  font-weight: 400;
  color: var(--text-secondary);
}

.row-detail-contrib {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.row-detail-contrib::before { content: '→ '; }

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.source-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}

.source-pill.source-news::before      { background: var(--news-color); }
.source-pill.source-reddit::before   { background: var(--reddit-red); }
.source-pill.source-linkedin::before { background: var(--linkedin-blue); }
.source-pill.source-github::before   { background: var(--github-color); }
.source-pill.source-hn::before       { background: var(--hn-color); }
.source-pill.source-exec_hire::before { background: var(--exec-hire-color); }
.source-pill.source-funding::before  { background: var(--funding-color); }

.meter-track {
  height: 5px;
  border-radius: var(--radius-sm);
  background: transparent;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--accent-deep);
}

.meter-fill.source-news     { background: var(--news-color); opacity: 0.9; }
.meter-fill.source-reddit   { background: var(--reddit-red); opacity: 0.9; }
.meter-fill.source-linkedin { background: var(--linkedin-blue); opacity: 0.9; }
.meter-fill.source-github   { background: var(--github-color); opacity: 0.9; }
.meter-fill.source-hn       { background: var(--hn-color); opacity: 0.9; }

.table-empty {
  margin: 0;
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ─────────────────────────────────────────
   Right rail
───────────────────────────────────────── */
.right-rail {
  display: flex;
  flex-direction: column;
}

.inspector-title-row { margin-top: 14px; }

.inspector-company-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.inspector-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.inspector-index {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
}

.mini-breakdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 6px;
}

.mini-breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-breakdown-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  line-height: 16px;
}

.mini-breakdown-top .label { color: var(--text-secondary); }
.mini-breakdown-top .value { color: var(--text-primary); font-weight: 700; font-family: var(--font-mono); }

.math-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.math-caption {
  margin: 2px 0 10px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
}

.math-group-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.math-group-label:first-child { margin-top: 0; }

.math-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 11px;
}

.math-row .math-label { color: var(--text-primary); font-weight: 500; }
.math-row .math-detail { color: var(--text-secondary); }

.math-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--accent-deep);
  opacity: 0.9;
}

.math-label.source-news::before      { background: var(--news-color); }
.math-label.source-reddit::before   { background: var(--reddit-red); }
.math-label.source-linkedin::before { background: var(--linkedin-blue); }
.math-label.source-github::before   { background: var(--github-color); }
.math-label.source-hn::before       { background: var(--hn-color); }
.math-label.source-exec_hire::before { background: var(--exec-hire-color); }
.math-label.source-funding::before   { background: var(--funding-color); }

.math-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.math-total-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.math-total-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
  font-family: var(--font-mono);
}

.inspector-card .btn-dark { margin-top: 16px; }

/* Suggested Contact */
.contact-person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.contact-title {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.contact-detail-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  margin-top: 12px;
}

.contact-detail-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.contact-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-detail-value-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-detail-value-linkedin svg { flex-shrink: 0; }

.contact-card .btn-dark { margin-top: 12px; }

/* ─────────────────────────────────────────
   Detail page (3-column, matching main dashboard)
───────────────────────────────────────── */
.detail-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.detail-topbar-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.detail-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.back-link {
  display: inline-block;
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link:hover { color: var(--text-primary); }

.back-link-arrow {
  display: inline-block;
  position: relative;
  top: -2px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.detail-company-name {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-index {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  color: var(--accent-deep);
}

.detail-blurb {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.detail-body {
  padding: 24px 32px 48px;
  position: relative;
  min-height: 400px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 350px 1fr 350px;
  gap: 30px;
  align-items: start;
}

.detail-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.breakdown-compact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
}

.trend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.peer-compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.peer-compare-headline {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.peer-compare-sub {
  margin: 4px 0 14px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.source-rank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.source-rank-headline {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.source-rank-headline strong { color: var(--text-primary); }

.source-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.source-rank-row + .source-rank-row { border-top: 1px solid var(--border); }

.source-rank-row-label {
  width: 84px;
  flex-shrink: 0;
  white-space: nowrap;
}

.source-rank-row-pct {
  width: 118px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
}

.source-rank-row-strip {
  flex: 1 0 0;
  min-width: 0;
}

.callout-box-standalone { margin-top: 0; }
.math-panel-standalone { margin-top: 0; }

.inspector-trend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.inspector-trend-card #inspector-trend-svg {
  display: block;
  width: 100%;
  height: 80px;
}

.contact-card-standalone { padding: 20px; }

.next-steps-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 8px;
}

.next-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.next-step-row:hover { background: var(--accent-tint); }

.next-step-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-input);
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.next-step-row.done .next-step-check {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.next-step-row.done .next-step-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #ffffff;
  line-height: 1;
}

.next-step-row.done .next-step-label { color: var(--text-secondary); }

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 1200px) {
  .dashboard-body {
    grid-template-columns: 1fr;
  }
  .detail-columns {
    grid-template-columns: 1fr;
  }
}
