/* =========================================================================
   traded.uk — "one ruler for every market"

   The identity is an instrument, not an app: brass on ink, ruled like a
   ledger, with every number set in a monospace so figures line up like a
   table of measurements. The recurring motifs — tick marks, catalogue
   numbers, the eight-sided fingerprint — all come from the one idea that
   makes the site different: every market measured on the same scale.
   ========================================================================= */

:root {
  /* Almanac paper and ink (light) */
  --paper:      #f5efe2;
  --paper-2:    #fbf8f1;
  --paper-3:    #ece4d2;
  --ink:        #16213d;
  --ink-2:      #3d4661;
  --ink-3:      #6b7188;
  --rule:       #ddd2bb;
  --rule-2:     #c4b595;
  --accent:     #94640e;     /* brass, darkened for contrast on paper */
  --accent-2:   #ad7a17;
  --accent-ink: #6c4806;
  --accent-bg:  #f0e2c0;
  --accent-contrast: #fffaf0;
  --warn:       #b0381c;
  --warn-bg:    #f6ddd2;
  --tick:       #b9a67e;
  --shadow:     0 1px 0 rgba(22,33,61,.06), 0 12px 28px -18px rgba(22,33,61,.35);
  --radius:     6px;
  --wrap:       76rem;
  --serif:      "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:       ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0b1020;
    --paper-2:    #111831;
    --paper-3:    #18213d;
    --ink:        #efe9dc;
    --ink-2:      #bdb6a6;
    --ink-3:      #8a8474;
    --rule:       #222b48;
    --rule-2:     #34406a;
    --accent:     #e2b04a;
    --accent-2:   #f0c669;
    --accent-ink: #f3d38b;
    --accent-bg:  #2a2411;
    --accent-contrast: #1a1405;
    --warn:       #ef7f64;
    --warn-bg:    #2d1712;
    --tick:       #3a466f;
    --shadow:     0 1px 0 rgba(0,0,0,.35), 0 16px 34px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  --paper: #0b1020; --paper-2: #111831; --paper-3: #18213d;
  --ink: #efe9dc; --ink-2: #bdb6a6; --ink-3: #8a8474;
  --rule: #222b48; --rule-2: #34406a;
  --accent: #e2b04a; --accent-2: #f0c669; --accent-ink: #f3d38b; --accent-bg: #2a2411; --accent-contrast: #1a1405;
  --warn: #ef7f64; --warn-bg: #2d1712; --tick: #3a466f;
  --shadow: 0 1px 0 rgba(0,0,0,.35), 0 16px 34px -18px rgba(0,0,0,.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
/* A faint ledger grain behind everything: the paper the ruler sits on. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--rule) 55%, transparent) 1px, transparent 1px);
  background-size: 8rem 100%;
  opacity: .35;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem); }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--paper-3); padding: .12em .38em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Figures read like measurements: monospaced, tabular, never proportional. */
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--accent); color: var(--accent-contrast); padding: .6rem 1rem; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- signature motif: the ruler ---------------------------------------- */
/* Tick marks every 8px, a taller tick every 40px — a scale you can see.    */
.ruler {
  height: 10px;
  background-image:
    linear-gradient(to right, var(--tick) 1px, transparent 1px),
    linear-gradient(to right, var(--tick) 1px, transparent 1px);
  background-size: 40px 10px, 8px 5px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 0;
  opacity: .9;
}
.eyebrow, .kicker {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .8rem;
}
.refno {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
}
.masthead-ruler { border-top: 1px solid var(--rule); }
.masthead-in { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand-svg { display: block; flex-shrink: 0; transition: transform .4s ease; }
.brand:hover .brand-svg { transform: rotate(45deg); }
.brand-text { font-family: var(--serif); font-size: 1.38rem; font-weight: 600; letter-spacing: -.02em; }
.brand-tld { color: var(--ink-3); font-weight: 400; }
.sitenav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.sitenav ul { display: flex; gap: 1.15rem; list-style: none; margin: 0; padding: 0; }
.sitenav a { color: var(--ink-2); text-decoration: none; font-size: .925rem; white-space: nowrap; }
.sitenav a:hover { color: var(--ink); }
.sitenav a.nav-scale { color: var(--accent); font-weight: 600; }
.sitenav a.nav-scale:hover { color: var(--accent-2); }
.navsearch { display: flex; align-items: center; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: .1rem .1rem .1rem .7rem; }
.navsearch input { border: 0; background: none; color: inherit; font: inherit; font-size: .9rem; width: 8.5rem; padding: .3rem 0; }
.navsearch input:focus { outline: none; }
.navsearch:focus-within { border-color: var(--rule-2); }
.navsearch button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: .35rem .5rem; display: grid; place-items: center; }
.navsearch button:hover { color: var(--accent); }
.nav-toggle { display: none; }

/* browse dropdown */
.sitenav .has-menu { position: relative; }
.menu-trigger {
  display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .925rem;
  color: var(--ink-2); background: none; border: 0; cursor: pointer; padding: 0;
}
.menu-trigger:hover, .menu-trigger[aria-expanded="true"] { color: var(--ink); }
.menu-trigger svg { transition: transform .18s; }
.menu-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.catmenu {
  position: absolute; top: calc(100% + .85rem); left: -1rem; right: auto; z-index: 50;
  width: min(34rem, calc(100vw - 2rem));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem; padding: .6rem;
  background: var(--paper-2); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.catmenu[hidden] { display: none; }
.catmenu a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem;
  align-items: start; padding: .6rem .65rem;
  border-radius: 7px; text-decoration: none; color: var(--ink);
  white-space: normal;  /* .sitenav a sets nowrap; taglines must wrap */
}
.catmenu a:hover { background: var(--paper-3); }
.catmenu-icon { font-size: 1rem; line-height: 1.35; }
.catmenu strong { display: block; font-size: .88rem; font-weight: 550; }
.catmenu small { display: block; color: var(--ink-3); font-size: .74rem; line-height: 1.35; margin-top: .1rem; overflow-wrap: break-word; }
.catmenu a > span:last-child { min-width: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 4vw, 3.5rem); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 16ch; margin-bottom: .4em; }
.hero .lede { font-size: clamp(1.06rem, .98rem + .45vw, 1.28rem); color: var(--ink-2); max-width: 62ch; }
.hero-search { margin: 2rem 0 1.25rem; display: flex; gap: .6rem; max-width: 34rem; }
.hero-search input {
  flex: 1; font: inherit; padding: .85rem 1.1rem; border-radius: 4px;
  border: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink);
}
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-weight: 600;
  font-size: .95rem; letter-spacing: .01em;
  padding: .8rem 1.35rem; border-radius: 4px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-contrast); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.btn:hover { background: var(--accent-2); color: var(--accent-contrast); }
