:root {
  --bg: #ffffff;
  --text: #202124;
  --title: #1a0dab;
  --url: #006621;
  --muted: #4d5156;
  --control: #70757a;
  --chip-bg: #f1f3f4;
  --chip-text: #3c4043;
  --shadow: 0 1px 6px rgba(32, 33, 36, 0.18);
  --font: "Arial", "Helvetica Neue", Helvetica, sans-serif;
  --site-header-h: 52px;
  /* Fixed footer (nav only); reserve for wrap on narrow viewports */
  --site-footer-reserve: 3.5rem;
  font-family: var(--font);
}

* { box-sizing: border-box; }

/* Screen-reader / Enter-submit only — not visible on landing */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}


/* Minimal top chrome — light, no card look */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 14px 24px;
  background: #fff;
  /* soft separation only — no heavy border chrome */
  box-shadow: 0 1px 0 rgba(32, 33, 36, 0.06);
}


.site-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header-docs {
  color: #5f6368;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  padding: 4px 2px;
}

.site-header-docs:hover {
  color: #202124;
  text-decoration: underline;
}

.site-header-docs:focus-visible {
  outline: 2px solid #1a0dab;
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header-docs.is-current {
  color: #202124;
  cursor: default;
  text-decoration: none;
}

.site-header-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3c4043;
  text-decoration: none;
  border-radius: 50%;
  padding: 4px;
}

.site-header-home:hover {
  color: #202124;
  background: #f1f3f4;
}

.site-header-home:focus-visible {
  outline: 2px solid #1a0dab;
  outline-offset: 2px;
}

