/* Hand-written, no framework, no build step.
 *
 * The design constraint for the whole web phase is "verdict at the top, evidence at the
 * bottom" — this is a reference work, not a dashboard. So: one column, generous type, and
 * colour used only where it carries meaning (the verdict badges) rather than for decoration.
 *
 * Light and dark both come from the same custom properties, switched by prefers-color-scheme.
 * The verdict tones keep their meaning in both: `unknown` is deliberately grey and calm in
 * each, because "we could not say" must never look like a bad grade.
 */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #5a5a5a;
  --rule: #e2ded8;
  --link: #1a4f8a;

  --good: #1f6f43;
  --good-bg: #e4f2e9;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --bad: #9b2226;
  --bad-bg: #f8e3e3;
  --ended: #5b3a8a;
  --ended-bg: #efe7f8;
  --unknown: #4a4a4a;
  --unknown-bg: #eceae6;

  --measure: 42rem;
  --wrap: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1b1e24;
    --ink: #e8e6e3;
    --ink-muted: #a2a09c;
    --rule: #2b2f37;
    --link: #8ab4f8;

    --good: #7fd1a3;
    --good-bg: #16301f;
    --warn: #e3bd6b;
    --warn-bg: #332711;
    --bad: #f09a9d;
    --bad-bg: #351a1c;
    --ended: #c4a8ee;
    --ended-bg: #241a35;
    --unknown: #b9b7b3;
    --unknown-bg: #24272d;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Keyboard users reach the content without walking the header every time. */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.5rem 0 1.25rem;
}

.wordmark {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wordmark a { color: inherit; text-decoration: none; }

.strapline {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

main { padding: 2.5rem 0 3rem; }

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  max-width: var(--measure);
}

h2 {
  font-size: 1.2rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

p { max-width: var(--measure); }

.muted { color: var(--ink-muted); font-size: 0.95rem; }

/* --- verdict badges ------------------------------------------------------
 * The only place colour carries meaning. Each badge pairs a tone with its own
 * foreground so contrast holds in both schemes, and none of them is a bare dot:
 * the word is the label, the colour only reinforces it.
 */

.badges { list-style: none; margin: 0; padding: 0; }
.badges li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font: 600 0.85rem/1.5 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.badge-good    { color: var(--good);    background: var(--good-bg); }
.badge-warn    { color: var(--warn);    background: var(--warn-bg); }
.badge-bad     { color: var(--bad);     background: var(--bad-bg); }
.badge-ended   { color: var(--ended);   background: var(--ended-bg); }
.badge-unknown { color: var(--unknown); background: var(--unknown-bg); }

/* An estimate must never look like an observation, wherever it appears. */
.estimated::after {
  content: " (estimated)";
  color: var(--ink-muted);
  font-size: 0.85em;
}

.footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.95rem;
}
.footer p { margin: 0 0 0.5rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.55rem; }
  main { padding: 1.75rem 0 2rem; }
}

/* --- pages ---------------------------------------------------------------
 * Everything below is furniture for the device, brand, search and evidence pages.
 * The ordering rule holds throughout: the verdict is the largest thing on the page,
 * the working is legible, and the evidence sits at the bottom where it belongs.
 */

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

.search { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.25rem 0 0.75rem; }
.search input {
  flex: 1 1 22rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.search input:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.search button {
  padding: 0.7rem 1.1rem;
  font: 600 1rem/1 ui-sans-serif, system-ui, sans-serif;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

/* The verdict block: the first thing read, and the largest. */
.verdict { border-bottom: 1px solid var(--rule); padding-bottom: 1.25rem; }
.crumb { margin: 0 0 0.35rem; font-size: 0.95rem; }
.revision { color: var(--ink-muted); font-weight: 400; }
.verdict-line { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.5rem 0; }
.badge-large { font-size: 1.05rem; padding: 0.35rem 0.9rem; }
.gloss { margin: 0.25rem 0 0; font-size: 1.05rem; }
/* The sentence the engine wrote about why it said what it said. On this data it is most
   often a refusal, and it is the most valuable thing on the page. */
.reason {
  margin: 0.75rem 0 0;
  padding-left: 0.85rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-muted);
}

.facts dl { display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; }
.facts dt { font: 600 0.8rem/1.4 ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.facts dd { margin: 0.15rem 0 1.1rem; }
.break { overflow-wrap: anywhere; }

.feed, .hits, .siblings, .caveats, .timeline { list-style: none; margin: 0; padding: 0; }
.feed li, .hits li, .siblings li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
.feed li, .siblings li { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; }
.feed .when { margin-left: auto; }
.feed .reason { flex-basis: 100%; margin: 0.25rem 0 0; border: 0; padding: 0; font-size: 0.9rem; }
.hit-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; margin: 0 0 0.2rem; max-width: none; }
.caveats li { padding: 0.5rem 0; color: var(--ink-muted); max-width: var(--measure); }
.bucket { display: flex; gap: 0.75rem; align-items: baseline; font-size: 1rem; margin: 1.75rem 0 0.5rem; border: 0; padding: 0; }

.timeline li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.timeline .withdrawn { opacity: 0.65; }
.release-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; margin: 0; max-width: none; }
.version { font: 600 0.95rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.cves { margin: 0.35rem 0 0; font-size: 0.9rem; }
.evidence-link { margin: 0.35rem 0 0; font-size: 0.9rem; }
.timeline summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-muted); margin-top: 0.4rem; }
/* Changelogs are shown verbatim — the vagueness is the measurement, so it is not tidied. */
.changelog {
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font: 0.85rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Rankings and the compare table. The span leads the row because it is what the ranking
   claims; the badge follows because it qualifies it. */
.ranking { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranking li {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline;
  padding: 0.6rem 0; border-bottom: 1px solid var(--rule);
}
.rank-span { font-weight: 600; min-width: 7rem; }

/* A wide table on a small screen scrolls rather than shrinking the type. */
.compare-scroll { overflow-x: auto; }
.compare { border-collapse: collapse; min-width: 32rem; }
.compare th, .compare td {
  text-align: left; vertical-align: top;
  padding: 0.6rem 0.9rem 0.6rem 0; border-bottom: 1px solid var(--rule);
}
.compare thead th { border-bottom: 2px solid var(--rule); }
.compare tbody th { font: 600 0.8rem/1.5 ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); white-space: nowrap; }

/* --- accounts, watchlist ------------------------------------------------- */

.account-nav {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.watch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1.4rem;
}

.signin {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  max-width: 26rem;
  margin: 1.2rem 0;
}

.signin input[type="email"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button:hover { border-color: var(--ink); }

/* A button that is really a link: used where the action needs a POST (unwatching, signing
   out) but should not shout like a primary control. */
.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}

form.inline { display: inline; }

.signout { margin-top: 2rem; }

.error {
  color: var(--bad);
  font-weight: 600;
}