.btn-ghost { background: none; border-color: var(--rule-2); color: var(--ink); }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); border-color: var(--rule-2); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.75rem; color: var(--ink-3); font-size: .9rem; }
.hero-stats b { color: var(--ink); font-weight: 600; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; position: relative; padding-bottom: .9rem; }
.section-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background-image: linear-gradient(to right, var(--tick) 1px, transparent 1px), linear-gradient(to right, var(--tick) 1px, transparent 1px);
  background-size: 40px 6px, 8px 3px; background-repeat: repeat-x; opacity: .7;
}
.section-head h2 { margin: 0; }
.section-head p { margin: .25rem 0 0; color: var(--ink-3); font-size: .95rem; }
.more { font-size: .92rem; white-space: nowrap; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(20.5rem, 1fr)); }
.card {
  display: block; padding: 1.35rem 1.4rem; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: var(--radius); position: relative;
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s;
}
/* Registration ticks in two corners: the card is a measured plate. */
.card::before, .card::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none;
  border-color: var(--accent); border-style: solid; opacity: 0; transition: opacity .15s;
}
.card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.card::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }
a.card:hover::before, a.card:hover::after { opacity: 1; }
a.card:hover { border-color: var(--rule-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 .35rem; font-size: 1.12rem; }
a.card:hover h3 { color: var(--accent); }
.card p { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }
.card-meta { margin-top: .85rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .78rem; color: var(--ink-3); }
.cat-card { position: relative; padding-left: 1.4rem; }
.cat-card .cat-icon { font-size: 1.5rem; line-height: 1; display: block; margin-bottom: .6rem; }
.count { color: var(--ink-3); font-size: .78rem; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; line-height: 1;
  padding: .34rem .55rem; border-radius: 3px; background: var(--paper-3);
  color: var(--ink-2); border: 1px solid var(--rule); text-decoration: none; white-space: nowrap;
}
a.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-accent { background: var(--accent-bg); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* ---------- article / entry ---------- */
.entry-head { padding: clamp(2rem, 4vw, 3.25rem) 0 1.75rem; border-bottom: 1px solid var(--rule); }
.crumbs { font-size: .85rem; color: var(--ink-3); margin: 0 0 1rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { color: var(--rule-2); }
.entry-head h1 { margin: 0 0 .35rem; }
.entry-aka { color: var(--ink-3); font-size: .95rem; margin: 0 0 .9rem; }
.entry-summary { font-size: 1.14rem; line-height: 1.6; color: var(--ink-2); max-width: 64ch; margin: 0; }
.entry-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }

.entry-body { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 2.75rem; padding: 2.75rem 0 4rem; align-items: start; }
.prose { max-width: 70ch; font-size: 1.06rem; }
.prose h2 { font-size: 1.55rem; margin: 2.2rem 0 .7rem; padding-top: .3rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.14rem; margin: 1.7rem 0 .5rem; font-family: var(--sans); font-weight: 650; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1.15em; }
.prose li { margin-bottom: .45em; }
.prose > p:first-of-type { font-size: 1.1em; }

.sidebar { position: sticky; top: 5rem; display: grid; gap: 1.25rem; font-size: .93rem; }
.panel { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.panel h3 { font-family: var(--sans); font-size: .76rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 .85rem; }
.spec { margin: 0; display: grid; gap: .8rem; }
.spec dt {
  color: var(--ink-3); font-size: .72rem; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: .15rem;
}
.spec dd { margin: 0; font-size: .9rem; line-height: 1.45; }
.spec div + div { border-top: 1px solid var(--rule); padding-top: .7rem; }
.panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.panel li a { text-decoration: none; }
.panel li a:hover { text-decoration: underline; }
.panel .note { color: var(--ink-3); font-size: .8rem; display: block; margin-top: .1rem; }

.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 6px; height: 12px; border-radius: 2px; background: var(--rule-2); display: block; }
.meter i.on { background: var(--accent); }
.meter-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

.callout { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 1rem 1.15rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.75rem 0; }
.callout h3 { margin: 0 0 .4rem; font-family: var(--sans); font-size: .95rem; color: var(--warn); }
.callout p:last-child { margin-bottom: 0; }
.callout ul { margin-bottom: 0; }

/* ---------- lists / tables ---------- */
.rowlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rowlist li { border-bottom: 1px solid var(--rule); }
.rowlist a { display: flex; gap: 1rem; align-items: baseline; padding: .9rem .25rem; text-decoration: none; color: inherit; }
.rowlist a:hover { background: var(--paper-2); }
.rowlist .rl-name { font-weight: 550; }
.rowlist a:hover .rl-name { color: var(--accent); }
.rowlist .rl-desc { color: var(--ink-3); font-size: .88rem; flex: 1; }
.rowlist .rl-cat { color: var(--ink-3); font-size: .78rem; white-space: nowrap; }

.az-letter { display: grid; grid-template-columns: 3.5rem 1fr; gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.az-letter h2 { font-size: 2rem; color: var(--rule-2); margin: 0; position: sticky; top: 5rem; }
.az-list { columns: 3 14rem; column-gap: 2rem; list-style: none; margin: 0; padding: 0; }
.az-list li { break-inside: avoid; margin-bottom: .45rem; }
.az-list a { text-decoration: none; }
.az-list a:hover { text-decoration: underline; }
.az-list small { color: var(--ink-3); }
.az-nav { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1.5rem 0 0; }
.az-nav a { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; font-size: .85rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cmp { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.cmp th, table.cmp td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.cmp thead th { font-family: var(--serif); font-size: 1.05rem; border-bottom: 2px solid var(--rule-2); }
table.cmp tbody th { color: var(--ink-3); font-weight: 500; font-size: .82rem; width: 11rem; }

/* ---------- misc ---------- */
.notice { padding: 1rem 1.15rem; background: var(--paper-3); border-radius: var(--radius); color: var(--ink-2); font-size: .93rem; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-3); }
.empty h2 { color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.prose .disclaim { font-size: .88rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2.5rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); background: var(--paper-2); margin-top: 3rem; padding: 3rem 0 2rem; font-size: .92rem; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2.5rem; }
.foot-brand p { color: var(--ink-3); max-width: 34ch; margin-top: .5rem; font-size: .88rem; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.foot h3 { font-family: var(--sans); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .75rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot-legal { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1.5rem; color: var(--ink-3); font-size: .8rem; }
.foot-legal p { max-width: 90ch; }
.foot-legal strong { color: var(--ink-2); }
.copy { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  .entry-body { grid-template-columns: 1fr; gap: 2.5rem; }
  .sidebar { position: static; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
}
@media (max-width: 56rem) {
  .nav-toggle {
    display: grid; gap: 4px; margin-left: auto; background: none; border: 0; cursor: pointer; padding: .5rem;
  }
  .nav-toggle span:not(.sr) { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sitenav {
    position: fixed; inset: 4rem 0 auto; background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; gap: 0; padding: 1rem; margin: 0;
    max-height: calc(100dvh - 4rem); overflow-y: auto;
    display: none;
  }
  .sitenav.open { display: flex; }
  .sitenav ul { flex-direction: column; gap: 0; }
  .sitenav li { border-bottom: 1px solid var(--rule); }
  .sitenav ul a { display: block; padding: .85rem .25rem; font-size: 1rem; }
  .sitenav .has-menu { position: static; }
  .menu-trigger { display: none; }
  .catmenu,
  .catmenu[hidden] {
    display: grid; position: static; width: auto; grid-template-columns: 1fr;
    padding: 0; border: 0; background: none; box-shadow: none; gap: 0;
  }
  .catmenu a { padding: .85rem .25rem; border-radius: 0; }
  .catmenu a + a { border-top: 1px solid var(--rule); }
  .catmenu small { display: none; }
  .catmenu strong { font-size: 1rem; font-weight: 400; }
  .navsearch { margin-top: 1rem; }
  .navsearch input { width: 100%; }
  .foot-in { grid-template-columns: 1fr; gap: 2rem; }
  .az-letter { grid-template-columns: 1fr; gap: .5rem; }
  .az-letter h2 { position: static; }
  .rowlist a { flex-direction: column; gap: .2rem; }
}
@media (max-width: 30rem) {
  .hero-search { flex-direction: column; }
  .hero-search .btn { justify-content: center; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .masthead, .foot-cols, .nav-toggle, .sidebar { display: none; }
  body { background: #fff; color: #000; }
}

/* =========================================================================
   Accounts, swaps and admin
   ========================================================================= */

.wrap.narrow { width: min(100% - 2rem, 46rem); }

/* nav auth cluster */
.navauth { display: flex; align-items: center; gap: .7rem; font-size: .9rem; }
.navauth a { color: var(--ink-2); text-decoration: none; }
.navauth a:hover { color: var(--ink); }
.navauth-you { font-weight: 550; color: var(--ink) !important; }
.inline { display: inline; }
.linkbtn {
  font: inherit; font-size: .9rem; background: none; border: 0; padding: 0;
  color: var(--ink-3); cursor: pointer; text-decoration: underline;
  text-underline-offset: .18em;
}
.linkbtn:hover { color: var(--ink); }
.linkbtn-danger:hover { color: #d9534f; }
:root[data-theme="dark"] .linkbtn-danger:hover, html:not([data-theme="light"]) .linkbtn-danger:hover { color: #ff8a84; }

/* flashes */
.flashes { padding-top: 1.25rem; }
.flash {
  margin: 0 0 .6rem; padding: .8rem 1.1rem; border-radius: var(--radius);
  background: var(--accent-bg); color: var(--accent-ink); font-size: .93rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* forms */
.form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.field-row > .field { flex: 1 1 11rem; }
.field label, .field .label { font-size: .88rem; font-weight: 550; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"],
.field input[type="url"], .field input[type="number"], .field input[type="search"],
.field select, .field textarea {
  font: inherit; font-size: .95rem; width: 100%;
  padding: .62rem .8rem; border-radius: 8px;
  border: 1px solid var(--rule-2); background: var(--paper-2); color: var(--ink);
}
.field textarea { resize: vertical; line-height: 1.55; }
.field textarea.mono { font-family: var(--mono); font-size: .86rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg);
}
.hint { color: var(--ink-3); font-size: .82rem; margin: 0; line-height: 1.45; }
.err { color: #c0392b; font-size: .82rem; margin: 0; font-weight: 500; }
:root[data-theme="dark"] .err, html:not([data-theme="light"]) .err { color: #ff8a84; }
.form-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.btn-sm { padding: .5rem 1rem; font-size: .88rem; }
.radios { display: flex; gap: 1.2rem; }
.radio, .check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400; cursor: pointer; }
.radio input, .check input { width: auto; margin: 0; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 1.2rem; }

/* two column blocks */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 3rem; align-items: start; }

/* listings */
.listings { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.listing {
  display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start;
  padding: .95rem .2rem; border-bottom: 1px solid var(--rule);
}
.listing-off { opacity: .55; }
.listing-main { min-width: 0; }
.listing-entry { display: block; font-size: .8rem; color: var(--ink-3); margin-top: .15rem; }
.listing-nomatch { color: var(--warn); }
.listing-detail { margin: .35rem 0 0; font-size: .87rem; color: var(--ink-2); }
.listing-actions { display: flex; gap: .7rem; align-items: center; flex-shrink: 0; }

/* match cards */
.match-card .swapline { display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; margin: 1rem 0; }
.match-card .swapline dt { color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.match-card .swapline dd { margin: 0; font-size: .92rem; font-weight: 500; }
.match-form { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.match-form input {
  flex: 1 1 10rem; min-width: 0; font: inherit; font-size: .88rem;
  padding: .5rem .7rem; border-radius: 8px; border: 1px solid var(--rule-2);
  background: var(--paper); color: var(--ink);
}
.match-form input:focus { outline: none; border-color: var(--accent); }
.chain { margin: .5rem 0 1rem 1.1rem; padding: 0; font-size: .92rem; }
.chain li { margin-bottom: .4rem; }

/* message thread */
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.thread li { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1.1rem; }
.thread li.mine { background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.thread-meta { margin: 0 0 .3rem; font-size: .85rem; display: flex; gap: .6rem; align-items: baseline; }
.thread-body { margin: 0; font-size: .95rem; }

/* admin */
.adminnav { background: var(--paper-3); border-bottom: 1px solid var(--rule); }
.adminnav-in { display: flex; gap: 1.4rem; align-items: center; padding: .85rem 0; font-size: .9rem; flex-wrap: wrap; }
.adminnav strong { font-family: var(--serif); font-size: 1rem; }
.adminnav a { color: var(--ink-2); text-decoration: none; }
.adminnav a:hover { color: var(--accent); }
.adminnav-out { margin-left: auto; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem; }
.stat {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: grid; gap: .2rem;
}
.stat b { font-size: 1.9rem; font-family: var(--serif); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--ink-3); }
.row-off { opacity: .5; }
table.cmp td .hint { display: block; }

@media (max-width: 52rem) {
  .two-col { gap: 2rem; }
  .listing { flex-direction: column; gap: .5rem; }
  .navauth { width: 100%; padding-top: .9rem; border-top: 1px solid var(--rule); margin-top: .5rem; }
}
.venuepick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .5rem 1rem; max-height: 16rem; overflow-y: auto;
  padding: .9rem 1rem; border: 1px solid var(--rule-2);
  border-radius: 8px; background: var(--paper-2);
}
.venuepick .check { font-size: .88rem; align-items: flex-start; }
.venuepick .hint { display: inline; }

/* =========================================================================
   Generated artwork
   ========================================================================= */

/* Per-category accent, applied by a cat-<slug> class on an ancestor. */
.cat-commodities           { --c: #b8763a; }
.cat-shares-and-funds      { --c: #2f8f68; }
.cat-debt                  { --c: #3d6fa8; }
.cat-currencies            { --c: #7a5cb8; }
.cat-derivatives           { --c: #2b8a8a; }
.cat-property              { --c: #b05a4a; }
.cat-collectibles          { --c: #a8487e; }
.cat-rights-and-claims     { --c: #5566b5; }
.cat-services-and-capacity { --c: #3a8fb0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-commodities           { --c: #e0a463; }
  :root:not([data-theme="light"]) .cat-shares-and-funds      { --c: #5ac795; }
  :root:not([data-theme="light"]) .cat-debt                  { --c: #7fb0e0; }
  :root:not([data-theme="light"]) .cat-currencies            { --c: #b39ce8; }
  :root:not([data-theme="light"]) .cat-derivatives           { --c: #5cc0c0; }
  :root:not([data-theme="light"]) .cat-property              { --c: #dd8b78; }
  :root:not([data-theme="light"]) .cat-collectibles          { --c: #d97fae; }
  :root:not([data-theme="light"]) .cat-rights-and-claims     { --c: #93a1e8; }
  :root:not([data-theme="light"]) .cat-services-and-capacity { --c: #6fbfdc; }
}

.cicon { display: block; }

/* ---- home hero ---- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 3rem; align-items: center; }
.hero-figure { justify-self: center; width: 100%; max-width: 26rem; }
.heroart { width: 100%; height: auto; display: block; }
.heroart circle, .heroart line { vector-effect: non-scaling-stroke; }

/* ---- category cards ---- */
.cat-card .cat-icon {
  display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem;
  border-radius: 10px; margin-bottom: .9rem;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 26%, transparent);
}
a.cat-card:hover { border-color: color-mix(in srgb, var(--c, var(--accent)) 45%, transparent); }
a.cat-card:hover h3 { color: var(--c, var(--accent)); }

/* ---- nav dropdown icons ---- */
.catmenu-icon {
  display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem;
  border-radius: 6px; margin-top: .1rem; flex-shrink: 0;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 13%, transparent);
}

/* ---- entry cards with thumbnails ---- */
.card-art { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-thumb { display: block; line-height: 0; background: var(--paper-3); }
.card-thumb .art { width: 100%; height: auto; aspect-ratio: 400 / 132; display: block; }
.card-body { display: block; padding: 1.15rem 1.3rem 1.3rem; }
.card-art h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.card-art .card-meta { margin-top: .8rem; }

/* ---- entry page banner ---- */
.entry-head-art { position: relative; overflow: hidden; }
.entry-banner { position: absolute; inset: 0; opacity: 1; }
.entry-banner .art { width: 100%; height: 100%; display: block; }
.entry-head-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right,
    var(--paper) 0%,
    var(--paper) 34%,
    color-mix(in srgb, var(--paper) 78%, transparent) 56%,
    color-mix(in srgb, var(--paper) 12%, transparent) 100%);
}
.entry-head-art > .wrap { position: relative; z-index: 2; }

/* ---- category page title ---- */
.cat-title { display: flex; align-items: center; gap: .85rem; }
.cat-title-icon {
  display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem;
  border-radius: 12px; flex-shrink: 0;
  color: var(--c, var(--accent));
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 26%, transparent);
}

/* ---- venue monograms ---- */
.vmark { display: block; border-radius: 11px; }
.venue-card { display: grid; grid-template-columns: auto 1fr; gap: .3rem .95rem; align-items: start; }
.venue-card-mark { grid-row: span 3; }
.venue-card h3, .venue-card p, .venue-card .card-meta { grid-column: 2; }
.venue-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: .35rem; }
.venue-head h1 { margin: 0; }
.venue-row { display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: start; }
.venue-row-mark { line-height: 0; }

/* ---- A–Z icons ---- */
.az-list li { display: flex; align-items: baseline; gap: .45rem; }
.az-icon { color: var(--c, var(--ink-3)); flex-shrink: 0; transform: translateY(2px); }

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-figure { max-width: 19rem; order: -1; }
  .entry-head-art::after {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--paper) 72%, transparent) 0%, var(--paper) 78%);
  }
}
@media (max-width: 40rem) {
  .hero-figure { max-width: 14rem; }
  .card-thumb .art { aspect-ratio: 400 / 118; }
}

/* =========================================================================
   THE MARKET FINGERPRINT — the USP, and everything built around it
   ========================================================================= */

/* Difficulty bands: a sequential ramp that reads the same in both themes. */
:root {
  --band-gentle: #2f8f68; --band-moderate: #7c8a2e; --band-demanding: #b8861f;
  --band-tough: #c2562f;  --band-extreme: #b3263a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --band-gentle: #5ac795; --band-moderate: #b9c35a; --band-demanding: #e2b04a;
    --band-tough: #ef8a5f;  --band-extreme: #f06a7c;
  }
}
:root[data-theme="dark"] {
  --band-gentle: #5ac795; --band-moderate: #b9c35a; --band-demanding: #e2b04a;
  --band-tough: #ef8a5f;  --band-extreme: #f06a7c;
}
.band-gentle { --b: var(--band-gentle); }  .band-moderate { --b: var(--band-moderate); }
.band-demanding { --b: var(--band-demanding); } .band-tough { --b: var(--band-tough); }
.band-extreme { --b: var(--band-extreme); }

.diff-chip {
  display: inline-flex; align-items: baseline; gap: .35rem; white-space: nowrap;
  font-size: .74rem; line-height: 1; padding: .32rem .5rem .3rem; border-radius: 3px;
  color: var(--b, var(--ink-2));
  background: color-mix(in srgb, var(--b, var(--ink-3)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--b, var(--ink-3)) 35%, transparent);
}
.diff-chip b { font-size: .86rem; color: var(--b, var(--ink)); }
.sw { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; vertical-align: -.05em; margin-right: .35rem; }
.linklike { font-size: .92rem; }
.axicon { display: block; }

/* ---- the radar ---- */
.fp-radar { display: block; width: 100%; height: auto; max-width: 100%; overflow: visible; }
.fp-shape { transition: opacity .2s; }
.fp-mini  { display: block; color: var(--ink-3); flex-shrink: 0; }

/* ---- the panel on every entry ---- */
.fp-panel {
  margin: 2.5rem 0 0; padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  position: relative;
}
.fp-panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--c, var(--accent)), var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
}
.fp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.fp-head h2 { margin: 0; }
.fp-score {
  display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: .2rem;
  padding: .7rem 1rem .75rem; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--b) 40%, transparent);
  background: color-mix(in srgb, var(--b) 10%, transparent);
}
.fp-score-n { font-size: 2.3rem; font-weight: 700; line-height: 1; color: var(--b); }
.fp-score-of { font-size: .95rem; color: var(--ink-3); }
.fp-score-band { grid-column: 1 / -1; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--b); margin-top: .35rem; }
.fp-note {
  font-family: var(--serif); font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.5;
  color: var(--ink); max-width: 60ch; margin: 1.1rem 0 0; padding-left: 1rem;
  border-left: 3px solid var(--c, var(--accent));
}
.fp-body { display: grid; grid-template-columns: minmax(0, 23rem) minmax(0, 1fr); gap: 2.5rem; align-items: center; margin-top: 1.75rem; }
.fp-figure { margin: 0; }
.fp-halves { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: .25rem; padding: 0 .5rem; }

.fp-axes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.75rem; }
.fp-axis { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: start; }
.fp-axis-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 5px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.fp-axis-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.fp-axis-name { font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; }
.fp-axis-name:hover { color: var(--accent); text-decoration: underline; }
.fp-axis-val { font-weight: 700; font-size: .95rem; }
.fp-axis-val small { color: var(--ink-3); font-weight: 400; font-size: .75rem; }
.fp-axis-q { display: block; font-size: .8rem; color: var(--ink-3); line-height: 1.4; margin-top: .3rem; }
.fp-bar { display: flex; gap: 3px; margin-top: .35rem; }
.fp-bar i { flex: 1; height: 6px; border-radius: 1px; background: var(--rule); }
.fp-bar i.on { background: var(--c, var(--accent)); }
.fp-bar-sm { display: inline-flex; width: 4.2rem; vertical-align: middle; margin: 0 .45rem 0 0; }
.fp-bar-sm i { height: 5px; }

.fp-similar { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px dashed var(--rule-2); }
.fp-similar h3 { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .25rem; }
.fp-similar ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .7rem; }
.fp-similar a {
  display: flex; gap: .7rem; align-items: center; padding: .6rem .75rem; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--paper); text-decoration: none; color: var(--ink);
}
.fp-similar a:hover { border-color: var(--accent); }
.fp-sim-text { display: grid; min-width: 0; }
.fp-sim-text strong { font-size: .9rem; line-height: 1.3; }
.fp-sim-pct { font-size: .76rem; color: var(--ink-3); font-family: var(--mono); }
.fp-sim-x { font-style: normal; font-size: .74rem; color: var(--accent); line-height: 1.3; margin-top: .1rem; }
.fp-similar a { align-items: flex-start; height: 100%; }
.fp-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.25rem 0 0; }
.fp-disclaim { font-size: .8rem; color: var(--ink-3); margin: 1.5rem 0 0; max-width: 80ch; }

/* ---- emblems ---- */
.emblem { display: block; color: var(--ink); flex-shrink: 0; }

/* ---- entry header with its illustration plate ---- */
.entry-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: center; }
.entry-ref { margin: 0 0 .5rem; }
.entry-plate {
  position: relative; margin: 0; width: 13.5rem; height: 13.5rem; display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c, var(--accent)) 26%, var(--paper-2)) 0%, var(--paper-2) 70%);
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 35%, var(--rule));
  box-shadow: var(--shadow), inset 0 0 0 8px color-mix(in srgb, var(--paper) 55%, transparent);
}
.entry-plate::after {           /* the outer ruler ring */
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  background: repeating-conic-gradient(var(--tick) 0 .5deg, transparent .5deg 7.5deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 6px), #000 calc(50% - 6px), #000 50%, transparent 50%);
          mask: radial-gradient(circle, transparent calc(50% - 6px), #000 calc(50% - 6px), #000 50%, transparent 50%);
  opacity: .8;
}
.emblem-hero { width: 70%; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.22)); }
.entry-plate-ref {
  position: absolute; bottom: -2.1rem; left: 50%; transform: translateX(-50%);
  font-size: .72rem; letter-spacing: .12em; color: var(--ink-3);
}

/* ---- cards ---- */
.card-thumb { position: relative; }
.card-emblem {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 4.9rem; height: 4.9rem; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--paper-2) 92%, transparent);
  box-shadow: 0 4px 14px rgba(0,0,0,.25), inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 40%, transparent);
}
.card-emblem .emblem { width: 3.6rem; height: 3.6rem; }
.card-ref {
  position: absolute; right: .7rem; top: .6rem; font-size: .68rem; letter-spacing: .1em;
  color: #fff; background: rgba(8, 12, 26, .45); padding: .22rem .4rem; border-radius: 3px;
}
.card-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; margin-top: .8rem; }
.card-foot .card-meta { margin-top: 0; }
.card-fp { color: var(--ink-3); }

/* category cards show a glimpse of their contents */
.cat-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.cat-card .cat-icon { margin-bottom: 0; }
.cat-samples { display: flex; }
.cat-samples .emblem {
  width: 2.35rem; height: 2.35rem; margin-left: -.55rem; padding: .25rem; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--rule);
}

/* ---- home ---- */
@media (min-width: 62.01rem) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); } }
.hero .lede strong { color: var(--ink); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center; margin: 0 0 1.4rem; }
.hero-demo { margin: 0; justify-self: center; width: 100%; max-width: 28rem; }
.hero-demo figcaption { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; font-size: .9rem; margin-top: .25rem; }
.hero-demo figcaption a { color: var(--ink); text-decoration: none; }
.hero-demo figcaption a:hover { color: var(--accent); }
.hero-demo figcaption b { color: var(--ink-3); font-weight: 500; margin-left: .2rem; }
.hero-demo figcaption em { flex-basis: 100%; text-align: center; font-family: var(--serif); color: var(--ink-3); }

