/* ═══════════════════════════════════════════════════════════════════════════
   Company Profile — editorial pitchbook stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --cp-canvas:      #fafaf7;
  --cp-surface:     #ffffff;
  --cp-ink:         #14140f;
  --cp-muted:       #6b6b66;
  --cp-hint:        #7c7a73;  /* darkened from #9a9890 to clear WCAG AA (≈4.6:1 on canvas) */
  --cp-rule:        #e4e4de;

  --cp-teal:        #00b09a;   /* oil / primary accent */
  --cp-teal-10:     rgba(0, 176, 154, 0.10);
  --cp-teal-20:     rgba(0, 176, 154, 0.20);
  --cp-red:         #c83232;   /* gas — reserved, never reused */
  --cp-amber:       #d4a456;   /* NGL */
  --cp-slate:       #3a6c8a;   /* FCF lines / secondary axes */
  --cp-slate-30:    rgba(58, 108, 138, 0.30);

  --cp-pos:         #1d9e75;   /* positive deltas */
  --cp-neg:         #d85a30;   /* negative deltas */

  --cp-header-h:    84px;
  --cp-sidebar-w:   220px;
  /* Shared site navbar (login / logout) is position:fixed with h-14 (56px).
     Account for it when stacking the editorial cp-header below. */
  --cp-navbar-h:    56px;

  --cp-font-serif:  'Source Serif 4', Georgia, serif;
  --cp-font-sans:   'Inter', system-ui, sans-serif;

  --cp-radius:      6px;
  --cp-radius-lg:   12px;
  --cp-shadow-sm:   0 1px 3px rgba(0,0,0,.07);
  --cp-shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --cp-shadow-lg:   0 8px 40px rgba(0,0,0,.14);

  --cp-transition:  150ms ease;
}

/* ─── Reset / base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Global keyboard-focus indicator. The page has dozens of interactive
   targets (sidebar nav, period buttons, tab strips, drawer/modal close,
   clickable table cells) but no `:focus-visible` rules anywhere — keyboard
   users had no way to see where they were. One rule covers the whole tree;
   the offset keeps it off the visible content for inset elements. */
:focus-visible {
  outline: 2px solid var(--cp-teal);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Mouse focus stays clean — only show the ring for keyboard nav. */
:focus:not(:focus-visible) { outline: none; }

.cp-body {
  font-family: var(--cp-font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--cp-ink);
  background: var(--cp-canvas);
  -webkit-font-smoothing: antialiased;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.cp-header {
  position: sticky;
  top: var(--cp-navbar-h);
  z-index: 100;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 24px;
  height: var(--cp-header-h);
  padding: 0 24px;
  background: var(--cp-surface);
  border-bottom: 1px solid var(--cp-rule);
  box-shadow: var(--cp-shadow-sm);
}

.cp-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.cp-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.cp-brand-divider {
  color: var(--cp-rule);
  font-size: 20px;
}

.cp-brand-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--cp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cp-header-identity {
  min-width: 0;
}

.cp-company-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-company-name {
  font-family: var(--cp-font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--cp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-company-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--cp-muted);
}

.cp-ticker {
  font-weight: 600;
  color: var(--cp-ink);
  font-size: 13px;
}

.cp-exchange {
  font-size: 12px;
}

.cp-meta-sep { color: var(--cp-hint); }

.cp-basin-pills {
  display: flex;
  gap: 4px;
}

.cp-basin-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--cp-teal-10);
  color: var(--cp-teal);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── KPI strip ──────────────────────────────────────────────────────────── */
.cp-kpi-strip {
  display: flex;
  gap: 2px;
  align-items: stretch;
}

.cp-kpi-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 16px;
  border-left: 1px solid var(--cp-rule);
  min-width: 100px;
  cursor: default;
}

.cp-kpi-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--cp-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.cp-kpi-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--cp-ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.cp-kpi-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--cp-muted);
  margin-left: 2px;
}

.cp-kpi-delta {
  font-size: 11px;
  font-weight: 500;
  margin-top: 1px;
}

