:root {
  --bg: #f6f5fb;
  --card: #ffffff;
  --ink: #1b1a2e;
  --muted: #5d5b75;
  --line: #e4e2f0;
  --accent: #1f63d6;
  --accent-2: #0b8fc7;
  --accent-ink: #ffffff;
  --good: #047857;
  --good-bg: #d1fae5;
  --tm: #1d4ed8;
  --tm-bg: #dbeafe;
  --bad: #b91c1c;
  --pen: #c62828;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(20 16 60 / 6%), 0 8px 28px rgb(20 16 60 / 8%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12111c;
    --card: #1c1b2b;
    --ink: #eceaf7;
    --muted: #a9a6c4;
    --line: #2f2d45;
    --good: #6ee7b7;
    --good-bg: #064e3b;
    --tm: #93c5fd;
    --tm-bg: #1e3a8a;
    --bad: #fca5a5;
    --pen: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); }

.top {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 18px 16px 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  justify-content: center;
}

.brand { color: #fff; font-weight: 800; font-size: 28px; letter-spacing: -0.02em; text-decoration: none; }
.tagline { opacity: 0.85; font-size: 15px; }

main { max-width: 760px; margin: -40px auto 0; padding: 0 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.lede, .hint, .field-hint { color: var(--muted); }
.lede { margin: 0 0 20px; }
.hint, .field-hint { font-size: 14px; margin: 4px 0 0; }

label { display: block; font-weight: 600; margin: 18px 0 6px; }

textarea, input[type="text"], select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* no zoom on iOS */
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 72px; }
select.max-len { width: auto; min-width: 10em; }
textarea:focus, input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(79 70 229 / 18%);
}
[aria-invalid="true"] { border-color: var(--bad) !important; }

.field-error, .form-error { color: var(--bad); font-size: 14px; margin: 4px 0 0; min-height: 1em; }
.form-error:empty, .field-error:empty { min-height: 0; }

fieldset.choice { border: 0; padding: 0; margin: 18px 0 0; }
fieldset.choice legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
label.radio, label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  margin: 8px 0;
  cursor: pointer;
}
label.radio input, label.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }

.go, .button {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  border: 0;
  border-radius: 12px;
  padding: 14px 28px;
  margin-top: 20px;
  color: var(--accent-ink);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgb(79 70 229 / 30%);
}
.go:disabled { opacity: 0.6; cursor: progress; }
form .go { width: 100%; }

.progress { text-align: center; padding: 24px 0; }
.progress progress { width: 100%; max-width: 360px; accent-color: var(--accent); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.results-head h1 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 8px 0 12px; }
.filters label.check { font-size: 14px; }