.axis-strip { border-bottom: 1px solid var(--rule); padding: 1.6rem 0 1.8rem; background: var(--paper-2); }
.axis-strip .kicker { margin-bottom: 1rem; }
.axis-strip-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .6rem; }
.axis-strip-list a {
  display: grid; gap: .35rem; justify-items: start; padding: .8rem .85rem; height: 100%;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper);
  text-decoration: none; color: var(--ink);
}
.axis-strip-list a:hover { border-color: var(--accent); }
.axis-strip-icon { color: var(--accent); }
.axis-strip-label { font-size: .85rem; font-weight: 600; line-height: 1.25; }

.ends { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.ends-h { font-family: var(--mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--b); margin: 0 0 .75rem; }
.ends-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.ends-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .9rem; align-items: center;
  padding: .75rem .25rem; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.ends-list a:hover { background: var(--paper-2); }
.ends-name { display: grid; }
.ends-name small { color: var(--ink-3); font-size: .78rem; }

/* ---- The Scale ---- */
.scale-hero { padding: clamp(2rem, 4vw, 3.25rem) 0 2rem; border-bottom: 1px solid var(--rule); }
.scale-lede { max-width: 66ch; }
.axis-hero { display: flex; gap: 1.25rem; align-items: center; }
.axis-hero h1 { margin: 0 0 .3rem; }
.axis-hero-icon { width: 4.2rem; height: 4.2rem; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent); background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.axis-anchors { display: grid; grid-template-columns: auto minmax(2rem, 1fr) auto; gap: 1rem; align-items: center; margin-top: 1.5rem; max-width: 50rem; font-size: .9rem; color: var(--ink-2); }
.axis-anchors .num { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 3px; background: var(--accent-bg); color: var(--accent-ink); font-weight: 700; margin-right: .35rem; }
.axis-anchors-rule { height: 10px; background-image: linear-gradient(to right, var(--tick) 1px, transparent 1px), linear-gradient(to right, var(--tick) 1px, transparent 1px); background-size: 40px 10px, 8px 5px; background-repeat: repeat-x; }

.axes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.axis-card { display: grid; gap: .45rem; padding: 1.1rem 1.15rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-2); text-decoration: none; color: var(--ink); }
.axis-card:hover { border-color: var(--accent); }
.axis-card-top { display: flex; justify-content: space-between; align-items: center; }
.axis-card-icon { color: var(--accent); }
.axis-card-q { font-size: .86rem; color: var(--ink-2); line-height: 1.45; }
.axis-card-range { display: grid; gap: .2rem; font-size: .76rem; color: var(--ink-3); border-top: 1px dashed var(--rule-2); padding-top: .55rem; margin-top: .2rem; }
.axis-card-range b { color: var(--accent-ink); margin-right: .25rem; }

