/* version: 0.1.0 | build: 2026-09-17 | update: 2026-09-17 */
/* MySoftRank - the live software index.
   Color carries meaning: amber = rank, green = fresh, clay = aging, rust = stale.
   Everything else stays in petrol ink on cool paper. */

:root {
  --ink: #10232a;
  --ink-2: #3d525a;
  --ink-3: #5e6e75;
  --paper: #f4f7f6;
  --surface: #ffffff;
  --sunken: #e9efed;
  --line: #d5dedb;
  --line-strong: #b7c4c0;
  /* The boundary that identifies a control must clear 3:1 (WCAG 1.4.11). */
  --control-border: #7c948c;
  --rank: #c98a06;
  /* Amber is a fill colour; text needs the darker ramp to clear 4.5:1. */
  --rank-text: #906304;
  --rank-soft: #fdf1d6;
  --fresh: #157a57;
  --fresh-soft: #dcf2e8;
  --aging: #995d23;
  --aging-soft: #fbead8;
  --stale: #b1402d;
  --stale-soft: #f8e0db;
  --focus: #2f6fd6;
  --petrol: #0f4c57;
  --petrol-soft: #dbeceb;
  --shadow: 0 1px 0 rgba(16, 35, 42, .04), 0 8px 24px -12px rgba(16, 35, 42, .18);
  /* Panels that invert the page: the pair flips together, never just the background. */
  --inverse-bg: var(--ink);
  --inverse-fg: var(--paper);
  --inverse-fg-2: #c5d6d2;
  --radius: 10px;
  --radius-sm: 6px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  /* Optimized for full-width data analysis: expands seamlessly across viewports. */
  --wrap: 100%;
  --wrap-wide: 100%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6efec;
    --ink-2: #b4c4c0;
    --ink-3: #8a9d98;
    --paper: #0b1a1f;
    --surface: #11252c;
    --sunken: #0e2026;
    --line: #22404a;
    --line-strong: #2f5561;
    --control-border: #6e8b93;
    --rank: #f0b73c;
    --rank-soft: #3a2c0c;
    --rank-text: #f0b73c;
    --fresh: #3fcf95;
    --fresh-soft: #0f3528;
    --aging: #e39a52;
    --aging-soft: #3a2612;
    --stale: #f07a64;
    --stale-soft: #3d1a14;
    --focus: #7fb0ff;
    --petrol: #7fd1d5;
    --petrol-soft: #123a40;
    --inverse-bg: #06121a;
    --inverse-fg: #dfe9e6;
    --inverse-fg-2: #9fb6b1;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  font-feature-settings: "tnum" 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -.01em;
}

p {
  margin: 0;
}

.mono,
code,
time,
.num {
  font-family: var(--mono);
  font-size: .92em;
}

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

.muted {
  color: var(--ink-3);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 99;
}

.skip:focus {
  top: 12px;
}

/* The shell width is a body-level token, so header, content and footer of a
   wide page stay on the same gutters. Pages opt in with `@section("shell", "wide")`. */
body[data-shell="wide"] {
  --wrap: var(--wrap-wide);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 28px;
  }
}

@media (min-width: 1440px) {
  .wrap {
    padding: 0 36px;
  }
}

.stack > * + * {
  margin-top: var(--gap, 16px);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head p {
  color: var(--ink-2);
  max-width: 60ch;
  margin-top: 6px;
}

.eyebrow {
  font: 600 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--petrol);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 800 1.2rem/1 var(--display);
  letter-spacing: -.03em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand b {
  color: var(--rank-text);
  font-weight: 800;
}

.nav {
  display: none;
  gap: 4px;
}

.nav a {
  white-space: nowrap;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: .94rem;
}

.nav a:hover {
  background: var(--sunken);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--rank);
  border-radius: 0;
}

.header-search {
  flex: 1;
  display: none;
  max-width: 420px;
  margin-left: auto;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.locale-switch {
  display: flex;
  gap: 2px;
  font: 600 .72rem/1 var(--mono);
}

.locale-switch a {
  padding: 6px 6px;
  text-decoration: none;
  color: var(--ink-3);
  border-radius: 4px;
}

.locale-switch a[aria-current="true"] {
  color: var(--ink);
  background: var(--sunken);
}

.menu-toggle {
  margin-left: auto;
}

.site-header .header-actions {
  display: none;
}

@media (min-width: 1080px) {
  .site-header .nav {
    display: flex;
  }

  .site-header .header-actions {
    display: flex;
    margin-left: auto;
  }

  .site-header .menu-toggle {
    display: none;
  }
}

@media (min-width: 1280px) {
  .site-header .header-search {
    display: block;
    margin-left: 12px;
  }

  .site-header .header-actions {
    margin-left: 0;
  }
}

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 12px 0 16px;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  font-weight: 600;
}

