/* ==========================================================================
   Components: top bar, buttons, slabs, toggles, legends, tables, tooltip,
   key-figure tiles, ranked rows. Glass surfaces with a warm rim, soft glows on
   hover and focus, smooth transitions. Labels are sentence case.
   ========================================================================== */

/* ---- Top bar ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.94), rgba(8, 11, 22, 0.88));
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
}

/* The bar's lower edge catches light */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(150, 170, 230, 0.1),
    rgba(150, 170, 230, 0.14) 38%,
    rgba(255, 214, 128, 0.5) 58%,
    rgb(255 240 214 / 0.8) 66%,
    rgba(255, 214, 128, 0.5) 74%,
    rgba(150, 170, 230, 0.12) 94%
  );
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100% - var(--gutter) * 2, var(--wrap-wide));
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font: 600 15px var(--font-sans);
  color: var(--text);
}
.brand svg {
  width: 24px;
  height: 24px;
  transition: transform 500ms var(--ease-out);
}
.brand:hover svg {
  transform: translateY(-1px) scale(1.1);
}

.nav {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  padding-inline: 14px;
}
.nav::-webkit-scrollbar {
  display: none;
}
.nav a {
  position: relative;
  flex: none;
  padding: 8px 11px;
  border-radius: 8px;
  font: 500 13.5px var(--font-sans);
  color: var(--text-3);
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}
.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav a[aria-current="true"] {
  color: var(--cream-hot);
}
.nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 230, 168, 0), var(--cream), rgba(255, 230, 168, 0));
  box-shadow: 0 0 10px rgba(255, 214, 128, 0.7);
}

@media (max-width: 760px) {
  .brand span {
    display: none;
  }
}

/* ---- Buttons (pills with a rim) ----------------------------------------- */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font: 600 14px/1 var(--font-sans);
  white-space: nowrap;
  color: var(--text);
  background: linear-gradient(180deg, #080b16, #05070f);
  box-shadow:
    0 0 0 1px rgba(255, 238, 204, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    box-shadow 220ms ease,
    transform 200ms var(--ease-out),
    color 160ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1.25px rgba(255, 238, 204, 0.7),
    0 0 18px -4px rgba(255, 230, 168, 0.5),
    inset 0 0 12px rgba(255, 230, 168, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms var(--ease-out);
}
.btn:hover svg {
  transform: translateX(2px);
}

.btn--primary {
  color: #fff6e4;
  background:
    radial-gradient(120% 110% at 50% 135%, rgba(255, 196, 92, 0.46), transparent 64%),
    linear-gradient(180deg, #0c0a10, #17110a);
  box-shadow:
    0 0 0 1.25px rgb(255 236 214 / 0.86),
    0 0 10px 1px rgba(255, 190, 90, 0.5),
    0 0 30px 2px rgba(255, 190, 90, 0.18),
    inset 0 0 14px rgba(255, 190, 90, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn--primary:hover {
  box-shadow:
    0 0 0 1.5px #fff6ea,
    0 0 14px 2px rgba(255, 190, 90, 0.75),
    0 0 44px 6px rgba(255, 190, 90, 0.26),
    inset 0 0 18px rgba(255, 190, 90, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn--sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 200ms ease;
}
.icon-btn:hover {
  color: var(--cream-hot);
  border-color: var(--line-cream-2);
  background: rgba(255, 230, 168, 0.06);
  box-shadow: 0 0 14px -4px rgba(255, 214, 128, 0.5);
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}
.icon-btn[data-done="true"] {
  color: #7ee0a8;
  border-color: rgba(126, 224, 168, 0.4);
}

/* ---- Slabs and figure frames ------------------------------------------- */

.slab {
  position: relative;
  border-radius: var(--radius-slab);
  padding: clamp(16px, 2vw, 28px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 36%),
    var(--night-2);
  border: 1px solid var(--line-cool);
  box-shadow:
    0 30px 70px -34px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 238, 204, 0.08);
  transition: border-color 260ms ease, box-shadow 320ms ease;
}
.slab::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 1px;
  border-radius: var(--radius-slab) var(--radius-slab) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 238, 204, 0.5) 16%, rgba(150, 170, 230, 0.18) 58%, transparent);
  pointer-events: none;
}
.slab:hover {
  border-color: rgba(190, 200, 235, 0.24);
  box-shadow:
    0 34px 80px -34px rgba(0, 0, 0, 0.95),
    0 0 46px -26px rgba(255, 214, 128, 0.28),
    inset 0 1px 0 rgba(255, 238, 204, 0.1);
}

.fig {
  display: grid;
  gap: 16px;
  margin: 0;
}
.fig-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 20px;
}
.fig-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.fig-title h3 {
  font-size: clamp(18px, 1.5vw, 21px);
}
.fig-title p {
  font-size: 14px;
  color: var(--text-3);
  max-width: 72ch;
}
.fig-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fig-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line-1);
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-4);
}

