/* ============================================================
   AI Tool IP Risk Index — marketing page (Promo v2)
   Layout + page-scoped tokens only. All color/type/spacing
   comes from public/colors_and_type.css. Grato Grotesk only.
   ============================================================ */

/* ── Marketing-only accent ────────────────────────────────
   NOT part of the product design system. Exists solely to
   match the butter-yellow primary CTA on copysight.ai. Used
   on the two primary pills only — never on risk-tier data. */
:root {
  --shell-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mkt-cta-yellow:       #FBE14D;
  --mkt-cta-yellow-text:  var(--color-black);
  --page-gutter:          56px;
  --section-gap:          120px;
  --board-max:            880px;
  --page-canvas:          rgb(243, 240, 255);
}

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute always wins, including over .btn display: inline-flex. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* Anchored headings land below the fixed header pill. */
html { scroll-padding-top: 92px; }

body {
  margin: 0;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.cs-page { background: var(--page-canvas); padding-top: 76px; }
/* Short pages: main grows so the footer sits at the bottom of the viewport. */
body.cs-page { min-height: 100vh; display: flex; flex-direction: column; }
body.cs-page > main { flex: 1 0 auto; width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

/* ── Header (copysight.ai shell) ──────────────────────────
   Mirrors copysight.ai LandingMenu; source app/components/LandingMenu in copysight/copysight
   (LandingMenu.module.scss + the Tailwind classes in LandingMenu.tsx / LandingMenuOverlay.tsx).
   Burger at 900px and below, as there. */
.site-header {
  position: fixed;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 30;
  height: 60px;
  padding: 0 28px;
  display: flex;
  justify-content: center;
}
.header-inner {
  display: flex;
  flex: 1;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
  background: rgba(243, 240, 255, 0.75);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.brand { display: inline-flex; align-items: center; color: rgb(2, 2, 10); text-decoration: none; }
.brand-wordmark { height: 26px; width: auto; aspect-ratio: 358 / 76; display: block; }
.brand-eye { display: none; height: 44px; width: auto; aspect-ratio: 125 / 121; flex-shrink: 0; margin-right: 16px; }
.site-nav { display: flex; flex: 1 1 auto; max-width: 600px; align-items: center; justify-content: space-between; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 2px;
  font-family: var(--shell-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 22.5px;
  letter-spacing: 0.01em;
  color: rgba(2, 2, 10, 0.32);
  text-decoration: none;
  transition: color 350ms cubic-bezier(0.22, 1, 0.36, 1), transform 350ms cubic-bezier(0.22, 1, 0.36, 1), letter-spacing 350ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 1.5px;
  background: rgb(2, 2, 10);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover { transform: scale(1.08); letter-spacing: 0.02em; color: rgb(2, 2, 10); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-eye { display: inline-flex; color: rgb(2, 2, 10); transition: transform 400ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.nav-eye:hover { transform: scale(1.08); }
.nav-eye svg { height: 44px; width: auto; aspect-ratio: 125 / 121; display: block; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.login-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 18px;
  border: 1.5px solid rgb(2, 2, 10);
  border-radius: 9999px;
  background: transparent;
  font-family: var(--shell-font);
  font-size: 15px;
  font-weight: 600;
  color: rgb(2, 2, 10);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.login-pill:hover { background: rgb(2, 2, 10); color: var(--color-white); }
.nav-toggle {
  display: none;
  width: 45px;
  height: 45px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: rgb(2, 2, 10);
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.nav-toggle svg { width: 100%; height: 100%; overflow: visible; }
.nav-toggle line { transform-origin: center; transform-box: fill-box; transition: transform 300ms ease-in-out; }
.site-header[data-open] .nav-toggle line:first-child { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle line:last-child { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 900px) {
  .brand-eye { display: block; }
  .site-nav, .login-pill { display: none; }
  .nav-toggle { display: flex; }
}
/* Full-screen menu under the header pill (LandingMenuOverlay). */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 29;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--page-canvas);
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
  transition: clip-path 500ms cubic-bezier(0.77, 0, 0.175, 1);
}
.menu-overlay[data-open] { clip-path: inset(0 0 0% 0); pointer-events: auto; }
.menu-overlay-link {
  font-family: var(--font-family);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: rgb(2, 2, 10);
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms ease-in-out, transform 400ms ease-in-out;
}
.menu-overlay-actions { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.menu-overlay-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  min-width: 220px;
  padding: 0 52px;
  border-radius: 100px;
  background: var(--mkt-cta-yellow);
  color: var(--mkt-cta-yellow-text);
  font-family: var(--shell-font);
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 400ms ease-in-out, transform 400ms ease-in-out;
}
.menu-overlay[data-open] .menu-overlay-link, .menu-overlay[data-open] .menu-overlay-login { opacity: 1; transform: none; }
.menu-overlay[data-open] .menu-overlay-link:nth-child(1) { transition-delay: 50ms; }
.menu-overlay[data-open] .menu-overlay-link:nth-child(2) { transition-delay: 100ms; }
.menu-overlay[data-open] .menu-overlay-link:nth-child(3) { transition-delay: 150ms; }
.menu-overlay[data-open] .menu-overlay-link:nth-child(4) { transition-delay: 200ms; }
.menu-overlay[data-open] .menu-overlay-login { transition-delay: 250ms; }
@media (prefers-reduced-motion: reduce) {
  .menu-overlay, .menu-overlay-link, .menu-overlay-login { transition: none; }
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  line-height: 1;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--mkt-cta-yellow);
  color: var(--mkt-cta-yellow-text);
}
.btn-primary:hover { background: #F7D62E; }
.btn-ghost {
  background: var(--color-white);
  color: var(--color-black);
  border-color: var(--color-header-border);
}
.btn-ghost:hover { border-color: var(--color-blue); }
.btn-ghost i { color: var(--color-blue); width: 18px; height: 18px; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(72px, 11vh, 128px) var(--page-gutter) clamp(88px, 12vh, 136px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-eyebrow {
  color: var(--color-gray-500);
  margin: 0 0 var(--space-6);
}
.hero-title {
  font-family: var(--font-family);
  font-weight: var(--font-black);
  font-size: clamp(52px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--color-black);
  margin: 0;
  max-width: 14ch;
  overflow-wrap: break-word;
}
.hero-subhead {
  max-width: 560px;
  margin: var(--space-6) 0 0;
  font-size: var(--text-lg);
}
.hero-cta {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-10);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── The Index (leaderboard, bare canvas) ─────────────── */
.index {
  max-width: var(--board-max);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}
.board {
  list-style: none;
  margin: 0;
  padding: 0;
  transition: opacity 150ms ease;
}
.board-error { padding: var(--space-8) 0; text-align: center; }
.clear-link { color: var(--color-blue); text-decoration: none; }

/* Group section header */
.board-section {
  color: var(--color-gray-500);
  margin: var(--space-10) 0 var(--space-3);
}
.board-section:first-child { margin-top: var(--space-4); }

.method-link { color: var(--color-blue); font-weight: var(--font-medium); text-decoration: none; }

/* ── Methodology page ─────────────────────────────────── */
.method { max-width: 100%; }
.method section { margin-top: var(--space-10); }
.method p.cs-body { margin: var(--space-3) 0 0; }
.method-table { width: 100%; border-collapse: collapse; margin-top: var(--space-4); }
.method-table th, .method-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-header-border); }
.method-table td { color: var(--color-gray-600); }
.method-table td:first-child { color: var(--color-black); font-weight: var(--font-medium); }
.method-table th { color: var(--color-gray-500); font-weight: var(--font-medium); font-size: var(--text-sm); }
.method-eg { background: var(--color-card-bg); border-radius: var(--radius-xl); padding: var(--space-6); margin-top: var(--space-4); }
.method-eg code { font-size: var(--text-sm); color: var(--color-gray-700); }
.method > section:first-child { margin-top: 0; }
.method details, .run-details { margin-top: var(--space-4); }
.method summary, .run-details summary, .nm-more summary { cursor: pointer; color: var(--color-blue); font-weight: var(--font-medium); list-style: none; }
summary::-webkit-details-marker { display: none; }
.nm-more summary, .run-details summary, .method summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  line-height: 24px;
  font-size: var(--text-base);
}
.nm-more summary::before, .run-details summary::before, .method summary::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 10px;
  transition: transform 0.15s ease;
}
.nm-more[open] > summary::before, .run-details[open] > summary::before, .method details[open] > summary::before { transform: rotate(45deg); }

/* ── Closing band ─────────────────────────────────────── */
.detail-cta .method { color: var(--color-gray-500); max-width: 560px; margin: 0 auto var(--space-12); }

/* ── Footer (copysight.ai shell) ─────────────────────── */
.legal-note { margin: var(--space-6) 0 0; padding: 0 var(--page-gutter) var(--space-6); text-align: center; color: var(--color-gray-500); }
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding: 48px 0 40px;
  font-size: 14px;
  line-height: 20px;
  color: rgb(2, 2, 10);
  background: transparent;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.footer-social { flex: 1; display: flex; justify-content: flex-start; gap: 8px; }
.footer-social a {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(2, 2, 10);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.footer-social a:hover { background: rgb(2, 2, 10); color: var(--color-white); }
.footer-social svg { width: 16px; height: 16px; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; flex-shrink: 0; }
.footer-links a { font-family: var(--shell-font); font-size: 14px; font-weight: 500; color: rgb(2, 2, 10); text-decoration: none; transition: opacity 0.15s ease; }
.footer-links a:hover { opacity: 0.6; }
.footer-copy { font-family: var(--shell-font); flex: 1; margin: 0; white-space: nowrap; text-align: right; font-size: 14px; font-weight: 400; opacity: 0.5; color: rgb(2, 2, 10); }
@media (max-width: 767px) {
  .site-footer { padding: 32px 0; }
  .footer-inner { flex-direction: column; text-align: center; gap: 24px; }
  .footer-copy { text-align: center; }
  .footer-links { gap: 0 12px; }
  /* 44px tap targets that still occupy a 20px row, as on copysight.ai. */
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; }
  .footer-social a { width: 44px; height: 44px; margin: -8px -4px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Spacing between hero and board ───────────────────── */
.index { margin-top: 0; }

/* ── Skip link (a11y) ─────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-blue);
  color: var(--color-white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

/* ── Control bar (filter / sort / group) ──────────────── */
.ctrl-cluster { display: inline-flex; align-items: center; gap: var(--space-3); }
.ctrl-label { color: var(--color-gray-500); }
.ctrl-count { width: 100%; margin: 0; color: var(--color-gray-500); text-align: left; white-space: nowrap; }

/* .chip-set / .chip — IP-type text filters on detail & violations pages. */
.chip-set { display: inline-flex; gap: var(--space-3); flex-wrap: wrap; }
.chip {
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-gray-600);
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  line-height: 1.2;
}
.chip[aria-pressed="true"] {
  color: var(--color-blue);
  font-weight: var(--font-bold);
}

.ctrl-select {
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-black);
  background: var(--color-white);
  border: 1px solid var(--color-header-border);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
  cursor: pointer;
}

/* ── Detail + Violations page ─────────────────────────── */
.detail {
  max-width: var(--board-max);
  margin: 0 auto;
  padding: var(--space-10) var(--page-gutter) 0;
}
.back-link { display: inline-flex; align-items: center; min-height: 44px; padding-right: var(--space-3); color: var(--color-gray-500); text-decoration: none; margin-bottom: var(--space-8); }
.back-link:hover { color: var(--color-blue); }
/* Desktop has the nav one line up; the back link only earns its space on phones. */

.detail-head { padding-bottom: var(--space-10); }
.detail-title {
  font-family: var(--font-family);
  font-weight: var(--font-bold);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--color-black);
  margin: 0;
  max-width: 30ch;
}
.detail-deck { max-width: 68ch; margin: var(--space-5) 0 var(--space-8); }
.detail-head > :last-child { margin-bottom: 0; }
.quick-facts { color: var(--color-gray-500); margin: 0; }
.method-link { color: var(--color-blue); text-decoration: none; }

/* ── Examples section + control row ───────────────────── */
.examples { padding-top: var(--space-4); }
.examples-title { margin: 0 0 var(--space-6); font-size: 24px; line-height: 30px; }
.control-row[hidden] { display: none; }
.control-row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-header-border);
  margin-bottom: var(--space-6);
}

/* ── Tile grid (shared detail + violations) ───────────── */
.tile-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-4);
}
.tile {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-header-border);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tile-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.tile-thumb-empty {
  background: var(--color-gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}
.tile-thumb-empty i, .tile-thumb-empty svg { width: 24px; height: 24px; color: var(--color-gray-500); }
.tile-thumb-empty .cs-caption { color: var(--color-gray-500); }
/* Real preview image hotlinked from source; placeholder sits behind as a fallback. */
.tile-thumb-img { position: relative; background: var(--color-gray-200); }
.tile-thumb-img .tile-thumb-under { position: absolute; inset: 0; }
/* No preview: collapse to a one-line strip instead of an empty 16/10 box. */
.tile-thumb-empty:not(.tile-thumb-under) { aspect-ratio: auto; min-height: 44px; flex-direction: row; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.tile-thumb-empty:not(.tile-thumb-under) i, .tile-thumb-empty:not(.tile-thumb-under) svg { width: 16px; height: 16px; flex: none; }
.tile-thumb-img img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
/* One line each, full text in the tooltip, so every row of cards has the same height. */
.tile-ip { margin: var(--space-1) 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-tags { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.tile-chip { color: var(--color-gray-500); text-transform: none; }
.tile-sim { font-weight: var(--font-bold); order: -1; margin-left: 0; flex-basis: 100%; text-transform: none; white-space: nowrap; font-size: var(--text-sm); line-height: 20px; letter-spacing: 0; }
.tile-owner { color: var(--color-gray-600); margin: 0 0 var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { margin-top: auto; color: var(--color-gray-600); }
.tile-meta a { color: var(--color-blue); text-decoration: none; white-space: nowrap; }
.tile-meta-part { display: block; }
.tile-meta-sep { display: none; }
.tile-sentinel { height: 1px; }
/* Rows share one track set so name, owner, Similarity and meta line up across a row. */
@supports (grid-template-rows: subgrid) {
  .tile { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: var(--space-2); }
  .tile > .tile-tags { align-content: flex-start; }
  .tile > .tile-ip, .tile > .tile-owner { align-self: start; }
  .tile-ip, .tile-owner { min-height: 0; }
  .tile-thumb-empty:not(.tile-thumb-under) { align-self: start; }
}
.tile-empty { padding: var(--space-10) 0; text-align: center; color: var(--color-gray-500); }
.grid-foot { margin: var(--space-3) 0 0; color: var(--color-gray-500); }
.control-row .grid-foot { width: 100%; margin: calc(var(--space-2) - var(--space-6)) 0 0; }

/* ── Detail closing CTA ───────────────────────────────── */
.detail-cta {
  max-width: var(--board-max);
  margin: var(--section-gap) auto var(--space-10);
  text-align: center;
}
.detail-cta .method { color: var(--color-gray-500); max-width: 60ch; margin: 0 auto var(--space-10); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); }
.cta-title {
  font-family: var(--font-family);
  font-weight: var(--font-black);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--color-black);
  margin: 0 0 var(--space-8);
}

/* ── Section rhythm ───────────────────────────────────── */
@media (min-width: 769px) {
  .hero { padding-bottom: var(--space-8); }
}

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --page-gutter: 24px; --section-gap: 80px; }

  .hero { padding-top: 56px; padding-bottom: 64px; }
  .hero-title { font-size: clamp(34px, 10vw, 52px); max-width: 100%; }
  .hero-subhead { font-size: var(--text-base); }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .tile-meta, .feed-run-count, .result-status, .result-det { font-size: var(--text-sm); line-height: 20px; }

  /* .chip-set (detail/violations filters): wrap with full-size tap targets. */
  .chip-set { flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
  .chip { padding: 8px 12px; min-height: 44px; }
  .ctrl-cluster { flex-direction: column; align-items: flex-start; width: 100%; }

  /* Detail head stacks. */
  .detail { padding-top: var(--space-8); }
  .detail-title { font-size: clamp(22px, 6.5vw, 28px); }
  .ctrl-select { min-height: 44px; padding: 10px 12px; }
  .quick-facts a, .detail-head .cs-caption a, .detail-head .cs-body a, .live-note a { display: inline-block; padding: 12px 0; }
  .board-foot a { display: inline-block; padding: 12px 0; }
  .back-link { font-size: var(--text-sm); color: var(--color-gray-700); }
  .tile .cs-caption { font-size: var(--text-sm); line-height: 20px; }
  .tile-meta a { display: inline-block; padding: 6px 0; }
  .tile-meta-part a { display: inline; padding: 6px 0; }
  .tile-ip, .tile-owner { min-height: 0; }
  .result-det, .result-model, .result-prompt { font-size: var(--text-sm); line-height: 20px; }
  /* Level rows: label left, count right. */
  .level-list li { grid-template-columns: 1fr auto; row-gap: 2px; }

  /* Tiles 2-up; within-page controls scroll. */
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .control-row { gap: var(--space-4); }

  /* Methodology tables stack into labeled blocks. */
  .method-table thead, .method-table colgroup { display: none; }
  .method-table, .method-table tbody { display: block; width: 100%; }
  .method-table tr { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-header-border); }
  .method-table td { display: block; border: 0; padding: 2px 0; }
  .method-table td::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--color-gray-500); margin-bottom: 2px; }
  .method-table td:first-child::before { display: none; }
  .method-table td:first-child { font-weight: var(--font-bold); margin-bottom: 4px; }

}