table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .88rem; min-width: 56rem; table-layout: fixed; }
/* Fixed layout: name, rank and difficulty take set widths; the eight axes share the rest equally. */
table.heat col.c-rank { width: 2.2rem; } table.heat col.c-name { width: 17rem; } table.heat col.c-diff { width: 8rem; }
table.heat thead th { font-weight: 500; font-size: .7rem; color: var(--ink-3); vertical-align: bottom; padding: 0 .1rem .4rem; }
table.heat thead a { display: grid; justify-items: center; gap: .3rem; color: inherit; text-decoration: none;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
table.heat thead th.is-sorted a, table.heat thead a:hover { color: var(--accent); }
.heat-rank { width: 2rem; text-align: right; color: var(--ink-3); font-size: .8rem; padding-right: .4rem; }
.heat-name { text-align: left; font-weight: 400; width: 17rem; min-width: 14rem; }
.heat-name a { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); padding: .2rem 0; }
.heat-name a:hover strong { color: var(--accent); }
.heat-name strong { display: block; font-weight: 600; font-size: .9rem; line-height: 1.25; }
.heat-name small { display: block; color: var(--ink-3); font-size: .74rem; }
.heat-cell { height: 2.3rem; min-width: 2.6rem; text-align: center; border-radius: 3px; font-weight: 700; font-size: .85rem; }
.heat-cell.h1 { background: color-mix(in srgb, var(--accent) 7%, transparent);  color: var(--ink-3); }
.heat-cell.h2 { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink-2); }
.heat-cell.h3 { background: color-mix(in srgb, var(--accent) 34%, transparent); color: var(--ink); }
.heat-cell.h4 { background: color-mix(in srgb, var(--accent) 56%, transparent); color: var(--ink); }
.heat-cell.h5 { background: var(--accent); color: var(--accent-contrast); }
.heat-cell.is-sorted { outline: 2px solid var(--ink); outline-offset: -2px; }
.heat-diff { text-align: left; padding-left: .5rem; white-space: nowrap; width: 7.5rem; }
table.heat tbody tr:hover .heat-name { background: var(--paper-2); }