.cp-kpi-delta.pos { color: var(--cp-pos); }
.cp-kpi-delta.neg { color: var(--cp-neg); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.cp-layout {
  display: grid;
  grid-template-columns: var(--cp-sidebar-w) 1fr;
  min-height: calc(100vh - var(--cp-navbar-h) - var(--cp-header-h));
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.cp-sidebar {
  position: sticky;
  top: calc(var(--cp-navbar-h) + var(--cp-header-h));
  height: calc(100vh - var(--cp-navbar-h) - var(--cp-header-h));
  overflow-y: auto;
  border-right: 1px solid var(--cp-rule);
  background: var(--cp-surface);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
}

.cp-nav-list {
  list-style: none;
  flex: 1;
}

.cp-nav-item {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--cp-transition), border-color var(--cp-transition), background var(--cp-transition);
}

.cp-nav-item:hover {
  color: var(--cp-ink);
  background: var(--cp-canvas);
}

.cp-nav-item.active {
  color: var(--cp-teal);
  border-left-color: var(--cp-teal);
  background: var(--cp-teal-10);
}

.cp-sidebar-controls {
  padding: 12px 16px;
  border-top: 1px solid var(--cp-rule);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cp-sidebar-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-sidebar-control-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Sidebar export actions — pack into a horizontal icon-only row so the
   sidebar stack (11 nav items + 3 control groups) fits on a 14" laptop
   without forcing the user to scroll past nav to reach Export Excel.
   The label text stays in the DOM as `.cp-btn-label` for screen readers
   and the buttons carry aria-label / title for hover discovery. */
.cp-sidebar-actions {
  flex-direction: row;
  gap: 4px;
}

.cp-sidebar-actions .cp-btn-ghost {
  flex: 1;
  justify-content: center;
  padding: 8px 6px;
  gap: 0;
}

.cp-sidebar-actions .cp-btn-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Period picker ──────────────────────────────────────────────────────── */
.cp-period-picker {
  display: flex;
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius);
  overflow: hidden;
}

.cp-period-btn {
  flex: 1;
  padding: 6px 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--cp-font-sans);
  color: var(--cp-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--cp-transition), color var(--cp-transition);
  text-align: center;
}

.cp-period-btn:not(:first-child) {
  border-left: 1px solid var(--cp-rule);
}

.cp-period-btn.active {
  background: var(--cp-teal);
  color: #fff;
}

.cp-period-btn:not(.active):hover {
  background: var(--cp-canvas);
  color: var(--cp-ink);
}

/* ─── Peer tags ──────────────────────────────────────────────────────────── */
.cp-peer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

.cp-peer-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--cp-canvas);
  border: 1px solid var(--cp-rule);
  font-size: 11px;
  font-weight: 500;
  color: var(--cp-ink);
}

.cp-peer-tag-remove {
  cursor: pointer;
  color: var(--cp-hint);
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
}

.cp-peer-tag-remove:hover { color: var(--cp-neg); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.cp-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius);
  background: transparent;
  font-family: var(--cp-font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-muted);
  cursor: pointer;
  transition: background var(--cp-transition), color var(--cp-transition);
  text-align: left;
}

.cp-btn-ghost:hover {
  background: var(--cp-canvas);
  color: var(--cp-ink);
}

.cp-btn-ghost.cp-btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.cp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--cp-radius);
  background: var(--cp-teal);
  font-family: var(--cp-font-sans);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--cp-transition);
}

.cp-btn-primary:hover { opacity: 0.88; }

/* ─── Main content area ──────────────────────────────────────────────────── */
/* Base cap keeps prose/AI-summary readable on ultra-wide displays. The
   metric tables (and tearsheet chart row) override below to fill more
   space when the viewport allows. */
.cp-main {
  padding: 32px 40px 80px;
  max-width: 1280px;
}

/* ≥1400px: tables get the extra horizontal real estate users specifically
   asked for. The card itself can break out wider than the .cp-main cap.
   Prose-style cards (AI summary, what-changed, descriptions) stay within
   the base cap for readability. */
@media (min-width: 1400px) {
  .cp-main {
    max-width: 1480px;
  }
}
@media (min-width: 1700px) {
  .cp-main {
    max-width: 1720px;
  }
}

/* ─── Section ────────────────────────────────────────────────────────────── */
.cp-section {
  padding-top: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--cp-rule);
}

.cp-section:last-child {
  border-bottom: none;
}

.cp-section-title {
  font-family: var(--cp-font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--cp-ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.cp-section-eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.cp-section-desc {
  font-size: 14px;
  color: var(--cp-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ─── Collapsible sections ───────────────────────────────────────────────── */
/* Click the header (or chevron) to toggle. The header wrapper gets the click
   handler in app.js; this just provides the visual affordance. */
.cp-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.cp-section-header > .cp-section-title {
  flex: 1;
  margin-bottom: 4px;
}
.cp-section-collapse-btn {
  background: transparent;
  border: 1px solid var(--cp-rule);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cp-muted);
  cursor: pointer;
  transition: transform var(--cp-transition), background var(--cp-transition);
  flex-shrink: 0;
}
.cp-section-collapse-btn:hover {
  background: var(--cp-canvas);
  color: var(--cp-ink);
}
.cp-section-collapsed .cp-section-collapse-btn {
  transform: rotate(-90deg);
}
.cp-section-collapsed .cp-section-body {
  display: none;
}

/* ─── Coming-soon placeholder ────────────────────────────────────────────── */
.cp-coming-soon-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  border: 2px dashed var(--cp-rule);
  border-radius: var(--cp-radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-hint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(250,250,247,0.6);
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.cp-card {
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius-lg);
  box-shadow: var(--cp-shadow-sm);
  overflow: hidden;
}

.cp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.cp-card-title {
  font-family: var(--cp-font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--cp-ink);
}

.cp-card-eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.cp-card-body {
  padding: 16px 20px 20px;
}

/* ─── Chart cards row ────────────────────────────────────────────────────── */
.cp-chart-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.cp-chart-container {
  padding: 0 12px 16px;
  min-height: 240px;
}

/* ─── AI summary ─────────────────────────────────────────────────────────── */
.cp-ai-summary-card {
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--cp-shadow-sm);
}

.cp-ai-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.cp-ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cp-teal);
  display: inline-block;
  flex-shrink: 0;
}