/* ============================================================
   Measured pilot surfaces (added with the controlled run).
   Composed only from tokens that already exist in
   public/colors_and_type.css. Colour stays semantic: a cell where
   every replicate leaked is similarity-high, a partial cell is
   similarity-medium, a clean cell is success, and blue is action.
   ============================================================ */

.board-note { margin: 0 0 var(--space-4); max-width: 68ch; color: var(--color-gray-700); }
.board-foot { margin: var(--space-4) 0 0; color: var(--color-gray-600); }

/* measured leaderboard: place, model, score, bar */
.board-leader { display: flex; flex-direction: column; gap: 0; }
.lrow {
  display: grid; align-items: center; column-gap: var(--space-4);
  grid-template-columns: 56px minmax(160px, 1.2fr) 72px minmax(120px, 2fr);
  padding: var(--space-3) var(--space-4); background: var(--color-header-bg);
  border: 1px solid var(--color-header-border); border-radius: var(--radius-xl);
  text-decoration: none; color: inherit;
}
.board-leader > a.lrow { border-radius: 0; }
.board-leader > a.lrow + a.lrow { border-top: 0; }
.board-leader > a.lrow:first-of-type { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.board-leader > a.lrow:last-of-type { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.board-leader > a.lrow:only-of-type { border-radius: var(--radius-xl); }
.lrow:hover { border-color: var(--color-blue); }
.lrow:focus-visible { outline: 2px solid var(--color-blue); outline-offset: 2px; }
.lrow-head {
  background: transparent; border: 0; padding-top: 0; padding-bottom: var(--space-1);
  font-size: var(--text-xs); color: var(--color-gray-500);
}
.lrow-place {
  font-family: var(--font-family); font-weight: var(--font-bold);
  font-size: 24px; line-height: 1; color: var(--color-gray-700); font-variant-numeric: tabular-nums;
}
.lrow-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lrow-name strong { font-weight: var(--font-medium); color: var(--color-black); }
.board-foot a { color: var(--color-blue); text-decoration: none; font-weight: var(--font-medium); }
.board-links { white-space: nowrap; }
.lrow-name .cs-caption { color: var(--color-gray-600); }
.lrow-score { font-size: 28px; font-weight: var(--font-bold); color: var(--color-black); font-variant-numeric: tabular-nums; text-align: right; }
.lrow-head span:nth-child(3) { text-align: right; }
.lrow-bar { display: block; height: 8px; border-radius: var(--radius-full); background: var(--color-gray-200); overflow: hidden; }
.lrow-fill { display: block; height: 100%; border-radius: var(--radius-full); background: var(--color-gray-700); }
/* skeleton while live scores load: the build-time numbers stay hidden until live-index.js swaps them in */
.board-leader.is-loading > a.lrow { pointer-events: none; }
.board-leader.is-loading .lrow-place,
.board-leader.is-loading .lrow-name strong,
.board-leader.is-loading .lrow-name .cs-caption,
.board-leader.is-loading .lrow-score {
  color: transparent !important; background: var(--color-gray-200); border-radius: var(--radius-sm, 6px);
  animation: check-pulse 1.4s ease-in-out infinite;
}
.board-leader.is-loading .lrow-place { display: inline-block; width: 28px; height: 24px; }
.board-leader.is-loading .lrow-score { justify-self: end; width: 44px; font-size: 22px; }
.board-leader.is-loading .lrow-score.is-none { grid-column: auto; }
.board-leader.is-loading .lrow-score::after { content: none; }
.board-leader.is-loading .lrow-bar { display: block !important; animation: check-pulse 1.4s ease-in-out infinite; }
.board-leader.is-loading .lrow-fill { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .board-leader.is-loading * { animation: none !important; } }
/* model page sections */
.level-list { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-2); max-width: 100%; }
.level-list li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label count" "bar bar"; column-gap: var(--space-4); align-items: baseline; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-header-border); }
.level-list li > .cs-body { grid-area: label; }
.level-list li > strong { grid-area: count; }
.level-list .level-bar { grid-area: bar; margin-top: var(--space-1); }
.level-list strong { font-weight: var(--font-medium); font-variant-numeric: tabular-nums; text-align: right; }
.run-details { color: var(--color-gray-600); }
.level-foot { margin: var(--space-3) 0 0; color: var(--color-gray-600); max-width: 78ch; }
.detail-head + .examples { margin-top: 0; }
.run-details code { font-size: var(--text-sm); overflow-wrap: anywhere; }

/* not yet measured */
.nm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nm-row {
  display: grid; gap: var(--space-3); align-items: baseline;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) minmax(220px, 2.4fr);
  padding: var(--space-3) var(--space-4); background: var(--color-header-bg);
  border: 1px solid var(--color-header-border); border-radius: var(--radius-xl);
}
.nm-name { font-weight: var(--font-medium); }
.nm-company { color: var(--color-gray-600); }
.nm-list--compact { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2) var(--space-6); }
.nm-list--compact .nm-row { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: var(--space-2) 0; background: transparent; border: 0; border-bottom: 1px solid var(--color-header-border); border-radius: 0; }
.nm-more { margin-top: var(--space-2); }