.atlas-group { margin-bottom: 2rem; }
.atlas-cat { display: flex; align-items: center; gap: .5rem; font-family: var(--sans); font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 .9rem; }
.atlas-cat-icon { color: var(--c, var(--accent)); }
.atlas { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr)); gap: .6rem; }
.atlas-item { display: grid; justify-items: center; gap: .35rem; padding: .8rem .4rem .7rem; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--paper-2); text-decoration: none; color: var(--ink-2); text-align: center; }
.atlas-item:hover { border-color: var(--c, var(--accent)); color: var(--ink); }
.atlas-item span { font-size: .74rem; line-height: 1.25; }

/* ---- Compare ---- */
.compare-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; margin-bottom: 2rem; }
.compare-pick { display: flex; align-items: center; gap: .55rem; padding: .35rem .5rem .35rem .65rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--paper-2); }
.compare-swatch { width: .8rem; height: .8rem; border-radius: 2px; background: var(--sw); flex-shrink: 0; }
.compare-pick select { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: .88rem; padding: .45rem 0; }
.compare-pick select:focus { outline: none; }
.compare-pick:focus-within { border-color: var(--accent); }
.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; }
.pair-card { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1rem; }
.pair-body { display: grid; gap: .5rem; }
.pair-body strong { font-size: .95rem; line-height: 1.4; }
.pair-body .vs { color: var(--ink-3); font-weight: 400; font-family: var(--mono); font-size: .75rem; margin: 0 .3rem; }
.pair-why { color: var(--ink-2); font-size: .86rem; }
.compare-overlay { display: grid; grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); gap: 2.5rem; align-items: center; margin-bottom: 2rem; }
.compare-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.compare-legend li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: .7rem; align-items: start;
  padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
