/*
 * The bootloader check: a plain report, apart from the rest of the site's look. Light and neutral,
 * in the system's own typefaces, with a neutral dark version when the system asks for one. Prose
 * keeps a reading measure; the list and the agent prompt take the full width.
 */

:root {
  --sans: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bg: #fff;
  --surface: #f6f7f8;
  --text: #1d2125;
  --muted: #5b636b;
  --rule: #d8dce0;
  --link: #0b57b0;
  --bad: #a8261b;
  --bad-bg: #fcefed;
  --good: #19663a;
  --good-bg: #eaf6ee;
  --warn: #8a4b08;
  --warn-bg: #fdf3e2;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --surface: #1f2226;
    --text: #e4e6e8;
    --muted: #a0a7ae;
    --rule: #383d43;
    --link: #8cb8ef;
    --bad: #f3a397;
    --bad-bg: #3a2220;
    --good: #8fd3a6;
    --good-bg: #1b3124;
    --warn: #f0c27b;
    --warn-bg: #362a17;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0 16px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

p {
  margin: 0 0 1rem;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  overflow-wrap: anywhere;
}

.back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.prose {
  max-width: 42rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose strong {
  font-weight: 600;
}

section {
  margin-top: 3rem;
}

.intro {
  max-width: 46rem;
}

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

.intro h1 {
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.075rem;
}

.checked {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* The totals: a row of figures between rules, like a report's summary. */
.tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin: 1.5rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  list-style: none;
}

.tally li {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 0 1.25rem 1.25rem 0;
}

.tally b {
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tally span {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.tally--affected b {
  color: var(--bad);
}

.tally--ok b {
  color: var(--good);
}

.tally--unclear b {
  color: var(--warn);
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 0 3rem;
}

/* What installs with m-bootloader, original and updated check side by side. */
.outcomes {
  min-width: 0;
  font-size: 0.8rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--rule);
}

.outcomes caption {
  padding-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
}

.outcomes th,
.outcomes td {
  padding: 0.45rem 0.6rem;
}

.outcomes thead th {
  position: static;
}

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

/* The FM-1's screen as the check leaves it. */
.screen {
  display: inline-grid;
  gap: 0.1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  background: #1d2125;
  color: #f2f3f4;
  font: 0.9rem/1.3 var(--mono);
  letter-spacing: 0.06em;
}

h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Explanations as a list of terms, each opened to read in turn. */
.points {
  margin: 0 0 1.25rem;
  border-top: 1px solid var(--rule);
}

.points details {
  border-bottom: 1px solid var(--rule);
}

.points summary,
.callout summary {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.4rem;
  list-style: none;
  cursor: pointer;
}

.points summary::-webkit-details-marker,
.callout summary::-webkit-details-marker {
  display: none;
}

/* A small triangle that turns when the term is open. */
.points summary::before,
.callout summary::before {
  position: absolute;
  top: 0.95rem;
  left: 0.2rem;
  border-width: 0.3rem 0 0.3rem 0.45rem;
  border-style: solid;
  border-color: transparent transparent transparent var(--muted);
  content: "";
  transition: transform 0.15s;
}

.points details[open] > summary::before,
.callout[open] > summary::before {
  transform: rotate(90deg);
}

.points summary b {
  display: block;
  font-weight: 600;
}

.points summary span,
.callout summary span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.points details > :not(summary) {
  margin-left: 1.4rem;
  font-size: 0.95rem;
}

.points details > :last-child {
  margin-bottom: 0.9rem;
}

/* The hardware tests: a full-width box that opens. */
.callout {
  margin-top: 3rem;
  padding: 0 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.callout summary {
  padding: 1rem 0 1rem 1.4rem;
}

.callout summary::before {
  top: 1.4rem;
}

.callout h2 {
  display: inline;
  margin: 0;
  font-size: 1.15rem;
}

.callout .prose {
  max-width: none;
  padding: 0 0 0.5rem 1.4rem;
}

.points summary:focus-visible,
.callout summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* The agent prompt. */
.promptbox {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.promptbox pre {
  max-height: 26rem;
  margin: 0;
  padding: 3rem 1rem 1rem;
  overflow-y: auto;
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}

/* The list's search, filters and sorting. */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 0 0 1rem;
}

.controls[hidden] {
  display: none;
}

.search,
.pick {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.search {
  flex: 1 1 18rem;
}

.search input,
.pick select {
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.search input {
  flex: 1;
}

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* The status filters, as one segmented control. */
.filters {
  display: flex;
  flex-wrap: wrap;
}

.filters button {
  margin-left: -1px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
}

.filters button:first-child {
  margin-left: 0;
  border-radius: 4px 0 0 4px;
}

.filters button:last-child {
  border-radius: 0 4px 4px 0;
}

.filters button[aria-pressed="true"] {
  position: relative;
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.search input:focus-visible,
.pick select:focus-visible,
.filters button:focus-visible,
.copy:focus-visible,
.promptbox pre:focus-visible,
.tablewrap:focus-visible {
  position: relative;
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* The tables. */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 76rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.45;
}

th,
td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

tbody th a {
  text-decoration: none;
}

tbody th a:hover {
  text-decoration: underline;
}

.repo,
.why,
.corrected {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.repo {
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.corrected {
  color: var(--warn);
}

.why {
  margin-top: 0.25rem;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.date,
.muted {
  color: var(--muted);
}

.date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tag {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.pill {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill--affected {
  background: var(--bad-bg);
  color: var(--bad);
}

.pill--ok {
  background: var(--good-bg);
  color: var(--good);
}

.pill--unclear {
  background: var(--warn-bg);
  color: var(--warn);
}

.pill--other,
.pill--unchecked {
  border: 1px solid var(--rule);
  color: var(--muted);
  font-weight: 400;
}

.forks {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.forks summary {
  font-weight: 600;
  cursor: pointer;
}

.forks p {
  margin: 0.75rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.forks table {
  min-width: 36rem;
}

/* The list scrolls sideways on narrower screens, keeping each firmware's name in view. */
.firmwares tbody th,
.firmwares thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 11rem;
  background: var(--bg);
}

.firmwares thead th:first-child {
  z-index: 2;
  background: var(--surface);
}

.firmwares .fix {
  min-width: 16rem;
}

.fine {
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.fine h2,
.fine strong {
  color: var(--text);
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