@media (max-width: 860px) {
  /* place spans both lines; name + score on top, bar full-width beneath */
  .lrow {
    grid-template-columns: 40px 1fr auto;
    grid-template-areas: "place name score" "place bar bar";
    row-gap: var(--space-2); column-gap: var(--space-3);
  }
  .lrow-head { display: none; }
  .lrow-place { grid-area: place; font-size: 30px; }
  .lrow-name { grid-area: name; }
  .lrow-score { grid-area: score; }
  .lrow-bar { grid-area: bar; }
  .nm-row { grid-template-columns: 1fr; }
  .nm-list--compact { grid-template-columns: repeat(2, 1fr); }
}

/* The finding is a sentence, not a three-word slogan, so it needs its own scale on the
   display face. Same token, same weight, tuned size only. */
.hero-title--sentence {
  font-size: clamp(48px, 8vw, 96px);   /* copysight.ai hero h1 */
  line-height: 0.95;
  max-width: 100%;
  margin-inline: auto;
  text-wrap: balance;
}
@media (max-width: 860px) {
  .detail-title { font-size: clamp(30px, 8vw, 34px); max-width: 100%; }
  .hero-title--sentence { font-size: 48px; }
  .board-section .cs-panel-title, .examples-title { font-size: 22px; line-height: 28px; }
}