.site-header-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #3c4043;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-header-title:hover {
  color: #202124;
  text-decoration: underline;
}
.site-header-title:focus-visible {
  outline: 2px solid #1a0dab;
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header-icon {
  display: block;
}


.wrap {
  max-width: 652px;
  margin: 0 auto;
  padding: 0 20px var(--site-footer-reserve);
  display: flex;
  flex-direction: column;
}

/* Landing only: fill viewport under header so .hero can optically center */
.wrap:not(:has(.hero.has-results)) {
  min-height: calc(100vh - var(--site-header-h));
  min-height: calc(100dvh - var(--site-header-h));
}

/* Landing: viewport-center search under site-header */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  flex: 1 1 auto;
  padding-top: 0;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.hero.has-results {
  flex: 0 0 auto;
  justify-content: flex-start;
  padding-top: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.logo {
  /* Prefer slight scale-down over wrap; fits ~320px with nowrap */
  font-size: clamp(1.35rem, 0.55rem + 6.2vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #202124;
  white-space: nowrap;
}

.hero.has-results .logo {
  display: none; /* search-first results chrome — no landing tagline */
}

.tagline {
  color: var(--control);
  margin: 0 0 32px;
  padding: 4px 0 2px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.hero.has-results .tagline {
  display: none;
}

/* Google-like single input — soft shadow, no heavy border chrome */
.search-form {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 584px;
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero.has-results .search-form {
  margin: 0;
}

.search-form input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.search-form input[type="search"]::placeholder {
  color: #9aa0a6;
}

.search-form button {
  border: 0;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  padding: 8px 16px;
  margin-right: 6px;
  cursor: pointer;
}

.search-form button:hover {
  background: #e8eaed;
}

.search-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}


.status {
  text-align: center;
  color: var(--control);
  margin: 24px 0 8px;
  font-size: 0.9rem;
}

.status.error { color: #d93025; }

/* Results: sterile stacked rows — no cards, no borders, no panels */
.results {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 28px;
}

.result {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}

.result .url {
  color: var(--url);
  font-size: 0.875rem;
  line-height: 1.3;
  word-break: break-all;
  margin-bottom: 2px;
}

.result a.title {
  color: var(--title);
  font-size: 1.25rem;
  line-height: 1.3;
  text-decoration: none;
  font-weight: 400;
  display: inline-block;
}

.result a.title:hover {
  text-decoration: underline;
}

.result a.title:visited {
  color: #681da8;
}

.result .snippet {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.58;
  margin: 4px 0 0;
}

.score-meter-wrap {
  position: relative;
  display: inline-block;
  margin-top: 8px;
  width: fit-content;
  /* Keep float above neighbors without covering title links */
  z-index: 1;
}

.score-meter-wrap.is-open {
  z-index: 20;
}

.score-meter {
  display: flex;
  gap: 3px;
  align-items: center;
  width: fit-content;
  cursor: help;
  outline: none;
  border-radius: 4px;
  padding: 2px;
  margin: -2px;
}

.score-meter:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a0dab;
}

.score-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #e8eaed;
  pointer-events: none;
}

.score-box.filled {
  background: #34a853; /* soft professional green, not neon */
}

.score-box.filled-warn {
  background: #f9ab00; /* professional amber for spam risk */
}

/* Floating relevance card — white, soft shadow, generous padding */
.score-card {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  max-width: min(320px, calc(100vw - 40px));
  padding: 16px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(32, 33, 36, 0.16), 0 1px 4px rgba(32, 33, 36, 0.08);
  pointer-events: none; /* don't block title/result clicks underneath */
  z-index: 50; /* above fixed .site-footer (40) so last-row hover cards stay visible */
}

.score-meter-wrap.is-open .score-card {
  display: block;
}

.score-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.score-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: #5f6368;
  letter-spacing: 0.01em;
}

.score-card-big {
  font-size: 1.5rem;
  font-weight: 500;
  color: #202124;
  line-height: 1;
  margin-left: auto;
}

.score-card-of {
  font-size: 0.85rem;
  font-weight: 400;
  color: #80868b;
  margin-left: 1px;
}

.score-card-percent {
  font-size: 0.8rem;
  color: #80868b;
}

.score-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.score-card-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.score-card-label {
  font-size: 0.8rem;
  color: #3c4043;
}

.score-card-meter {
  display: flex;
  gap: 2px;
  align-items: center;
}

.score-card-meter .score-box {
  width: 7px;
  height: 7px;
}

.score-card-pct {
  font-size: 0.75rem;
  color: #80868b;
  min-width: 2.4em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-card-footer {
  font-size: 0.75rem;
  color: #9aa0a6;
  padding-top: 4px;
}


/* Quiet crawlable prose below the fold (always in the HTML source).
   Hidden only after JS adds .has-results so the results list stays clean. */
.home-prose {
  max-width: 584px;
  margin: 0 auto;
  padding: 40px 20px 96px;
  color: var(--control);
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 -1px 0 rgba(32, 33, 36, 0.04);
}

.home-prose h2 {
  font-size: 0.78rem;
  font-weight: 500;
  color: #80868b;
  letter-spacing: 0.01em;
  margin: 22px 0 8px;
}

.home-prose h2:first-child {
  margin-top: 0;
}

.home-prose p {
  margin: 0 0 10px;
}

.home-prose a {
  color: var(--control);
  text-decoration: none;
}

.home-prose a:hover {
  color: var(--text);
  text-decoration: underline;
}

.home-prose code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: transparent;
  padding: 0;
}

body:has(.hero.has-results) .home-prose {
  display: none;
}

/* Quiet agent callout under search (landing only) */
.agent-callout {
  max-width: 584px;
  margin: 12px auto 0;
  padding: 0;
  color: var(--control);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.hero.has-results .agent-callout {
  display: none;
}

.agent-callout a {
  color: var(--control);
  text-decoration: none;
}

.agent-callout a:hover {
  color: var(--text);
  text-decoration: underline;
}

.agent-callout code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: transparent;
  padding: 0;
}

/* Fixed bottom chrome: site nav only (always visible on /) */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 8px 20px 10px;
  background: #fff;
  box-shadow: 0 -1px 0 rgba(32, 33, 36, 0.06);
  color: var(--control);
  font-size: 0.8rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  /* Same centered column as .search-form / .agent-callout (not .wrap's 652px). */
  width: 100%;
  max-width: 584px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--control);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Website-only lifetime demo quota (REST /v1/search). Dismissible. */
.demo-dialog {
  border: 0;
  border-radius: 8px;
  padding: 24px 28px 20px;
  max-width: 420px;
  width: calc(100vw - 40px);
  color: var(--text);
  font-family: var(--font);
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}
.demo-dialog::backdrop {
  background: rgba(32, 33, 36, 0.32);
}
.demo-dialog-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
}
.demo-dialog p {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.demo-dialog a {
  color: var(--title);
  text-decoration: none;
  font-size: 0.9rem;
}
.demo-dialog a:hover {
  text-decoration: underline;
}
.demo-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.demo-dialog-close {
  border: 1px solid #dadce0;
  background: #f8f9fa;
  color: #3c4043;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-family: var(--font);
  cursor: pointer;
}
.demo-dialog-close:hover {
  background: #f1f3f4;
  box-shadow: 0 1px 1px rgba(32, 33, 36, 0.1);
}
.demo-dialog-close:focus-visible {
  outline: 2px solid #1a0dab;
  outline-offset: 2px;
}

/* Frozen preference eval (/eval) — reuse system fonts / muted meta */
body.eval-page .docs-wrap {
  max-width: 720px;
}
.eval-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 18px;
}
body.eval-page .eval-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2rem !important;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text) !important;
  margin: 4px 0 6px;
  line-height: 1.15;
}
.eval-score-n {
  font-size: 1rem;
  color: var(--muted);
}
body.eval-page .eval-score-sub,
body.eval-page .eval-score-stat {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem !important;
  color: var(--muted) !important;
  margin: 0 0 12px;
}
body.eval-page .eval-score-stat {
  font-size: 0.8rem !important;
  color: var(--control) !important;
  margin: 0 0 8px;
}
.eval-chips,
.eval-meta,
.eval-note {
  color: var(--control) !important;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0 0 8px;
}
.eval-honesty {
  margin: 0 0 16px;
}
.eval-flip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 14px 0 4px;
}
.eval-method {
  margin: 22px 0 8px;
}
.eval-method summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}
.eval-method ol {
  margin-top: 10px;
}
.eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 8px 0 16px;
}
.eval-table th,
.eval-table td {
  padding: 6px 6px;
  vertical-align: top;
  border-bottom: 1px solid rgba(32, 33, 36, 0.08);
}
.eval-table th {
  color: var(--text);
  font-weight: 500;
}
.eval-table tr.eval-accent td {
  background: #f8f9fa;
  color: var(--text);
}
body.eval-page {
  --eval-win-bg: #eef6ef;
  --eval-loss-bg: #f8eceb;
}
.eval-num.eval-win {
  background: var(--eval-win-bg);
  background: color-mix(in srgb, var(--url) 12%, var(--bg));
}
.eval-num.eval-loss {
  background: var(--eval-loss-bg);
  background: color-mix(in srgb, #c5221f 9%, var(--bg));
}
.eval-compare th,
.eval-compare td {
  font-size: 0.78rem;
}
.eval-scroll {
  overflow-x: auto;
  margin: 0 0 8px;
}
body.eval-page td.eval-num,
body.eval-page th.eval-num {
  text-align: right;
}
.eval-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.eval-page .eval-rate {
  color: var(--text);
}
body.eval-page .eval-ci,
body.eval-page .eval-p {
  display: block;
  margin-top: 1px;
  font-size: 0.68rem;
  line-height: 1.25;
  font-weight: 400;
  color: var(--control);
}
.eval-queries td:nth-child(4) {
  white-space: nowrap;
}
.eval-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}
.eval-queries td details.eval-q {
  margin: 0;
}
.eval-q summary {
  cursor: pointer;
  color: var(--muted);
}
.eval-q summary:hover {
  color: var(--text);
}
.eval-lists {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 10px 0 8px;
}
.eval-lists > div {
  flex: 1 1 220px;
  min-width: 0;
}
.eval-lists h4 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}
.eval-urls {
  margin: 0;
  padding-left: 1.15em;
  font-size: 0.75rem;
  word-break: break-all;
}
.eval-rationale {
  font-size: 0.8rem;
  color: var(--muted) !important;
  margin: 0 0 6px;
}

