/* report-cards.css
 * The report card pages' own styles. The header, the fold and the disclosure panel are the shared
 * component in theme.css (.cebe-page-head, .cebe-disclose; CHATCOPILOT_2026-10-20o); this file adds
 * the table, the (i) toggle and the company picker only. Colours are theme tokens, so dark and
 * light follow the theme with no rule of their own here.
 */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--cebe-surface-page); color: var(--cebe-text-primary); font-family: 'Inter', sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.6; }
.rc-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; --cebe-page-head-top: 0px; }
.rc-mono { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); }

/* The dated answer line is the header's one sentence. */
.cebe-page-head .rc-answer { max-width: 82ch; }
.rc-fold-note { margin: 0 0 10px; }
.rc-fold-note strong { color: var(--cebe-text-primary); font-weight: 600; }
.rc-stamp { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; color: var(--cebe-text-muted); }

/* Controls above the table */
.rc-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 12px; }
.rc-controls label { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; color: var(--cebe-text-muted); }
.rc-select { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 13px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--cebe-border-subtle); border-radius: 6px; background: var(--cebe-surface-card); color: var(--cebe-text-primary); }
.rc-btn { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; padding: 8px 14px; min-height: 36px; border: 1px solid var(--cebe-border-subtle); border-radius: 6px; background: var(--cebe-surface-card); color: var(--cebe-text-primary); cursor: pointer; }
.rc-btn:hover, .rc-btn:focus-visible { border-color: var(--cebe-brand-orange); color: var(--cebe-brand-orange-text); }

/* The (i) text, one panel above the table, opened by the (i) in a column head. */
.rc-info { margin: 0 0 12px; padding: 14px 16px; max-width: 82ch; background: var(--cebe-surface-card); border: 1px solid var(--cebe-border-subtle); border-radius: 8px; font-size: 14px; line-height: 1.6; color: var(--cebe-text-secondary); }
.rc-info[hidden] { display: none; }
.rc-info p { margin: 0 0 8px; }
.rc-info .rc-lead { color: var(--cebe-text-primary); font-weight: 700; }
.rc-info .rc-formula { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; color: var(--cebe-text-muted); }
.rc-info a { color: var(--cebe-brand-orange-text); }
.rc-i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px; padding: 0; vertical-align: middle; border: 1px solid var(--cebe-border-strong, var(--cebe-border-subtle)); border-radius: 50%; background: transparent; color: var(--cebe-text-muted); font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; text-transform: none; letter-spacing: 0; }
.rc-i:hover, .rc-i:focus-visible, .rc-i[aria-expanded="true"] { color: var(--cebe-brand-orange-text); border-color: var(--cebe-brand-orange); }

/* The table */
.rc-table-scroll { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--cebe-border-subtle); border-radius: 10px; -webkit-overflow-scrolling: touch;
  /* A shade at whichever edge still has columns beyond it; the covers scroll with the content. */
  background:
    linear-gradient(to right, var(--cebe-surface-card) 30%, rgba(255,255,255,0)) 0 0 / 48px 100% no-repeat local,
    linear-gradient(to left, var(--cebe-surface-card) 30%, rgba(255,255,255,0)) 100% 0 / 48px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,0.42), rgba(0,0,0,0)) 0 0 / 16px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,0.42), rgba(0,0,0,0)) 100% 0 / 16px 100% no-repeat scroll,
    var(--cebe-surface-card); }
[data-theme="light"] .rc-table-scroll {
  background:
    linear-gradient(to right, var(--cebe-surface-card) 30%, rgba(255,255,255,0)) 0 0 / 48px 100% no-repeat local,
    linear-gradient(to left, var(--cebe-surface-card) 30%, rgba(255,255,255,0)) 100% 0 / 48px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,0.16), rgba(0,0,0,0)) 0 0 / 16px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,0.16), rgba(0,0,0,0)) 100% 0 / 16px 100% no-repeat scroll,
    var(--cebe-surface-card);
}
.rc-scroll-hint { display: none; font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; color: var(--cebe-text-muted); margin: 0 0 12px; }
@media (min-width: 641px) and (max-width: 900px) { .rc-scroll-hint { display: block; } }
.rc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.rc-table th, .rc-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--cebe-border-subtle); white-space: nowrap; vertical-align: top; }
.rc-table th { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; color: var(--cebe-text-muted); vertical-align: middle; }
.rc-table th .rc-th-sub { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.04em; text-transform: none; color: var(--cebe-text-muted); }
.rc-table tbody tr:last-child td { border-bottom: 0; }
.rc-table tr.rc-first td { border-top: 2px solid var(--cebe-border-subtle); }
.rc-table td.co a { color: var(--cebe-text-primary); text-decoration: none; font-weight: 600; }
.rc-table td.co a:hover, .rc-table td.co a:focus-visible { color: var(--cebe-brand-orange-text); }
.rc-table td.co span, .rc-table td .rc-sub { display: block; font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 12px; color: var(--cebe-text-muted); font-weight: 400; }
.rc-table td.mono { font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 13px; }
.rc-table td.nd { color: var(--cebe-text-muted); font-style: italic; }
.rc-table td.nd-why { color: var(--cebe-text-muted); font-size: 13px; white-space: normal; }
/* Above the phone card layout the head labels may wrap and the reason wraps inside the columns it spans, so the
   table fits the scroll box and the reason is read in full without scrolling sideways. */