/* ── Round 3: heading scale + menu scroll lock ────────── */
/* h1 44px > section h2 24px > live-gallery h2 18px >= group h3 16px */
.index .board-section > .cs-panel-title { font-size: 24px; line-height: 30px; }
html.nav-open, html:has(.site-header[data-open]) { overflow: hidden; }
.tile-meta a { white-space: nowrap; }
.board-links a:first-child { margin-left: 0; }
@media (max-width: 768px) { .detail-cta .btn { width: 100%; } }

/* ── Live checker + brief ─────────────────────────────── */
.check .detail-head { padding-bottom: var(--space-6); }
.check-step {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.check-step-title {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-xl); line-height: 28px; font-weight: var(--font-bold);
  color: var(--color-black); margin: 0 0 var(--space-4);
}
.check-step-num {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--color-page-bg); font-size: var(--text-sm);
}
.check-label { display: block; color: var(--color-gray-500); margin-bottom: var(--space-2); }
.check-row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.check-input {
  flex: 1 1 260px; min-width: 0;
  font: inherit; font-size: var(--text-base); color: var(--color-gray-900);
  background: var(--color-white);
  border: 1px solid var(--color-header-border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
}
.check-input:focus { outline: 2px solid var(--color-blue); outline-offset: 1px; }
input.check-input { border-radius: var(--radius-full); padding: 12px 20px; }
textarea.check-input { width: 100%; resize: vertical; line-height: 1.4; }
.check-status { color: var(--color-gray-500); margin: var(--space-3) 0 0; min-height: 1em; }
.check-status:empty { display: none; }
.check-hint { color: var(--color-gray-600); margin: 0 0 var(--space-4); max-width: 70ch; }
.check-cost { color: var(--color-gray-500); }
/* Same 48px height as the input beside it. */
.check-row .btn { padding: 15px 28px; }
.btn:disabled { opacity: .5; cursor: progress; }

.prompt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.prompt-label { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; margin-bottom: var(--space-2); }
.prompt-level { font-weight: var(--font-bold); color: var(--color-gray-900); margin: 0; }
.prompt-text { margin: 0; white-space: pre-wrap; }

.model-picks { border: 0; margin: 0 0 var(--space-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); }
.model-pick {
  display: flex; gap: var(--space-3); align-items: flex-start;
  border: 1px solid var(--color-header-border); border-radius: var(--radius-lg);
  padding: var(--space-3); cursor: pointer;
}
.model-pick input { margin-top: 3px; accent-color: var(--color-blue); }
.model-pick-text { display: grid; }
.model-pick-name { font-weight: var(--font-medium); color: var(--color-gray-900); }
.model-pick-vendor { color: var(--color-gray-500); }

.check-results { margin-top: var(--space-10); }
.result-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.summary-card { background: var(--color-white); border-radius: var(--radius-xl); padding: var(--space-4); }
.summary-card p { margin: 0; }
.summary-model { font-weight: var(--font-bold); color: var(--color-gray-900); margin-bottom: var(--space-1) !important; }
.summary-line { color: var(--color-gray-600); }

.result-grid { display: grid; gap: var(--space-3); }
.result-row { display: grid; grid-template-columns: 200px repeat(var(--cols, 5), minmax(0, 1fr)); gap: var(--space-3); align-items: stretch; }
.result-head .result-model { color: var(--color-gray-500); font-weight: var(--font-medium); }
.result-level p { margin: 0; }
.result-prompt { color: var(--color-gray-500); margin-top: var(--space-1) !important; }
.result-cell { margin: 0; background: var(--color-white); border: 1px solid var(--color-header-border); border-radius: var(--radius-xl); overflow: hidden; display: flex; flex-direction: column; }
.result-img-link { display: block; }
.result-img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--color-card-bg-alt); }
.result-img-empty { display: grid; place-items: center; text-align: center; padding: var(--space-3); color: var(--color-gray-500); font-size: var(--text-sm); background: var(--color-gray-200); }
@keyframes check-pulse { 50% { opacity: .45; } }
.result-cap { padding: var(--space-3); }
.result-cap p { margin: 0; }
.result-verdict { font-weight: var(--font-bold); color: var(--color-gray-900); margin-bottom: var(--space-1) !important; }
.result-det { color: var(--color-gray-600); overflow-wrap: anywhere; }
.tier-high { color: var(--color-similarity-high) !important; }
.tier-medium { color: var(--color-similarity-medium) !important; }