/* Callout: a glass note with a warm edge. An icon is optional. */
.callout {
  position: relative;
  padding: 14px 18px 14px 20px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-cream);
  background: linear-gradient(180deg, rgba(255, 230, 168, 0.05), rgba(255, 230, 168, 0.015));
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-2);
  transition: border-color 240ms ease, box-shadow 300ms ease;
}
.callout::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cream);
  box-shadow: 0 0 12px -1px rgba(255, 214, 128, 0.7);
}
.callout:hover {
  border-color: var(--line-cream-2);
  box-shadow: 0 0 36px -20px rgba(255, 214, 128, 0.5);
}
.callout:has(> svg) {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
}
.callout > svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--cream);
}
.callout b {
  color: var(--text);
  font-weight: 600;
}
.callout--open {
  border-color: rgba(144, 133, 233, 0.38);
  background: linear-gradient(180deg, rgba(144, 133, 233, 0.08), rgba(144, 133, 233, 0.02));
}
.callout--open::before {
  background: #aaa1f1;
  box-shadow: 0 0 12px -1px rgba(144, 133, 233, 0.8);
}
.callout--open:hover {
  border-color: rgba(144, 133, 233, 0.6);
  box-shadow: 0 0 36px -20px rgba(144, 133, 233, 0.6);
}

/* ---- Toggles ------------------------------------------------------------ */

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--night-1);
  border: 1px solid var(--line-2);
}
.seg button {
  padding: 7px 14px;
  border-radius: 999px;
  font: 500 13.5px/1.1 var(--font-sans);
  color: var(--text-3);
  white-space: nowrap;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 200ms ease;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] {
  color: #0a0e1c;
  background: var(--cream);
  box-shadow: 0 0 14px -2px rgba(255, 214, 128, 0.55);
  font-weight: 600;
}
.seg--sm button {
  padding: 5px 11px;
  font-size: 13px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 13.5px var(--font-sans);
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}
.switch input {
  appearance: none;
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: var(--night-4);
  border: 1px solid var(--line-2);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 200ms ease;
  cursor: pointer;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 180ms var(--ease-out), background-color 160ms ease;
}
.switch input:checked {
  background: rgba(255, 230, 168, 0.22);
  border-color: var(--line-cream-2);
  box-shadow: 0 0 12px -3px rgba(255, 214, 128, 0.5);
}
.switch input:checked::after {
  transform: translateX(15px);
  background: var(--cream);
}

.range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 13.5px var(--font-sans);
  color: var(--text-3);
}
.range input[type="range"] {
  appearance: none;
  width: 140px;
  height: 4px;
  border-radius: 4px;
  background: var(--night-5);
  outline-offset: 6px;
}
.range input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--night-2);
  box-shadow: 0 0 10px rgba(255, 214, 128, 0.6);
  cursor: pointer;
}
.range input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--night-2);
  cursor: pointer;
}
.range output {
  min-width: 5ch;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---- Swatches, legend ---------------------------------------------------- */

.sw {
  --c: var(--text-4);
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
}
.sw--line {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.sw--ring {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.sw--dash {
  background: transparent;
  border: 1.5px dashed var(--c);
  box-sizing: border-box;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font: 500 13px var(--font-sans);
  color: var(--text-3);
}
.legend button,
.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: inherit;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, opacity 140ms ease, box-shadow 200ms ease;
}
.legend button:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.legend button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--line-cream-2);
  background: rgba(255, 230, 168, 0.06);
  box-shadow: 0 0 14px -6px rgba(255, 214, 128, 0.6);
}
.legend[data-has-iso="true"] button[aria-pressed="false"] {
  opacity: 0.5;
}