.mobile-nav[hidden] {
  display: none;
}

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--ink);
  font: 600 .94rem/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--ink-3);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn-primary:hover {
  background: var(--petrol);
  border-color: var(--petrol);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: .86rem;
}

.btn[aria-busy="true"] {
  opacity: .7;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.label {
  font-weight: 600;
  font-size: .9rem;
}

.hint {
  color: var(--ink-3);
  font-size: .84rem;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem/1.4 var(--body);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select {
  border-color: var(--stale);
}

.error-text {
  color: var(--stale);
  font-size: .86rem;
  font-weight: 600;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--ink);
}

.search {
  position: relative;
}

.search .input {
  padding-left: 40px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-lg .input {
  min-height: 58px;
  font-size: 1.1rem;
  padding-left: 48px;
  padding-right: 120px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-lg svg {
  left: 16px;
  width: 22px;
  height: 22px;
}

.search-lg .btn {
  position: absolute;
  right: 7px;
  top: 7px;
  min-height: 44px;
}

/* ---------- chips, badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-2);
}

.chip:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.chip[aria-current="true"],
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.chip .count {
  font: 500 .74rem/1 var(--mono);
  color: inherit;
  opacity: .7;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font: 600 .72rem/1.2 var(--mono);
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--sunken);
  color: var(--ink-2);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.plain::before {
  display: none;
}

.badge-fresh {
  background: var(--fresh-soft);
  color: var(--fresh);
}

.badge-aging {
  background: var(--aging-soft);
  color: var(--aging);
}

.badge-stale {
  background: var(--stale-soft);
  color: var(--stale);
}

.badge-rank {
  background: var(--rank-soft);
  color: var(--rank-text);
}

.badge-verified {
  background: var(--petrol-soft);
  color: var(--petrol);
}

.badge-sponsored {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink-3);
}

/* ---------- monogram ---------- */
.mono-tile {
  --h: 180;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font: 800 1rem/1 var(--display);
  letter-spacing: -.04em;
  color: hsl(var(--h) 55% 22%);
  background: hsl(var(--h) 60% 88%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 40% 70% / .5);
}

.mono-tile.lg {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
  border-radius: 16px;
}

.mono-tile.sm {
  width: 32px;
  height: 32px;
  font-size: .8rem;
  border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mono-tile {
    color: hsl(var(--h) 70% 85%);
    background: hsl(var(--h) 35% 22%);
  }
}

/* ---------- stars ---------- */
.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--rank);
  vertical-align: middle;
}

.stars svg {
  width: 14px;
  height: 14px;
}

.stars .none {
  color: var(--line-strong);
}

/* ---------- signature: freshness strip ---------- */
.strip {
  display: inline-grid;
  grid-template-columns: repeat(12, 5px);
  gap: 2px;
  align-items: end;
  height: 22px;
}

.strip i {
  display: block;
  width: 5px;
  border-radius: 1px;
  background: var(--fresh);
  min-height: 2px;
  opacity: .9;
}

.strip i.zero {
  background: var(--line);
  opacity: 1;
}

.strip.aging i:not(.zero) {
  background: var(--aging);
}

.strip.stale i:not(.zero) {
  background: var(--stale);
}

.strip.lg {
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  height: 64px;
  width: 100%;
}

.strip.lg i {
  width: 100%;
  border-radius: 2px;
}

.strip-axis {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  font: 500 .66rem/1 var(--mono);
  color: var(--ink-3);
  margin-top: 6px;
  text-align: center;
}

/* ---------- rank chip ---------- */
.rank {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--mono);
}

.rank-pos {
  font: 700 1.05rem/1 var(--mono);
  color: var(--rank-text);
}

.rank-pos::before {
  content: "#";
  opacity: .6;
  margin-right: 1px;
}

.rank-score {
  font-weight: 600;
  font-size: .88rem;
}

.delta {
  font: 600 .74rem/1 var(--mono);
}

.delta.up {
  color: var(--fresh);
}

.delta.down {
  color: var(--stale);
}

.delta.flat {
  color: var(--ink-3);
}