.code-dialog { border: 0; border-radius: var(--radius-xl); padding: var(--space-6); max-width: 420px; width: calc(100% - 32px); }
.code-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.code-dialog .check-input { width: 100%; margin-top: var(--space-4); }
.code-dialog .check-row { margin-top: var(--space-4); }

.brief-step { font-size: var(--text-base); font-weight: var(--font-bold); color: var(--color-gray-900); margin: var(--space-6) 0 0; }

@media (max-width: 860px) {
  .result-head { display: none; }
  .result-row { grid-template-columns: 1fr; }
  .result-row .result-level { grid-column: 1 / -1; padding-top: var(--space-4); }
  .result-grid .result-cell { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-3); align-items: center; }
  .tile-owner { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .method-table td[data-label="Batman example"]::before { display: none; }
  .result-grid .result-cell::before { content: attr(data-model); display: block; grid-column: 2; padding: var(--space-3) var(--space-3) 0 0; font-size: var(--text-sm); color: var(--color-gray-500); }
  .result-grid .result-cell > .result-img, .result-grid .result-cell > .result-img-link { grid-column: 1; }
  .result-grid .result-cell > .result-img { aspect-ratio: 1; }
  .result-grid .result-cell > .result-img-empty { padding: var(--space-1); font-size: var(--text-xs); }
  .result-grid .result-cell > .result-cap { grid-column: 2; padding: 0 var(--space-3) var(--space-3) 0; }
  .check-step { padding: var(--space-4); }
  /* Links inside sentences: bigger tap area without breaking the line. */
  p .method-link { padding: 12px 0; margin: -12px 0; display: inline-block; line-height: inherit; }
  .tile-meta a { padding: 11px 0; }
  .check-row .btn { width: 100%; }
  .check-cost { font-size: var(--text-sm); }
  .nm-list--compact .nm-row { min-height: 44px; }
  .nm-name a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
  .nm-company { font-size: 14px; }
}

