/* ============================================================
   CPM calculator page (/cpm-calculator). Loaded after roas-calc.css,
   which gives the whole calculator card (.rc-*), so the two tools
   look like a set. Only the CPM-specific pieces live here.
   ============================================================ */

/* --- Tab A: "Solve for" switch --- */
.cc-solve { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cc-solve__label { font-size: 14px; font-weight: var(--font-weight-semibold); color: var(--rc-ink); }
.cc-solve__opts { display: inline-flex; gap: 4px; padding: 3px; background: #EEF0FA; border-radius: 10px; }
.cc-solve__opts button {
  font: inherit;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--rc-muted);
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
}
.cc-solve__opts button:hover { color: var(--color-brand); }
.cc-solve__opts button[aria-pressed="true"] { background: #FFFFFF; color: var(--color-brand); box-shadow: 0 1px 3px rgba(14, 16, 32, 0.12); }
.cc-solve__opts button:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
/* Which field is hidden changes with "Solve for", so every Tab A field keeps the same gap */
.rc-panel[data-panel="cpm"] > .rc-field { margin-top: 18px; }

.rc-note a { color: var(--color-brand); font-weight: var(--font-weight-semibold); }

/* --- Tab B results --- */
.cc-cap {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rc-muted);
}
.cc-per { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #FFFFFF; border: 1px solid var(--rc-line); border-radius: 12px; }
.cc-per > div { padding: 10px 12px; }
.cc-per > div + div { border-left: 1px solid var(--rc-line); }
.cc-per dt { font-size: 13px; font-weight: var(--font-weight-semibold); color: var(--rc-muted); }
.cc-per dd { margin-top: 2px; font-size: 20px; font-weight: var(--font-weight-bold); font-variant-numeric: tabular-nums; }
.cc-caveat { margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--rc-muted); }
.cc-caveat a { color: var(--color-brand); font-weight: var(--font-weight-semibold); }

/* --- Tab C: your CPM next to the highest you can afford --- */
.cc-vs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cc-vs > div { padding: 12px; background: #FFFFFF; border: 1px solid var(--rc-line); border-radius: 12px; }
.cc-vs .rc-kicker { font-size: 11.5px; letter-spacing: 0.06em; }
.cc-vs[data-max-verdict="red"] .rc-mid--real { color: #B91C1C; }
.cc-vs[data-max-verdict="green"] .rc-mid--real { color: #047857; }

/* --- How it's calculated + comparison table --- */
.cc-ex-say { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--color-text-muted); }
.cc-table-wrap { margin-top: var(--space-4); overflow-x: auto; }
.cc-table td { white-space: normal; text-align: left; font-weight: var(--font-weight-regular); }
.cc-table td:last-child { white-space: nowrap; text-align: right; font-weight: var(--font-weight-semibold); }
.cc-table thead th:not(:first-child) { text-align: left; }
.cc-table thead th:last-child { text-align: right; }
.cc-table tbody th { white-space: nowrap; }

@media (max-width: 560px) {
  .cc-per dd { font-size: 18px; }
  .cc-per > div { padding: 10px; }
  /* The comparison table becomes one card per metric, so nothing scrolls sideways */
  .cc-table thead { display: none; }
  .cc-table, .cc-table tbody, .cc-table tr, .cc-table th, .cc-table td { display: block; }
  .cc-table tr { border-bottom: 1px solid #E8EBF3; padding: 10px 12px; }
  .cc-table tr:last-child { border-bottom: 0; }
  .cc-table th, .cc-table td, .cc-table td:last-child { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .cc-table td:nth-child(3) { font-size: 14px; color: #4B5160; }
}
