/* FXSwaps.

   Written for someone who has never heard the word "swap": light surface, one idea
   per row, money in plain words ("you earn" / "you pay") next to every number, and a
   flag or a logo on anything a reader would otherwise have to decode from an acronym.
   Colour is never the only signal — the words say it too. */

:root {
  /* Light is the trading-desk paper: a warm off-white stock rather than screen white,
     which is the tone financial print has used for a century. It is the same warm
     off-white MMT uses for its *text* on black — one colour, inverted between themes. */
  --bg:        #f7f5f0;
  --raise:     #ffffff;
  --tint:      #f1eee7;
  --tint-2:    #e8e4da;
  --line:      #e2ddd2;
  --line-2:    #cdc7b9;

  --ink:       #16181c;
  --ink-2:     #5a5952;
  --ink-3:     #8b8a80;

  --brand:     #2f4fd0;
  --brand-soft:#e9edfc;
  --brand-ink: #1f379e;
  --brand-line:rgba(47,79,208,.26);
  --warn-soft: #fdf2da;
  --warn-ink:  #8a6008;

  --earn:      #12855c;
  --earn-soft: #e4f3ec;
  --pay:       #c3303c;
  --pay-soft:  #fbeaec;

  --seg-track: #e8e4da;
  --seg-chip:  #ffffff;

  --r:         12px;
  --ctl:       40px;   /* every toolbar control lines up on this height */
  --shadow:    0 1px 2px rgba(24,22,16,.05), 0 8px 24px rgba(24,22,16,.06);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* Dark theme. Three states matter: an explicit choice stamps data-theme on <html>,
   and the default "system" setting stamps nothing — so the media query is guarded to
   lose against an explicit light choice, and the [data-theme] block wins both ways. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0b0c;
    --raise:     #131314;
    --tint:      #19191b;
    --tint-2:    #202023;
    --line:      rgba(255,255,255,.10);
    --line-2:    rgba(255,255,255,.17);
    --ink:       #f4f3ef;
    --ink-2:     #8e8e88;
    --ink-3:     #6f6f6a;
    --brand:     #6d8bf5;
    --brand-soft:#191f3b;
    --brand-ink: #a8bcff;
    --brand-line:rgba(109,139,245,.32);
    --earn:      #3ecf8e;
    --earn-soft: #102a20;
    --pay:       #f7596b;
    --pay-soft:  #2e1519;
    --warn-soft: #33280f;
    --warn-ink:  #f5c24b;
    --seg-track: #0f0f10;
    --seg-chip:  #2a2a2e;
    --shadow:    0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#0b0b0c; --raise:#131314; --tint:#19191b; --tint-2:#202023;
  --line:rgba(255,255,255,.10); --line-2:rgba(255,255,255,.17);
  --ink:#f4f3ef; --ink-2:#8e8e88; --ink-3:#6f6f6a;
  --brand:#6d8bf5; --brand-soft:#191f3b; --brand-ink:#a8bcff;
  --brand-line:rgba(109,139,245,.32);
  --earn:#3ecf8e; --earn-soft:#102a20; --pay:#f7596b; --pay-soft:#2e1519;
  --warn-soft:#33280f; --warn-ink:#f5c24b;
  --seg-track:#0f0f10; --seg-chip:#2a2a2e;
  --shadow: 0 1px 2px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Any author `display` beats the user-agent rule for [hidden], so an element toggled
   with the attribute stays laid out unless this is stated. It bit the selection
   banner, which rendered as an empty coloured bar. */
[hidden] { display: none !important; }

:root[data-theme="light"] { color-scheme: light; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Visually hidden but read by screen readers and found by in-page search. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 12px 18px;
  border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------- header */

header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 26px; height: 74px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -.03em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand b { color: var(--brand); font-weight: 700; }
.logomark { width: 30px; height: 30px; flex: none; display: block; }

.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav a {
  color: var(--ink-2); text-decoration: none; font: 500 14.5px/1 var(--sans);
  padding: 9px 13px; border-radius: 9px;
}
.mainnav a:hover { color: var(--ink); background: var(--tint); }
.mainnav a.on { color: var(--ink); background: var(--tint-2); font-weight: 600; }

/* Trade size is one control, not three. The typed number and its presets share a
   single box with a hairline between them, so the presets read as part of the field
   instead of floating beside it as if they were page content. */
.lot { display: flex; align-items: center; gap: 9px; }
.lot-label {
  font: 600 10.5px/1 var(--sans); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.lot-group {
  display: flex; align-items: stretch; height: var(--ctl);
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px;
}
.lot-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lot-input { display: flex; align-items: center; gap: 5px; padding: 0 10px 0 3px; }
.lot-input input {
  width: 48px; padding: 9px 4px; text-align: center;
  background: none; border: none; outline: none;
  font: 700 15.5px/1 var(--sans); color: var(--brand); font-variant-numeric: tabular-nums;
}
.lot-input span { font-size: 12px; color: var(--ink-3); }
.quick {
  display: flex; gap: 2px; padding: 3px; border-left: 1px solid var(--line);
}
.quick button {
  background: none; border: none; border-radius: 7px; min-width: 30px;
  color: var(--ink-3); font: 500 12.5px/1 var(--sans); padding: 0 7px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.quick button:hover { color: var(--ink-2); background: var(--tint); }
.quick button.on { color: var(--brand); background: var(--brand-soft); font-weight: 700; }

/* The live dot replaces the old "updated N ago" text. It still has to carry that
   information: it pulses only while the data is fresh, and turns amber and still when
   the snapshot is over a day old, because a silently stale page is the failure mode
   this whole pipeline exists to avoid. */
.live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font: 500 12px/1 var(--sans); letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-3); cursor: help; white-space: nowrap;
}
.live .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--earn);
  position: relative; flex: none;
}
.live .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--earn); opacity: 0;
  animation: ping 2.4s cubic-bezier(.2,.6,.4,1) infinite;
}
@keyframes ping {
  0%   { transform: scale(.55); opacity: .85; }
  70%  { transform: scale(1.5);  opacity: 0; }
  100% { transform: scale(1.5);  opacity: 0; }
}
.live.stale { color: var(--warn-ink); }
.live.stale .dot { background: var(--warn-ink); }
.live.stale .dot::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .live .dot::after { animation: none; } }