/* ── Round 6: phone overflow, caption size, tap targets ── */
@media (max-width: 860px) {
  /* Two fixed tracks; long hostnames truncate instead of widening the track. */
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .tile-meta a, .tile-meta-part a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; padding: 12px 0; }
  .live-note, .feed-run .method-link { font-size: var(--text-sm); line-height: 20px; }
  .detail-head .cs-caption a { padding: 12px 0; min-height: 44px; box-sizing: border-box; }
  /* Compact tool list: one 44px line per tool, name only. */
  .nm-list--compact .nm-company { display: none; }
  .nm-list--compact .nm-row { padding: 0; align-items: center; }
}
/* Tool page head: caption lines sit close together instead of four spaced paragraphs. */
@media (min-width: 861px) {
  .detail[data-vendor-id] .detail-head .cs-caption { margin: var(--space-2) 0 0; }
}

/* ── Round 7: one heading, readable captions, link rows ── */
/* The copysight.ai-size headline needs more room than the 880px page column, so the hero spans wider. */
@media (min-width: 861px) {
  .index > .hero { --hero-w: min(1200px, calc(100vw - 48px)); max-width: none; width: var(--hero-w); margin-inline: calc((100% - var(--hero-w)) / 2); }
}
.hero-subhead { text-wrap: balance; max-width: 780px; font-size: clamp(18px, 2.5vw, 28px); line-height: 1.25; }   /* copysight.ai hero lead */
@media (max-width: 768px) { .hero-subhead { font-size: 17px; } }
@media (max-width: 768px) {
  .cs-caption, .legal-note, .tile-chip { font-size: var(--text-sm); line-height: 20px; }
  .level-list li > strong { white-space: nowrap; }
  .detail-head .cs-caption, .board-foot, .level-foot, .ctrl-count, .ctrl-label, .grid-foot, .check-label, .model-pick-vendor, .hero-eyebrow { font-size: var(--text-sm); line-height: 20px; }
  /* Leaderboard rows read as links: chevron after the score. */
  .lrow-score { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-3); }
  .lrow-score::after {
    content: ''; flex: none; width: 8px; height: 8px;
    border-right: 2px solid var(--color-gray-500); border-bottom: 2px solid var(--color-gray-500);
    transform: rotate(-45deg);
  }
  /* Tile meta: label words hidden, links inline with a 44px tap area. */
  .tile-meta-label { display: none; }
  /* inline-block + 44px line keeps the ellipsis that inline-flex would drop. */
  .tile-meta a, .tile-meta-part a { display: inline-block; min-height: 44px; line-height: 44px; margin: -12px 0; padding: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
}