.cp-ai-text {
  font-family: var(--cp-font-serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.65;
  color: var(--cp-ink);
}

.cp-ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--cp-rule);
}

.cp-ai-generated-at {
  font-size: 11px;
  color: var(--cp-hint);
}

.cp-ai-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--cp-teal);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--cp-font-sans);
  padding: 0;
  transition: opacity var(--cp-transition);
}

.cp-ai-refresh-btn:hover { opacity: 0.75; }

/* ─── What Changed panel ─────────────────────────────────────────────────── */
.cp-what-changed {
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--cp-shadow-sm);
}

.cp-what-changed-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.cp-delta-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.cp-delta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-delta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--cp-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cp-delta-value {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-delta-value.pos { color: var(--cp-pos); }
.cp-delta-value.neg { color: var(--cp-neg); }

.cp-delta-note {
  font-size: 11px;
  color: var(--cp-hint);
  line-height: 1.4;
}

/* ─── Peer strip ─────────────────────────────────────────────────────────── */
.cp-peer-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 24px;
}

.cp-peer-card {
  flex-shrink: 0;
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius-lg);
  padding: 12px 16px;
  min-width: 140px;
  box-shadow: var(--cp-shadow-sm);
}

.cp-peer-card-ticker {
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-ink);
}

.cp-peer-card-name {
  font-size: 11px;
  color: var(--cp-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.cp-peer-card-stat {
  font-size: 11px;
  color: var(--cp-muted);
  display: flex;
  justify-content: space-between;
}

.cp-peer-card-stat + .cp-peer-card-stat {
  margin-top: 2px;
}

.cp-peer-card-stat-value {
  font-weight: 600;
  color: var(--cp-ink);
}

/* ─── Financials section ─────────────────────────────────────────────────── */
.cp-fin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--cp-rule);
  margin-bottom: 20px;
}

.cp-fin-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--cp-font-sans);
  transition: color var(--cp-transition), border-color var(--cp-transition);
}

.cp-fin-tab.active {
  color: var(--cp-teal);
  border-bottom-color: var(--cp-teal);
}

.cp-fin-tab:not(.active):hover { color: var(--cp-ink); }

.cp-fin-period-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.cp-fin-period-label {
  font-size: 12px;
  color: var(--cp-muted);
  font-weight: 500;
}

.cp-fin-period-btn {
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--cp-rule);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--cp-font-sans);
  color: var(--cp-muted);
  background: transparent;
  cursor: pointer;
  transition: background var(--cp-transition), color var(--cp-transition);
}

.cp-fin-period-btn.active {
  background: var(--cp-ink);
  color: #fff;
  border-color: var(--cp-ink);
}

/* ─── Financial table ────────────────────────────────────────────────────── */
.cp-fin-table-wrap {
  overflow-x: auto;
}

.cp-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cp-fin-table thead th {
  padding: 8px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--cp-rule);
  white-space: nowrap;
}

.cp-fin-table thead th:first-child { text-align: left; }

.cp-fin-table tbody tr:hover td { background: var(--cp-canvas); }

.cp-fin-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--cp-rule);
  color: var(--cp-ink);
}

.cp-fin-table tbody td:first-child {
  color: var(--cp-muted);
  font-weight: 500;
}

.cp-fin-table tbody td:not(:first-child) { text-align: right; }

.cp-fin-table td.clickable {
  cursor: pointer;
  color: var(--cp-ink);
  position: relative;
}

.cp-fin-table td.clickable:hover {
  color: var(--cp-teal);
  text-decoration: underline;
  text-decoration-style: dotted;
}

.cp-fin-table tbody tr.row-indent-1 td:first-child { padding-left: 28px; }
.cp-fin-table tbody tr.row-indent-2 td:first-child { padding-left: 44px; }

.cp-fin-table tfoot td {
  padding: 8px 12px;
  font-weight: 600;
  border-top: 2px solid var(--cp-rule);
}

/* Subtotal / total rows in the IS/BS/CF tables — bold + top border so the
   eye separates them from the line items above. */
.cp-fin-table tbody tr.cp-fin-total-row td {
  font-weight: 600;
  border-top: 1px solid var(--cp-rule);
  background: var(--cp-canvas);
}

/* Cap statement table heights so a 21-row IS doesn't stretch the section
   forever. Wraps the existing table in a scroll viewport. */
.cp-fin-table-wrap {
  max-height: 540px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Group header row inside the Ratios & Margins tab */
.cp-fin-table tr.cp-fin-group-row td {
  background: var(--cp-canvas);
  font-family: var(--cp-font-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cp-muted);
  padding: 14px 12px 6px;
  border-top: 1px solid var(--cp-rule);
  text-align: left;
}

/* ─── Financial Health card ─────────────────────────────────────────────── */
.cp-fh-card {
  padding: 24px;
}

.cp-fh-headline {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
}
@media (max-width: 720px) {
  .cp-fh-headline {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.cp-fh-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  border-radius: 10px;
  border: 1px solid var(--cp-rule);
  background: var(--cp-canvas);
}

.cp-fh-badge-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cp-muted);
  margin-bottom: 6px;
}

