/*
 * Shared by every page on the site: the app (index.html links it before the
 * app's own styles), the best-card pages the server renders, and the terms
 * and privacy pages. It holds the design tokens, the page background, and
 * the header and footer every page shares, so they read as one site.
 */

/*
 * Design tokens. One accent (indigo-blue) for actions and the best pick, one
 * money color (emerald) for dollars earned, and neutrals tinted toward the
 * accent so light and dark both read as one palette.
 */
:root {
  color-scheme: light dark;
  --bg: #f3f4fa;
  --bg-glow: rgb(59 91 253 / 0.1);
  --surface: #ffffff;
  --surface-2: #f6f7fc;
  --text: #11142a;
  --muted: #5d6380;
  /* The select arrow, drawn in --muted (data URIs can't use variables). */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235d6380' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --border: #e2e5f0;
  --border-strong: #cdd2e3;
  --accent: #3b5bfd;
  --accent-hover: #2944e0;
  --accent-text: #ffffff;
  --accent-soft: #edf0ff;
  --accent-glow: rgb(59 91 253 / 0.16);
  --good: #087a48;
  --good-soft: #e6f6ee;
  --warn-bg: #fff6db;
  --warn-text: #6b4e00;
  --error: #c0261b;
  --error-bg: #fdecea;
  --skeleton: #e6e8f2;
  --ink: #0f1433;
  --ink-2: #26307a;
  --ink-text: #f2f4ff;
  --ink-muted: #b3bbe6;
  --logo-card: #3b5bfd;
  --logo-stripe: #18257a;
  --shadow-sm: 0 1px 2px rgb(17 20 42 / 0.05), 0 1px 3px rgb(17 20 42 / 0.04);
  --shadow-md: 0 2px 4px rgb(17 20 42 / 0.04), 0 8px 24px -6px rgb(17 20 42 / 0.1);
  --radius: 16px;
  --radius-sm: 10px;

  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/*
 * Dark palette: used when the system asks for it, unless the person picked
 * light with the header toggle, or whenever they picked dark.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0c16;
    --bg-glow: rgb(110 136 255 / 0.12);
    --surface: #131729;
    --surface-2: #181d33;
    --text: #e9ebf7;
    --muted: #9ba2c0;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239ba2c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    --border: #242a45;
    --border-strong: #323a5c;
    --accent: #7f97ff;
    --accent-hover: #9aadff;
    --accent-text: #0a0e26;
    --accent-soft: #1b2246;
    --accent-glow: rgb(127 151 255 / 0.2);
    --good: #4fd796;
    --good-soft: #0f2a1f;
    --warn-bg: #2f2710;
    --warn-text: #f0d07a;
    --error: #ff8a80;
    --error-bg: #3a1a18;
    --skeleton: #20263f;
    --ink: #171d3d;
    --ink-2: #2a3584;
    --ink-text: #f2f4ff;
    --ink-muted: #b3bbe6;
    --logo-card: #7f97ff;
    --logo-stripe: #2a3584;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 2px 4px rgb(0 0 0 / 0.3), 0 12px 32px -8px rgb(0 0 0 / 0.5);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0c16;
  --bg-glow: rgb(110 136 255 / 0.12);
  --surface: #131729;
  --surface-2: #181d33;
  --text: #e9ebf7;
  --muted: #9ba2c0;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239ba2c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --border: #242a45;
  --border-strong: #323a5c;
  --accent: #7f97ff;
  --accent-hover: #9aadff;
  --accent-text: #0a0e26;
  --accent-soft: #1b2246;
  --accent-glow: rgb(127 151 255 / 0.2);
  --good: #4fd796;
  --good-soft: #0f2a1f;
  --warn-bg: #2f2710;
  --warn-text: #f0d07a;
  --error: #ff8a80;
  --error-bg: #3a1a18;
  --skeleton: #20263f;
  --ink: #171d3d;
  --ink-2: #2a3584;
  --ink-text: #f2f4ff;
  --ink-muted: #b3bbe6;
  --logo-card: #7f97ff;
  --logo-stripe: #2a3584;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 4px rgb(0 0 0 / 0.3), 0 12px 32px -8px rgb(0 0 0 / 0.5);
}

:root[data-theme='light'] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Clear of the notch and home bar in the iOS app (viewport-fit=cover). */
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* A soft wash of the accent behind the header, fading into the page. */
  background: radial-gradient(60rem 28rem at 50% -8rem, var(--bg-glow), transparent 70%), var(--bg);
}