/* ── Round 8: reading measure, ghost button edge, control weights ── */
.method p.cs-body, .method li.cs-body, .method-table { max-width: 68ch; }
.quick-place { margin: var(--space-2) 0 0; }
.check-step .btn-ghost { border-color: var(--color-gray-300); }
.cta-title { font-weight: var(--font-bold); }
.details-close { margin-top: var(--space-4); }

/* ── Home: links to the other pages (replaced the old header nav) ── */
.board-legend { margin: var(--space-3) 0 0; color: var(--color-gray-600); }
.index-links { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-10); }
.index-card { grid-column: span 2; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); background: var(--color-header-bg); border: 1px solid var(--color-header-border); border-radius: var(--radius-xl); text-decoration: none; color: inherit; min-height: 44px; }
.index-card:nth-child(n+4) { grid-column: span 3; }
.index-card:hover { border-color: var(--color-blue); }
.index-card-title { font-weight: var(--font-medium); color: var(--color-black); }
.index-card-line { color: var(--color-gray-600); }
@media (max-width: 640px) {
  .index-links { grid-template-columns: 1fr; }
  .index-card, .index-card:nth-child(n+4) { grid-column: auto; }
}

/* ── 23 models: fixed model list on /check, board tags ── */
ul.model-picks { list-style: none; }
li.model-pick { cursor: default; }
.lrow-tag {
  display: inline-block; width: fit-content; margin-top: 2px; padding: 0 8px;
  border: 1px solid var(--color-gray-300); border-radius: var(--radius-full);
  font-size: var(--text-xs); line-height: 18px; color: var(--color-gray-600); white-space: nowrap;
}
.lrow-score.is-none { font-size: var(--text-sm); font-weight: 400; color: var(--color-gray-600); white-space: nowrap; }
.board-rule { margin: var(--space-2) 0 0; color: var(--color-gray-600); }
/* A model with no checks: the label takes the score and bar columns, no empty bar. */
.lrow:has(.lrow-score.is-none) .lrow-bar { display: none; }
.lrow-score.is-none { grid-column: 3 / -1; text-align: left; }
@media (max-width: 860px) { .lrow-score.is-none { grid-column: auto; grid-area: score; } }
