/* ============================================
   CLARITY LAB — COMPANY REPORT (/report.html)
   Builds on styles.css tokens and the .ix- report system in intake.css.
   Prefixed .rp- for report-only pieces.
   ============================================ */
.report-page { --rp-strong: #2f6f4e; --rp-mid: var(--brass); --rp-weak: #C2652A; --rp-critical: #A3372F; }

/* Tighten the page header once a report is open */
body[data-report-phase="report"] .intake-header .lede,
body[data-report-phase="report"] .intake-header .rule { display: none; }
body[data-report-phase="report"] .intake-header h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }

/* Tone colours shared by bars, pills and scores */
.rp-tone--strong   { --tone: var(--rp-strong); }
.rp-tone--mid      { --tone: var(--rp-mid); }
.rp-tone--weak     { --tone: var(--rp-weak); }
.rp-tone--critical { --tone: var(--rp-critical); }
.rp-dim-score, .rp-score-chip strong, .rp-readiness strong, .report-page .ix-ring strong { font-variant-numeric: lining-nums; }

/* ---------- Section tabs (sticky) ---------- */
.rp-tabs {
  position: sticky; top: 72px; z-index: 5;
  display: flex; gap: 0.25rem; overflow-x: auto;
  padding: 0 clamp(1.25rem, 3vw, 2.25rem);
  background: var(--card); border-bottom: 1px solid #dde4ec;
}
.rp-tabs a {
  padding: 0.95rem 1rem 0.85rem; white-space: nowrap;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--track-md); font-weight: 500;
  color: #6b7688; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.rp-tabs a:hover { color: var(--charcoal); }
.rp-tabs a.is-active { color: var(--charcoal); border-bottom-color: var(--brass); }

/* ---------- Sections ---------- */
.rp-section { padding: 0; border-bottom: 1px solid #dde4ec; scroll-margin-top: 130px; }
.rp-section-head {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.25rem, 3vw, 2.25rem) 0;
}
.rp-section-head .ic-badge { width: 40px; height: 40px; }
.rp-section-head .ic-badge .ic { width: 19px; height: 19px; }
.rp-section-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 1.85rem); line-height: 1.1; }
.rp-section-body { padding: 1.25rem clamp(1.25rem, 3vw, 2.25rem) 1.9rem; }
.rp-block { margin-bottom: 1.75rem; }
.rp-block > .ix-kicker { margin-bottom: 1rem; }

.rp-empty {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.9rem 1.1rem; background: #eef2f7; border-left: 2px solid var(--brass);
  color: var(--ink-soft); font-size: 0.92rem;
}
.rp-empty .ic { width: 18px; height: 18px; color: var(--olive); margin-top: 0.2rem; flex-shrink: 0; }

