:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --border: #e3e3e3;
  --text: #191919;
  --text-2: #666666;
  --link: #1b64be;
  --meter-fill: #257de0;
  --meter-track: #cce3fd;
  --good: #0aac23;
  --warning: #fbb315;
  --serious: #f18a59;
  --critical: #dc3c3d;
  --neutral: #b5b5b5;
  --cell-ink: #191919;
  --tint-pq: #d3f2d8;
  --tint-classical: #fdeec4;
  --tint-tls12: #f8d4d4;
  --tint-unreachable: #e8e8e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #191919;
    --surface-2: #222222;
    --border: #383838;
    --text: #efefef;
    --text-2: #9c9c9c;
    --link: #84b9f3;
    --meter-fill: #338ced;
    --meter-track: #0e3d7e;
    --neutral: #6b6b6b;
    --cell-ink: #efefef;
    --tint-pq: #173d1e;
    --tint-classical: #46380f;
    --tint-tls12: #4a1d1d;
    --tint-unreachable: #2e2e2e;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--surface); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
h1 { font-size: 28px; line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 19px; margin: 36px 0 12px; }
.mono, code, .host { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.muted, .note, .sub { color: var(--text-2); }
.note { font-size: 14px; }
.lede { max-width: 70ch; color: var(--text-2); font-size: 16px; }

header.site { border-bottom: 1px solid var(--border); }
.trail { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; font-size: 15px; }
.trail a { color: var(--text-2); }
.trail a:hover { color: var(--text); }
.trail .brand { font-weight: 650; color: var(--text); }
.trail .step { white-space: nowrap; }
.trail .sep { color: var(--text-2); opacity: .5; padding: 0 10px; }
.meta { margin: 0 0 4px; color: var(--text-2); font-size: 14px; }
.meta .mono { font-size: 13px; }
h1 + .meta { margin-top: -2px; }
footer.site { max-width: 1200px; margin: 0 auto; padding: 20px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }


/* Region tiles */
.partition h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.partition-score { font-size: 14px; font-weight: 400; color: var(--text-2); }
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile > a, .tile > div { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.tile > a:hover { border-color: var(--meter-fill); text-decoration: none; }
.tile.empty > a, .tile.empty > div { background: var(--surface-2); }
.region-name { font-weight: 600; }
.region-desc { font-size: 13px; color: var(--text-2); min-height: 1.5em; }
.mini { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; margin-top: 6px; font-size: 13px; }
.mini-label { color: var(--text-2); }
.mini-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-count { font-size: 12px; color: var(--text-2); margin-top: auto; padding-top: 6px; }
.excluded .tile { opacity: .8; }

/* Status: color + icon + label, never color alone */
.status { white-space: nowrap; }
.status i, .cell i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--neutral); }
.s-pq i { background: var(--good); }
.s-classical i { background: var(--warning); }
.s-tls12 i { background: var(--critical); }
.s-unreachable i { background: var(--neutral); }
.pending { font-size: 12px; color: var(--text-2); border-bottom: 1px dotted var(--text-2); cursor: help; }
.warn { color: var(--critical); }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sortable thead th { cursor: pointer; user-select: none; }
.sortable thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 10px; }
.sortable thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 10px; }
td.host { word-break: break-all; }

/* Service grid: cell fill = status, with icon + short label */
table.grid td.cell { white-space: nowrap; color: var(--cell-ink); font-size: 13px; border-left: 2px solid var(--surface); }
table.grid td.s-pq { background: var(--tint-pq); }
table.grid td.s-classical { background: var(--tint-classical); }
table.grid td.s-tls12 { background: var(--tint-tls12); }
table.grid td.s-unreachable { background: var(--tint-unreachable); }
table.grid td.none { background: var(--surface-2); }
table.grid tbody th { font-weight: 400; white-space: nowrap; }

/* Changes */
.changes { list-style: none; padding: 0; margin: 0; }
.changes > li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.changes time { font-variant-numeric: tabular-nums; color: var(--text-2); margin-right: 6px; }
.changes ul { margin: 4px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }

.hero h1 { font-size: 34px; }