.cp-fh-badge-value {
  font-family: var(--cp-font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cp-ink);
  line-height: 1.1;
}

.cp-fh-badge-asof {
  margin-top: 6px;
  font-size: 12px;
  color: var(--cp-hint);
}

/* Composite badge color tinting per category */
.cp-fh-badge-strong   { background: rgba(29, 158, 117, 0.10); border-color: rgba(29, 158, 117, 0.35); }
.cp-fh-badge-strong   .cp-fh-badge-value { color: #156d50; }
.cp-fh-badge-stable   { background: rgba(58, 108, 138, 0.10); border-color: rgba(58, 108, 138, 0.35); }
.cp-fh-badge-stable   .cp-fh-badge-value { color: #2c5570; }
.cp-fh-badge-watch    { background: rgba(212, 164, 86, 0.14); border-color: rgba(212, 164, 86, 0.45); }
.cp-fh-badge-watch    .cp-fh-badge-value { color: #8d6520; }
.cp-fh-badge-stressed { background: rgba(216, 90, 48, 0.10); border-color: rgba(216, 90, 48, 0.40); }
.cp-fh-badge-stressed .cp-fh-badge-value { color: #a04018; }

.cp-fh-narrative {
  font-family: var(--cp-font-serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cp-ink);
  margin: 0;
}

.cp-fh-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.cp-fh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cp-fh-table thead th {
  text-align: right;
  padding: 10px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cp-muted);
  border-bottom: 1px solid var(--cp-rule);
  font-weight: 600;
  white-space: nowrap;
}

.cp-fh-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cp-rule);
  text-align: right;
  color: var(--cp-ink);
}

.cp-fh-table tbody td.cp-fh-anchor-label {
  text-align: left;
  font-weight: 500;
}

.cp-fh-table tbody td.cp-fh-anchor-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cp-fh-table td.cp-fh-threshold {
  color: var(--cp-hint);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* Per-anchor category pill */
.cp-fh-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cp-fh-pill-strong   { background: rgba(29, 158, 117, 0.12); color: #156d50; }
.cp-fh-pill-stable   { background: rgba(58, 108, 138, 0.12); color: #2c5570; }
.cp-fh-pill-watch    { background: rgba(212, 164, 86, 0.18); color: #8d6520; }
.cp-fh-pill-stressed { background: rgba(216, 90, 48, 0.14); color: #a04018; }

.cp-fh-methodology {
  margin-top: 16px;
  font-size: 12px;
  color: var(--cp-hint);
  line-height: 1.5;
  font-style: italic;
}

.cp-fh-skeleton { padding: 12px; }

/* ─── Source lineage drawer ──────────────────────────────────────────────── */
.cp-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,15,0.35);
  z-index: 200;
  animation: cp-fade-in 150ms ease;
}

.cp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--cp-surface);
  border-left: 1px solid var(--cp-rule);
  box-shadow: var(--cp-shadow-lg);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: cp-slide-in 200ms ease;
}

.cp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cp-rule);
  flex-shrink: 0;
}

.cp-drawer-title {
  font-family: var(--cp-font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--cp-ink);
}

.cp-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cp-muted);
  padding: 4px;
  border-radius: var(--cp-radius);
  display: flex;
  align-items: center;
  transition: color var(--cp-transition);
}

.cp-drawer-close:hover { color: var(--cp-ink); }

.cp-drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Lineage header (metric label + period) */
.cp-lineage-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cp-rule);
}

.cp-lineage-metric-label {
  font-family: var(--cp-font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--cp-ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cp-lineage-period {
  font-size: 12px;
  color: var(--cp-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* Sections (STANDARDIZED / STAGING / RAW) */
.cp-lineage-section {
  margin-bottom: 28px;
}
.cp-lineage-section:last-child { margin-bottom: 0; }

.cp-lineage-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cp-rule);
}

.cp-lineage-std-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--cp-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Staging rows: column flex — label/value top, XBRL tag below */
.cp-lineage-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cp-rule);
}
.cp-lineage-row:first-child { padding-top: 0; }
.cp-lineage-row:last-child { border-bottom: none; padding-bottom: 0; }

.cp-lineage-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.cp-lineage-row-label {
  font-size: 13px;
  color: var(--cp-ink);
  font-weight: 500;
}

.cp-lineage-row-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.cp-lineage-pos { color: var(--cp-pos); }
.cp-lineage-neg { color: var(--cp-neg); }

.cp-lineage-xbrl-tag {
  font-size: 11px;
  color: var(--cp-hint);
  font-family: 'SF Mono', Menlo, Consolas, 'Courier New', monospace;
  word-break: break-all;
  line-height: 1.4;
  background: var(--cp-canvas);
  border: 1px solid var(--cp-rule);
  border-radius: 3px;
  padding: 4px 8px;
}