.rp-pill {
  display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: var(--track-sm);
  padding: 0.25rem 0.6rem; border: 1px solid var(--tone, #cfd7e2); color: var(--tone, #5f6b7c);
  background: color-mix(in srgb, var(--tone, #cfd7e2) 9%, #fff); white-space: nowrap; line-height: 1.4;
}

/* ---------- Profile ---------- */
.rp-oneliner { font-family: var(--serif); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.4; color: var(--charcoal); margin-bottom: 1.5rem; }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; border-top: 1px solid #dde4ec; border-left: 1px solid #dde4ec; margin-bottom: 1.5rem; }
.rp-fact { padding: 0.85rem 1rem; border-right: 1px solid #dde4ec; border-bottom: 1px solid #dde4ec; background: #fff; min-width: 0; }
.rp-fact dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: var(--track-sm); color: var(--olive); font-weight: 500; margin-bottom: 0.2rem; }
.rp-fact dd { font-size: 0.97rem; color: var(--charcoal); font-weight: 400; overflow-wrap: anywhere; }
.rp-fact a { border-bottom: 1px solid var(--brass); }
.rp-tagrow { margin-bottom: 1.25rem; }
.rp-tagrow .ix-kicker { margin-bottom: 0.55rem; }

.rp-readiness {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center;
  margin-top: 1.5rem; padding: 1.1rem 1.25rem; background: var(--stone); border-left: 3px solid var(--tone);
}
.rp-readiness strong { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; line-height: 1; color: var(--tone); }
.rp-readiness small { font-family: var(--sans); font-size: 0.85rem; color: #6b7688; margin-left: 0.15rem; }
.rp-readiness-bar { height: 6px; background: #fff; }
.rp-readiness-bar span { display: block; height: 100%; background: var(--tone); }

/* ---------- Dossier (rendered markdown) ---------- */
.rp-md { max-width: 52rem; color: var(--charcoal); }
.rp-md h3, .rp-md h4, .rp-md h5 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
.rp-md h3 { font-size: 1.6rem; margin: 0 0 0.75rem; }
.rp-md h4 {
  font-size: 1.3rem; margin: 2rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--gold-line);
}
.rp-md > h4:first-child { margin-top: 0; }
.rp-md h5 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.rp-md p { margin: 0 0 0.6rem; font-size: 0.98rem; line-height: 1.7; }
.rp-md strong { font-weight: 500; color: var(--navy); }
.rp-md ul, .rp-md ol { margin: 0.25rem 0 0.9rem 1.3rem; display: grid; gap: 0.4rem; }
.rp-md li { font-size: 0.98rem; line-height: 1.65; padding-left: 0.2rem; }
.rp-md ol li::marker { color: var(--olive); font-family: var(--serif); font-weight: 500; }
.rp-md ul li::marker { color: var(--brass); }

/* ---------- Pitch deck ---------- */
.rp-band .ix-bar-top strong { font-family: var(--sans); font-size: 0.9rem; }
.rp-band .ix-bar-track span { background: var(--tone); }
.rp-cols { align-items: start; }
.rp-col { background: #fff; border: 1px solid #dde4ec; border-top: 2px solid var(--tone); padding: 1.1rem 1.25rem 1.25rem; }
.rp-col--strengths { --tone: var(--rp-strong); }
.rp-col--growth { --tone: var(--rp-weak); }
.rp-col h3 {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem;
  font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--track-md); font-weight: 500; color: var(--tone);
}
.rp-col h3 .ic { width: 17px; height: 17px; stroke-width: 2; }
.rp-col ul { list-style: none; display: grid; gap: 0.7rem; }
.rp-col li { position: relative; padding-left: 1rem; font-size: 0.93rem; line-height: 1.6; color: var(--charcoal); }
.rp-col li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: var(--tone); }

/* ---------- Rubric ---------- */
.rp-score-chip {
  margin-left: auto; display: inline-flex; align-items: baseline; gap: 0.45rem;
  padding: 0.4rem 0.85rem; border: 1px solid var(--tone); background: color-mix(in srgb, var(--tone) 10%, #fff);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: var(--track-sm); color: var(--tone); font-weight: 500;
}
.rp-score-chip strong { font-family: var(--serif); font-size: 1.5rem; line-height: 1; letter-spacing: 0; }
.rp-rubric-summary { font-size: 1rem; color: var(--charcoal); }
.rp-meta { font-size: 0.78rem; color: #8a94a3; margin: 0.15rem 0 1.25rem; }
.rp-dims { list-style: none; display: grid; gap: 0.5rem; }
.rp-dim { background: #fff; border: 1px solid #dde4ec; }
.rp-dim-row, .rp-dim summary {
  display: grid; grid-template-columns: 3rem minmax(0, auto) auto auto 1fr; gap: 0.9rem; align-items: center;
  padding: 0.85rem 1.1rem;
}
.rp-dim summary { cursor: pointer; list-style: none; grid-template-columns: 1rem 3rem minmax(0, auto) auto auto 1fr; }
.rp-dim summary::-webkit-details-marker { display: none; }
.rp-dim summary::before { content: '›'; font-size: 1.2rem; color: #8a94a3; transition: transform 0.2s; line-height: 1; }
.rp-dim details[open] summary::before { transform: rotate(90deg); }
.rp-dim-score { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; color: var(--tone); text-align: right; line-height: 1; }
.rp-dim-name { font-weight: 400; color: var(--charcoal); }
.rp-dim-weight { font-size: 0.78rem; color: #8a94a3; white-space: nowrap; }
.rp-dim-bar { justify-self: end; width: min(180px, 100%); height: 6px; background: #e3e9f0; }
.rp-dim-bar span { display: block; height: 100%; background: var(--tone); }
.rp-dim-detail { padding: 0 1.1rem 1rem 5.1rem; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Index & messages ---------- */
.rp-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.rp-message { padding: clamp(1.5rem, 3.5vw, 2.25rem); text-align: center; }
.rp-message p + p { margin-top: 0.75rem; }
.ix-report-foot .ix-muted { display: flex; gap: 0.5rem; align-items: center; }
.ix-report-foot .ix-muted .ic { width: 16px; height: 16px; color: var(--brass); flex-shrink: 0; }
button.btn { font: inherit; font-size: 0.74rem; text-transform: uppercase; letter-spacing: var(--track-md); cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .rp-tabs { top: 64px; }
  .rp-readiness { grid-template-columns: 1fr auto; }
  .rp-readiness-bar { grid-column: 1 / -1; grid-row: 2; }
  .rp-dim-row, .rp-dim summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.75rem; }
  .rp-dim-score { min-width: 2.2rem; text-align: left; }
  .rp-dim-name { flex: 1; min-width: 0; }
  .rp-dim-weight { order: 5; }
  .rp-dim-bar { order: 6; flex: 1 1 100%; width: 100%; }
  .rp-dim-detail { padding-left: 1.1rem; }
  .rp-score-chip { margin-left: 0; }
}

/* ---------- Print / Save as PDF ---------- */
@media print {
  .rp-tabs { display: none !important; }
  .rp-section { break-inside: auto; }
  .rp-section-head, .rp-dim, .rp-col, .rp-fact, .rp-band { break-inside: avoid; }
  .rp-dim details > *:not(summary) { display: block; }
  .rp-readiness, .rp-pill, .rp-score-chip, .ix-bar-track span, .rp-dim-bar span, .rp-readiness-bar span, .ix-panel-head--navy, .ix-ring {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* Back to all reports (the Report page isn't in the nav) */
.rp-back { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; }
.rp-back .ic { width: 14px; height: 14px; transform: scaleX(-1); fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Footer links on the dark navy band — light blue so they're readable */
.ix-report-foot .btn-ghost { color: #A9C1DE; border-bottom-color: rgba(169, 193, 222, 0.5); }
.ix-report-foot .btn-ghost:hover { color: #D6E3F2; border-bottom-color: var(--brass); }