.compare-legend .sw { width: .9rem; height: 2.6rem; border-radius: 2px; margin: 0; }
.compare-legend li > span:last-child { display: grid; gap: .35rem; justify-items: start; }
.compare-legend a { color: var(--ink); text-decoration: none; }
.compare-legend small { color: var(--ink-3); font-size: .82rem; line-height: 1.45; }
.cmp-fp td { white-space: nowrap; }
.cmp-fp td.cmp-text { white-space: normal; }
.cmp-fp td.is-max .num { color: var(--warn); font-weight: 700; }
.cmp-ax { display: inline-flex; align-items: center; gap: .45rem; }
.cmp-ax .axicon { color: var(--accent); }
.cmp-diffrow td, .cmp-diffrow th { border-bottom: 2px solid var(--rule-2); }

/* ---- responsive ---- */
@media (max-width: 70rem) {
  .axis-strip-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: 1fr; }
  .fp-body { grid-template-columns: 1fr; }
  .fp-figure { max-width: 24rem; margin-inline: auto; }
  .compare-overlay { grid-template-columns: 1fr; }
  .entry-head-grid { grid-template-columns: 1fr; }
  .entry-plate { width: 9.5rem; height: 9.5rem; order: -1; justify-self: start; margin: 1rem 0 .5rem 12px; }
  .entry-plate-ref { display: none; }
  .ends { grid-template-columns: 1fr; }
  .hero-demo { max-width: 22rem; order: 0; }
}
@media (max-width: 40rem) {
  .fp-axes { grid-template-columns: 1fr; }
  .axis-strip-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair-card { grid-template-columns: 1fr; }
  .pair-radar { max-width: 11rem; margin: 0 auto; }
  .fp-head { flex-direction: column; }
}

/* admin: fingerprint scoring */
.fp-fieldset { border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.25rem; margin: 0; display: grid; gap: 1rem; background: var(--paper-2); }
.fp-fieldset legend { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding: 0 .4rem; }
.fp-fieldset-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: start; }
.fp-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.fp-field label { display: inline-flex; align-items: center; gap: .35rem; }
.fp-field .axicon { color: var(--accent); }
.fp-preview { margin: 0; width: 13.5rem; text-align: center; }
.fp-preview figcaption { font-size: .78rem; color: var(--ink-3); margin-top: .3rem; }
@media (max-width: 52rem) { .fp-fieldset-body { grid-template-columns: 1fr; } .fp-preview { margin-inline: auto; } }