/* Italic explanatory note shown on the placeholder staging row when no
   single XBRL fact rolls up to a standardized value (rare for direct rows,
   common for Q4 increments derived from 10-K minus YTD-Q3). */
.cp-lineage-row-note {
  font-size: 12px;
  color: var(--cp-muted);
  font-style: italic;
  line-height: 1.5;
  margin-top: 6px;
  max-width: 480px;
}

/* Derivation note: shown above the staging rows when the standardized
   value was computed from cumulative XBRL facts (e.g. Q4 = FY − 9M YTD).
   Light-amber tint so it reads as an annotation, not data. */
.cp-lineage-derivation-note {
  font-size: 12px;
  line-height: 1.55;
  color: #6b5a2a;
  background: rgba(212, 164, 86, 0.10);
  border-left: 2px solid var(--cp-amber);
  padding: 8px 12px;
  margin: 8px 0 12px;
  border-radius: 0 4px 4px 0;
}

/* Raw filing block */
.cp-lineage-raw-meta {
  font-size: 13px;
  color: var(--cp-ink);
  margin-bottom: 6px;
}

.cp-lineage-raw-filing {
  font-weight: 600;
}

.cp-lineage-accession {
  font-size: 11px;
  color: var(--cp-hint);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  margin-bottom: 12px;
  word-break: break-all;
}

.cp-lineage-sec-link {
  font-size: 13px;
  color: var(--cp-teal);
  text-decoration: none;
  display: inline-block;
  margin-top: 4px;
  font-weight: 500;
}
.cp-lineage-sec-link:hover { text-decoration: underline; }

.cp-drawer-error {
  font-size: 13px;
  color: var(--cp-hint);
  padding: 16px 0;
}

/* ─── Peer picker modal ───────────────────────────────────────────────────── */
.cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,15,0.40);
  z-index: 300;
  animation: cp-fade-in 150ms ease;
}

.cp-peer-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: 80vh;
  background: var(--cp-surface);
  border-radius: var(--cp-radius-lg);
  box-shadow: var(--cp-shadow-lg);
  z-index: 301;
  display: flex;
  flex-direction: column;
  animation: cp-fade-in 150ms ease;
}

.cp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--cp-rule);
  flex-shrink: 0;
}

.cp-modal-title {
  font-family: var(--cp-font-serif);
  font-size: 17px;
  font-weight: 600;
}

.cp-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cp-muted);
  padding: 4px;
  border-radius: var(--cp-radius);
  display: flex;
  align-items: center;
  transition: color var(--cp-transition);
}

.cp-modal-close:hover { color: var(--cp-ink); }

.cp-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.cp-peer-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius);
  font-size: 13px;
  font-family: var(--cp-font-sans);
  color: var(--cp-ink);
  background: var(--cp-canvas);
  outline: none;
  margin-bottom: 12px;
}

.cp-peer-search-input:focus { border-color: var(--cp-teal); }

.cp-peer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-peer-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--cp-radius);
  cursor: pointer;
  transition: background var(--cp-transition);
}

.cp-peer-list-item:hover { background: var(--cp-canvas); }

.cp-peer-list-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cp-teal);
  flex-shrink: 0;
}

.cp-peer-list-ticker {
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-ink);
  min-width: 48px;
}

.cp-peer-list-name {
  font-size: 12px;
  color: var(--cp-muted);
}

.cp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--cp-rule);
  flex-shrink: 0;
}

/* ─── Hero block ─────────────────────────────────────────────────────────── */
.cp-hero {
  margin-bottom: 28px;
}

.cp-hero-name {
  font-family: var(--cp-font-serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--cp-ink);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cp-hero-sub {
  font-size: 16px;
  color: var(--cp-muted);
  line-height: 1.5;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes cp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cp-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cp-layout {
    grid-template-columns: 1fr;
  }

  .cp-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--cp-rule);
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
  }

  .cp-nav-list {
    display: flex;
    flex-direction: row;
  }

  .cp-nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }

  .cp-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--cp-teal);
  }

  .cp-sidebar-controls { display: none; }

  .cp-main { padding: 24px 20px 60px; }

  .cp-chart-row { grid-template-columns: 1fr; }

  .cp-delta-list { grid-template-columns: repeat(3, 1fr); }

  /* Tablet / split-screen sidebar nav: keep the KPI strip visible (the
     page's signature first impression) but let it scroll horizontally so
     a narrow viewport doesn't crowd the company-name column. */
  .cp-kpi-strip {
    overflow-x: auto;
    max-width: 60vw;
  }
  .cp-search { width: 200px; }
}

/* Phone / very narrow split: drop the KPI strip + collapse header to its
   essential 3-column layout. Below this size, the tearsheet section's
   own KPI tiles still convey the same information once the user scrolls. */
@media (max-width: 768px) {
  .cp-header { grid-template-columns: auto auto 1fr; }
  .cp-kpi-strip { display: none; }
}