/* Skim-first /eval — twin heroes, smaller deep card, collapsed explore */
body.eval-v1 .docs-wrap {
  max-width: 880px;
}
.eval-heroes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 4px 0 8px;
}
.eval-hero {
  border: 1px solid rgba(32, 33, 36, 0.12);
  border-radius: 12px;
  background: #f8f9fa;
  padding: 14px 16px 12px;
  min-width: 0;
}
body.eval-v1 .eval-intro {
  margin: 0 0 16px;
}
body.eval-v1 .eval-intro p,
body.eval-v1 .eval-gloss,
body.eval-v1 .eval-deep-line {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.45;
}
body.eval-v1 .eval-intro p {
  margin: 0 0 8px;
}
body.eval-v1 .eval-gloss {
  margin: 2px 0 10px;
}
body.eval-v1 .eval-hero h2,
body.eval-v1 .eval-secondary h2,
body.eval-v1 .eval-diagnostics h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.eval-kicker,
.eval-method-line,
.eval-proof {
  color: var(--control);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0 0 8px;
}
.eval-wtl {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 4px;
}
body.eval-v1 .eval-wtl {
  color: var(--text) !important;
}
.eval-wtl-label {
  display: block;
  margin-top: 2px;
  font-family: var(--font);
  font-size: 0.75rem;
  color: var(--control);
}
.eval-first-hits {
  margin: 8px 0 8px;
}
body.eval-v1 .eval-first-hit-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--control);
}
body.eval-v1 .eval-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
body.eval-v1 .eval-rank {
  display: grid;
  grid-template-columns: auto auto auto minmax(1.25rem, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-width: 0;
  color: var(--text);
  line-height: 1.15;
}
body.eval-v1 .eval-rank-place,
body.eval-v1 .eval-rank-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
body.eval-v1 .eval-rank-place {
  font-size: 0.95rem;
}
body.eval-v1 .eval-rank-count {
  font-size: 1.15rem;
  min-width: 1.5ch;
}
body.eval-v1 .eval-rank-1 .eval-rank-place,
body.eval-v1 .eval-rank-1 .eval-rank-count {
  font-size: 1.45rem;
}
body.eval-v1 .eval-rank-arrow {
  color: var(--control);
  font-size: 0.95rem;
}
body.eval-v1 .eval-rank-track {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(32, 33, 36, 0.08);
  overflow: hidden;
}
body.eval-v1 .eval-rank-1 .eval-rank-track {
  height: 8px;
}
body.eval-v1 .eval-rank-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #34a853;
}
body.eval-v1 .eval-rank-1 .eval-rank-fill {
  background: #188038;
}
body.eval-v1 .eval-rank-share {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--control);
  white-space: nowrap;
  text-align: right;
}
body.eval-v1 .eval-rank-of {
  font-weight: 400;
}
body.eval-v1 .eval-first-hit-note {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text);
}
body.eval-v1 .eval-outcomes {
  margin: 8px 0 8px;
}
body.eval-v1 .eval-outcomes .eval-rank {
  grid-template-columns: 4.6rem auto auto minmax(1.25rem, 1fr) auto;
}
body.eval-v1 .eval-outcomes .eval-rank-1 .eval-rank-place {
  font-size: 0.95rem;
}
body.eval-v1 .eval-rank-tie .eval-rank-fill {
  background: #9aa0a6;
}
body.eval-v1 .eval-rank-loss .eval-rank-fill {
  background: #d96560;
}
body.eval-v1 .eval-hero .eval-score {
  font-size: 1.85rem !important;
  margin: 2px 0 4px;
}
body.eval-v1 .eval-hero .eval-pending {
  font-size: 1.55rem !important;
  color: var(--muted) !important;
}
body.eval-v1 .eval-hero.eval-win {
  background: var(--eval-win-bg);
  background: color-mix(in srgb, var(--url) 10%, var(--bg));
}
.eval-secondary {
  margin: 8px 0 16px;
}
body.eval-v1 .eval-secondary .eval-score {
  font-size: 1.2rem !important;
  margin: 2px 0 4px;
}
.eval-deep-line {
  margin: 4px 0 18px;
}
.eval-measured,
.eval-diagnostics,
.eval-explore {
  margin: 12px 0 8px;
}
.eval-measured summary,
.eval-diagnostics summary,
.eval-explore summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  font-size: 1.05rem;
}

@media (max-width: 700px) {
  .eval-heroes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  /* clamp + nowrap already keep one line; avoid fixed 2.4rem wrap */
  .logo {
    font-size: clamp(1.25rem, 0.4rem + 5.8vw, 2.2rem);
  }
  .search-form { padding: 12px 14px; }
  .results { gap: 28px; }
}