/* ---- theme toggle ---- */
.themebtn {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  background: none; border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--ink-2); cursor: pointer;
}
.themebtn:hover { color: var(--ink); border-color: var(--ink-3); }
.themebtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .moon { display: none; }
:root[data-theme="dark"] .themebtn .sun { display: none; }
:root[data-theme="dark"] .themebtn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn .sun { display: none; }
  :root:not([data-theme="light"]) .themebtn .moon { display: block; }
}

/* ---------------------------------------------------------- hero */

main { padding: 44px 0 72px; }

.hero-wrap { padding-top: 4px; }
.hero { max-width: 760px; }
h1 { font: 700 34px/1.2 var(--sans); letter-spacing: -.03em; }
h1 em { font-style: normal; color: var(--brand); }
.lede { margin-top: 14px; font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.lede b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------- toolbar */

/* The toolbar is a control surface, not four loose widgets on the page ground. Giving
   it a recessed panel and putting white fields inside separates "things you operate"
   from "things you read", which is what the flat version lacked. Reading order is
   find -> refine -> order: search first, filters beside it, sorting below the rule. */
.toolbar {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  margin: 26px 0 18px; padding: 11px 13px;
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--r);
}
.tb-find   { display: flex; align-items: center; gap: 10px; flex: 1 1 330px; min-width: 260px; }
.tb-refine { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }

/* On a pair page the asset tabs and the pair search have nothing to act on, so the
   whole find group steps aside — hiding only its children would leave the flex slot
   holding an empty gap. Trade size and the broker picker still apply and stay put. */
body.on-detail .tb-find,
body.on-detail .hero-wrap { display: none; }
body.on-detail .toolbar { justify-content: flex-end; }

/* Segmented switch. Previously a solid brand fill, which made a filter the loudest
   thing on the page — louder than the search it sits next to. */
.tabs {
  display: flex; gap: 2px; padding: 3px; flex: none; height: var(--ctl);
  background: var(--seg-track); border: 1px solid var(--line); border-radius: 11px;
}
.tabs button {
  background: none; border: none; border-radius: 8px; white-space: nowrap;
  color: var(--ink-2); font: 500 13.5px/1 var(--sans); padding: 9px 14px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on {
  background: var(--seg-chip); color: var(--brand); font-weight: 600;
  box-shadow: 0 1px 2px rgba(12,40,48,.10);
}

.searchbox { position: relative; flex: 1 1 auto; min-width: 190px; }
.searchbox svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 1.8;
  stroke-linecap: round;
}
.searchbox input {
  width: 100%; height: var(--ctl); padding: 0 13px 0 36px;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px;
  font: 400 14.5px/1 var(--sans); color: var(--ink); outline: none;
}
.searchbox input::placeholder { color: var(--ink-3); }
.searchbox input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* sort bar ------------------------------------------------------------- */

/* Ordering is the third and quietest job, so it sits below the toolbar on the list's
   own header rule. The label is set in the same micro-caps as "Trade size" so the two
   read as labels rather than as one more clickable option in the row. */
.sortbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.sortlabel {
  font: 600 10.5px/1 var(--sans); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.sorts { display: flex; gap: 2px; flex-wrap: wrap; }
.sorts button {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink-2); font: 500 13.5px/1 var(--sans); padding: 8px 11px; cursor: pointer;
}
.sorts button:hover { background: var(--tint-2); color: var(--ink); }
.sorts button.on {
  background: var(--brand-soft); border-color: var(--brand-line);
  color: var(--brand); font-weight: 600;
}
.sorts .dir { font-size: 10px; opacity: .8; }
.resultcount { margin-left: auto; font-size: 13px; color: var(--ink-3); }

/* sortable table headers ------------------------------------------------ */

.tablehead .th {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--ink-3); text-align: left;
  display: inline-flex; align-items: center; gap: 5px;
}
.tablehead .th:hover { color: var(--ink); }
.tablehead .th.static { cursor: default; }
.tablehead .th.static:hover { color: var(--ink-3); }
.tablehead .th-num { justify-content: flex-end; }
.tablehead .th.active { color: var(--brand); font-weight: 600; }
.tablehead .th::after { content: ""; font-size: 9px; opacity: 0; }
.tablehead .th.active.asc::after  { content: "▲"; opacity: 1; }
.tablehead .th.active.desc::after { content: "▼"; opacity: 1; }

/* tools sheet ----------------------------------------------------------- */

.navtool {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; cursor: pointer;
  color: var(--ink-2); font: 500 14.5px/1 var(--sans); padding: 9px 13px;
  border-radius: 9px;
}
.navtool:hover { color: var(--ink); background: var(--tint); }
.navtool[aria-expanded="true"] { color: var(--brand); background: var(--brand-soft); }
.navtool svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px; overflow-y: auto;
}
.sheet {
  width: 100%; max-width: 560px; background: var(--raise);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font: 600 19px/1 var(--sans); letter-spacing: -.02em; }
.sheet-x {
  background: none; border: 0; cursor: pointer; color: var(--ink-3);
  font-size: 16px; padding: 6px 8px; border-radius: 7px;
}
.sheet-x:hover { color: var(--ink); background: var(--tint); }

.sheet-tabs { display: flex; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  overflow-x: auto; }
.sheet-tabs button {
  background: none; border: 1px solid transparent; border-radius: 9px;
  color: var(--ink-2); font: 500 13.5px/1 var(--sans); padding: 9px 12px;
  cursor: pointer; white-space: nowrap;
}
.sheet-tabs button:hover { color: var(--ink); background: var(--tint); }
.sheet-tabs button.on {
  background: var(--brand-soft); border-color: var(--brand-line);
  color: var(--brand); font-weight: 600;
}

.sheet-body { padding: 22px; }
.tool-intro { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.6; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font: 500 12px/1 var(--sans); letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3); }
.field input, .field select {
  padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--tint); color: var(--ink); font: 500 15px/1.2 var(--sans);
  outline: none; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.result {
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 12px; padding: 18px 20px; margin-top: 6px;
}
.result .big {
  font: 700 30px/1.1 var(--sans); letter-spacing: -.02em; color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}
.result .sub { margin-top: 7px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.result.bad { background: var(--pay-soft); border-color: transparent; }
.result.bad .big { color: var(--pay); font-size: 18px; }

/* countdown + sessions */
.count-big {
  font: 700 44px/1 var(--sans); letter-spacing: -.03em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.triple {
  display: inline-block; margin-top: 12px; padding: 6px 11px; border-radius: 8px;
  font: 600 12.5px/1 var(--sans);
  background: var(--warn-soft); color: var(--warn-ink);
}
.sessions { display: flex; flex-direction: column; gap: 10px; }
.session {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px;
}
.session.open { border-color: var(--brand-line); background: var(--brand-soft); }
.session .city { font: 600 15px/1 var(--sans); }
.session .hours { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.session .state { font: 600 11.5px/1 var(--sans); color: var(--ink-3); }
.session.open .state { color: var(--brand); }

@media (max-width: 620px) {
  .overlay { padding: 0; align-items: stretch; }
  .sheet { max-width: none; border-radius: 0; border: 0; min-height: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .count-big { font-size: 36px; }
  .navtool { padding: 8px 10px; font-size: 13.5px; }
}

/* broker picker --------------------------------------------------------

   Comparing 89 brokers is the wrong job for most readers — they hold accounts at two
   or three. Narrowing to those turns a directory into a personal answer, so the
   choice is persisted and applies to every screen. */

.picker { position: relative; }
.picker-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-2); font: 500 14px/1 var(--sans); height: var(--ctl);
  padding: 0 13px; cursor: pointer; white-space: nowrap;
}
.picker-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.picker-btn[aria-expanded="true"] {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
}
.picker-btn.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.picker-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.picker-btn .caret { width: 14px; height: 14px; opacity: .7; }

.picker-panel {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0;
  width: 330px; max-width: calc(100vw - 32px);
  background: var(--raise); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden;
}
.picker-head { padding: 12px; border-bottom: 1px solid var(--line); }
.picker-head input {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--tint);
  font: 400 14px/1 var(--sans); color: var(--ink); outline: none;
}
.picker-head input:focus { border-color: var(--brand); }
.picker-acts { display: flex; gap: 6px; margin-top: 9px; }
.picker-acts button {
  flex: 1; background: var(--tint); border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink-2);
  font: 500 12px/1 var(--sans); padding: 8px 6px; cursor: pointer;
}
.picker-acts button:hover { color: var(--brand); border-color: var(--brand); }