/* ─── Skeleton loader ────────────────────────────────────────────────────── */
.cp-skeleton,
.cp-shimmer {
  background: linear-gradient(90deg, var(--cp-rule) 25%, var(--cp-canvas) 50%, var(--cp-rule) 75%);
  background-size: 400% 100%;
  animation: cp-shimmer 1.4s ease infinite;
  border-radius: 4px;
}

/* The lineage-drawer skeleton wraps shimmer bars in its own container; give
   it consistent vertical rhythm so the loading state matches the resolved
   state's column spacing. */
.cp-lineage-skeleton {
  padding: 4px 0;
}

/* Peer modal: empty-state row + the "no peers selected" placeholder under
   the sidebar tag list. Both are hint-tier by design — no ornament, just
   small muted text aligned with the surrounding label rhythm. */
.cp-peer-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: var(--cp-hint);
  text-align: center;
}

.cp-peer-tag-hint {
  font-size: 11px;
  font-style: italic;
  color: var(--cp-hint);
}

@keyframes cp-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ─── Not-found / coverage list ──────────────────────────────────────────── */
.cp-not-found {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}

.cp-not-found-title {
  font-family: var(--cp-font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--cp-ink);
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}

.cp-not-found-sub {
  font-size: 15px;
  color: var(--cp-muted);
  margin: 0 0 48px;
  max-width: 640px;
  line-height: 1.5;
}

.cp-not-found-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.cp-not-found-group-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--cp-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cp-rule);
}

.cp-not-found-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.cp-coverage-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: var(--cp-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.cp-coverage-card:hover {
  border-color: var(--cp-teal);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 176, 154, 0.08);
}

.cp-coverage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cp-coverage-ticker {
  font-family: var(--cp-font-body, Inter, sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cp-ink);
  background: rgba(0, 176, 154, 0.08);
  border: 1px solid rgba(0, 176, 154, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

.cp-coverage-badge {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cp-hint);
  border: 1px dashed var(--cp-rule);
  padding: 2px 6px;
  border-radius: 3px;
}

.cp-coverage-name {
  font-family: var(--cp-font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--cp-ink);
  line-height: 1.25;
}

.cp-coverage-basins {
  font-size: 12px;
  color: var(--cp-muted);
  letter-spacing: 0.01em;
}

.cp-coverage-note {
  font-size: 11px;
  color: var(--cp-hint);
  font-style: italic;
}

/* ─── Header search ──────────────────────────────────────────────────────── */
.cp-search-mount {
  flex-shrink: 0;
}

.cp-search {
  position: relative;
  width: 260px;
}

.cp-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--cp-hint);
  pointer-events: none;
}

.cp-search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border: 1px solid var(--cp-rule);
  border-radius: 6px;
  background: var(--cp-canvas);
  color: var(--cp-ink);
  font-family: var(--cp-font-body, Inter, sans-serif);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.cp-search-input::placeholder {
  color: var(--cp-hint);
}
.cp-search-input:focus {
  border-color: var(--cp-teal);
  background: var(--cp-surface);
}

.cp-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: var(--cp-surface);
  border: 1px solid var(--cp-rule);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(20, 20, 15, 0.08);
  z-index: 200;
}

.cp-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--cp-rule);
  cursor: pointer;
}
.cp-search-row:last-child { border-bottom: none; }
.cp-search-row.active,
.cp-search-row:hover {
  background: rgba(0, 176, 154, 0.06);
}

.cp-search-row-ticker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cp-ink);
  background: rgba(0, 176, 154, 0.08);
  border: 1px solid rgba(0, 176, 154, 0.2);
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}

.cp-search-row-name {
  font-size: 13px;
  color: var(--cp-ink);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-search-row-badge {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cp-hint);
  border: 1px dashed var(--cp-rule);
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cp-search-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--cp-hint);
  text-align: center;
}

/* ─── Hedging section ────────────────────────────────────────────────────── */
.cp-hedge-card {
  padding: 0;
}

.cp-hedge-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--cp-rule);
  font-size: 12px;
}

.cp-hedge-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cp-hint);
  font-weight: 600;
  font-size: 10px;
}

.cp-hedge-meta-value {
  color: var(--cp-ink);
  font-weight: 500;
}

.cp-hedge-meta-source {
  color: var(--cp-muted);
  margin-left: auto;
  font-size: 11px;
}

.cp-hedge-source-link {
  color: var(--cp-teal);
  text-decoration: none;
  margin-left: 4px;
}
.cp-hedge-source-link:hover { text-decoration: underline; }

.cp-hedge-commodity {
  padding: 18px 20px;
  border-bottom: 1px solid var(--cp-rule);
}
.cp-hedge-commodity:last-child { border-bottom: none; }

.cp-hedge-commodity-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.cp-hedge-commodity-label {
  font-family: var(--cp-font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--cp-ink);
}

.cp-hedge-commodity-sub {
  font-size: 12px;
  color: var(--cp-muted);
  font-variant-numeric: tabular-nums;
}

.cp-hedge-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 420px;
}
.cp-hedge-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--cp-surface);
}

.cp-hedge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cp-hedge-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--cp-rule);
  white-space: nowrap;
}