/* Compact grid: fixed narrow variant columns, row label takes the rest */
.grid-wrap { max-width: 1200px; }
table.grid { table-layout: fixed; }
table.grid thead th:not(:first-child) { width: 145px; }
table.grid thead th:first-child { width: auto; }
table.grid th, table.grid td { padding: 4px 10px; }
table.grid tbody th { overflow: hidden; text-overflow: ellipsis; }
.legend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.legend .status { color: var(--text-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

details.endpoints > summary { cursor: pointer; color: var(--link); margin-bottom: 10px; }
table.compact td, table.compact th { padding: 5px 10px; }
.changes > li.rollup { color: var(--text); }

/* Grid cells link to endpoint details */
table.grid td.cell { padding: 0; }
table.grid td.cell a { display: block; padding: 4px 10px; color: var(--cell-ink); }
table.grid td.cell a:hover { text-decoration: none; box-shadow: inset 0 0 0 2px var(--meter-fill); }

/* Endpoint details */
.details-list { border: 1px solid var(--border); border-radius: 8px; }
details.ep { border-bottom: 1px solid var(--border); }
details.ep:last-child { border-bottom: 0; }
details.ep > summary { cursor: pointer; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
details.ep > summary { list-style: none; }
details.ep > summary::-webkit-details-marker { display: none; }
details.ep > summary::before { content: "▸"; color: var(--text-2); width: 1em; flex: none; margin-right: -6px; }
details.ep[open] > summary::before { content: "▾"; }
details.ep > summary .host { font-weight: 600; }
details.ep[open] > summary { background: var(--surface-2); }
details.ep:target > summary { box-shadow: inset 3px 0 0 var(--meter-fill); }
.ep-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 32px; padding: 4px 16px 12px; }
.ep-body h3 { font-size: 14px; margin: 12px 0 6px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.ep-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
.ep-body dt { color: var(--text-2); }
.ep-body dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fp { font-size: 12px; }
.chain { margin: 0; padding-left: 20px; font-size: 14px; }
.chain li { margin-bottom: 6px; }

/* Grid: row labels wrap with the id beneath; on narrow screens the table
   scrolls sideways with the label column pinned. */
table.grid { min-width: 640px; }
table.grid thead th:first-child { width: 220px; }
table.grid thead th:not(:first-child) { width: auto; }
table.grid tbody th { white-space: normal; overflow: visible; line-height: 1.3; padding-top: 6px; padding-bottom: 6px; }
table.grid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.grid thead th:first-child { background: var(--surface-2); z-index: 2; }
.row-note { display: block; font-size: 12px; color: var(--text-2); }
@media (min-width: 900px) { table.grid thead th:first-child { width: 280px; } }
.row-note { overflow-wrap: anywhere; }
.table-wrap > table:not(.grid) { min-width: 560px; }
@media (max-width: 600px) {
  table.grid { min-width: 560px; }
  table.grid thead th:first-child { width: 150px; }
  table.grid tbody th { font-size: 14px; }
}

/* Grid cells: marker and label centered vertically in the cell */
table.grid td.cell { vertical-align: middle; }
table.grid td.cell a { display: flex; align-items: center; gap: 6px; min-height: 100%; }
table.grid td.cell i { margin: 0; flex: none; vertical-align: 0; }
table.grid tbody th { vertical-align: middle; }

/* Segmented bars: post-quantum in blues, classical in grays, TLS 1.2 red.
   A 2px surface gap separates segments. */
.segbar { display: flex; gap: 2px; height: 10px; margin: 10px 0 8px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.segbar > span { display: block; height: 100%; min-width: 2px; }
.mini .segbar { grid-column: 1 / -1; height: 6px; margin: 2px 0 0; }
:root { --pq-0: #257de0; --pq-1: #6aabf1; --pq-2: #b6d5f8; --cl-0: #6b6b6b; --cl-1: #949494; --cl-2: #b5b5b5; --cl-3: #d0d0d0; --old: #dc3c3d; }
@media (prefers-color-scheme: dark) {
  :root { --pq-0: #1f6fd0; --pq-1: #84b9f3; --pq-2: #cce3fd; --cl-0: #5a5a5a; --cl-1: #6b6b6b; --cl-2: #555555; --cl-3: #444444; }
}
.seg-pq-0 { background: var(--pq-0); } .seg-pq-1 { background: var(--pq-1); } .seg-pq-2 { background: var(--pq-2); }
.seg-cl-0 { background: var(--cl-0); } .seg-cl-1 { background: var(--cl-1); } .seg-cl-2 { background: var(--cl-2); } .seg-cl-3 { background: var(--cl-3); }
.seg-old { background: var(--old); }
.seglegend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; }
.seglegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--tint-classical); color: var(--cell-ink); vertical-align: middle; white-space: nowrap; }

/* New statuses */
.s-invalid_cert i { background: var(--serious); }
.s-retired i { background: var(--border); }
:root { --tint-invalid: #fbe0d2; --tint-retired: #f0f0f0; }
@media (prefers-color-scheme: dark) { :root { --tint-invalid: #4a2a1b; --tint-retired: #262626; } }
table.grid td.s-invalid_cert { background: var(--tint-invalid); }
/* Invalid certificate: still counted by key exchange, outlined in red. */
td.bad-cert { box-shadow: inset 0 0 0 2px var(--serious); }
.cell-key.bad-cert { display: inline-block; padding: 0 6px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--serious); }
table.hosts td.cell { font-weight: 600; font-size: 13px; white-space: nowrap; }
table.hosts td.s-pq { background: var(--tint-pq); }
table.hosts td.s-classical { background: var(--tint-classical); }
table.hosts td.s-tls12 { background: var(--tint-tls12); }
table.hosts td.s-unreachable { background: var(--tint-unreachable); }
table.hosts td.s-retired { background: var(--tint-retired); color: var(--text-2); }
table.grid td.s-retired { background: var(--tint-retired); color: var(--text-2); }

/* Score blocks: full width, key exchange above certificates, tall bars
   with labels inside the segments that fit them. */
.scoreblocks { display: grid; gap: 22px; margin: 20px 0 8px; }
.score-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.score-head .label { font-weight: 600; font-size: 18px; }
.score-head .value { font-size: 40px; font-weight: 600; line-height: 1; }
.score-head .sub { color: var(--text-2); font-size: 14px; }
.tallbar { display: flex; gap: 2px; height: 28px; margin-bottom: 8px; }
.tallbar > span { display: flex; align-items: center; min-width: 2px; height: 100%; border-radius: 4px; padding: 0 8px; overflow: hidden; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; color: #191919; }
.tallbar > span:empty { padding: 0; }
.tallbar b { font-weight: 600; margin-right: 6px; }
.tallbar > .seg-pq-0, .tallbar > .seg-cl-0, .tallbar > .seg-old { color: #ffffff; }
@media (prefers-color-scheme: dark) { .tallbar > .seg-cl-1, .tallbar > .seg-cl-2, .tallbar > .seg-cl-3 { color: #efefef; } }
@media (max-width: 600px) { .tallbar > span { font-size: 11px; padding: 0 5px; } .tallbar b { display: none; } }


/* Leaderboard */
.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.leaderboard a { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 2fr) minmax(180px, 2fr); gap: 8px 24px; align-items: center; padding: 14px 18px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.leaderboard a:hover { border-color: var(--meter-fill); text-decoration: none; }
.lb-name { font-size: 20px; font-weight: 600; display: flex; flex-direction: column; }
.lb-count { font-size: 13px; font-weight: 400; color: var(--text-2); }
.lb-score { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; font-size: 13px; }
.lb-score .segbar { grid-column: 1 / -1; height: 8px; margin: 4px 0 0; }
.lb-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .leaderboard a { grid-template-columns: 1fr; }
}

/* Filter box and dense listings */
.filter { width: 100%; max-width: 420px; padding: 9px 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: 8px 0 16px; }
.search-results { list-style: none; margin: -6px 0 20px; padding: 0; max-width: 720px; }
.search-results li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.search-results li:last-child { border-bottom: 0; }
.filter:focus { outline: 2px solid var(--meter-fill); outline-offset: 1px; }
table.dense td, table.dense th { padding: 5px 10px; }
table.dense td { vertical-align: middle; }
.barcell { display: grid; grid-template-columns: 3.2em minmax(60px, 1fr); align-items: center; gap: 8px; min-width: 150px; }
.barcell .segbar { margin: 0; height: 6px; }
.barcell .pct { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 28px; }
.group-head h2, .group-head h3 { margin: 0; }
table.aligned { table-layout: fixed; }
table.aligned .c-name { width: 34%; }
table.aligned .c-num { width: 10%; }
table.aligned .c-bar { width: 28%; }
table.aligned td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sites { table-layout: fixed; }
table.sites col.c-site { width: 13%; }
table.sites col.c-n { width: 10%; }
table.sites col.c-kx { width: 22%; }
table.sites th { white-space: normal; vertical-align: bottom; }
table.sites td:nth-child(4), table.sites th:nth-child(4) { border-left: 1px solid var(--border, #e5e5e5); }
[hidden] { display: none !important; }

/* Space between the score blocks and what follows them */
.hero + section, .scoreblocks + h2, .scoreblocks + section { margin-top: 28px; }
/* Section headings on home: same ink whether or not they link */
.group-head h2 a { color: var(--text); }
.group-head h2 a::after { content: " →"; color: var(--text-2); font-weight: 400; }
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  table.aligned { min-width: 0 !important; }
  table.aligned col.c-num, table.aligned td:nth-child(2), table.aligned th:nth-child(2) { display: none; }
  table.aligned .barcell { grid-template-columns: auto; min-width: 0; }
  table.aligned .barcell .segbar { display: none; }
  table.aligned .c-name { width: 50%; }
}
.meta + .table-wrap { margin-top: 16px; }
/* A segment labeled inside the bar needs no legend entry, except on
   phones, where the bar hides its labels. */
@media (min-width: 601px) { .seglegend .inbar { display: none; } }
@media (max-width: 600px) { table.aligned thead th { white-space: normal; vertical-align: bottom; font-size: 13px; } table.aligned th, table.aligned td { padding-left: 6px; padding-right: 6px; } }