/* ---------- cards & ranked rows ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.card.pad-lg {
  padding: 28px;
}

.card-link {
  text-decoration: none;
  display: block;
  transition: border-color .15s, transform .15s;
}

.card-link:hover {
  border-color: var(--ink-3);
}

.ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.ranked-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px;
  align-items: start;
}

.ranked-row .pos {
  font: 700 1.3rem/44px var(--mono);
  color: var(--rank-text);
  text-align: center;
}

.ranked-row .body {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
}

.ranked-row h3 a {
  text-decoration: none;
}

.ranked-row h3 a:hover {
  text-decoration: underline;
}

.ranked-row .summary {
  color: var(--ink-2);
  font-size: .94rem;
  margin-top: 2px;
}

.ranked-row .meta {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
  font-size: .84rem;
  color: var(--ink-3);
}

.ranked-row .side {
  grid-column: 1 / -1;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 4px;
}

@media (min-width: 860px) {
  .ranked-row {
    grid-template-columns: 56px 1fr 300px;
    align-items: center;
  }

  .ranked-row .side {
    grid-column: auto;
    justify-content: flex-end;
    padding-top: 0;
  }
}

/* ---------- signature: rank receipt ---------- */
.receipt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: .86rem;
  position: relative;
}

.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 8px;
  background: radial-gradient(circle at 6px -1px, transparent 6px, var(--surface) 6.5px) 0 0 / 12px 8px repeat-x;
  filter: drop-shadow(0 1px 0 var(--line));
}

.receipt-head {
  padding: 16px 18px 12px;
  border-bottom: 1px dashed var(--line-strong);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.receipt-head .score {
  font: 700 2.2rem/1 var(--mono);
  letter-spacing: -.04em;
}

.receipt-head .score small {
  font-size: .9rem;
  color: var(--ink-3);
  font-weight: 500;
}

.receipt-lines {
  list-style: none;
  margin: 0;
  padding: 10px 18px;
}

.receipt-lines li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 7px 0;
}

.receipt-lines .name {
  font-family: var(--body);
  font-weight: 600;
  font-size: .88rem;
}

.receipt-lines .calc {
  color: var(--ink-3);
  font-size: .78rem;
}

.receipt-lines .pts {
  text-align: right;
  font-weight: 600;
}

.receipt-lines .bar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--sunken);
  border-radius: 2px;
  overflow: hidden;
}

.receipt-lines .bar span {
  display: block;
  height: 100%;
  background: var(--ink-2);
}

.receipt-lines .bar.freshness span {
  background: var(--fresh);
}

.receipt-foot {
  border-top: 1px dashed var(--line-strong);
  padding: 12px 18px 18px;
  color: var(--ink-3);
  font-size: .76rem;
  display: grid;
  gap: 4px;
}

.receipt-foot strong {
  color: var(--ink);
  font-weight: 600;
}

details.receipt-toggle > summary {
  cursor: pointer;
  list-style: none;
  font: 600 .78rem/1 var(--mono);
  color: var(--petrol);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

details.receipt-toggle > summary::-webkit-details-marker {
  display: none;
}

details.receipt-toggle > summary::before {
  content: "+";
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-size: .7rem;
}

details.receipt-toggle[open] > summary::before {
  content: "-";
}

details.receipt-toggle[open] .receipt {
  margin-top: 12px;
}

/* ---------- hero + live ledger ---------- */
.hero {
  padding: 40px 0 56px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
}

.hero-grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 56px;
  }
}

.hero h1 {
  max-width: 13ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--rank);
}

.hero .lede {
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 18px 0 26px;
}

.kind-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.ledger {
  background: var(--ink);
  color: #dfe9e6;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: .82rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ledger {
    background: #06121a;
    border: 1px solid var(--line);
  }
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #9fb6b1;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.ledger-live {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #6ee7b7;
}

.ledger-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.ledger ol {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.ledger li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 16px;
  opacity: 0;
  transform: translateY(6px);
  animation: row-in .5s ease forwards;
}

.ledger li:nth-child(2) {
  animation-delay: .08s;
}

.ledger li:nth-child(3) {
  animation-delay: .16s;
}

.ledger li:nth-child(4) {
  animation-delay: .24s;
}

.ledger li:nth-child(5) {
  animation-delay: .32s;
}

.ledger li:nth-child(6) {
  animation-delay: .4s;
}

.ledger li:nth-child(7) {
  animation-delay: .48s;
}

.ledger li + li {
  border-top: 1px solid rgba(255, 255, 255, .05);
}

.ledger .ago {
  color: #7f9893;
  white-space: nowrap;
}

.ledger .what a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.ledger .what a:hover {
  text-decoration: underline;
}

