/* ==========================================================================
   report-copycat.css — loaded ONLY by app/views/company/copycat.php, after
   report.css and report-harbor.css. CopyCat is styled as Harbor: everything
   else on the page uses Harbor's classes and stylesheets. This file holds only
   (a) the two figures Harbor has no component for — the number tiles and the
   competition map — built from the same tokens, and (b) fixes from the
   13 Nov review. Nothing here restyles a shared rp-* component on desktop.
   ========================================================================== */

/* --- number tiles (.cc-tiles): four, or three in .cc-tiles--3 ------------- */
.cc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--spacing-padding-inline) * 3); }
.cc-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-tile { background: var(--lp-panel); border-radius: 20px; padding: 24px; }
.cc-tile-v { margin: 0 0 8px; font-size: var(--alpha-heading-h5); font-weight: var(--font-weight-medium); line-height: 1.2; color: var(--lp-black); }
.cc-tile-c { margin: 0; font-size: var(--alpha-body-xs); line-height: 1.4; color: #525252; }
@media (max-width: 1279px) {
  .cc-tiles, .cc-tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* an odd last tile spans the row, as the stat cards do */
  .cc-tiles > .cc-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 479px) { .cc-tiles, .cc-tiles--3 { grid-template-columns: minmax(0, 1fr); } }

/* --- competition map (.cc-map): an axis on the left, the three fronts stacked */
.cc-map { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: calc(var(--spacing-padding-inline) * 4); }
.cc-axis { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: var(--rp-fig-fine); line-height: 1.3; color: #525252; }
.cc-axis-line { position: relative; flex: 1; width: 2px; min-height: 120px; background: linear-gradient(to bottom, var(--lp-orange), #D4D4D4); }
.cc-axis-line::before, .cc-axis-line::after { content: ''; position: absolute; left: 50%; border-left: 6px solid transparent; border-right: 6px solid transparent; transform: translateX(-50%); }
.cc-axis-line::before { top: -2px; border-bottom: 9px solid var(--lp-orange); }
.cc-axis-line::after { bottom: -2px; border-top: 9px solid #D4D4D4; }
.cc-stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cc-front { padding: 20px 24px; border-radius: 12px; background: var(--lp-bg-light); font-size: var(--rp-font-table); line-height: 1.4; color: var(--lp-black); }
.cc-front-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: var(--font-weight-medium); }
.cc-front-line { margin: 0 0 12px; color: #525252; }
.cc-front ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 1.1em; }
.cc-front li::marker { color: var(--lp-orange); }
.cc-front b { font-weight: var(--font-weight-medium); }
/* .cc-tag (Above / Alongside / Below) is styled with the other chips in report.css. */
.cc-push { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: var(--rp-fig-fine); color: #525252; }
.cc-push-arrow { font-size: 18px; line-height: 1; color: var(--lp-orange); }
.cc-mid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.6fr); gap: 12px; align-items: stretch; }
.cc-center { display: flex; align-items: center; justify-content: center; min-height: 140px; border-radius: 12px; background: #D7FE7C; }
.cc-center span { font-size: var(--rp-font-table); font-weight: var(--font-weight-medium); color: var(--lp-black); }
.cc-push--side { flex-direction: column; gap: 4px; }
@media (max-width: 767px) {
  .cc-map { grid-template-columns: minmax(0, 1fr); }
  .cc-axis { display: none; }
  .cc-mid { grid-template-columns: minmax(0, 1fr); }
  .cc-center { min-height: 64px; }
  .cc-push--side { flex-direction: row; }
}

/* --- keeps a last word and its citation together (markup utility) --- */
.rp-nowrap { white-space: nowrap; }

/* --- 13 Nov review fixes ------------------------------------------------- */
/* Tables fit their card on tablets (no scrollbar); phones still scroll, as on Harbor. */
@media (min-width: 700px) { .rp-verify-table { min-width: 0; } }
/* "How a quote becomes a proposal": the highlighted step stays inside the card. */
.rp-flow li { padding-left: calc(var(--spacing-padding-inline) * 3); padding-right: calc(var(--spacing-padding-inline) * 3); }
.rp-flow li.is-ai { margin: 0; }

/* --- 16 Nov editor pass ------------------------------------------------- */
/* Phones: the two-column tables (snapshot, plans, input types, outside signals,
   ledger, cannot-establish) fit the card instead of scrolling sideways. Wider
   tables keep report.css's 640px floor and still scroll. */
@media (max-width: 699px) {
  .rp-verify-table:not(:has(col:nth-child(3))) { min-width: 0; }
  .rp-verify-table:not(:has(col:nth-child(3))) .rp-nowrap { white-space: normal; overflow-wrap: anywhere; }
  .rp-verify-table:not(:has(col:nth-child(3))) th { white-space: normal; }
}
/* Market cards with their one-line caption. */
.cc-tiles-block { display: flex; flex-direction: column; gap: calc(var(--spacing-padding-inline) * 3); }
.cc-tiles-cap { margin: 0; font-size: var(--rp-fig-fine); line-height: 1.4; color: #525252; }
/* Fact sheet tables C1-C6: clear the sticky header when a "table Cx" link jumps to them. */
[id^="table-c"] { scroll-margin-top: 160px; }

/* Positioning chart: nine named points need more height on phones than the
   shared square-chart height (240-280px) gives them. */
@media (max-width: 699px) {
  .cc-scatter .rp-chart-canvas { height: 400px; }
}

/* Claim ledger on phones: two columns left the verdict pills three lines tall.
   Each row stacks instead: the claim, then its pill on one line underneath,
   lined up with the claim text (past the dot). The orange rule over the first
   row still marks the top of the list, so the header row is dropped. */
@media (max-width: 699px) {
  .rp-ledger .rp-verify-table thead { display: none; }
  .rp-ledger .rp-verify-table,
  .rp-ledger .rp-verify-table tbody,
  .rp-ledger .rp-verify-table tr,
  .rp-ledger .rp-verify-table td { display: block; width: auto; }
  .rp-ledger .rp-verify-table td:first-child { padding-bottom: calc(var(--spacing-padding-inline) * 2); }
  .rp-ledger .rp-verify-table td:last-child {
    border-top: 0;
    padding-top: 0;
    padding-left: calc(var(--spacing-padding-inline) * 4 + var(--cc-dot-indent, 21px));
  }
  .rp-ledger .rp-verify-badge { white-space: nowrap; }
}

/* Competition map on phones: the three fronts stack, so "Same layer" sits
   between boxes above and below; its arrow turns to point up and down. */
@media (max-width: 767px) {
  .cc-push--side .cc-push-arrow { display: inline-block; transform: rotate(90deg); }
}

/* "How we calculated this: table Cx" links: underlined, orange on hover and
   keyboard focus (the landing reset strips link styling). */
.landing a[href^="#table-c"] {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.landing a[href^="#table-c"]:hover,
.landing a[href^="#table-c"]:focus-visible { color: var(--lp-orange); text-decoration-color: var(--lp-orange); }

/* Stat cards: 22px side padding so "Agencies in CopyCat's core market" fits on
   one line (all three cards keep equal widths; top/bottom padding unchanged).
   Below about 1280px wide the three desktop cards are too narrow for it at
   this font size, so it wraps there. */
/* left padding stays the shared value (lines up with every other card); only the
   right side is trimmed so the caption has room for one line */
.rp-stat-card { padding-right: 6px; }
.landing .rp-stat-caption { text-wrap: wrap; }

/* "What is changing" small multiples (docs/copycat_what_is_changing_small_multiples.html):
   four white cards, each with a pair of bars or one split bar. */
.cc-sm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .cc-sm { grid-template-columns: minmax(0, 1fr); } }
.cc-sm-card { padding: 18px 20px; border-radius: 16px; background: #FFFFFF; }
.cc-sm-title { margin: 0 0 14px; font-size: 15px; font-weight: var(--font-weight-medium); line-height: 1.3; color: var(--lp-black); }
.cc-sm-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; color: #525252; }
.cc-sm-bar { display: flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: var(--font-weight-medium); white-space: nowrap; }
.cc-sm-split { display: flex; height: 22px; margin: 4px 0 8px; border-radius: 4px; overflow: hidden; font-size: 12px; font-weight: var(--font-weight-medium); }
.cc-sm-split > div { display: flex; align-items: center; padding: 0 8px; }
.cc-sm-split-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #525252; }
.cc-sm-src { margin: 10px 0 0; font-size: 11px; color: #888; }

/* 17 Nov: chapter 4's scenario numbers use the "Three numbers" stat cards (same white
   card, /01 index, value, caption). In the chapter column the cards are about a third
   as wide, so the value steps down to the h2 size (36px at most) and the card padding to the stat
   card's own tablet padding, keeping "$0.9M–9M" on one line. */
.cc-stats-inline { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--spacing-padding-inline) * 3); }
.cc-stats-inline .rp-stat-card { grid-column: auto; padding: 32px 6px 32px 32px; }
.cc-stats-inline .rp-stat-index { margin-bottom: calc(var(--spacing-padding-inline) * 6); }
.cc-stats-inline .rp-stat-value { font-size: min(var(--alpha-heading-h2), 36px); white-space: nowrap; margin-bottom: calc(var(--spacing-padding-inline) * 4); }
/* Columns by width (user's spec): 3 above 1312px; 1 from 1025 to 1312px (TOC beside a
   narrow column); 2 from 601 to 1024px (the odd third card spans both, report.css); 1 below. */
@media (max-width: 1312px) { .cc-stats-inline { grid-template-columns: repeat(1, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .cc-stats-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cc-stats-inline { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 479px) { .cc-stats-inline .rp-stat-card { padding: 24px; } }
/* 17 Nov: caption in these boxes at the small body size (user's spec). */
.landing .cc-stats-inline .rp-stat-caption { font-size: var(--alpha-body-small); }

/* 17 Nov: "What rivals charge": CopyCat's two plans highlighted as one peach block, as
   Squid's "three rungs" key row: rounded outer corners, no row lines in or around it. */
.rp-verify-table tr.cc-row-key td { background: #FCE1D6; }
.rp-verify-table tbody tr.cc-row-key:first-child td:first-child { border-top-left-radius: 8px; }
.rp-verify-table tbody tr.cc-row-key:first-child td:last-child { border-top-right-radius: 8px; }
.rp-verify-table tbody tr.cc-row-key + tr.cc-row-key td:first-child { border-bottom-left-radius: 8px; }
.rp-verify-table tbody tr.cc-row-key + tr.cc-row-key td:last-child { border-bottom-right-radius: 8px; }
.rp-verify-table tbody tr.cc-row-key:first-child td,
.rp-verify-table tbody tr.cc-row-key td,
.rp-verify-table tbody tr.cc-row-key + tr td { border-top-color: transparent; }

/* 17 Nov (design feedback): key entry for a dashed reference line on a chart
   (rules of thumb, software benchmark), drawn as the line itself. */
.rp-chart-legend-dash { flex: none; width: 18px; height: 0; border-top: 2px dashed #8A8A8A; }

/* 17 Nov: "Share of estimated value kept" went from four rows to two (the rules of
   thumb became dashed lines). The canvas loses the two rows' height so the bars keep
   their old thickness instead of doubling: half the old plot area plus the room the
   reference-line labels take at the top (one more line when they stagger on phones). */
.cc-chart-2rows { height: calc((var(--rp-chart-h) - 66px) / 2 + 62px); }
@media (max-width: 640px) { .cc-chart-2rows { height: calc((var(--rp-chart-h) - 66px) / 2 + 78px); } }

/* 17 Nov (design feedback c13): "How we calculated the numbers" as one card with
   tabs C1-C6, one table at a time (report-tabs.js). Pills as the design: 14px medium,
   grey #F2F2F2 with #525252 text; the active one black with white text. */
.cc-calc { scroll-margin-top: 160px; }
.cc-tabs-wrap { margin: 0 0 16px; }
.cc-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cc-tabs::-webkit-scrollbar { display: none; }
.cc-tab {
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-radius: 100px;
  background: #F2F2F2;
  font: inherit;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  color: #525252;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cc-tab:hover { color: var(--lp-black); }
.cc-tab.is-on { background: var(--lp-black); color: #FFFFFF; }
.cc-tab:focus-visible { outline: 2px solid var(--lp-orange); outline-offset: 2px; }
/* the pill row's own scrollbar, always visible when the pills overflow (phones);
   the site's scrollbar greys: #F2F2F2 track, #D1D1D1 thumb */
.cc-tabs-bar { position: relative; height: 4px; margin-top: 10px; border-radius: 100px; background: #F2F2F2; touch-action: none; }
.cc-tabs-bar[hidden] { display: none; }
.cc-tabs-thumb { position: absolute; top: 0; left: 0; height: 100%; border-radius: 100px; background: var(--scroll-thumb, #D1D1D1); cursor: grab; }
.cc-calc-panel[hidden] { display: none; }

/* 17 Nov (design feedback c5): "Where competition comes from" with one idea per row:
   tag + row name, the names as white pills, one line on what the row does. The facts
   moved to the paragraph after the figure. CopyCat's own row in peach, its pill lime
   (the chart shows other companies). The axis on the left is unchanged. */
.cc-rows { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cc-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 8px 20px; align-items: center; padding: 16px 20px; border-radius: 16px; }
.cc-row--self { background: #FCE1D6; }
.cc-row-lab { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cc-row-name { font-size: 15px; font-weight: var(--font-weight-medium); line-height: 1.3; color: var(--lp-black); }
.cc-names { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cc-names li { padding: 6px 12px; border-radius: 100px; background: #FFFFFF; font-size: 13px; font-weight: var(--font-weight-medium); line-height: 1.2; color: #525252; white-space: nowrap; }
.cc-names li.is-self { background: #B8FD15; color: var(--lp-black); }
.cc-row-what { grid-column: 2; margin: 0; font-size: 14px; line-height: 1.4; color: #525252; }
.cc-fronts-fig .cc-map + .rp-chart-note { margin-top: 24px; }
@media (max-width: 760px) {
  .cc-row { grid-template-columns: minmax(0, 1fr); }
  .cc-row-what { grid-column: 1; }
}
/* the old fact-list rule (.cc-front ul: a column with bullets) must not reach the pills */
.cc-front ul.cc-names { flex-direction: row; gap: 8px; padding-left: 0; }
.cc-front .cc-names li::marker { content: none; }
/* 17 Nov: the row tags (Above / Alongside / Below) as the filled orange chip, by request
   (overrides the white in-box chip from report.css for these rows only) */
.cc-front.cc-row .cc-tag { border-color: var(--lp-orange); background: var(--lp-orange); color: #FFFFFF; }

/* 17 Nov: lead-ins in the bulleted lists ("Self-serve software", "Acquisition." ...)
   at medium weight, not bold, by request */
.landing .rp-tldr b { font-weight: var(--font-weight-medium); }
