/*
 * pick.tools: one stylesheet, plain CSS (spec §7.7).
 * Minimal, dense, monospace-forward. One accent colour (deep teal).
 * Light and dark from prefers-color-scheme; every text colour is at least
 * 4.5:1 against --bg in both schemes. Badges carry words, never colour alone.
 */

:root {
  --bg: #fbfbf8;
  --fg: #1b1d1c;
  --muted: #5d615f;
  --accent: #0a6b63;
  --rule: #d6d8d4;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --target: 44px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --fg: #e4e6e3;
    --muted: #9da29f;
    --accent: #4fc2b4;
    --rule: #2f3432;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 0.9375rem/1.5 var(--sans);
}

.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 1rem; }

/* Numbers, slugs, code. */
.mono, .num, code, pre, kbd, samp, time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code, kbd, samp, pre { font-size: 0.9em; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 0.9rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999rem; top: 0; padding: 0.5rem 1rem; background: var(--bg); }
.skip:focus { left: 1rem; }

/* Header and footer. */
header.site { border-bottom: 1px solid var(--rule); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem; }
.wordmark {
  display: inline-flex; align-items: center; min-height: var(--target);
  color: var(--fg); font-weight: 700; text-decoration: none;
}
nav ul { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0; padding: 0; list-style: none; }
nav a {
  display: inline-flex; align-items: center; min-height: var(--target);
  color: var(--fg); text-decoration: none;
}
nav a:hover, nav a[aria-current] {
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px;
}

footer.site { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
footer.site a { display: inline-flex; align-items: center; min-height: var(--target); }

/* Content. */
main { padding-top: 1.5rem; padding-bottom: 3rem; }
h1 { margin: 0 0 0.75rem; font-size: 1.5rem; line-height: 1.25; }
h1 .slug { font-size: 0.7em; font-weight: normal; }
h2 {
  margin: 2rem 0 0.5rem; padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule); font-size: 1.05rem;
}
h3 { margin: 1rem 0 0.25rem; font-size: 0.9rem; }
p { max-width: 72ch; margin: 0 0 0.75rem; }
.lede { font-size: 1.05rem; }

pre {
  margin: 0 0 0.75rem; padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule); overflow-x: auto; line-height: 1.4;
}
:not(pre) > code { overflow-wrap: anywhere; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Tables: 1 px rules, right-aligned numbers, sticky header. */
.data {
  width: 100%; margin: 0 0 0.75rem;
  border-collapse: separate; border-spacing: 0; font-size: 0.9rem;
}
.data caption { padding: 0 0 0.4rem; color: var(--muted); text-align: left; caption-side: top; }
.data th, .data td {
  padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--rule);
  text-align: left; vertical-align: top;
}
.data th:first-child, .data td:first-child { padding-left: 0; }
.data th:last-child, .data td:last-child { padding-right: 0; }
.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg); border-bottom-color: var(--fg);
  font-weight: 600; white-space: nowrap;
}
.data tbody th { font-weight: normal; }
.data .num { text-align: right; white-space: nowrap; }
.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.data a { display: inline-flex; align-items: center; min-height: var(--target); }
.data td:has(.badge), .data td.num, .data th[scope="row"] { vertical-align: middle; }
.data th.service a { margin-right: 0.4rem; }
.data .nowrap { white-space: nowrap; }
.data.tools tbody th { vertical-align: top; }

/* On narrow screens tables scroll sideways (the header then stops sticking). */
@media (max-width: 48rem) {
  .scroll { overflow-x: auto; }
  .data thead th { position: static; }
}

details summary {
  display: flex; align-items: center; min-height: var(--target);
  color: var(--accent); cursor: pointer; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; width: 1.2em; font-family: var(--mono); }
details[open] summary::before { content: "−"; }
/* Schemas wrap rather than widen the table (and the page) when opened. */
details pre { max-height: 24rem; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Badges: words first, styling second. */
.badge {
  display: inline-block; padding: 0 0.4em;
  border: 1px solid currentColor; border-radius: 2px;
  font: 0.78rem/1.5 var(--mono); white-space: nowrap;
}
.badge-keyless, .health-up { color: var(--accent); }
.badge-api-key { color: var(--fg); }
.badge-oauth { color: var(--muted); }
.badge-unknown, .health-unknown { color: var(--muted); border-style: dashed; }
.badge-dead, .health-down { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.sparkline { color: var(--accent); vertical-align: middle; }

/* Filters. */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.filters label { display: flex; flex-direction: column; gap: 0.15rem; color: var(--muted); font-size: 0.8rem; }
.filters label.check { flex-direction: row; align-items: center; gap: 0.4rem; min-height: var(--target); color: var(--fg); font-size: 0.9rem; }
.filters .reset { display: inline-flex; align-items: center; min-height: var(--target); }
input, select, button {
  min-height: var(--target); padding: 0 0.5rem;
  border: 1px solid var(--muted); border-radius: 2px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 0.9rem;
}
input[type="checkbox"] { min-height: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
button { border-color: var(--accent); color: var(--accent); cursor: pointer; }
button:hover { background: var(--accent); color: var(--bg); }