.cp-hedge-table thead th:nth-child(n+4) { text-align: right; }

.cp-hedge-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cp-rule);
  color: var(--cp-ink);
  white-space: nowrap;
}
.cp-hedge-table tbody tr:last-child td { border-bottom: none; }
.cp-hedge-table tbody td:nth-child(n+4) { text-align: right; }

.cp-hedge-muted { color: var(--cp-muted); }

.cp-hedge-skeleton {
  padding: 24px;
}

/* ─── Shared metric section (operations / acreage / reserves / credit / guidance) */
.cp-metric-card {
  padding: 0;
}

.cp-metric-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--cp-rule);
  font-size: 11px;
  color: var(--cp-muted);
  letter-spacing: 0.02em;
}

.cp-metric-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 540px;
}

/* Sticky header inside the scrollable wrap so column labels stay visible
   while the user scrolls through long credit / guidance / reserves tables. */
.cp-metric-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--cp-surface);
}

.cp-metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cp-metric-table thead th {
  text-align: right;
  font-size: 10px;
  font-weight: 600;
  color: var(--cp-hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--cp-rule);
  white-space: nowrap;
}
.cp-metric-table thead th:first-child { text-align: left; }

.cp-metric-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--cp-rule);
  color: var(--cp-ink);
  white-space: nowrap;
}
.cp-metric-table tbody tr:last-child td { border-bottom: none; }

.cp-metric-table .cp-metric-label {
  font-weight: 500;
  color: var(--cp-ink);
}

.cp-metric-table .cp-metric-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cp-metric-table .cp-metric-group-row td {
  font-family: var(--cp-font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-ink);
  background: var(--cp-canvas);
  padding: 12px 14px 6px;
  border-bottom: 1px solid var(--cp-rule);
  letter-spacing: -0.005em;
}

/* Flat-layout tables (credit, guidance) hold qualitative text in the Value
   column — covenant prose, ratings strings — so allow wrapping on Metric
   and Value while keeping As-of / Source single-line. Capping max-width on
   value prevents one long covenant from dominating the whole table. */
.cp-metric-table.cp-metric-table-flat tbody td {
  white-space: normal;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: anywhere;
}
.cp-metric-table.cp-metric-table-flat .cp-metric-value {
  white-space: normal;
}
.cp-metric-table.cp-metric-table-flat tbody td:nth-child(2) {
  max-width: 360px;
}
.cp-metric-table.cp-metric-table-flat tbody td:nth-child(3),
.cp-metric-table.cp-metric-table-flat tbody td:nth-child(4) {
  white-space: nowrap;
}

.cp-metric-skeleton {
  padding: 24px;
}

/* ─── Debt Maturity Ladder (credit section custom block) ─────────────────── */
.cp-maturity-card {
  margin-top: 16px;
  padding: 20px 24px 24px;
}

.cp-maturity-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cp-rule);
}

.cp-maturity-title {
  font-family: var(--cp-font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--cp-ink);
  margin: 0;
  letter-spacing: -0.005em;
}

.cp-maturity-total {
  font-size: 12px;
  color: var(--cp-muted);
  font-variant-numeric: tabular-nums;
}

.cp-maturity-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-maturity-row {
  display: grid;
  grid-template-columns: 56px 1fr 90px;
  gap: 14px;
  align-items: center;
}

.cp-maturity-year {
  font-size: 12px;
  font-weight: 500;
  color: var(--cp-muted);
  letter-spacing: 0.02em;
}

.cp-maturity-bar-wrap {
  height: 22px;
  background: var(--cp-canvas);
  border-radius: 3px;
  overflow: hidden;
}

.cp-maturity-bar {
  height: 100%;
  background: var(--cp-teal);
  border-radius: 3px;
  transition: width 240ms ease;
}

.cp-maturity-amount {
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Presentations & Research ─────────────────────────────────────────── */
.cp-presentations-card,
.cp-research-card {
  padding: 4px 0;
}

.cp-presentations-list,
.cp-filings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* Cap height so a long backlog of presentations / filings doesn't push the
     rest of the page off-screen. The list scrolls inside its card; the rest
     of the section header stays in place. Matches the .cp-fin-table-wrap
     and .cp-hedge-table-wrap pattern. */
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

.cp-presentation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--cp-rule);
}
.cp-presentation-row:last-child {
  border-bottom: 0;
}

.cp-presentation-link {
  color: var(--cp-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-presentation-link:hover {
  color: var(--cp-teal);
  text-decoration: underline;
}

.cp-presentation-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cp-muted);
  background: var(--cp-canvas);
  border: 1px solid var(--cp-rule);
  border-radius: 3px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.cp-research-card .cp-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cp-ink);
  margin: 0;
}
.cp-research-body {
  padding: 8px 0;
  /* The body wraps the filings <ul>; cap matches presentations/filings list
     so the section stays a fixed editorial height regardless of how many
     filings the company has. */
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Filing rows: form pill, meta block, view link */
.cp-filing-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--cp-rule);
}
.cp-filing-row:last-child { border-bottom: 0; }

