/* logoty.pe: one stylesheet, system fonts, no images. The colours come from the design.
   Dark follows the browser's setting, unless the switch in the header chose for this browser:
   static/theme.js sets data-theme on <html> before the page is drawn. */

:root {
  color-scheme: light;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-soft: #fbfbf9;
  --ink: #0f1424;
  --ink-soft: #444b5e;
  --muted: #6b7080;
  --line: #e6e4df;
  --field: #d6d4cd;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-ink: #3730a3;
  --dark: #1c2130;
  --dark-muted: #a8aec0;
  --term-bg: #0f1422;
  --term-line: #232a3d;
  --term-text: #e5e7eb;
  --term-muted: #8a91a5;
  --tok-key: #c4b5fd;
  --tok-str: #a6e3a1;
  --tok-num: #fdba74;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn-line: #f5dfa0;
  --warn-soft: #fffcf2;
  --warn-bg: #fff8e6;
  --warn-ink: #6b4e00;
  /* Text on a filled button, whatever fills it. */
  --on-fill: #ffffff;
  --ink-hover: #262c40;
  --chip: #f1f0ec;
  --tabs: #ecebe6;
  /* The colour of shadows, as r, g, b for rgba(). */
  --shadow: 15, 20, 36;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

/* The same colours twice: once for a browser set to dark, unless the switch chose light, and
   once for the switch choosing dark. pages/tests.py holds the two blocks to each other. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1017;
    --surface: #151923;
    --surface-soft: #191e29;
    --ink: #e8eaf0;
    --ink-soft: #b4bacb;
    --muted: #8b91a3;
    --line: #262c3a;
    --field: #3a4152;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1d2042;
    --accent-ink: #c7cdfd;
    --dark: #151923;
    --danger: #f97066;
    --danger-hover: #fda29b;
    --danger-soft: #35161a;
    --ok: #47cd89;
    --ok-soft: #0e2a1d;
    --warn-line: #5a4614;
    --warn-soft: #1f1a0c;
    --warn-bg: #251f0d;
    --warn-ink: #f1cf76;
    --on-fill: #0d1017;
    --ink-hover: #ffffff;
    --chip: #222838;
    --tabs: #1b202c;
    --shadow: 0, 0, 0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1017;
  --surface: #151923;
  --surface-soft: #191e29;
  --ink: #e8eaf0;
  --ink-soft: #b4bacb;
  --muted: #8b91a3;
  --line: #262c3a;
  --field: #3a4152;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1d2042;
  --accent-ink: #c7cdfd;
  --dark: #151923;
  --danger: #f97066;
  --danger-hover: #fda29b;
  --danger-soft: #35161a;
  --ok: #47cd89;
  --ok-soft: #0e2a1d;
  --warn-line: #5a4614;
  --warn-soft: #1f1a0c;
  --warn-bg: #251f0d;
  --warn-ink: #f1cf76;
  --on-fill: #0d1017;
  --ink-hover: #ffffff;
  --chip: #222838;
  --tabs: #1b202c;
  --shadow: 0, 0, 0;
}

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

/* Elements the script reveals stay hidden whatever display a class gives them. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code, pre { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.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;
}

.container { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 28rem; }
.narrow-wide { max-width: 44rem; }
.narrow-table { max-width: 60rem; }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.button-large { padding: .85rem 1.5rem; font-size: 1rem; }
.button-block { width: 100%; justify-content: center; }
.button-dark { background: var(--ink); color: var(--on-fill); }
.button-dark:hover { background: var(--ink-hover); color: var(--on-fill); }
.button-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button-outline:hover { border-color: var(--field); color: var(--ink); }
.button-accent { background: var(--accent); color: var(--on-fill); }
.button-accent:hover { background: var(--accent-hover); color: var(--on-fill); }
.button-danger { background: var(--danger); color: var(--on-fill); }
.button-danger:hover { background: var(--danger-hover); color: var(--on-fill); }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Header and footer */

.site-header { padding: 1.25rem 0; }
/* On a phone the wordmark and the language switch share the top row and the links go below. */
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.header-inner > .wordmark { margin-right: auto; }
.header-inner > .site-nav { order: 1; width: 100%; }

.wordmark {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.03em;
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark span { color: var(--accent); }
.wordmark-small { font-size: 1.1rem; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  font-size: .95rem;
}
.site-nav > a:not(.button), .nav-button { color: var(--ink-soft); text-decoration: none; }
.site-nav > a:not(.button):hover, .nav-button:hover { color: var(--ink); }
.inline-form { display: inline; margin: 0; }
.nav-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

.language-switch { display: inline-flex; gap: .5rem; font-size: .8rem; letter-spacing: .04em; }
.language-switch a { color: var(--muted); text-decoration: none; }
.language-switch a:hover { color: var(--ink); }

/* Like the browser, light or dark: three buttons the script shows, since only it can switch. */
.theme-switch { display: inline-flex; gap: .125rem; padding: .125rem; border: 1px solid var(--line); border-radius: 999px; }
.theme-switch button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--chip); color: var(--ink); }
.theme-switch svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.messages { margin: 1rem 0 0; padding: 0; list-style: none; }
.message {
  padding: .75rem 1rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.message + .message { margin-top: .5rem; }
.message-error { background: var(--danger-soft); color: var(--danger); }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a, .link-button { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-links a:hover, .link-button:hover { color: var(--ink); }
.link-button { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }

/* The analytics consent banner, over the bottom of the page until a choice is made. */

.consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -4px 16px rgba(var(--shadow), .08);
}
.consent-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.consent-text { flex: 1 1 24rem; margin: 0; color: var(--ink-soft); font-size: .92rem; }
.consent-actions { display: flex; flex: 0 0 auto; gap: .75rem; }

/* Home: hero */

.hero { padding: 3rem 0 4rem; }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
.hero-grid > * { min-width: 0; }

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.lead { margin: 1.25rem 0 0; max-width: 34rem; color: var(--ink-soft); font-size: 1.15rem; }

.tabs {
  display: inline-flex;
  gap: .25rem;
  margin-bottom: 1rem;
  padding: .25rem;
  border-radius: 10px;
  background: var(--tabs);
}
.tab {
  padding: .5rem 1rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow), .08); }