/* ---- Tables ------------------------------------------------------------- */

.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-1);
  background: rgba(0, 0, 0, 0.12);
  scrollbar-color: var(--night-5) transparent;
  scrollbar-width: thin;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--text-2);
}
.tbl caption {
  text-align: left;
  padding: 12px 14px 4px;
  font: 500 13px var(--font-sans);
  color: var(--text-4);
}
.tbl th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 10px 14px;
  font: 500 13px var(--font-sans);
  color: var(--text-4);
  background: #0b1020;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.tbl th button {
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 140ms ease;
}
.tbl th button:hover {
  color: var(--text);
}
.tbl th[aria-sort="ascending"] button::after {
  content: "\2191";
}
.tbl th[aria-sort="descending"] button::after {
  content: "\2193";
}
.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-1);
  vertical-align: top;
}
.tbl tbody tr {
  transition: background-color 160ms ease;
}
.tbl tbody tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.tbl .n,
.tbl th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl td.n {
  font-family: var(--font-mono);
  font-size: 13px;
}
.tbl .sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-4);
  line-height: 1.45;
}
.tbl .tot td {
  border-top: 1px solid var(--line-3);
  color: var(--text);
  font-weight: 600;
}
.tbl tr.is-own td {
  color: var(--text);
  background: rgba(255, 230, 168, 0.06);
}
.tbl tr.is-own td:first-child {
  box-shadow: inset 2px 0 0 var(--cream);
}
.tbl--compact td,
.tbl--compact th {
  padding-block: 6px;
}
/* On a phone a table marked .tbl--cards turns into one card per row: the header cell of each
   column is printed in front of its value, and the first column is the card's title. */
@media (max-width: 760px) {
  .tbl--cards {
    min-width: 0 !important;
  }
  .tbl--cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .tbl--cards,
  .tbl--cards tbody,
  .tbl--cards tr,
  .tbl--cards td {
    display: block;
    width: 100%;
  }
  .tbl--cards tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
  }
  .tbl--cards tbody tr:last-child td {
    border-bottom: 0;
  }
  .tbl--cards td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
    border: 0;
    background: none !important;
    text-align: left;
    white-space: normal;
    min-width: 0 !important;
  }
  .tbl--cards td::before {
    content: attr(data-label);
    font: 500 12.5px var(--font-sans);
    color: var(--text-4);
  }
  .tbl--cards td.n {
    text-align: left;
    white-space: normal;
  }
  .tbl--cards tr.is-own {
    background: rgba(255, 230, 168, 0.05);
    box-shadow: inset 3px 0 0 var(--cream);
  }
  .tbl--cards tr.is-own td:first-child {
    box-shadow: none;
  }
  .tbl--cards td:empty {
    display: none;
  }
  .tbl--cards td:first-child {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 8px;
    font-weight: 600;
    color: var(--text);
  }
  .tbl--cards td:first-child::before {
    display: none;
  }
}
.tbl-title {
  margin: 22px 0 8px;
  font: 600 15px/1.35 var(--font-sans);
  color: var(--text);
}
.tbl-scroll {
  max-height: 440px;
  overflow: auto;
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-1);
  background: rgba(0, 0, 0, 0.12);
  scrollbar-color: var(--night-5) transparent;
  scrollbar-width: thin;
}
.tbl-scroll .tbl-wrap {
  border: 0;
  background: none;
  overflow: visible;
}
.tbl-scroll:focus-visible {
  outline-offset: -2px;
}
@media (max-width: 760px) {
  .tbl-scroll {
    max-height: min(70vh, 620px);
  }
}
.cell-stack {
  display: grid;
  gap: 2px;
}
.cell-stack small {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-4);
}