.picker-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.picker-row:hover { background: var(--tint); }
.picker-row input { accent-color: var(--brand); flex: none; }
.picker-row .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.picker-row .lic { flex: none; font-size: 10.5px; }
.picker-empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 14px; }

.selnote {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: 10px; padding: 11px 15px; margin-bottom: 16px;
  font-size: 14px; color: var(--brand-ink);
}
.selnote button {
  background: none; border: 0; color: var(--brand); font: 600 13.5px/1 var(--sans);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0;
}

@media (max-width: 980px) {
  /* The button sits right of centre once the toolbar wraps, so anchor the panel to
     its right edge instead of pushing off-screen. */
  .picker-panel { left: auto; right: 0; }
}

/* ---------------------------------------------------------- icons */

.tokens { display: flex; align-items: center; }
.tokens img, .tokens .metal {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2);
}
.tokens > * + * { margin-left: -9px; }
.metal {
  display: grid; place-items: center;
  font: 700 11px/1 var(--sans); color: #6b4e07; background: #f5d97a;
}
.metal.ag { color: #4b5563; background: #dfe3ea; }
.metal.coin { color: #7a4a05; background: #f7c76a; }
.metal.small { font-size: 9px; letter-spacing: -.02em; }

/* Fixed slot so rows line up whether the broker has a real logo or a monogram.
   MyFXBook only publishes logos for some brokers; guessing the rest from domain
   names produced other companies' marks, so the monogram is the honest fallback. */
.logo-slot { width: 104px; height: 40px; flex: none; display: flex; align-items: center; }
.logo-slot img { border-radius: 7px; }
.logo-slot img {
  max-width: 104px; max-height: 40px; object-fit: contain; object-position: left center;
  border-radius: 7px;
}
:root[data-theme="dark"] .logo-slot img,
:root:not([data-theme="light"]) .logo-slot img { background: #fff; padding: 2px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .logo-slot img { background: none; padding: 0; } }
.mono {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font: 700 13px/1 var(--sans); letter-spacing: .02em;
  color: hsl(var(--h) 62% 32%); background: hsl(var(--h) 68% 94%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 45% 86%);
}

/* ---------------------------------------------------------- pair cards */

.cards { display: flex; flex-direction: column; gap: 10px; }

.card {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(260px, 1.2fr) minmax(170px, .9fr) auto;
  align-items: center; gap: 20px;
  background: var(--raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 20px;
  cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.c-pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-pair .name { display: block; font: 600 17px/1.2 var(--sans); letter-spacing: -.01em; }
.c-pair .kind { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.c-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
/* The text block must be allowed to shrink, or the flex default (min-width:auto)
   holds the broker name at full width and pushes the card past a narrow viewport. */
.c-who > span:last-child { min-width: 0; flex: 1; }
.c-who .lbl { display: block; font-size: 11.5px; color: var(--ink-3); }
.c-who .nm { display: block; font: 600 15px/1.3 var(--sans); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.c-money .v { display: block; font: 700 20px/1.1 var(--sans); letter-spacing: -.02em; }
.c-money .w { display: block; font-size: 12.5px; margin-top: 4px; }
.c-money .worst { display: block; font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.earn .v, .earn .w { color: var(--earn); }
.pay  .v, .pay  .w { color: var(--pay); }
.flat .v { color: var(--ink); } .flat .w { color: var(--ink-3); }

.c-go { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.c-go .n { font-size: 12.5px; white-space: nowrap; }
.c-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.card:hover .c-go { color: var(--brand); }

.empty {
  border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 40px; text-align: center; color: var(--ink-3);
}

/* ---------------------------------------------------------- detail */

.back {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-2); font: 500 14px/1 var(--sans); padding: 10px 15px 10px 11px;
  cursor: pointer; margin-bottom: 26px;
}
.back:hover { color: var(--ink); border-color: var(--ink-3); }

.detail-tools { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-tools .searchbox { margin-left: 0; }
.detail-tools .searchbox input { width: 240px; }
.detail-tools .count { font-size: 13.5px; color: var(--ink-3); }
.rows-empty { padding: 32px 20px; text-align: center; color: var(--ink-3); }

.stale {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff6e5; color: #8a5a00; border: 1px solid #f0dcb4;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.detail-head { display: flex; align-items: center; gap: 16px; }
.detail-head .tokens img, .detail-head .tokens .metal { width: 40px; height: 40px; }
.detail-head h2 { font: 700 30px/1.15 var(--sans); letter-spacing: -.03em; }
.detail-head .kind { font-size: 14px; color: var(--ink-3); margin-top: 3px; }

.answer {
  margin: 22px 0 26px; padding: 22px 24px;
  background: var(--tint); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 74ch;
}
.answer .head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font: 600 17px/1.3 var(--sans); color: var(--ink); margin-bottom: 8px;
  min-width: 0;
}
/* The logo is fixed-width; without this the sentence beside it refuses to wrap and
   pushes the whole page sideways on a narrow screen. */
.answer .head > .logo-slot { flex: none; }
.answer .head { word-break: break-word; }
.answer b { color: var(--ink); font-weight: 600; }
.answer .earn { color: var(--earn); font-weight: 700; }
.answer .pay  { color: var(--pay);  font-weight: 700; }

/* rows */

.tablecard {
  background: var(--raise); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.tablehead, .row {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) 130px 130px minmax(215px, 1fr);
  align-items: center; gap: 16px; padding: 14px 20px;
}
.tablehead {
  background: var(--tint); border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.tablehead b { color: var(--ink-2); font-weight: 600; }
.th-num, .row .n { text-align: right; }

.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row:hover { background: var(--tint); }
.row.top { background: var(--earn-soft); box-shadow: inset 3px 0 0 var(--earn); }
.row.top:hover { background: #ddf1e6; }

.r-broker { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.r-broker .nm { font: 600 15px/1.3 var(--sans); }
.r-broker a { color: inherit; text-decoration: none; }
.r-broker a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.rank { font-size: 12.5px; color: var(--ink-3); width: 20px; text-align: right; flex: none; }

.row .n { font: 600 15.5px/1.2 var(--sans); }
.n.earn { color: var(--earn); } .n.pay { color: var(--pay); } .n.flat { color: var(--ink-3); }

.pick { display: flex; align-items: center; gap: 9px; }
.pill {
  font: 700 11px/1 var(--sans); letter-spacing: .04em;
  padding: 6px 9px; border-radius: 7px; white-space: nowrap;
}
.pill.buy  { background: var(--brand-soft); color: var(--brand); }
.pill.sell { background: var(--tint-2); color: var(--ink-2); }
.pick .t { font-size: 13.5px; color: var(--ink-2); }
.pick .t b { font-weight: 600; }
.pick .t .earn { color: var(--earn); } .pick .t .pay { color: var(--pay); }

.todo {
  background: #fff3cd; color: #7a5b00; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.prose-table .todo { display: inline-block; }

/* licence badges ------------------------------------------------------- */

.nmwrap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-width: 0; flex: 1;
}
.nmwrap .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The licence label is context, not a headline. One size everywhere, quiet by
   default, and it only gains colour when it is telling you something you would
   otherwise assume wrongly. */
.lic {
  font: 500 11px/1 var(--sans); letter-spacing: .01em;
  padding: 3px 0 3px 11px; border-radius: 0; white-space: nowrap; cursor: help;
  position: relative; color: var(--ink-3); background: none;
}
.lic::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.lic-ok   { color: var(--ink-3); }
.lic-ok::before { background: var(--earn); opacity: .55; }
.lic-warn { color: var(--warn-ink); }
.lic-warn::before { background: var(--warn-ink); }
.lic-mid  { color: var(--ink-3); opacity: .75; }

.c-who .lic { margin-left: 6px; vertical-align: middle; }

.detail-tools .chk {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none;
}
.detail-tools .chk input { accent-color: var(--brand); }

/* ---------------------------------------------------------- entry cost */

.entry { margin-top: 52px; padding-top: 40px; border-top: 1px solid var(--line); }
.section-h { font: 700 24px/1.2 var(--sans); letter-spacing: -.025em; }
.section-h em { font-style: normal; color: var(--brand); }
.section-sub { margin: 10px 0 20px; color: var(--ink-2); max-width: 66ch; }

.tablehead.entryhead, .entry .row {
  grid-template-columns: minmax(210px, 1.3fr) 110px 120px 130px minmax(140px, .8fr);
}
.entry .row .n::before { content: none; }
.acct { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cheap { color: var(--earn); font-weight: 700; }

/* ---------------------------------------------------------- prose page */

.prose { max-width: 760px; padding-top: 48px; padding-bottom: 80px; }
.prose h1 { font-size: 32px; margin-bottom: 14px; }
.prose h2 {
  font: 700 21px/1.25 var(--sans); letter-spacing: -.02em;
  margin: 44px 0 12px; padding-top: 22px; border-top: 1px solid var(--line);
}
.prose p { margin-bottom: 14px; color: var(--ink-2); }
.prose p b, .prose li b { color: var(--ink); font-weight: 600; }
.prose ul { margin: 0 0 14px 20px; color: var(--ink-2); }
.prose li { margin-bottom: 9px; }
.prose a { color: var(--brand); }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--tint-2); padding: 2px 6px; border-radius: 5px; color: var(--ink);
}
.prose .lede { font-size: 18px; margin-bottom: 8px; }

.prose-table {
  width: 100%; border-collapse: collapse; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.prose-table th {
  position: static; background: var(--tint); text-align: left; padding: 12px 14px;
  font: 600 12px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
}
.prose-table td {
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-2); vertical-align: top;
}
.prose-table tr:last-child td { border-bottom: none; }

.callout {
  background: var(--brand-soft); border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: 16px 20px; margin: 18px 0;
  font-size: 15px; color: var(--ink-2);
}
.formula {
  background: var(--tint); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; font-size: 15px; color: var(--ink);
  overflow-x: auto; white-space: nowrap;
}

/* ---------------------------------------------------------- notes */

.tip { margin-top: 18px; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); max-width: 78ch; }
.tip b { color: var(--ink-2); font-weight: 600; }

.warn {
  margin: 22px 0; padding: 20px 22px;
  background: #fffaf0; border: 1px solid #f2e3c2; border-radius: var(--r);
  font-size: 15.5px; line-height: 1.65; color: #7a5a12; max-width: 76ch;
}
.warn b { color: #4d3a08; font-weight: 600; }

/* ---------------------------------------------------------- footer

   The risk warning is a legal obligation that only works if it is read, so it is not
   set as grey small print. It gets its own surface, a label, one sentence at reading
   size, and the caveats as separate lines — four claims presented as four things. */

footer { border-top: 1px solid var(--line); margin-top: 8px; padding: 34px 0 64px; }
.foot { display: flex; flex-direction: column; gap: 22px; }

.foot-top {
  display: flex; align-items: baseline; gap: 14px 28px; flex-wrap: wrap;
}
.foot-brand { font-size: 17px; }
.foot-brand .logomark { width: 24px; height: 24px; }

.risk {
  background: var(--tint); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 22px; max-width: 80ch;
}
.risk-label {
  font: 600 10.5px/1 var(--sans); letter-spacing: .11em; text-transform: uppercase;
  color: var(--warn-ink); margin-bottom: 11px;
}
.risk-lead {
  font: 600 15.5px/1.5 var(--sans); color: var(--ink);
  text-wrap: balance; margin-bottom: 12px;
}
.risk-lead span { color: var(--ink-2); font-weight: 500; }
.risk-list { list-style: none; display: grid; gap: 7px; }
.risk-list li {
  position: relative; padding-left: 17px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.risk-list li::before {
  content: ""; position: absolute; left: 2px; top: .68em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3);
}
.risk-list b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------- responsive

   The wide layout is a 4-column grid whose minmax() floors add up to ~740px, so it
   cannot simply reflow: below that the columns are reassigned explicitly and the
   detail rows grow their own labels, since the table header is hidden there. */

@media (max-width: 980px) {
  .card {
    grid-template-columns: 1fr auto;
    row-gap: 14px; column-gap: 16px; padding: 18px;
  }
  .c-pair  { grid-column: 1; }
  .c-go    { grid-column: 2; justify-self: end; align-self: start; }
  .c-who   { grid-column: 1 / -1; }
  .c-money { grid-column: 1 / -1; }
  .c-money .w, .c-money .worst { display: inline; margin: 0 0 0 8px; }

  .tablehead { display: none; }
  .entry .row { grid-template-columns: 1fr 1fr; }
  .entry .row .acct { grid-column: 1 / -1; }
  .row {
    grid-template-columns: 1fr 1fr;
    row-gap: 10px; column-gap: 16px; padding: 16px 18px;
  }
  .r-broker, .pick { grid-column: 1 / -1; }
  .row .n { text-align: left; }
  .row .n::before {
    display: block; margin-bottom: 3px;
    font: 500 11px/1 var(--sans); color: var(--ink-3);
  }
  .row .n.buy::before    { content: "If you buy"; }
  .row .n.sell::before   { content: "If you sell"; }
  .row .n.spread::before { content: "Spread"; }
  .row .n.comm::before   { content: "Commission"; }
  .row .n.turn::before   { content: "Round turn"; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .bar { height: auto; padding: 14px 0; flex-wrap: wrap; gap: 12px 18px; }
  .stamp { margin-left: auto; text-align: right; }

  h1 { font-size: 25px; }
  .lede { font-size: 15.5px; }

  /* Stacked, but still grouped: find on top, refine under it, each control full
     width so nothing ends up a 90px-wide tap target. */
  .toolbar { gap: 10px; padding: 10px; }
  .tb-find, .tb-refine {
    flex-direction: column; align-items: stretch; gap: 10px;
    width: 100%; flex: 1 1 100%; margin-left: 0; min-width: 0;
  }
  .picker, .picker-btn { width: 100%; justify-content: space-between; }
  .picker-panel { width: 100%; }
  .lot { width: 100%; justify-content: space-between; }
  .lot-group { flex: 1; margin-left: 6px; }
  .lot-input { flex: 1; justify-content: center; }
  .mainnav { order: 4; width: 100%; }
  .mainnav a { padding: 8px 10px; font-size: 13.5px; }
  .sortbar { gap: 8px; }
  .resultcount { margin-left: 0; width: 100%; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; font-size: 13.5px; }
  .searchbox { width: 100%; }
  .detail-tools { width: 100%; }
  .detail-tools .searchbox, .detail-tools .searchbox input { width: 100%; }
  .lot { gap: 8px; }

  .card { grid-template-columns: 1fr; }
  .c-go { grid-column: 1; justify-self: start; }
  .c-money .v { font-size: 22px; }
  .logo-slot { width: 76px; height: 30px; }
  .logo-slot img { max-width: 76px; max-height: 30px; }
  .lic { font-size: 10px; padding: 3px 6px; }

  .risk { padding: 16px 17px; }
  .risk-lead { font-size: 14.5px; }
  .detail-head h2 { font-size: 24px; }
  .answer { padding: 18px; font-size: 15.5px; }
  .row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- find-my-broker

   The site answers "what does it cost"; the form answers "so which one". It is the
   only element allowed to use the brand as a fill on the list page, because it is
   the only thing on that page asking to be pressed. */

.findcta {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  margin: 22px 0 0; padding: 16px 18px; cursor: pointer;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--r); color: inherit; font: inherit;
}
.findcta:hover { border-color: var(--brand); }
.findcta-ic {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 11px; background: var(--brand); color: #fff;
}
.findcta-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; }
.findcta-txt { display: grid; gap: 3px; min-width: 0; }
.findcta-txt b { font: 600 15.5px/1.3 var(--sans); color: var(--ink); }
.findcta-txt span { font-size: 13.5px; color: var(--ink-2); }
.findcta-go { margin-left: auto; font-size: 20px; color: var(--brand); flex: none; }

/* ---- questions ---- */

.q-dots { display: flex; gap: 5px; margin-bottom: 18px; }
.q-dots span {
  height: 3px; flex: 1; border-radius: 2px; background: var(--line-2);
}
.q-dots span.done { background: var(--brand); }
.q-dots span.now  { background: var(--brand); opacity: .45; }

.q-step {
  font: 600 10.5px/1 var(--sans); letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3);
}
.q-title { font: 700 22px/1.25 var(--sans); margin: 10px 0 6px; text-wrap: balance; }
.q-why { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

.q-opts { display: grid; gap: 8px; margin: 20px 0 4px; }
.q-opts button {
  text-align: left; padding: 14px 16px; cursor: pointer;
  background: var(--raise); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--ink); font: 500 15px/1.3 var(--sans);
}
.q-opts button:hover { border-color: var(--ink-3); }
.q-opts button.on {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand); font-weight: 600;
}

.q-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.q-back, .q-again {
  background: none; border: none; cursor: pointer; padding: 9px 0;
  color: var(--ink-2); font: 500 14px/1 var(--sans);
}
.q-back:hover, .q-again:hover { color: var(--ink); }
.q-next {
  background: var(--brand); border: none; border-radius: 10px; cursor: pointer;
  color: #fff; font: 600 14.5px/1 var(--sans); padding: 12px 18px;
}
.q-next:hover { filter: brightness(1.08); }

.q-empty h3 { font: 700 19px/1.3 var(--sans); margin-bottom: 8px; }
.q-empty p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 14px; }

/* ---- the recommendation ---- */

.rec-label {
  font: 600 10.5px/1 var(--sans); letter-spacing: .11em; text-transform: uppercase;
  color: var(--ink-3);
}
.rec-name { font: 700 30px/1.15 var(--sans); letter-spacing: -.025em; margin: 9px 0 5px; }
.rec-reg { font-size: 13px; color: var(--ink-3); }
.rec-why { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 16px 0 18px; }
.rec-why b { color: var(--ink); font-weight: 600; }

.rec-nums {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;
}
.rec-nums > div {
  background: var(--tint); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px 16px;
}
.rec-nums .v { display: block; font: 700 25px/1.1 var(--sans); color: var(--ink); }
.rec-nums .v.up { color: var(--earn); }
.rec-nums .v.dn { color: var(--pay); }
.rec-nums .l { display: block; font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.rec-second { font-size: 13.5px; color: var(--ink-2); margin-top: 14px; }
.rec-second b { color: var(--ink); font-weight: 600; }
.rec-basis {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-3);
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.rec-basis b { color: var(--ink-2); font-weight: 600; }

.rec-acts {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-top: 16px;
}
.q-open {
  color: var(--brand); font: 600 14px/1 var(--sans); text-decoration: none;
}
.q-open:hover { text-decoration: underline; }
.rec-nfa {
  font-size: 12px; line-height: 1.6; color: var(--ink-3);
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}

@media (max-width: 620px) {
  .findcta { gap: 12px; padding: 14px; }
  .findcta-txt b { font-size: 14.5px; }
  .findcta-txt span { font-size: 12.5px; }
  .q-title { font-size: 19px; }
  .rec-name { font-size: 25px; }
}

/* ---------------------------------------------------------- matrix view

   Pairs down, brokers across. Two grids rather than one, because a nightly swap and
   a one-off entry cost are different money and a single table invites adding them.
   Both axes are sticky: with 60 rows and a horizontal scroll, a cell with neither its
   pair nor its broker in view is an unreadable number. */

.viewseg {
  display: flex; gap: 2px; padding: 3px; margin-left: auto; flex: none;
  background: var(--seg-track); border: 1px solid var(--line); border-radius: 10px;
}
.viewseg button {
  background: none; border: none; border-radius: 7px; cursor: pointer;
  color: var(--ink-2); font: 500 12.5px/1 var(--sans); padding: 7px 12px;
}
.viewseg button:hover { color: var(--ink); }
.viewseg button.on {
  background: var(--seg-chip); color: var(--brand); font-weight: 600;
  box-shadow: 0 1px 2px rgba(12,40,48,.10);
}

.grouphead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 0 8px; }
.grouphead:first-child { margin-top: 4px; }
.grouphead .t { font: 600 17px/1.3 var(--sans); letter-spacing: -.015em; }
.grouphead .d {
  font: 500 10.5px/1 var(--sans); letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3);
}
.grouphead.hold  .t::before { content: "◆ "; color: var(--brand); }
.grouphead.trade .t::before { content: "◆ "; color: var(--ink-3); }

.viewhint { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }

.matrixbox {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--raise); overflow: auto; max-height: 70vh;
}
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.matrix th, .matrix td {
  padding: 11px 14px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.matrix thead th {
  position: sticky; top: 0; z-index: 2; background: var(--tint);
  font: 600 10.5px/1.4 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
}
.matrix th:first-child, .matrix td:first-child {
  position: sticky; left: 0; z-index: 1; text-align: left;
  background: var(--raise); font: 600 13.5px/1.2 var(--sans); color: var(--ink);
}
.matrix thead th:first-child { z-index: 3; background: var(--tint); }
.matrix tbody tr { cursor: pointer; }
.matrix tbody tr:hover td,
.matrix tbody tr:hover th:first-child { background: var(--tint); }
.matrix tbody tr:last-child td, .matrix tbody tr:last-child th { border-bottom: 0; }

.prowname {
  display: block; margin-top: 2px; font: 400 10px/1 var(--sans);
  color: var(--ink-3); letter-spacing: .04em;
}
.cell-best { color: var(--earn); font-weight: 700; }
.cell-bad  { color: var(--pay); }
.cell-mid  { color: var(--ink-2); }
.cell-na   { color: var(--ink-3); }

@media (max-width: 620px) {
  .viewseg { margin-left: 0; }
  .matrix th, .matrix td { padding: 10px 11px; font-size: 12.5px; }
  .grouphead .t { font-size: 15.5px; }
}