.cp-filing-form {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cp-ink);
  background: var(--cp-canvas);
  border: 1px solid var(--cp-rule);
  border-radius: 3px;
  padding: 3px 6px;
  text-align: center;
}
.cp-filing-form-10k    { color: var(--cp-teal);  border-color: var(--cp-teal); }
.cp-filing-form-10ka   { color: var(--cp-teal);  border-color: var(--cp-teal); }
.cp-filing-form-10q    { color: var(--cp-slate); border-color: var(--cp-slate); }
.cp-filing-form-10qa   { color: var(--cp-slate); border-color: var(--cp-slate); }
.cp-filing-form-8k     { color: var(--cp-muted); }
.cp-filing-form-8ka    { color: var(--cp-muted); }

.cp-filing-meta { min-width: 0; }
.cp-filing-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--cp-ink);
  font-variant-numeric: tabular-nums;
}
.cp-filing-period {
  font-size: 11px;
  color: var(--cp-muted);
}
.cp-filing-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--cp-teal);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.cp-filing-link:hover { text-decoration: underline; }

/* Drilling-cost subsection inside Operations. Lighter-weight than the
   primary section header so it reads as a card-within-a-section, not a
   peer of the section title. */
.cp-drilling-costs { margin-top: 32px; }
.cp-section-header-sub { margin-bottom: 4px; }
.cp-section-subtitle {
  font-family: var(--cp-font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--cp-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.cp-drilling-reservoir { padding: 16px 20px; border-bottom: 1px solid var(--cp-rule); }
.cp-drilling-reservoir:last-child { border-bottom: 0; }
.cp-drilling-reservoir-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cp-ink);
  margin: 0 0 8px 0;
  letter-spacing: 0.01em;
}
.cp-drilling-reservoir-count {
  font-weight: 400;
  color: var(--cp-muted);
  font-size: 12px;
}

/* ─── Institutional Ownership section ────────────────────────────────────── */
/* Four stacked cards (snapshot KPI grid, trend chart, top-holders table,
   buyer/seller flows). Visual language matches the rest of the dashboard:
   surface = .cp-card, type ramp = section/card titles, accents = teal/red.
   The tilt pills (oil/gas) reuse --cp-teal and --cp-red so investor commodity
   bias inherits the same color rule the rest of the app already trains on. */
.cp-ownership-card {
  margin-top: 12px;
  padding: 14px 16px;
}

.cp-ownership-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .cp-ownership-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cp-ownership-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-ownership-kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cp-muted);
}
.cp-ownership-kpi-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--cp-ink);
  font-variant-numeric: tabular-nums;
}

.cp-ownership-qa {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--cp-rule);
}
.cp-ownership-qa-label {
  font-size: 11px;
  color: var(--cp-muted);
  margin-right: 4px;
}

/* Pills shared across snapshot QA strip, holder rows, and flow rows.
   Six variants: pos (teal), neg (red), warn (amber), muted (slate-on-canvas),
   oil (teal), gas (red). Oil/gas reuse the primary palette intentionally —
   the dashboard's red is always gas-coded. */
.cp-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cp-pill-pos   { background: var(--cp-teal-10);          color: var(--cp-teal); }
.cp-pill-neg   { background: rgba(200,50,50,0.10);       color: var(--cp-red); }
.cp-pill-warn  { background: rgba(212,164,86,0.14);      color: #9b7424; }
.cp-pill-muted { background: var(--cp-rule);             color: var(--cp-muted); }
.cp-pill-oil   { background: var(--cp-teal-10);          color: var(--cp-teal); }
.cp-pill-gas   { background: rgba(200,50,50,0.10);       color: var(--cp-red); }

/* Top Holders table. Fixed-layout makes the manager column elastic while
   numeric columns size to their content; tabular-nums keeps share/value
   columns vertically aligned. */
.cp-ownership-table-wrap {
  margin-top: 10px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--cp-rule);
  border-radius: 4px;
}
.cp-ownership-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.cp-ownership-table thead th {
  position: sticky;
  top: 0;
  background: var(--cp-canvas);
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cp-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--cp-rule);
}
.cp-ownership-table th.num,
.cp-ownership-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cp-ownership-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--cp-rule);
  color: var(--cp-ink);
}
.cp-ownership-table tbody tr:last-child td {
  border-bottom: 0;
}
.cp-ownership-table tbody tr:hover td {
  background: var(--cp-teal-10);
}

/* Flows: two-column "adds | cuts" grid. Each row pairs a manager name (with
   optional New/Exited pill) on the left and a signed delta on the right. */
.cp-ownership-flows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .cp-ownership-flows { grid-template-columns: 1fr; }
}
.cp-ownership-flow-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cp-ownership-flow-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cp-muted);
  margin: 0 0 4px 0;
  font-weight: 600;
}
.cp-ownership-flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cp-ownership-flow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--cp-rule);
  font-size: 12px;
}
.cp-ownership-flow-row:last-child {
  border-bottom: 0;
}
.cp-ownership-flow-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cp-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-ownership-flow-delta {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
