/**
 * /intelligence — the dashboard, with models where the markets go.
 *
 * Almost nothing is here on purpose. The page loads `app.min.css` and wears the
 * dashboard's own markup (`.app-home-table`, `.app-home-row`, `.app-home-fuel-tab`),
 * so the table, the tab strip, the type scale and both themes come from the one
 * place they should. What is left is the two things the fuel table has no
 * equivalent for: the provider mark that sits in the market flag's slot, and the
 * per-million-tokens price unit.
 */

.intel-head {
  padding: 4px var(--ppx-dsh-page-inset) 0;
}

.intel-title {
  font-family: var(--font-display);
  font-size: var(--ppx-dsh-fs-highlights, 1.375rem);
  font-weight: 600;
  margin: 0 0 4px;
}

.intel-lede {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}

.intel-tabs {
  padding: 0 var(--ppx-dsh-page-inset);
}

/* The dashboard slides an indicator span with JS; here the active tab carries
   its own underline so the strip reads identically without app-home-core. */
.intel-tabs .app-home-fuel-tab {
  border-bottom: 2px solid transparent;
}

.intel-tabs .app-home-fuel-tab--active,
.intel-tabs .app-home-fuel-tab[aria-selected='true'] {
  border-bottom-color: var(--orange);
}

.intel-table .app-home-th,
.intel-table .app-home-td {
  padding-block: 8px;
}

.intel-table .app-home-th--rank { width: 5%; }
.intel-table .app-home-th--name { width: 33%; }
.intel-table .intel-th--rate { width: 14%; }
.intel-table .app-home-th--price { width: 20%; }

/* Six columns do not fit a phone. Scroll the table rather than drop a rate —
   the cached column is the one a reader would most miss. */
@media (max-width: 720px) {
  .intel-table {
    min-width: 640px;
  }

  .app-home-table-outer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.intel-table .intel-th--rate .app-home-col-head-btn,
.intel-table .app-home-th--price .app-home-col-head-btn {
  justify-content: flex-end;
}

.intel-table .app-home-th--name .app-home-col-head-btn {
  justify-content: flex-start;
}

.intel-th--rate,
.intel-td--rate {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.intel-td--rate {
  font-weight: 400;
  color: var(--muted);
}

/* No published cache rate. Not the same as a rate of zero. */
.intel-none {
  color: var(--muted);
  opacity: 0.6;
}

.intel-table tbody tr {
  border-top: 1px solid var(--hairline);
}

/* ── The provider mark: the market flag's slot ─────────────────────────── */

.ai-mark {
  flex: 0 0 auto;
  width: var(--ppx-dsh-flag-size, 24px);
  height: var(--ppx-dsh-flag-size, 24px);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--line) 40%, transparent);
  color: var(--text);
}

/* A mask, not an image: these marks are painted in `currentColor`, and an SVG
   loaded through <img> is its own document — currentColor resolves to black
   there and the chip renders black-on-black in dark mode. */
.ai-mark-glyph {
  display: block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--ai-mark-src) center / 16px 16px no-repeat;
  mask: var(--ai-mark-src) center / 16px 16px no-repeat;
}

/* No licensed mark for this provider — a letter, never a redrawn trademark. */
.ai-mark--monogram {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.ai-price-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 3px;
}

.ai-chg {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Down is good news — the same mapping as every other price surface here. */
.ai-chg--down { color: var(--pct-down); }
.ai-chg--up { color: var(--pct-up); }
.ai-chg--none { color: var(--muted); font-weight: 400; }

.intel-foot,
.intel-meta {
  margin: 0;
  padding: 12px var(--ppx-dsh-page-inset) 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 78ch;
}

.intel-meta--caveat {
  padding-bottom: 8px;
}

.intel-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