ol.results { list-style: none; padding: 0; margin: 0; }
li.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
}
li.result:first-child { border-top: 0; }
.result-name {
  font-weight: 650;
  font-size: 18px;
  text-decoration: none;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.result-name:hover { color: var(--accent); }
.result-score .mark { font-size: 15px; }

/* Traffic lights: a domain or trade mark, with its label inside. */
.lights { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lights-gap { width: 6px; }
.light {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 10.5px; font-weight: 750; line-height: 1.05; letter-spacing: -0.02em; text-align: center;
}
.light.free { background: #86efac; color: #14532d; }
.light.taken { background: #ef4444; color: #fff; }
.light.unknown { background: #d1d5db; color: #374151; }

.tld-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tld-row label.check { margin: 0; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.pager button, .pager .disabled {
  font: inherit; font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.pager .disabled { opacity: 0.4; cursor: default; }
.pager-pos { color: var(--muted); font-size: 14px; text-align: center; }

.empty, .failed { padding: 16px 0; }

.detail .domain { font-size: 34px; overflow-wrap: anywhere; }
.detail-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.score-big { font-weight: 700; color: var(--muted); }
.status-list { padding-left: 0; list-style: none; color: var(--muted); }
.status-list li { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.status-list b { color: var(--ink); }
table.halves { width: 100%; border-collapse: collapse; }
table.halves th, table.halves td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.halves th { font-size: 13px; color: var(--muted); border-top: 0; }
.half-text { font-weight: 700; }
.half-text .from-word { font-weight: 400; color: var(--muted); }
.register { margin: 8px 0 0; }
.back { display: inline-block; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.detail .nav-links:last-child { margin: 16px 0 0; }
.change-search {
  margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--accent);
  padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 10px; white-space: nowrap;
}
.change-search:hover { border-color: var(--accent); }

.foot { max-width: 760px; margin: 0 auto 32px; padding: 0 16px; color: var(--muted); font-size: 13px; }
.foot .owner { font-size: 11px; margin-top: 12px; }

#turnstile:empty { display: none; }
#turnstile { margin-top: 16px; }

/* Phones */
@media (max-width: 560px) {
  .card { padding: 18px 16px; border-radius: 14px; }
  h1 { font-size: 22px; }
  .detail .domain { font-size: 26px; }
  .top { padding-bottom: 52px; }
  .tagline { font-size: 14px; text-align: center; }
  li.result { grid-template-columns: minmax(0, 1fr) auto; }
  li.result .lights { grid-column: 1 / -1; }
  .result-name { font-size: 16px; }
  .light { width: 36px; height: 36px; font-size: 9.5px; }
  table.halves thead { display: none; }
  table.halves, table.halves tbody, table.halves tr, table.halves td { display: block; width: 100%; }
  table.halves tr { border-top: 1px solid var(--line); padding: 8px 0; }
  table.halves td { border: 0; padding: 2px 0; }
  table.halves td::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; font-size: 13px; }
  .go, .button { width: 100%; text-align: center; }
}
.foot a { color: inherit; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.guide-list { list-style: none; padding-left: 0 !important; }
.guide-list li { margin: 14px 0; }
.guide-list a { font-weight: 600; }
.disclaimer { margin-top: 28px; padding: 12px 16px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.about h2:first-child { margin-top: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }

/* The thinking animal while a search runs (thinking.rs). */
.thinking { position: relative; width: 100%; max-width: 300px; margin: 8px auto 0; color: var(--accent); }
.thinking svg { display: block; width: 100%; height: auto; overflow: visible; }
.thinking .line { fill: var(--card); stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.thinking .dot { fill: var(--accent); }
.thinking .cheek { fill: var(--accent-2); opacity: 0.22; }
.thinking .animal { animation: pop 0.35s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
.thinking .thought {
  position: absolute; left: 72.9%; top: 27.6%; transform: translate(-50%, -50%);
  max-width: 34%; text-align: center; font-weight: 400; line-height: 1.1;
  color: var(--accent-2); overflow-wrap: break-word; opacity: 0;
}
/* In over one second, out over the next. Two names for one fade, so that
   swapping them restarts it for each new word (thinking.rs). */
.thinking .fade-a { animation: thought-a 2s linear both; }
.thinking .fade-b { animation: thought-b 2s linear both; }
@keyframes thought-a { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes thought-b { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pop { from { transform: scale(0.92); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .thinking .animal { animation: none; }
}

/* The qualities box: lozenges, then the text being typed (chips.rs). */
.chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 7px 8px; cursor: text; transition: border-color 0.15s, box-shadow 0.15s;
}
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(79 70 229 / 18%); }
.chips.invalid { border-color: var(--bad); }
.chips input[type="text"] {
  flex: 1 1 140px; min-width: 0; width: auto; border: 0; background: transparent; padding: 5px 6px; box-shadow: none;
}
.chips input[type="text"]:focus { box-shadow: none; }
.chips input[aria-invalid="true"] { border-color: transparent !important; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  padding: 4px 4px 4px 12px; font-size: 15px; line-height: 1.2;
}
.chip.bad { background: var(--bad); }
.chip-text { overflow-wrap: anywhere; }
.chip-x {
  border: 0; background: transparent; color: inherit; font: inherit; font-size: 17px; line-height: 1;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; opacity: 0.8;
}
.chip-x:hover, .chip-x:focus-visible { opacity: 1; background: rgb(255 255 255 / 20%); outline: none; }

/* Scores out of 10 on the detail page: a fraction in a teacher's red pen. */
@font-face { font-family: "Pen"; src: url("/assets/pen-d1883acb53b35d4f.woff2") format("woff2"); font-weight: 600; font-display: swap; }
table.halves td.score { white-space: nowrap; text-align: center; }
.mark {
  display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle;
  font-family: "Pen", "Bradley Hand", "Segoe Print", cursive; font-weight: 600; font-size: 24px; line-height: 0.95;
  color: var(--pen); transform: rotate(-6deg);
}
.mark .num { padding: 0 4px 2px; border-bottom: 2px solid currentColor; border-radius: 1px; }
.mark .den { padding-top: 2px; }
.mark.big { font-size: 34px; margin-left: 4px; }
.score-big { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) {
  table.halves td.score { text-align: left; padding: 6px 0; }
  table.halves td.score::before { vertical-align: middle; }
}

/* The advert: beside the page on screens with room for it (wide_screen() in
   main.rs loads none on narrower ones). */
.ads { position: absolute; top: 112px; left: calc(50% + 396px); width: 180px; }
.ads iframe { display: block; border: 0; width: 180px; height: 300px; }
@media (max-width: 1199px) { .ads { display: none; } }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.live-marks { margin: 4px 0 12px; padding-left: 20px; font-size: 14px; }
.live-mark.lapsed { color: var(--muted); }

/* Accounts and Premium (account.rs, downloads.rs). */
.account-nav { display: flex; gap: 14px; align-items: baseline; font-size: 15px; }
.account-nav a, .account-nav .link-button { color: #fff; }
.account-nav .nav-premium { font-weight: 700; }

.providers { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; max-width: 340px; }
.providers .button { display: block; text-align: center; }

.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; }
.tier.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier h2 { font-size: 18px; margin: 0 0 4px; }
.tier .price { font-size: 28px; font-weight: 800; margin: 0; }
.tier .price span { font-size: 15px; font-weight: 400; color: var(--muted); }
.tier .price .was { font-size: 20px; font-weight: 600; color: var(--muted); text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.tier .price .sale { color: var(--bad); }
.tier ul { padding-left: 18px; margin: 10px 0 14px; flex: 1; }
.tier li { margin: 4px 0; }
.tier .button { text-align: center; }
@media (max-width: 560px) { .tiers { grid-template-columns: 1fr; } }

.invite { border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.invite p { margin: 0 0 10px; }
.notice { border-left: 4px solid var(--good); padding: 6px 10px; background: var(--good-bg); border-radius: 6px; }

.account-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.account-facts dt { color: var(--muted); }
.account-facts dd { margin: 0; }
@media (max-width: 560px) { .account-facts { grid-template-columns: 1fr; } .account-facts dd { margin-bottom: 6px; } }

.downloads { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-top: 16px; font-size: 15px; }
.downloads-label { color: var(--muted); }

.terms table { border-collapse: collapse; }
.terms th, .terms td { border-top: 1px solid var(--line); padding: 6px 10px; text-align: left; }

/* The numbers (/admin). */
.admin h2 { margin-top: 28px; }
.admin .periods { display: flex; flex-wrap: wrap; gap: 12px; }
.admin .periods a.current { font-weight: 700; text-decoration: none; color: var(--ink); }
.table-scroll { overflow-x: auto; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { padding: 4px 8px; text-align: left; white-space: nowrap; }
table.stats thead th { font-size: 12px; color: var(--muted); }
table.stats .num { text-align: right; font-variant-numeric: tabular-nums; }
table.stats .total { font-weight: 700; }
table.stats tr.group-head th { padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
table.stats td.detail { color: var(--muted); padding-left: 16px; }
.bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 24px; }
.bars .bar { display: inline-block; width: 4px; background: var(--accent); border-radius: 1px; }
.failures { font-size: 14px; padding-left: 18px; }
.failures time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.tile b { font-size: 28px; font-variant-numeric: tabular-nums; }
.tile-name { font-size: 13px; color: var(--muted); }
.tile-sub { font-size: 12px; color: var(--muted); }