.ledger .what .src {
  display: block;
  color: #8fb3ad;
  font-size: .72rem;
  margin-top: 2px;
}

.ledger .delta.up {
  color: #6ee7b7;
}

.ledger .delta.down {
  color: #fca5a5;
}

.ledger .delta.flat {
  color: #7f9893;
}

.ledger-foot {
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #9fb6b1;
  font-size: .74rem;
}

@keyframes row-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- publish pipeline (a real sequence) ---------- */
.pipeline {
  display: grid;
  gap: 12px;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 860px) {
  .pipeline {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pipeline li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
}

.pipeline li::before {
  content: counter(step);
  font: 700 .74rem/1 var(--mono);
  color: var(--paper);
  background: var(--ink);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.pipeline p {
  color: var(--ink-2);
  font-size: .92rem;
  margin-top: 6px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ---------- category tiles ---------- */
.cat-tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.cat-tile .kind {
  font: 600 .68rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.cat-tile h3 {
  margin-top: 6px;
}

.cat-tile .count {
  font: 600 1.3rem/1 var(--mono);
  color: var(--ink-3);
}

/* ---------- profile ---------- */
.profile-head {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.crumbs {
  font-size: .84rem;
  color: var(--ink-3);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.crumbs a {
  color: var(--ink-2);
}

.profile-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}

.profile-title .pitch {
  color: var(--ink-2);
  font-size: 1.08rem;
  margin-top: 6px;
  max-width: 60ch;
}

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: .88rem;
  color: var(--ink-2);
  align-items: center;
}

.profile-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.profile-body {
  display: grid;
  gap: 28px;
  padding: 32px 0 64px;
}

@media (min-width: 980px) {
  .profile-body {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }

  .profile-aside {
    position: sticky;
    top: 88px;
  }
}

.subnav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.subnav a {
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.subnav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--rank);
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: .92rem;
}

.kv dt {
  color: var(--ink-3);
}

.kv dd {
  margin: 0;
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tag-list li {
  padding: 4px 10px;
  background: var(--sunken);
  border-radius: 4px;
  font-size: .86rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}

.timeline li:first-child {
  border-top: 0;
}

.timeline .v {
  font: 600 .9rem/1.3 var(--mono);
}

.source-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: .88rem;
}

.source-row:first-child {
  border-top: 0;
}

.source-row .url {
  font: 400 .78rem/1.3 var(--mono);
  color: var(--ink-3);
  overflow-wrap: anywhere;
  grid-column: 1 / -1;
}

/* ---------- reviews ---------- */
.review {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.review:first-child {
  border-top: 0;
  padding-top: 0;
}

.review h3 {
  font-size: 1.02rem;
}

.review .who {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: .84rem;
  color: var(--ink-3);
  margin-top: 6px;
  flex-wrap: wrap;
}

.review dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  font-size: .94rem;
}

.review dt {
  font: 600 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
}

.review dd {
  margin: 2px 0 0;
}

.vendor-reply {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--petrol);
  background: var(--petrol-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .9rem;
}

.dist {
  display: grid;
  gap: 6px;
  font-size: .84rem;
}

.dist-row {
  display: grid;
  grid-template-columns: 28px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.dist-row .bar {
  height: 8px;
  background: var(--sunken);
  border-radius: 4px;
  overflow: hidden;
}

.dist-row .bar span {
  display: block;
  height: 100%;
  background: var(--rank);
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th {
  text-align: left;
  font: 600 .7rem/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--sunken);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data td.num,
table.data th.num {
  text-align: right;
}

/* ---------- layout helpers for listing pages ---------- */
.page-head {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-head p {
  color: var(--ink-2);
  margin-top: 10px;
  max-width: 64ch;
}

.with-filters {
  display: grid;
  gap: 24px;
  padding: 28px 0 64px;
}

@media (min-width: 980px) {
  .with-filters {
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
  }

  .filters {
    position: sticky;
    top: 88px;
  }
}

.filters fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

.filters legend {
  font: 600 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.filters .check {
  font-size: .92rem;
  padding: 3px 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}

.lane {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.lane-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .8rem;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* ---------- states ---------- */
.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .94rem;
}

.notice strong {
  display: block;
}

.notice-success {
  border-color: color-mix(in srgb, var(--fresh) 45%, transparent);
  background: var(--fresh-soft);
}

.notice-error {
  border-color: color-mix(in srgb, var(--stale) 45%, transparent);
  background: var(--stale-soft);
}

.notice-warning {
  border-color: color-mix(in srgb, var(--aging) 45%, transparent);
  background: var(--aging-soft);
}

.notice-info {
  border-color: color-mix(in srgb, var(--petrol) 35%, transparent);
  background: var(--petrol-soft);
}

.empty {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty h2 {
  font-size: 1.3rem;
}

.empty p {
  color: var(--ink-2);
  margin: 8px auto 18px;
  max-width: 46ch;
}

.skeleton {
  background: linear-gradient(90deg, var(--sunken) 0%, var(--line) 50%, var(--sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
  min-height: 14px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- stepper ---------- */
.stepper {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}

.stepper li::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.stepper li:last-child::before {
  display: none;
}

.stepper .dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 .8rem/1 var(--mono);
  border: 2px solid var(--line-strong);
  background: var(--surface);
}

.stepper li.done .dot {
  background: var(--fresh);
  border-color: var(--fresh);
  color: var(--inverse-bg);
}

.stepper li.current .dot {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* ---------- compare tray ---------- */
.compare-tray {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 50;
  width: min(760px, calc(100% - 24px));
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  padding: 10px 12px 10px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5);
}

.compare-tray[hidden] {
  display: none;
}

.compare-tray .items {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.compare-tray .items span {
  background: rgba(255, 255, 255, .1);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .84rem;
  white-space: nowrap;
}

.compare-tray .btn {
  background: var(--rank);
  color: #1b1300;
  border-color: var(--rank);
}

.compare-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: .84rem;
  color: var(--ink-2);
  cursor: pointer;
}

.compare-toggle input {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
}

/* ---------- compare matrix ---------- */
.matrix th[scope="row"] {
  font-weight: 600;
  font-family: var(--body);
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
  color: var(--ink-2);
  background: var(--surface);
}

.matrix td.num {
  text-align: left;
}

.matrix .best {
  box-shadow: inset 3px 0 0 var(--rank);
  font-weight: 700;
}

.yes {
  color: var(--fresh);
  font-weight: 700;
}

.no {
  color: var(--ink-3);
}

/* ---------- console (vendor + admin) ---------- */
.console {
  display: grid;
  gap: 24px;
  padding: 28px 0 64px;
}

@media (min-width: 980px) {
  .console {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }
}

.console-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

@media (min-width: 980px) {
  .console-nav {
    flex-direction: column;
    position: sticky;
    top: 88px;
  }
}

.console-nav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-2);
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.console-nav a:hover {
  background: var(--sunken);
}

.console-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.stat {
  padding: 16px 18px;
}

.stat .label {
  font: 600 .7rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.stat .value {
  font: 700 1.9rem/1.1 var(--mono);
  letter-spacing: -.03em;
  margin-top: 8px;
}

.stat .foot {
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 4px;
}

.meter {
  height: 8px;
  background: var(--sunken);
  border-radius: 4px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--rank);
}

.meter.risk span {
  background: var(--stale);
}

pre.code {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font: 400 .82rem/1.55 var(--mono);
  margin: 0;
}

/* ---------- pricing ---------- */
.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan .price {
  font: 700 2rem/1 var(--mono);
  letter-spacing: -.03em;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: .94rem;
}

.plan ul li::before {
  content: "+ ";
  font-family: var(--mono);
  color: var(--fresh);
  font-weight: 700;
}

.plan.featured {
  border-color: var(--ink);
  box-shadow: inset 0 3px 0 var(--rank);
}

.guarantee {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--inverse-bg);
  color: var(--inverse-fg);
}

.guarantee .eyebrow {
  color: var(--rank);
}

.guarantee p {
  color: var(--inverse-fg-2);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 40px 0 28px;
  font-size: .9rem;
  color: var(--ink-2);
  margin-top: 0;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }
}

.site-footer h2 {
  font: 600 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.site-footer a {
  text-decoration: none;
}

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

.footer-base {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .ledger li {
    opacity: 1;
    transform: none;
  }
}

/* Focus must never sit under the fixed compare tray (WCAG 2.4.11). */
:root {
  scroll-padding-bottom: 96px;
  scroll-padding-top: 104px;
}

body:has(.compare-tray:not([hidden])) {
  padding-bottom: 88px;
}

.compare-tray .btn[aria-disabled="true"] {
  opacity: .6;
}

/* Sections targeted by the profile sub-nav clear the sticky header. */
.profile-body section[id],
.profile-aside[id] {
  scroll-margin-top: 104px;
}

/* Scrollable tables are focusable regions; show they can be scrolled. */
.table-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