.panel + .panel { margin-top: 1.5rem; }

/* The seven logo tiles above the box (pages/tiles.py): one row at any width, each a square
   that shrinks on a narrow screen rather than wrapping, its image no larger than its 64 px file.
   A tile is nine tenths of what a seventh of the row less the gaps would give it, and of 5.5rem at
   most, so the first and last stay at the box's edges and the room it leaves goes between them. */
.tiles {
  display: grid;
  grid-template-columns: repeat(7, min(4.95rem, (100% - 3rem) * .9 / 7));
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .75rem;
  padding: 0;
  list-style: none;
}
.tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  /* Of the tile's width, so a phone's narrow tiles keep the same share of their room for the
     image: 72% of the tile, with room around it. */
  padding: 14%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.tile:hover { border-color: var(--field); }
.tile picture { display: contents; }
.tile img { display: block; width: 100%; max-width: 64px; height: auto; object-fit: contain; }
/* What the image reads well on, in either theme, as the card's logo box does it. */
.tile-light { background: #ffffff; }
.tile-dark { background: var(--term-bg); }

.search { display: flex; gap: .5rem; }
.search-field { position: relative; display: flex; flex: 1; min-width: 0; }
.search input {
  flex: 1;
  min-width: 0;
  padding: .7rem .9rem;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  /* A search field's own look shifts its text, which the completion over it has to match. */
  appearance: none;
}
.search input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
/* The completion static/suggest.js draws over the box: the box's padding, border and font, so the
   grey rest of it sits right after what was typed, which is there only to push it into place. */
.search-ghost {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: .7rem .9rem;
  border: 1px solid transparent;
  font: inherit;
  white-space: pre;
  pointer-events: none;
  /* A long completion stops where the browser's own clear button starts, so it is not drawn
     under it and a tap there still clears the box. */
  clip-path: inset(0 calc(.9rem + 1px + 1.25em) 0 0);
}
.search-typed { visibility: hidden; }
.search-rest { color: var(--muted); cursor: pointer; pointer-events: auto; }
/* Below the box, once static/suggest.js runs, the card of the most popular match replaces whatever
   was there: room for one card from the start, so the page under it does not jump when the first
   arrives. */
.search-live { min-height: 24rem; }

.hint { margin: .9rem 0; color: var(--muted); font-size: .9rem; }
.notice {
  margin: .9rem 0;
  padding: .7rem .9rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
/* The search asked nothing, or the API could not answer it. */
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }

.company-card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 48px -28px rgba(var(--shadow), .3);
}
.company-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.company-head h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.company-head p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.company-logo {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.company-logo-small { width: 40px; height: 40px; border-radius: 8px; }
.sample-logo { width: 60%; height: 60%; }
.sample-logo rect { fill: var(--ink); }
.sample-logo path { fill: var(--surface); }

.company-facts { margin: 0; }
.company-facts > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.company-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.company-facts dt { color: var(--muted); font-size: .9rem; }
.company-facts dd { margin: 0; font-size: .95rem; overflow-wrap: anywhere; }
.company-facts code { font-family: var(--mono); font-size: .85rem; }

/* A card the API answered: every field it holds, its links and its logo as img.logoty.pe serves it. */
.cards { display: grid; gap: 1rem; }
.company-name { min-width: 0; overflow-wrap: anywhere; }
.company-logo img { width: 40px; height: 40px; object-fit: contain; }
/* What the logo reads well on, in either theme. */
.company-logo-light { background: #ffffff; }
.company-logo-dark { background: var(--term-bg); }
.company-initial { color: var(--muted); font-size: 1.4rem; font-weight: 600; }
.company-mcc { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; }
.company-also { color: var(--muted); font-size: .85rem; }
.company-confidence { display: inline-flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.company-confidence meter { width: 5rem; height: .5rem; }
.company-files { color: var(--muted); font-size: .8rem; }
.chip { padding: .1rem .4rem; border-radius: 4px; background: var(--chip); }

.response { margin-top: 1rem; }
.response-label { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; color: var(--muted); font-size: .85rem; }
.status {
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-family: var(--mono);
  font-size: .75rem;
}
.status-error { background: var(--danger-soft); color: var(--danger); }
/* A whole answer of the API, which can run to hundreds of lines: it scrolls in its window. */
.terminal-tall pre { max-height: 28rem; overflow-y: auto; }

/* Terminal windows */

.terminal {
  overflow: hidden;
  border: 1px solid var(--term-line);
  border-radius: 12px;
  background: var(--term-bg);
  color: var(--term-text);
  box-shadow: 0 30px 60px -32px rgba(var(--shadow), .5);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.terminal-dots { display: inline-flex; gap: 6px; }
.terminal-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a4155; }
.terminal-title { overflow: hidden; color: var(--term-muted); font-family: var(--mono); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.terminal pre {
  margin: 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.65;
  scrollbar-color: #3a4155 transparent;
}
.terminal code { font-family: inherit; }

.copy {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
  padding: .25rem .55rem;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: transparent;
  color: #c3c8d6;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
.copy:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }

/* Home: features and the dark band */

.features { padding: 3.5rem 0; border-top: 1px solid var(--line); background: var(--surface-soft); }
.features-grid { display: grid; gap: 2.5rem; }
.icon {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h2 { margin: 1.1rem 0 .5rem; font-size: 1.1rem; font-weight: 600; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }

.products { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.products h2 { margin: 0 0 .75rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.products-lead { max-width: 44rem; color: var(--muted); }
.products-grid { display: grid; gap: 1.25rem; margin: 1.5rem 0; }
.product { min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.products-grid .product h3 { margin: 0 0 .5rem; font-size: 1.1rem; font-weight: 600; }
.product p { margin: 0 0 .75rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.product-paths { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .85rem; }
.product-paths code { overflow-wrap: anywhere; }

.cta { padding: 4rem 0; background: var(--dark); color: #fff; }
.cta-grid { display: grid; gap: 2.5rem; align-items: center; }
.cta-grid > * { min-width: 0; }
.cta h2 { max-width: 14ch; margin: 0 0 .75rem; font-size: 2rem; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.cta p { max-width: 26rem; margin: 0 0 1.75rem; color: var(--dark-muted); }
.cta .terminal { border-color: #2a3145; background: #151a28; box-shadow: none; }
.link-light { display: inline-block; margin-top: 1.25rem; color: var(--dark-muted); font-size: .9rem; text-decoration: none; }
.link-light:hover { color: #fff; }

/* Inner pages */

.page { padding: 2.5rem 0 5rem; }
.page-head { margin-bottom: 2rem; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -.03em; }
.page-head .lead { margin-top: .5rem; }

.prose { max-width: 46rem; }
.prose h2 { margin: 2.5rem 0 .75rem; font-size: 1.3rem; font-weight: 600; }
.prose h3 { margin: 2rem 0 .5rem; font-size: 1.05rem; font-weight: 600; }
.prose p { color: var(--ink-soft); }
.prose .terminal { margin: 1rem 0; box-shadow: none; }
.prose :not(pre) > code { padding: .1rem .35rem; border-radius: 4px; background: var(--chip); font-family: var(--mono); font-size: .85em; overflow-wrap: anywhere; }
.prose h3 code { padding: 0; background: none; font-size: 1em; }

/* The docs page: its sections, the reference's parameters, responses, fields and errors in tables,
   and the key's schemes in a list that reads the same on a phone. */
.toc { display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9rem; }
.prose h4 { margin: 1.5rem 0 .5rem; font-size: .95rem; font-weight: 600; }
.docs-index { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .75rem 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: .85rem; }
.docs-index-head { margin: 1rem 0 0; font-weight: 600; }
.docs-index-head + .docs-index { margin-top: .4rem; }
.docs-types { padding-left: 1.1rem; }
.docs-types li + li { margin-top: .3rem; }
.docs-steps { padding-left: 1.25rem; color: var(--ink-soft); }
.docs-steps li + li { margin-top: .4rem; }
.docs-table { margin: 1rem 0; }
.docs-table p { margin: 0; }
.docs-table p + p { margin-top: .4rem; }
.docs-table .docs-rule { color: var(--muted); font-size: .85rem; }
/* Under the name, so the column is as wide as the name and a phone shows the next one too. */
.docs-table td:first-child .badge { display: table; margin-top: .35rem; }
/* A pattern or a list of values is no name to copy whole: it may break where the cell ends. */
.table.docs-table .docs-rule code, .docs-kind code { white-space: normal; overflow-wrap: anywhere; }
/* .table td, further down, keeps every cell on one line; these cells hold sentences. */
.table.docs-table td { white-space: normal; vertical-align: top; }
.table.docs-table td:first-child { white-space: nowrap; }
/* A sentence a word a line reads worse than a table that scrolls in its box. */
.table.docs-table td:last-child { min-width: 14rem; }
/* A problem's type is copied whole, so it is never broken across lines; a narrow screen scrolls. */
.table.docs-table code { white-space: nowrap; overflow-wrap: normal; }
.fields { margin: 1rem 0 1.5rem; border-top: 1px solid var(--line); }
.fields > div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.fields dd { margin: .35rem 0 0; color: var(--ink-soft); }

/* The cookies page: an entry per cookie, which reads the same on a phone as on a desktop. */
.cookie-list { margin: 1rem 0 1.5rem; border-top: 1px solid var(--line); }
.cookie-list > div { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.cookie-list code { padding: .1rem .35rem; border-radius: 4px; background: var(--chip); font-size: .85rem; }
.cookie-list dd { margin: .4rem 0 0; color: var(--ink-soft); }
.cookie-list .cookie-kept { color: var(--muted); font-size: .9rem; }

.card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card + .card { margin-top: 1.5rem; }
.card h1 { margin: 0 0 1.5rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.card h2 { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 600; }
.card .terminal { margin: 1.25rem 0; box-shadow: none; }
.card-notice { border-color: var(--warn-line); background: var(--warn-soft); }
.card-notice p { margin: 0 0 1.25rem; color: var(--ink-soft); }

/* Log in with Google or GitHub, above the form for an address and a password. */
.providers { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.provider-icon { flex: 0 0 auto; }
.providers-or { display: flex; align-items: center; gap: .75rem; margin: .75rem 0 0; color: var(--muted); font-size: .85rem; }
.providers-or::before, .providers-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.ways { margin: 0; padding: 0; list-style: none; }
.way { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.way:first-child { padding-top: 0; }
.way:last-child { border-bottom: 0; }
.way-name { display: inline-flex; flex: 1 1 12rem; align-items: center; gap: .5rem; font-weight: 500; }
.way-status { color: var(--muted); font-size: .9rem; }
.way-action { margin: 0; }
.card-text { margin: 0 0 1.25rem; color: var(--ink-soft); }
/* A product's own part of a card, such as each product's use on the keys page. */
.card-subhead { margin: 1.75rem 0 .75rem; font-size: 1rem; font-weight: 600; }
.card-text + .card-subhead { margin-top: 0; }

.aside { margin-top: 1.25rem; color: var(--muted); font-size: .92rem; text-align: center; }
.empty { margin: 0; color: var(--muted); }

/* A list of pages, each a link with a line on what it shows. */
.page-list { margin: 0; padding: 0; list-style: none; }
.page-list li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.page-list li:first-child { padding-top: 0; }
.page-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.page-list a { font-weight: 500; }
.page-list p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .95rem; }
.fine-print { margin-top: 1.5rem; color: var(--muted); font-size: .85rem; }

.callout {
  padding: 1rem 1.1rem;
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: .92rem;
}
.callout strong { display: block; margin-bottom: .25rem; }

/* The second step's setup: the QR code a phone scans, dark on white in either theme, and the
   same key to type by hand, which may break anywhere on a phone. */
.steps { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--ink-soft); }
.steps li + li { margin-top: .35rem; }
.qr { max-width: 14rem; margin: 1.5rem auto 1rem; }
.qr-code { display: block; width: 100%; height: auto; border-radius: 8px; }
.secret { margin: 0 0 1.5rem; text-align: center; overflow-wrap: anywhere; }
.secret-label { display: block; margin-bottom: .25rem; color: var(--muted); font-size: .85rem; }
.secret code { font-size: 1rem; letter-spacing: .02em; }

/* Forms */

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 500; }
.field input, .field select {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.field-invalid input, .field-invalid select { border-color: var(--danger); }
.help { margin-top: .35rem; color: var(--muted); font-size: .8rem; }
.help ul { margin: 0; padding-left: 1.1rem; }
.errorlist { margin: .35rem 0 0; padding: 0; color: var(--danger); font-size: .85rem; list-style: none; }
.form-errors { margin-bottom: 1.1rem; }
.form-errors .errorlist { margin: 0; padding: .7rem .9rem; border-radius: 8px; background: var(--danger-soft); }

/* Keys */

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { padding: .6rem .75rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 500; text-align: left; }
.table td { padding: .8rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table code { padding: .1rem .35rem; border-radius: 4px; background: var(--chip); font-size: .85rem; }
.table-action { text-align: right; white-space: nowrap; }
.table-action a + a { margin-left: .75rem; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: var(--danger-hover); }

.badge { padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 500; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: var(--chip); color: var(--muted); }
.badge-paid { background: var(--accent-soft); color: var(--accent-ink); }

/* The admins' pages of figures: how full the merchants database is (mcc/), and how many
   accounts and keys there are (counts/). */
.figures { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.figures .card + .card { margin-top: 0; }
.figure-label { margin: 0; color: var(--muted); font-size: .85rem; }
.figure-value { margin: .35rem 0 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure-note { margin: .25rem 0 0; color: var(--ink-soft); font-size: .85rem; }
/* Tighter on a phone, so the three columns fit its width. */
.fill-table th, .fill-table td { padding-right: .375rem; padding-left: .375rem; }
.fill-table tbody th { padding-top: .7rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .92rem; font-weight: 400; }
.fill-table tbody tr:last-child th { border-bottom: 0; }
.fill-table .fill-section th { padding-top: 1.75rem; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.fill-table .fill-num { text-align: right; font-variant-numeric: tabular-nums; }
.fill-share { display: inline-flex; align-items: center; gap: .75rem; }
/* As wide as 100.0%, so the bars above and below line up whatever the figure. */
.fill-share > span { min-width: 3.25rem; text-align: right; }
/* Only where there is room beside the numbers; the percentage says the same. */
.fill-share progress { display: none; width: 6rem; height: .4rem; border: 0; border-radius: 999px; background: var(--chip); appearance: none; overflow: hidden; }
.fill-share progress::-webkit-progress-bar { background: var(--chip); }
.fill-share progress::-webkit-progress-value { background: var(--accent); }
.fill-share progress::-moz-progress-bar { background: var(--accent); }
.fill-read { margin: 1rem 0 0; color: var(--muted); font-size: .85rem; }

/* mcc's settings: those of every refresh as fields, each layer's as a row of inputs. */
.card-notice + .setting-form, .setting-form + .card { margin-top: 1.5rem; }
.setting-grid { display: grid; gap: 0 1.5rem; }
.setting-form .hint { margin-top: 0; }
.setting-label { margin: 0 0 .4rem; font-size: .9rem; font-weight: 500; }
.setting-value { margin: 0; padding: .65rem 0; font-variant-numeric: tabular-nums; }
/* The layer's name and a value without a field line up with the text inside the fields. */
.setting-table tbody th { padding-top: calc(.95rem + 1px); color: var(--ink); font-size: .92rem; font-weight: 500; vertical-align: top; }
.setting-cell { display: inline-block; padding: calc(.45rem + 1px) 0; }
.setting-table td { padding-top: .5rem; padding-bottom: .5rem; font-variant-numeric: tabular-nums; vertical-align: top; }
.setting-table input {
  width: 9rem;
  padding: .45rem .6rem;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
/* Wide enough for a model's name, claude-sonnet-5-5, whole. */
.setting-table .setting-text { width: 11rem; }
.setting-table input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.setting-table .field-invalid input { border-color: var(--danger); }
.setting-table .errorlist { max-width: 14rem; white-space: normal; }
.setting-about { margin: 1.25rem 0 0; font-size: .85rem; }
.setting-about dt { font-weight: 500; }
.setting-about dd { margin: .15rem 0 .75rem; color: var(--muted); }
.setting-about dd:last-child { margin-bottom: 0; }
.setting-save { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem; }
.setting-save .help { flex: 1 1 20rem; margin: 0; }

/* The admins' review panel (mcc/review.py): a merchant's details, and beside them on a wide
   screen, after them on a phone, the verdict, whose codes show only once wrong is chosen. */
.review-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .25rem; }
.review-switch a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .92rem;
  text-decoration: none;
}
.review-switch a:hover { border-color: var(--field); color: var(--ink); }
.review-switch a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--on-fill); }
.review-count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.review-switch a[aria-current="page"] .review-count { color: inherit; }
.review-off { margin-bottom: 1.5rem; }
.review-layout { display: grid; gap: 1.5rem; }
.review-position { margin: 0 0 .25rem; color: var(--muted); font-size: .85rem; }
.review-domain { overflow-wrap: anywhere; }
.review-facts { display: grid; gap: .7rem; margin: 0; }
.review-facts dt { color: var(--muted); font-size: .85rem; }
.review-facts dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.review-next { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.review-pkd { margin-top: 1.25rem; }
.review-pkd-list { margin: 0; padding: 0; list-style: none; }
.review-more { margin: 1rem 0 0; font-size: .92rem; }
.page-head + .review-more { margin: 0 0 1.5rem; }
.review-model { margin: 0 0 1rem; }
.review-meta { color: var(--muted); font-size: .85rem; }
.review-codes { margin: 0; padding: 0; list-style: none; }
.review-codes li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.review-codes li:first-child { padding-top: 0; }
.review-codes li:last-child { padding-bottom: 0; border-bottom: 0; }
.review-code { margin: 0; overflow-wrap: anywhere; }
.review-code code { font-weight: 600; }
.review-quote { margin: .5rem 0 0; padding: .4rem .8rem; border-left: 3px solid var(--field); color: var(--ink-soft); font-size: .92rem; overflow-wrap: anywhere; }
.review-form fieldset { min-width: 0; margin: 0 0 1.1rem; padding: 0; border: 0; }
.review-form legend { margin-bottom: .5rem; padding: 0; font-size: .9rem; font-weight: 500; }
.review-choice { display: flex; gap: .65rem; align-items: flex-start; padding: .65rem .8rem; border: 1px solid var(--field); border-radius: 10px; cursor: pointer; }
.review-choice + .review-choice { margin-top: .5rem; }
.review-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.review-choice input { flex: 0 0 auto; margin: .3rem 0 0; }
.review-choice small { color: var(--muted); font-size: .85rem; }
.review-key { padding: 0 .35rem; border: 1px solid var(--field); border-radius: 4px; color: var(--muted); font-family: var(--mono); font-size: .75rem; }
.review-form:not(:has(input[name="verdict"][value="wrong"]:checked)) .review-picker { display: none; }
.review-form .field textarea {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.review-form .field textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.review-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.review-table td { vertical-align: top; }
.review-table .review-note { min-width: 12rem; white-space: normal; }
.review-signals { white-space: normal; min-width: 10rem; }
.review-signal { display: block; color: var(--ink-soft); font-size: .85rem; }

/* The admins' logo review (mcc/logos.py): merchants one under another, each version its card
   serves at 128 px on the ground it reads on, Yes and No under it as buttons that are radios. */
.logo-counts { margin: 0 0 1.25rem; color: var(--ink-soft); font-size: .92rem; }
.logo-counts strong { color: var(--ink); }
.logo-merchants { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.logo-merchant-name { margin: 0 0 1rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.logo-versions { display: flex; flex-wrap: wrap; gap: 1rem; }
.logo-version { width: 12.5rem; min-width: 0; margin: 0; padding: .5rem .75rem .75rem; border: 1px solid var(--line); border-radius: 10px; }
.logo-version.is-current { border-color: var(--accent); }
.logo-version legend { padding: 0 .25rem; font-size: .85rem; font-weight: 500; }
.logo-image { display: grid; place-items: center; width: 146px; height: 146px; margin: 0 auto .5rem; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.logo-image img { display: block; width: 128px; height: 128px; object-fit: contain; }
.logo-none { color: var(--muted); font-size: .8rem; }
/* What the image reads well on, in either theme; any gets both halves, so a fault on either shows. */
.logo-ground-light { background: #ffffff; }
.logo-ground-dark { background: var(--term-bg); }
.logo-ground-any { background: linear-gradient(90deg, #ffffff 50%, var(--term-bg) 50%); }
.logo-meta { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.logo-earlier { margin: .25rem 0 0; color: var(--ink-soft); font-size: .8rem; text-align: center; overflow-wrap: anywhere; }
.logo-choices { display: flex; gap: .5rem; margin-top: .6rem; }
.logo-choice {
  position: relative;
  display: inline-flex;
  flex: 1;
  justify-content: center;
  padding: .45rem .6rem;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
/* The radio stays under its label, unseen, so the label is what is clicked and the radio what is
   focused and sent. */
.logo-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.logo-choice:hover { border-color: var(--ink-soft); }
.logo-choice:has(input:focus-visible), .logo-choice:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.logo-yes:has(input:checked), .logo-yes[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.logo-no:has(input:checked), .logo-no[aria-pressed="true"] { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.logo-save { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.5rem; }
.logo-save .help { flex: 1 1 20rem; margin: 0; }
.logo-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1.25rem; }
.logo-filter .field { flex: 1 1 16rem; margin: 0; }
.logo-layer { width: min(92vw, 56rem); max-width: none; max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.logo-layer::backdrop { background: rgba(15, 20, 34, .72); }
.logo-layer-inner { display: grid; gap: .75rem; padding: 1rem; }
.logo-layer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo-layer-head h2 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.logo-layer-ground { display: grid; place-items: center; height: min(72vh, 80vw); border: 1px solid var(--line); border-radius: 8px; }
/* Scaled to fit, up or down, whatever size the file has. */
.logo-layer-ground img { box-sizing: border-box; width: 100%; height: 100%; padding: 1.5rem; object-fit: contain; }
.logo-layer .logo-choices { margin: 0; }

/* Progress: one class a series colours its swatch and its bars alike, in either theme. */
.progress-range .field { flex: 0 1 11rem; }
/* On the button's line, its text level with the button's. */
.progress-back { padding-bottom: .65rem; font-size: .92rem; }
.progress-final { fill: var(--accent); background-color: var(--accent); }
.progress-logo { fill: var(--ok); background-color: var(--ok); }
.progress-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; vertical-align: -.05rem; }
.progress-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 1rem; padding: 0; list-style: none; color: var(--ink-soft); font-size: .9rem; }
.progress-legend li { display: inline-flex; align-items: center; gap: .5rem; }
/* On a phone the chart keeps a width its labels read at, and scrolls. */
.progress-scroll { overflow-x: auto; }
.progress-chart { display: block; width: 100%; min-width: 36rem; height: auto; }
.progress-bar:hover { opacity: .7; }
.progress-grid line { stroke: var(--line); }
.progress-axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-axis .progress-month { fill: var(--ink-soft); font-weight: 600; }
.progress-table tfoot th, .progress-table tfoot td { border-top: 1px solid var(--line); font-weight: 600; }

/* Pricing */

.plans { display: grid; gap: 1.25rem; }
.plan {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 24px 48px -28px rgba(79, 70, 229, .5); }
.plan h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.plan-price { margin: 1rem 0 .25rem; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; }
.plan-requests { margin: 0 0 1.25rem; color: var(--muted); font-size: .9rem; }
.plan-features { flex: 1; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.plan-features li { position: relative; padding: .35rem 0 .35rem 1.5rem; color: var(--ink-soft); font-size: .92rem; }
.plan-features li::before {
  content: "";
  position: absolute;
  top: .75rem;
  left: .1rem;
  width: .6rem;
  height: .32rem;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.plan .button { justify-content: center; }

/* Wider screens */

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 2rem; }
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .figures-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures .card { padding: 1.5rem; }
  .fill-share progress { display: block; }
  .fill-table th, .fill-table td { padding-right: .75rem; padding-left: .75rem; }
  .setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
  .form-row .form-errors { grid-column: 1 / -1; }
  .form-row .field { margin: 0; }
  /* Lines the button up with the inputs, under their labels. */
  .form-row > .button { margin-top: 1.75rem; padding: .7rem 1.1rem; }
}

@media (min-width: 768px) {
  .header-inner > .site-nav { order: 0; width: auto; }
}

@media (min-width: 960px) {
  .hero { padding: 4.5rem 0 5.5rem; }
  /* The verdict stays in view while the details beside it scroll past. */
  .review-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: start; }
  .review-form { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
  /* The search box's cards run far taller than the copy beside them: centred, the copy would sit
     out of sight halfway down, so it stays at the top while the cards scroll past. */
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4rem; align-items: start; }
  .hero-copy { position: sticky; top: 2rem; }
  .features-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .feature { padding: 0 2rem; }
  .feature:first-child { padding-left: 0; }
  .feature + .feature { border-left: 1px solid var(--line); }
  .cta-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4rem; }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