@media (min-width: 641px) {
  .rc-table th, .rc-table td.co, .rc-table td:last-child { white-space: normal; }
  .rc-table th, .rc-table td { padding-left: 8px; padding-right: 8px; }
  .rc-table td.nd-why { max-width: 0; overflow-wrap: anywhere; }
}
.rc-table tr.rc-nd td.mono { color: var(--cebe-text-muted); }

.rc-note { color: var(--cebe-text-secondary); font-size: 14px; margin: 12px 0 0; max-width: 860px; }
.rc-changes { margin: 12px 0 0; font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 13px; color: var(--cebe-text-secondary); max-width: 860px; }
.rc-changes strong { color: var(--cebe-text-primary); font-weight: 500; }

/* The in-cell label is for the phone card only; above 640px the head row labels the column. */
.rc-table .rc-cl { display: none; }
.rc-info { scroll-margin-top: 170px; }

/* Phone: under 640px each row is a stacked card, so nothing scrolls sideways and no column is cut off.
   Order, top to bottom: company and quarter (one line), Is yours growing?, CEBE open to close,
   Senior Claims % open to close, band; the quarter pages' other columns follow. A row the card cannot
   score keeps its company and quarter, "not enough data", and the plain reason. */
@media (max-width: 640px) {
  .rc-wrap { padding-top: 16px; }
  .rc-i { width: 28px; height: 28px; }
  .rc-table-scroll { overflow: visible; background: none; border: 0; border-radius: 0; margin: 0 0 12px; }
  .rc-table, .rc-table tbody { display: block; width: 100%; }
  .rc-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
  .rc-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; margin: 0 0 12px; padding: 4px 14px 8px;
    background: var(--cebe-surface-card); border: 1px solid var(--cebe-border-subtle); border-radius: 10px; }
  .rc-table th, .rc-table td { white-space: normal; }
  .rc-table td { display: block; grid-column: 1 / -1; min-width: 0; padding: 8px 0; border: 0; border-top: 1px solid var(--cebe-border-subtle); overflow-wrap: anywhere; }
  .rc-table tbody tr:last-child td { border-bottom: 0; }
  .rc-table tbody tr.rc-first td { border-top: 1px solid var(--cebe-border-subtle); }
  .rc-table tbody tr td.c-co, .rc-table tbody tr td.c-q { border-top: 0; }
  .rc-table td.c-co { grid-column: 1; grid-row: 1; order: 1; padding-bottom: 10px; font-size: 15px; }
  .rc-table td.c-q { grid-column: 2; grid-row: 1; order: 2; text-align: right; padding-bottom: 10px; }
  .rc-table td.c-grow { order: 3; }
  .rc-table td.c-cebe { order: 4; }
  .rc-table td.c-owed { order: 5; }
  .rc-table td.c-band { order: 6; }
  .rc-table td.c-x { order: 7; }
  .rc-table td.c-why { order: 4; }
  .rc-table td.c-band:empty { display: none; }
  .rc-table td.c-grow { font-size: 16px; font-weight: 600; }
  .rc-table td.c-grow.nd { font-size: 14px; font-weight: 400; font-family: inherit; }
  .rc-table .rc-cl { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0 0 3px; font-family: var(--cebe-font-mono, 'JetBrains Mono', monospace); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; font-style: normal; color: var(--cebe-text-muted); }
  .rc-table .rc-cl .rc-th-sub { display: block; flex-basis: 100%; margin: 0; font-size: 10px; }
  /* The (i) stays 28px to the eye and 44px to the thumb (theme.css gives every phone button a 44px minimum). */
  .rc-table .rc-cl button.rc-i { position: relative; width: 28px; height: 28px; min-width: 28px; min-height: 28px; margin: -4px 0 -4px 0; }
  .rc-table .rc-cl button.rc-i::after { content: ''; position: absolute; inset: -8px; }
  .rc-table td.c-q .rc-cl { display: inline; margin-right: 6px; }
}