/* ---- Addresses ---------------------------------------------------------- */

.addr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.addr a.addr-link {
  font: 500 13px var(--font-mono);
  color: var(--text);
  border-bottom: 1px solid var(--line-cream-2);
  padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease, text-shadow 200ms ease;
}
.addr a.addr-link:hover {
  color: var(--cream-hot);
  border-color: var(--cream);
  text-shadow: 0 0 14px rgba(255, 214, 128, 0.45);
}
.addr .addr-pref {
  font: 500 13px var(--font-mono);
  color: var(--text-3);
}
/* Address words inside running text (see core/linkify.js and core/autolink.js) */
a.addr-link {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text);
  border-bottom: 1px solid var(--line-cream-2);
  transition: color 140ms ease, border-color 140ms ease, text-shadow 200ms ease;
}
a.addr-link:hover {
  color: var(--cream-hot);
  border-color: var(--cream);
  text-shadow: 0 0 14px rgba(255, 214, 128, 0.45);
}
.addr-pref {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-3);
}
/* headings keep their own type; the link is only underlined */
h1 a.addr-link,
h2 a.addr-link,
h3 a.addr-link,
h4 a.addr-link {
  font: inherit;
  color: inherit;
  border-bottom: 2px dotted var(--line-cream-2);
}
h1 a.addr-link:hover,
h2 a.addr-link:hover,
h3 a.addr-link:hover,
h4 a.addr-link:hover {
  color: var(--cream-hot);
  border-color: var(--cream);
}
/* chart labels (SVG) */
svg a.addr-link {
  font: inherit;
  fill: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
  border: 0;
}
svg a.addr-link:hover {
  fill: var(--cream-hot);
}
.addr .icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.addr .icon-btn svg {
  width: 12px;
  height: 12px;
}

/* ---- Tooltip ------------------------------------------------------------ */

#tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.94);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid var(--line-cream-2);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  transition: opacity 110ms ease;
  will-change: transform, opacity;
}
#tip.on {
  opacity: 1;
}
#tip .t-title {
  font: 500 12.5px var(--font-sans);
  color: var(--text-4);
  margin-bottom: 5px;
}
#tip .t-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 1px 0;
}
#tip .t-row .sw {
  align-self: center;
}
#tip .t-val {
  margin-left: auto;
  padding-left: 14px;
  font: 600 13px var(--font-sans);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#tip .t-name {
  color: var(--text-3);
}
#tip .t-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line-1);
  color: var(--text-4);
  font-size: 12.5px;
}
#tip .t-big {
  font: 600 18px/1.15 var(--font-sans);
  color: var(--text);
}


/* ---- Footer ------------------------------------------------------------- */

.footer {
  padding-block: 48px 64px;
  border-top: 1px solid var(--line-cream);
  color: var(--text-4);
  font-size: 14px;
}
.footer .wrap {
  display: grid;
  gap: 10px;
}
.footer p {
  max-width: 80ch;
}
.footer a {
  color: var(--text-3);
  border-bottom: 1px solid var(--line-cream-2);
  transition: color 140ms ease;
}
.footer a:hover {
  color: var(--cream-hot);
}