/* The React app renders into #root: let it fill the page the same way. */
#root {
  display: flex;
  flex: 1;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

::selection {
  background: var(--accent-glow);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
 * Site header: one bar across every page, pinned while the page scrolls.
 * The brand on the left, page links beside it, and the page's own controls
 * (sign in, theme) on the right.
 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.65rem 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand .logo {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  filter: drop-shadow(0 3px 6px var(--accent-glow));
}

.site-nav {
  display: flex;
  gap: 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.site-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.site-nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.theme-toggle {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    color 0.15s,
    border-color 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle[hidden] {
  display: none;
}

/*
 * Site footer: the short note on the left, the site's links on the right,
 * the same on every page.
 */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer-inner {
  display: grid;
  gap: 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 2rem;
}

.site-footer .site-brand {
  font-size: 0.95rem;
}

.site-footer .site-brand .logo {
  width: 1.6rem;
  height: 1.6rem;
  filter: none;
}

.site-footer p {
  max-width: 62ch;
  margin: 0.5rem 0 0;
  line-height: 1.55;
  text-wrap: pretty;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-content: start;
  font-weight: 600;
}

.site-footer nav a,
.site-footer nav button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.site-footer nav a:hover,
.site-footer nav button:hover,
.site-footer nav a[aria-current='page'] {
  color: var(--accent);
}

.site-footer nav a:hover,
.site-footer nav button:hover {
  text-decoration: underline;
}

@media (min-width: 48rem) {
  .site-footer-inner {
    grid-template-columns: 1fr auto;
    gap: 3rem;
    padding-top: 2rem;
  }

  .site-footer nav {
    padding-top: 0.2rem;
  }
}

/* Phones: the bar can wrap to two rows, too tall to pin over the page. */
@media (max-width: 47.99rem) {
  .site-header {
    position: static;
  }
}

@media (min-width: 64rem) {
  .site-header-inner,
  .site-footer-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/*
 * Content pages: the best-card pages and the terms and privacy pages. They
 * share a page hero (breadcrumb, title, lede) and the components below.
 */
.page {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem 3.5rem;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  line-height: 1.6;
}

@media (min-width: 64rem) {
  .page {
    padding: 0 1.5rem 4.5rem;
  }
}

.page h1,
.page h2,
.page h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.page-hero {
  max-width: 46rem;
  padding: 2.25rem 0 1.75rem;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 6vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.eyebrow,
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.crumbs a {
  color: var(--accent);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.lede {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  margin-top: 1.5rem;
  /* Room above and below for when a long label wraps on a phone. */
  padding: 0.65rem 1.4rem;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px var(--accent);
  transition:
    background 0.15s,
    transform 0.15s;
}

.button:hover {
  background: var(--accent-hover);
}

.button:active {
  transform: translateY(1px);
}

.button svg {
  flex: none;
  width: 1rem;
  height: 1rem;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.section-title,
.page .section-title {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
  font-weight: 750;
}

/* A quiet box for the fine print a ranking depends on. */
.callout {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  position: relative;
}

.callout::before {
  content: 'i';
  position: absolute;
  /* Centred on the first line: padding + (line height - icon) / 2. */
  top: calc(0.9rem + (0.92rem * 1.5 - 1.15rem) / 2);
  left: 1rem;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font:
    italic 700 0.75rem/1 Georgia,
    serif;
}

.callout p {
  margin: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pills a {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 550;
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.pills a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Hero facts: when the ranking was made, and what it covers. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 1rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 550;
  list-style: none;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.facts li::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--good);
}

/*
 * Best-card page: the top pick, a few cards worth a look, then the full list
 * folded away, with what the ranking rests on beside it.
 */
.guide {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.guide-main {
  display: grid;
  gap: 1.75rem;
  min-width: 0;
}

@media (min-width: 64rem) {
  .guide {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 2.5rem;
  }

  .guide-aside {
    position: sticky;
    top: 5rem;
  }
}

.page .badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page .earn {
  margin: 0;
  line-height: 1.15;
}

.page .earn strong {
  color: var(--good);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.page .earn span {
  color: var(--muted);
  font-size: 0.8rem;
}

.page .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page .reasons {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

.page .reasons li {
  padding-left: 1.3rem;
  position: relative;
}

.page .reasons li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 0.15rem;
  width: 0.45rem;
  height: 0.25rem;
  border-left: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}

.page .reasons:empty {
  display: none;
}

/* The winner: lifted, outlined in the accent, the answer at a glance. */
.winner {
  display: grid;
  gap: 0.7rem;
  padding: 1.5rem;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background:
    radial-gradient(32rem 12rem at 100% 0%, var(--good-soft), transparent 70%), var(--surface);
  box-shadow:
    0 0 0 4px var(--accent-glow),
    var(--shadow-md);
}

.winner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
}

.winner h2 {
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 800;
}

.winner .earn strong {
  font-size: clamp(2rem, 7vw, 2.6rem);
}

.winner .meta {
  font-size: 0.98rem;
}

.winner .reasons {
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.winner .button {
  justify-self: start;
  margin-top: 0.5rem;
}

/* The next few cards, side by side where there's room. */
.alt-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.alt-grid > li {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
}

.page .tag {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.alt-name {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}

.alt-grid .earn strong {
  font-size: 1.3rem;
}

/* Phones: the way into the picker spans the winner, so it reads as one tap. */
@media (max-width: 35.99rem) {
  .winner {
    padding: 1.25rem;
  }

  .winner .button {
    justify-self: stretch;
    justify-content: center;
    text-align: center;
  }
}

.alt-grid .meta {
  font-size: 0.84rem;
}

/* Phones: the next cards become short rows, name left and dollars right. */
@media (max-width: 35.99rem) {
  .alt-grid > li {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'tag earn'
      'name earn'
      'meta meta';
    gap: 0.1rem 0.75rem;
    padding: 0.85rem 1rem;
  }

  .alt-grid .tag {
    grid-area: tag;
  }

  .alt-grid .alt-name {
    grid-area: name;
  }

  .alt-grid .earn {
    grid-area: earn;
    align-self: center;
    text-align: right;
  }

  .alt-grid .earn strong {
    display: block;
  }

  .alt-grid .meta {
    grid-area: meta;
  }
}

/* The full list: folded by default, opened by its summary. */
.full-ranking {
  overflow: hidden;
}

.full-ranking summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 1rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  list-style: none;
}

.full-ranking summary::-webkit-details-marker {
  display: none;
}

.full-ranking summary::after {
  content: '';
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--chevron) center / contain no-repeat;
  transition: transform 0.2s;
}

.full-ranking[open] summary::after {
  transform: rotate(180deg);
}

.full-ranking summary:hover .summary-title {
  color: var(--accent);
}

.summary-title {
  font-size: 1.05rem;
  font-weight: 750;
}

.summary-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.full-body {
  border-top: 1px solid var(--border);
}

/* A filter made of radios, so it works before (and without) any script. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0.9rem 1.25rem 0.25rem;
  border: 0;
}

.filters label {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.filters input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filters label:has(:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

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

.full-ranking:has([data-no-fee]:checked) .ranking > li[data-fee='paid'] {
  display: none;
}

.ranking {
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.ranking > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'rank name value'
    'rank meta value'
    'rank reasons reasons';
  gap: 0.1rem 0.9rem;
  padding: 0.9rem 1.25rem;
}

.ranking > li + li {
  border-top: 1px solid var(--border);
}

.ranking .rank {
  grid-area: rank;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.ranking > li.top .rank {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.ranking h3 {
  grid-area: name;
  align-self: center;
  font-size: 1rem;
  font-weight: 700;
}

.ranking .meta {
  grid-area: meta;
  font-size: 0.86rem;
}

.ranking .earn {
  grid-area: value;
  text-align: right;
}

.ranking .earn strong {
  display: block;
  font-size: 1.2rem;
}

.ranking .reasons {
  grid-area: reasons;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

@media (max-width: 35.99rem) {
  .full-ranking summary,
  .ranking > li {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .ranking > li {
    grid-template-areas:
      'rank name value'
      'rank meta value'
      'reasons reasons reasons';
  }
}

.aside-box {
  padding: 1.25rem;
}

.aside-box + .aside-box {
  margin-top: 1rem;
}

.aside-box h2 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 750;
}

.aside-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.notes {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.notes li::marker {
  color: var(--accent);
}

/*
 * Best-card index: a search box, the stores people look for most, then a
 * tile per category with its top card and its stores folded inside.
 */
.finder {
  margin-top: 1.5rem;
}

.finder[hidden] {
  display: none;
}

.finder input {
  width: 100%;
  max-width: 32rem;
  min-height: 3rem;
  padding: 0 1.1rem 0 2.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90ad' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E")
      1rem center / 1.1rem no-repeat,
    var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.finder input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.popular {
  margin: 0 0 2rem;
}

.popular[hidden] {
  display: none;
}

.topics {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic {
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 1.15rem;
  scroll-margin-top: 5rem;
}

.topic[hidden] {
  display: none;
}

.topic h3 {
  font-size: 1.1rem;
  font-weight: 750;
}

.topic h3 a {
  color: var(--text);
  text-decoration: none;
}

.topic h3 a:hover {
  color: var(--accent);
}

.topic h3 a::after {
  content: ' →';
  color: var(--accent);
}

.leader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 0.75rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9rem;
  line-height: 1.35;
}

.leader span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leader strong {
  font-weight: 650;
}

.leader em {
  color: var(--good);
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.stores summary {
  width: fit-content;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.stores summary:hover {
  text-decoration: underline;
}

.stores .pills {
  margin-top: 0.65rem;
}

.stores .pills a {
  font-size: 0.82rem;
  padding: 0.22rem 0.6rem;
}

.stores li[hidden] {
  display: none;
}

.no-match {
  color: var(--muted);
}

.no-match[hidden] {
  display: none;
}

/*
 * Terms and privacy: the text in one readable column on a raised sheet, with
 * the section list beside it on wide screens.
 */
.doc-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 64rem) {
  .doc-layout {
    grid-template-columns: 15rem minmax(0, 46rem);
    gap: 3rem;
  }

  .toc {
    position: sticky;
    top: 5.5rem;
  }
}

.toc {
  font-size: 0.9rem;
}

.toc h2 {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc a {
  display: block;
  padding: 0.3rem 0.65rem;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--accent);
  color: var(--accent);
}

/* Phones: the section list is folded away under the title. */
/* Narrower screens: the section list sits over the text, in two columns. */
@media (max-width: 63.99rem) {
  .toc {
    padding: 0.85rem 1rem;
  }

  .toc ol {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  }

  .toc a {
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
  }
}

.doc {
  padding: 1.5rem 1.25rem;
  line-height: 1.7;
}

@media (min-width: 36rem) {
  .doc {
    padding: 2.25rem 2.5rem 2.5rem;
  }
}

.doc h2 {
  margin: 2.25rem 0 0.6rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 1.2rem;
  font-weight: 750;
  scroll-margin-top: 5rem;
}

.doc > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc p,
.doc ul {
  margin: 0.75rem 0 0;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.4rem;
}

.doc li::marker {
  color: var(--accent);
}

.updated {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

.updated em {
  color: var(--text);
  font-style: normal;
  font-weight: 650;
}
