:root {
  --blue: #61b9f0;
  --red: #ff5555;
  --ink: #111111;
  --formula: #2412e6;
  --flag: #ff1a1a;
  --line: #2b2b2b;
  --white: #ffffff;
  --logo-blue: var(--blue);
  --logo-red: var(--red);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--white) linear-gradient(180deg, var(--blue) 0%, rgba(97, 185, 240, 0) 78%) no-repeat;
  background-size: 100% 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* Wordmark: full-bleed, cropped at the top edge like the pilot design */
.wordmark {
  display: block;
  width: 100%;
  line-height: 0;
}
.wordmark img { display: block; width: 100%; height: auto; }

/* Search */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(48px, 10vh, 120px) 16px 48px;
}

.search {
  width: min(640px, 100%);
}

.search__labels,
.search__pill {
  display: grid;
  grid-template-columns: 72% 28%;
}

.search__labels label {
  font-weight: 400;
  font-size: clamp(15px, 2vw, 22px);
  padding: 0 0 8px;
  white-space: nowrap;
}
.search__labels label:first-child { text-align: right; padding-right: 10px; }
.search__labels label:last-child { padding-left: 8px; }

.search__pill {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: clamp(52px, 6.5vw, 62px);
  box-shadow: 0 10px 18px -8px rgba(26, 26, 26, 0.35);
}

/* Thin red divider that rises above the pill, between the two labels */
.search__pill::before {
  content: "";
  position: absolute;
  left: 72%;
  bottom: 4px;
  height: calc(100% + 2.6em);
  width: 1px;
  background: var(--red);
  pointer-events: none;
}

.search input {
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  outline: none;
}
.search input#service { padding: 0 16px 0 28px; border-radius: 999px 0 0 999px; }
.search input#zip { padding: 0 52px 0 14px; letter-spacing: 0.08em; }
.search input::placeholder { color: #9aa3ad; }

.search__pill:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(97, 185, 240, 0.35), 0 10px 18px -8px rgba(26, 26, 26, 0.35);
}

.search__go {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search__go:hover { filter: brightness(0.95); }
.search__go:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.formula {
  display: block;
  margin: 22px 0 0 5%;
  font-size: clamp(13px, 1.45vw, 16px);
  font-weight: 500;
  line-height: 1.35;
  color: var(--formula);
  text-decoration: none;
}
.formula .flag { color: var(--flag); }
.formula:hover .formula__body { text-decoration: underline; text-underline-offset: 3px; }

.notice {
  margin: 28px 0 0;
  max-width: 520px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}
.notice[hidden] { display: none; }

/* Search results */
.results { width: min(640px, 100%); margin-top: 18px; }
.results[hidden], .credits[hidden] { display: none; }
.results__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.result {
  background: var(--white);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 8px 20px -14px rgba(26, 26, 26, 0.45);
}
.result { position: relative; }
.result--scored .result__head, .result--scored .result__meta { padding-right: 112px; }
.result__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.result__name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }

/* Trust score chip (top-right of a result) and its breakdown */
.trust__summary {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
  padding: 4px 8px 4px 4px;
}
.trust__summary::-webkit-details-marker { display: none; }
.trust__summary:hover, .trust[open] .trust__summary { background: #eef6fc; }
.trust__summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.trust__score {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--formula);
  color: var(--formula);
  font-weight: 800;
  font-size: 16px;
}
.trust__caption { display: grid; line-height: 1.15; }
.trust__word { font-size: 12px; font-weight: 700; color: var(--formula); }
.trust__conf { font-size: 10px; color: #6b7480; }
.trust__parts {
  margin-top: 14px;
  border-top: 1px solid #e3e9ef;
  padding-top: 10px;
  display: grid;
  gap: 3px;
  font-size: 13px;
}
.trust__part, .trust__item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline; }
.trust__part { margin-top: 8px; font-weight: 700; }
.trust__part:first-child { margin-top: 0; }
.trust__item { grid-template-columns: 18px 1fr auto; color: #3d4752; }
.trust__icon { font-weight: 700; text-align: center; }
.trust__item--ok .trust__icon { color: #1d6b34; }
.trust__item--no .trust__icon, .trust__item--flag { color: #c21414; }
.trust__item--unknown, .trust__item--start, .trust__item--na { color: #6b7480; }
.trust__pts { white-space: nowrap; font-variant-numeric: tabular-nums; }
.trust__note { margin: 12px 0 0; font-size: 12px; color: #6b7480; line-height: 1.45; }
.trust__note a { color: var(--formula); }
.result__meta { margin: 4px 0 0; font-size: 14px; color: #4a5562; }
.result__links { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-weight: 500; }
.result__links a { color: var(--formula); text-decoration: none; }
.result__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.result__links--profiles { margin-top: 6px; }
.result__label { color: #4a5562; font-weight: 400; margin-right: -10px; }
.badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--ok { background: #e6f4ea; color: #1d6b34; }
.badge--flag { background: #ffe8e8; color: #c21414; }
.more {
  display: block;
  margin: 18px auto 0;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.more:hover { border-color: var(--blue); }

footer {
  padding: 24px 16px 28px;
  text-align: center;
  font-size: 13px;
  color: #5b6573;
}

/* Trust score page */
.doc {
  width: min(760px, 100%);
  background: var(--white);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 44px);
  box-shadow: 0 12px 30px -16px rgba(26, 26, 26, 0.35);
  line-height: 1.6;
  font-size: 16px;
}
.doc h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; margin: 0 0 4px; }
.doc h2 { font-size: 18px; font-weight: 700; margin: 28px 0 6px; color: var(--formula); }
.doc h2 .pts { color: var(--ink); font-weight: 400; }
.doc h2.flag { color: var(--flag); }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; background: #eef6fc; padding: 1px 5px; border-radius: 4px; }
.doc .lede { font-size: 17px; }
.doc .draft { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.back { display: inline-block; margin-bottom: 18px; font-size: 14px; }

@media (max-width: 560px) {
  .search__labels, .search__pill { grid-template-columns: 64% 36%; }
  .search__pill::before { left: 64%; }
  .search__labels label:first-child { text-align: left; padding-left: 20px; }
  .search input { font-size: 16px; }
  .search input#service { padding-left: 20px; }
  .search input#zip { padding-right: 48px; }
  .search__go { width: 36px; height: 36px; right: 6px; }
  .formula { margin-left: 0; }
  /* Phones: the score chip sits at the bottom of the card instead of over the address */
  .result--scored .result__head, .result--scored .result__meta { padding-right: 0; }
  .trust__summary { position: static; display: inline-flex; margin-top: 10px; }
}