/* ---- Key figures: glass tiles with an accent bar ------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 14px;
}
.stats--3 {
  --cols: 3;
}
.stats--4 {
  --cols: 4;
}
.stats--5 {
  --cols: 5;
}
.stat,
.tile {
  --c: var(--cream);
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px 20px 18px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 45%),
    rgba(10, 14, 28, 0.82);
  border: 1px solid var(--line-cool);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 238, 204, 0.07);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 260ms var(--ease-out), border-color 260ms ease, box-shadow 320ms ease;
}
.stat::before,
.tile::before {
  content: "";
  position: absolute;
  left: 18px;
  top: -1px;
  width: 34px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--c);
  box-shadow: 0 0 14px -2px var(--c);
  transition: width 320ms var(--ease-out), box-shadow 320ms ease;
}
.stat:hover,
.tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 42%, rgba(150, 170, 230, 0.2));
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.95),
    0 0 44px -18px var(--c),
    inset 0 1px 0 rgba(255, 238, 204, 0.1);
}
.stat:hover::before,
.tile:hover::before {
  width: 64px;
  box-shadow: 0 0 20px 0 var(--c);
}
.stat p {
  margin: 0;
}
.stat-label,
.tile-label {
  font: 500 14px/1.35 var(--font-sans);
  color: var(--text-3);
}
.stat-value {
  font: 600 clamp(30px, 2.7vw, 40px)/1.05 var(--font-sans);
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-value span {
  font: 400 13px var(--font-sans);
  letter-spacing: 0;
  color: var(--text-4);
}
.stat-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-3);
}
@media (max-width: 1080px) {
  .stats--5,
  .stats--4 {
    --cols: 2;
  }
  .stats--3 {
    --cols: 3;
  }
}
@media (max-width: 700px) {
  .stats,
  .stats--3,
  .stats--4,
  .stats--5 {
    --cols: 1;
  }
}

/* a heading inside a section, between its blocks */
.sub-h {
  margin: clamp(36px, 4.5vw, 56px) 0 16px;
  font-size: clamp(20px, 1.9vw, 26px);
}

.prose {
  max-width: 72ch;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.fine {
  max-width: 80ch;
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-4);
}
/* text links inside running copy (addresses keep their own style) */
.prose a:not(.addr-link),
.fine a:not(.addr-link),
.lead a:not(.addr-link),
.callout a:not(.addr-link),
.stat-sub a:not(.addr-link),
.fig-title a:not(.addr-link),
.fig-foot a:not(.addr-link),
.tm-steps a:not(.addr-link):not(.np-more-link),
.facts dd a:not(.addr-link),
.mt-block a:not(.addr-link):not(.mt-link) {
  color: var(--cream);
  border-bottom: 1px solid var(--line-cream-2);
  transition: color 140ms ease, border-color 140ms ease;
}
.prose a:not(.addr-link):hover,
.fine a:not(.addr-link):hover,
.lead a:not(.addr-link):hover,
.callout a:not(.addr-link):hover,
.stat-sub a:not(.addr-link):hover,
.fig-title a:not(.addr-link):hover,
.fig-foot a:not(.addr-link):hover,
.tm-steps a:not(.addr-link):not(.np-more-link):hover,
.facts dd a:not(.addr-link):hover,
.mt-block a:not(.addr-link):not(.mt-link):hover {
  color: var(--cream-hot);
  border-bottom-color: var(--cream-hot);
}

/* A proportion bar under a key figure: parts of one whole, each in its own colour */
.tile-bar {
  display: flex;
  gap: 2px;
  height: 8px;
}
.tile-bar i {
  background: var(--c);
  min-width: 3px;
  box-shadow: 0 0 10px -3px var(--c);
}
.tile-bar i:first-child {
  border-radius: 4px 0 0 4px;
}
.tile-bar i:last-child {
  border-radius: 0 4px 4px 0;
}
.tile-bar i:only-child {
  border-radius: 4px;
}

/* Plain horizontal bars for a short ranked list */
.mini-bars {
  display: grid;
  gap: 7px;
}
.mini-row {
  display: grid;
  grid-template-columns: minmax(84px, 120px) 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-3);
}
.mini-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.mini-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--text-3);
  transform-origin: left center;
  transition: transform 900ms var(--ease-out);
}
.mini-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

/* ---- Ranked rows and stacked bars ---------------------------------------- */

.rank {
  display: grid;
  gap: 6px;
}
.rank-row {
  --c: var(--cream);
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 300px) minmax(0, 1fr) minmax(96px, 150px);
  gap: 4px 18px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-panel);
  border: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 280ms ease;
}
.rank-row:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--line-1);
  box-shadow: 0 0 40px -24px var(--c);
}
.rank-name {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text);
}
.rank-name .sw {
  margin-top: 5px;
}
.rank-bar {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.rank-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--c);
  box-shadow: 0 0 14px -2px var(--c);
  transform-origin: left center;
}
.rank-fill.is-tint {
  background: transparent;
  border: 1.5px dashed var(--c);
  box-sizing: border-box;
  box-shadow: none;
}
.rank-fill.is-hatch {
  background: repeating-linear-gradient(135deg, rgba(5, 7, 15, 0.62) 0 1.5px, transparent 1.5px 4px), var(--c);
}
.rank-num {
  display: grid;
  text-align: right;
}
.rank-num b {
  font: 600 15px var(--font-sans);
  color: var(--text);
}
.rank-num span {
  font-size: 12.5px;
  color: var(--text-4);
}
.rank-def {
  grid-column: 1 / -1;
  max-width: 90ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-3);
}
@media (max-width: 760px) {
  .rank-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 12px;
  }
  .rank-name {
    grid-column: 1;
  }
  .rank-num {
    grid-column: 2;
    grid-row: 1;
  }
  .rank-bar {
    grid-column: 1 / -1;
  }
}

.sbar {
  display: flex;
  gap: 2px;
  height: 30px;
}
.sbar > i {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2px;
  overflow: hidden;
  background: var(--c);
  font: 600 11.5px var(--font-sans);
  font-style: normal;
  color: var(--ink, #fff);
  outline-offset: 2px;
  transition: filter 160ms ease, box-shadow 220ms ease;
}
.sbar > i:first-child {
  border-radius: 6px 0 0 6px;
}
.sbar > i:last-child {
  border-radius: 0 6px 6px 0;
}
.sbar > i:only-child {
  border-radius: 6px;
}
.sbar > i:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px -2px var(--c);
}
.sbar > i.is-tint {
  background: transparent;
  border: 1.5px dashed var(--c);
  box-sizing: border-box;
  color: var(--text-2);
}
.sbar > i.is-hatch {
  background: repeating-linear-gradient(135deg, rgba(5, 7, 15, 0.62) 0 1.5px, transparent 1.5px 4px), var(--c);
}
.sbar > i > span {
  padding: 0 4px;
  white-space: nowrap;
}

/* A short list of facts about one thing: label on the left, value on the right, on a glass panel */
.facts {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0 24px;
  margin: 0 0 clamp(28px, 3.5vw, 44px);
  padding: 6px clamp(16px, 2vw, 26px);
  border-radius: var(--radius-slab);
  border: 1px solid var(--line-cool);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%),
    rgba(10, 14, 28, 0.82);
  box-shadow: 0 24px 50px -32px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 238, 204, 0.06);
}
.facts dt,
.facts dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-1);
  font-size: 14.5px;
  line-height: 1.55;
}
.facts dt {
  color: var(--text-4);
}
.facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
}
.facts dt:last-of-type,
.facts dd:last-of-type {
  border-bottom: 0;
}
@media (max-width: 640px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

/* ---- Notes and disclosures ------------------------------------------------ */

.notes {
  display: grid;
  gap: 14px;
  max-width: 84ch;
  margin-top: 32px;
}
.notes .callout {
  max-width: none;
}

.disclose {
  border-radius: var(--radius-panel);
  border: 1px solid var(--line-1);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 220ms ease, background-color 220ms ease;
}
.disclose:hover,
.disclose[open] {
  border-color: var(--line-cream);
  background: rgba(255, 230, 168, 0.025);
}
.disclose > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font: 600 15px var(--font-sans);
  color: var(--text);
}
.disclose > summary::-webkit-details-marker {
  display: none;
}
.disclose > summary::after {
  content: "";
  order: 9;
  width: 7px;
  height: 7px;
  margin: 0 4px 3px auto;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: rotate(45deg);
  align-self: center;
  transition: transform 240ms var(--ease-out), margin 240ms var(--ease-out);
}
.disclose[open] > summary::after {
  margin-bottom: -2px;
  transform: rotate(-135deg);
}
.disclose > summary small {
  font: 400 13.5px var(--font-sans);
  color: var(--text-4);
}
.disclose > :not(summary) {
  padding: 4px 18px 18px;
}
