/* ═══════════════════════════════════════════════════════════════
   /market — watch price analytics
   ───────────────────────────────────────────────────────────────
   The site is dark-only (see style.css :root), so there is exactly
   one selected mode here. Data colours were validated against the
   card surface #181b20 with the dataviz palette validator:

     above retail  #c67f26   L .64  ┐ diverging pair, warm ↔ cool
     below retail  #3f8fe0   L .64  ┘ worst-pair ΔE 25.5 protan /
                                     29.6 normal · both ≥ 3:1
     de-emphasis   #8b9099   grey on purpose (chroma floor N/A)

   Brand amber (--primary #efac4d) is UI chrome only — it is too
   light for the dark lightness band, so it never carries data.
   ═══════════════════════════════════════════════════════════════ */

.mkt-root {
  /* Surfaces */
  --surface:        hsl(220 13% 11%);
  --surface-2:      hsl(220 12% 13%);
  --surface-sunk:   hsl(220 14% 8%);

  /* Ink */
  --ink:            hsl(220 9% 98%);
  --ink-2:          hsl(220 6% 72%);
  --ink-muted:      hsl(220 5% 55%);

  /* Chart chrome */
  --grid:           hsl(220 8% 18%);
  --axis:           hsl(220 8% 26%);
  --ref:            hsl(220 6% 42%);

  /* Data — diverging pair + neutral midpoint */
  --above:          #c67f26;
  --above-soft:     color-mix(in oklab, #c67f26 22%, transparent);
  --below:          #3f8fe0;
  --below-soft:     color-mix(in oklab, #3f8fe0 22%, transparent);
  --neutral:        #8b9099;
  --neutral-soft:   color-mix(in oklab, #8b9099 18%, transparent);

  --r:  0.75rem;
  --r-sm: 0.5rem;

  color-scheme: dark;
  padding: 5.5rem 0 5rem;
  container-type: inline-size;
}

.mkt-wrap { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* ─── Hero ───────────────────────────────────────── */
.mkt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: end;
  padding: 1rem 0 2rem;
}
@container (max-width: 860px) { .mkt-hero { grid-template-columns: 1fr; gap: 1.5rem; } }

.mkt-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary);
}
.mkt-eyebrow::before {
  content: ''; width: 1.5rem; height: 1px;
  background: var(--grad-primary);
}
.mkt-hero h1 {
  font-size: clamp(2rem, 4.5cqi, 3rem);
  line-height: 1.08;
  font-weight: 700;
  margin: .75rem 0 .875rem;
  letter-spacing: -.02em;
}
.mkt-lede { color: var(--ink-2); font-size: 1rem; line-height: 1.6; max-width: 60ch; }
.mkt-lede a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* The one hero figure on the page. Proportional figures on purpose —
   tabular-nums makes a big standalone number look loose. */
.mkt-herofig {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.mkt-herofig::after {
  content: ''; position: absolute; inset: auto -20% -60% auto;
  width: 16rem; height: 16rem; border-radius: 50%;
  background: radial-gradient(circle, var(--below-soft), transparent 68%);
  pointer-events: none;
}
.mkt-herofig.is-above::after { background: radial-gradient(circle, var(--above-soft), transparent 68%); }
.mkt-herofig-label { font-size: .8125rem; color: var(--ink-2); }
.mkt-herofig-value {
  font-size: clamp(2.75rem, 7cqi, 4rem);
  font-weight: 700; line-height: 1;
  letter-spacing: -.03em;
  margin: .375rem 0 .25rem;
  color: var(--below);
}
.mkt-herofig.is-above .mkt-herofig-value { color: var(--above); }
.mkt-herofig-sub { font-size: .8125rem; color: var(--ink-muted); position: relative; z-index: 1; }

/* ─── Filter bar (one row, scopes everything below) ── */
.mkt-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .75rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -18px rgb(0 0 0 / .9);
}
.mkt-filter-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  width: 100%;
}

/* ─── Brand strip ────────────────────────────────── */
.mkt-brandbar {
  width: 100%;
  border-top: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  padding-top: .625rem;
}
.mkt-sub-label {
  display: block; margin-bottom: .5rem;
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.mkt-brandgrid {
  display: grid; gap: .375rem;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}

/* One uniform box per brand: the logos have wildly different aspect ratios
   (Panerai is 9:1, Patek is 2:1), so the button — not the artwork — sets the
   rhythm, and each logo is contained inside it. */
.mkt-brand {
  position: relative;
  display: grid; place-items: center;
  height: 3rem;
  /* Symmetric side padding keeps the logo centred while reserving a gutter the
     count badge can sit in — otherwise a wide wordmark runs under it. */
  padding: .5rem 1.125rem;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgb(255 255 255 / .04);
  cursor: pointer;
  transition: border-color .18s, background .18s, opacity .18s;
}
.mkt-brand img {
  max-height: 1.625rem; max-width: 100%;
  object-fit: contain;
  /* The mirrored logos are white silhouettes; dim rather than recolour so the
     selected state reads as "lit up". */
  opacity: .72; transition: opacity .18s;
}
.mkt-brand-name {
  font-size: .6875rem; font-weight: 600; line-height: 1.15;
  text-align: center; color: var(--ink-2);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mkt-brand-n {
  position: absolute; top: .1875rem; right: .3125rem;
  font-size: .625rem; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--ink-muted); transition: color .18s;
}
.mkt-brand:hover { background: var(--accent); border-color: color-mix(in oklab, var(--primary) 45%, var(--border)); }
.mkt-brand:hover img { opacity: 1; }
.mkt-brand:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mkt-brand[aria-pressed="true"] {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary) 13%, transparent);
}
.mkt-brand[aria-pressed="true"] img { opacity: 1; }
.mkt-brand[aria-pressed="true"] .mkt-brand-n { color: var(--primary); }

/* Once anything is picked, the rest recede so the selection is obvious. */
.mkt-brandgrid:has(.mkt-brand[aria-pressed="true"]) .mkt-brand[aria-pressed="false"] { opacity: .4; }
.mkt-brandgrid:has(.mkt-brand[aria-pressed="true"]) .mkt-brand[aria-pressed="false"]:hover { opacity: 1; }
.mkt-filters:has(.mkt-chip) { border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); }

.mkt-search { position: relative; flex: 1 1 12rem; min-width: 10rem; }
.mkt-search .input { padding-left: 2rem; }
.mkt-search svg {
  position: absolute; left: .625rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); pointer-events: none;
}

/* Dropdown filters use the native popover API; the anchor fallback is
   plain absolute positioning set from JS, so no anchor-name support needed. */
.mkt-drop { position: relative; }
.mkt-drop-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .75rem;
  font-size: .8125rem; font-weight: 500;
  color: var(--ink); background: rgb(255 255 255 / .05);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.mkt-drop-btn:hover { background: var(--accent); }
.mkt-drop-btn[aria-expanded="true"] { border-color: var(--primary); }
.mkt-drop-btn .mkt-pill[hidden] { display: none; }
.mkt-drop-btn .mkt-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.125rem; height: 1.125rem; padding: 0 .3rem;
  border-radius: 9999px; font-size: .6875rem; font-weight: 600;
  background: var(--primary); color: var(--primary-fg);
}
.mkt-drop-btn svg { color: var(--ink-muted); }

.mkt-pop {
  color-scheme: dark;
  position: fixed; margin: 0; inset: auto;
  width: min(20rem, calc(100vw - 2rem));
  max-height: min(24rem, 60vh);
  overflow-y: auto; overscroll-behavior: contain;
  padding: .5rem;
  background: hsl(220 13% 12%);
  border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: 0 24px 48px -12px rgb(0 0 0 / .8);
  color: var(--ink);
}
.mkt-pop::backdrop { background: transparent; }
.mkt-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .25rem .5rem .5rem;
  font-size: .6875rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-muted);
}
.mkt-pop-head button {
  background: none; border: 0; cursor: pointer; padding: .125rem .25rem;
  font: inherit; font-size: .6875rem; letter-spacing: 0; text-transform: none;
  color: var(--primary); border-radius: .25rem;
}
.mkt-pop-head button:hover { background: var(--accent); }

.mkt-opt {
  display: flex; align-items: center; gap: .625rem;
  padding: .4rem .5rem; border-radius: var(--r-sm);
  font-size: .8125rem; cursor: pointer;
}
.mkt-opt:hover { background: var(--accent); }
.mkt-opt input { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; flex: none; }
.mkt-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-opt-n { font-size: .6875rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Segmented control */
.mkt-seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: rgb(255 255 255 / .05);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.mkt-seg button {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .375rem .625rem; border: 0; border-radius: calc(var(--r-sm) - 2px);
  background: transparent; color: var(--ink-2);
  font: inherit; font-size: .8125rem; font-weight: 500; cursor: pointer;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.mkt-seg button:hover { color: var(--ink); }
.mkt-seg button[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
.mkt-seg .mkt-dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.mkt-seg .mkt-dot.is-above { background: var(--above); }
.mkt-seg .mkt-dot.is-below { background: var(--below); }

.mkt-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: rgb(255 255 255 / .05);
  font-size: .8125rem; cursor: pointer; white-space: nowrap;
}
.mkt-toggle:hover { background: var(--accent); }
.mkt-toggle input { accent-color: var(--primary); width: 14px; height: 14px; cursor: pointer; }
.mkt-toggle:has(input:checked) { border-color: var(--primary); color: var(--primary); }

.mkt-spacer { flex: 1 1 0; min-width: 0; }

/* Active-filter chips */
.mkt-chips { display: flex; flex-wrap: wrap; gap: .375rem; width: 100%; }
.mkt-chips:empty { display: none; }
.mkt-chip {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .5rem .25rem .625rem;
  border-radius: 9999px; font-size: .75rem;
  background: color-mix(in oklab, var(--primary) 14%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}
.mkt-chip button {
  display: grid; place-items: center;
  width: 1rem; height: 1rem; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in oklab, var(--primary) 22%, transparent);
  color: inherit; font: inherit; line-height: 1;
}
.mkt-chip button:hover { background: var(--primary); color: var(--primary-fg); }

/* ─── KPI row ────────────────────────────────────── */
.mkt-kpis {
  display: grid; gap: .75rem; margin-bottom: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.mkt-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: .875rem 1rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.mkt-kpi-label { font-size: .75rem; color: var(--ink-2); }
.mkt-kpi-value { font-size: 1.625rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.mkt-kpi-sub { font-size: .75rem; color: var(--ink-muted); }
.mkt-kpi-sub b { color: var(--ink-2); font-weight: 500; }

/* Share meter — unfilled track is a lighter step of the filled ramp */
.mkt-meter {
  height: .375rem; border-radius: 9999px; overflow: hidden;
  background: var(--below-soft); display: flex; margin-top: .125rem;
}
.mkt-meter i { display: block; height: 100%; background: var(--above); }
.mkt-meter i + i { background: var(--below); margin-left: 2px; }

/* ─── Chart cards ────────────────────────────────── */
.mkt-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mkt-grid > .mkt-span2 { grid-column: 1 / -1; }
@container (max-width: 900px) { .mkt-grid { grid-template-columns: 1fr; } }

.mkt-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.125rem 1.25rem 1rem;
  container-type: inline-size;
}
.mkt-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; }
.mkt-card h2 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.mkt-card-sub { font-size: .8125rem; color: var(--ink-muted); margin-top: .1875rem; max-width: 62ch; }
.mkt-card-tools { display: flex; gap: .375rem; flex: none; }

/* Side by side the title gets squeezed to a few words per line once a level
   switcher sits next to it, so below a card width of ~420px they stack. */
@container (max-width: 420px) {
  .mkt-card-head { flex-direction: column; gap: .625rem; }
  .mkt-card-tools { flex-wrap: wrap; }
}

/* A caveat that belongs to one view of a chart, not to the chart itself. */
.mkt-card-note {
  margin-top: .625rem; padding: .5rem .75rem;
  border-radius: var(--r-sm);
  border-left: 2px solid color-mix(in oklab, var(--primary) 55%, transparent);
  background: color-mix(in oklab, var(--primary) 7%, transparent);
  font-size: .75rem; line-height: 1.5; color: var(--ink-2);
}
.mkt-card-note[hidden] { display: none; }

.mkt-seg button:disabled { opacity: .4; cursor: not-allowed; }
.mkt-seg button:disabled:hover { color: var(--ink-2); }

.mkt-plot { position: relative; margin-top: .875rem; }
.mkt-plot svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Chart text wears ink tokens, never a series colour. */
.mkt-plot text { fill: var(--ink-muted); font-size: 11px; }
.mkt-plot .t-strong { fill: var(--ink); font-weight: 600; }
.mkt-plot .t-2 { fill: var(--ink-2); }
.mkt-plot .grid { stroke: var(--grid); stroke-width: 1; }
.mkt-plot .axis { stroke: var(--axis); stroke-width: 1; }
.mkt-plot .ref { stroke: var(--ref); stroke-width: 1; }

.mkt-mark { transition: opacity .15s; }
.mkt-hit { fill: transparent; outline: none; }
.mkt-hit.is-pickable { cursor: pointer; }
/* The band behind a picked row/column, so a chart shows what it is filtering by. */
.mkt-rowsel {
  fill: color-mix(in oklab, var(--primary) 12%, transparent);
  stroke: color-mix(in oklab, var(--primary) 45%, transparent);
  stroke-width: 1;
}
.mkt-hit:focus-visible + .mkt-mark,
.mkt-hit.is-hot + .mkt-mark { filter: brightness(1.22); }
.mkt-hit:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 3px; }

.mkt-legend { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: .75rem; }
.mkt-legend-item { display: inline-flex; align-items: center; gap: .4375rem; font-size: .75rem; color: var(--ink-2); }
.mkt-key { width: .625rem; height: .625rem; border-radius: 3px; flex: none; }
.mkt-key.is-round { border-radius: 50%; }
.mkt-key.is-line { width: 1rem; height: 2px; border-radius: 1px; }

.mkt-empty {
  display: grid; place-items: center; gap: .5rem;
  min-height: 9rem; text-align: center;
  color: var(--ink-muted); font-size: .875rem;
}

/* ─── Tooltip ────────────────────────────────────── */
.mkt-tip {
  position: fixed; z-index: 60; pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
  min-width: 11rem; max-width: 17rem;
  padding: .625rem .75rem;
  background: hsl(220 13% 13% / .97);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: 0 16px 32px -12px rgb(0 0 0 / .85);
  font-size: .8125rem; line-height: 1.45;
}
.mkt-tip.is-on { opacity: 1; transform: none; }
.mkt-tip-title { font-weight: 600; color: var(--ink); }
.mkt-tip-meta { font-size: .6875rem; color: var(--ink-muted); margin-bottom: .375rem; }
.mkt-tip-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
/* Values lead, labels follow. */
.mkt-tip-row b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.mkt-tip-row span { color: var(--ink-muted); font-size: .75rem; display: inline-flex; align-items: center; gap: .375rem; }
.mkt-tip-rule { height: 1px; background: var(--border); margin: .375rem 0; }
/* Reference photos come from three different third-party hosts; if one fails
   the tooltip simply loses the picture (see the onerror in market.js). */
.mkt-tip-img {
  display: block; width: 100%; max-height: 8rem;
  object-fit: contain; object-position: left;
  margin: .25rem 0 .5rem;
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / .04);
}
.mkt-tip-hint {
  margin-top: .375rem; padding-top: .375rem;
  border-top: 1px solid var(--border);
  font-size: .6875rem; color: var(--primary);
}

/* ─── Builder callout ────────────────────────────── */
.mkt-callout {
  margin-top: 1rem;
  background: linear-gradient(135deg, hsl(220 13% 12%), hsl(220 14% 10%));
  border: 1px solid color-mix(in oklab, var(--primary) 24%, var(--border));
  border-radius: var(--r); padding: 1.25rem 1.5rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem; align-items: center;
}
@container (max-width: 760px) { .mkt-callout { grid-template-columns: 1fr; } }
.mkt-callout h2 { font-size: 1.0625rem; margin-bottom: .375rem; }
.mkt-callout p { font-size: .875rem; color: var(--ink-2); line-height: 1.55; max-width: 66ch; }
.mkt-callout-cta { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ─── Table view ─────────────────────────────────── */
.mkt-tablewrap {
  margin-top: 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden;
}
.mkt-tablehead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.mkt-tablescroll { max-height: 34rem; overflow: auto; }
.mkt-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.mkt-table th, .mkt-table td {
  padding: .5rem .625rem; text-align: left; white-space: nowrap;
  /* Reference rows carry ten columns; long free-text cells get an ellipsis
     (and a title) so the premium column stays on screen. */
  max-width: 13rem; overflow: hidden; text-overflow: ellipsis;
}
/* At model level the first column pairs a name with a homage badge and needs
   more room. Reference rows can't spare it — they already fill the width. */
.mkt-table[data-level="models"] td:first-child,
.mkt-table[data-level="models"] th:first-child { max-width: 17rem; }
/* Reference rows are the widest set — thumbnail, link, ten columns. Free text
   gets a tighter cap there so "vs retail" stays on screen without scrolling. */
.mkt-table[data-level="refs"] td, .mkt-table[data-level="refs"] th { max-width: 10rem; }
.mkt-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.mkt-table thead th:hover { color: var(--ink-2); }
.mkt-table thead th[aria-sort]:not([aria-sort="none"]) { color: var(--primary); }
.mkt-table thead th .mkt-sort::after { content: '↕'; margin-left: .3rem; opacity: .45; }
.mkt-table thead th[aria-sort="ascending"] .mkt-sort::after { content: '↑'; opacity: 1; }
.mkt-table thead th[aria-sort="descending"] .mkt-sort::after { content: '↓'; opacity: 1; }
.mkt-table tbody tr { border-bottom: 1px solid color-mix(in oklab, var(--border) 55%, transparent); }
.mkt-table tbody tr:hover { background: rgb(255 255 255 / .03); }
.mkt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mkt-table .mkt-prem { display: inline-flex; align-items: center; gap: .4rem; justify-content: flex-end; }
.mkt-table .mkt-prem i { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.mkt-table .is-above i { background: var(--above); }
.mkt-table .is-below i { background: var(--below); }
/* Outbound name links. The arrow is drawn in CSS so the cell stays plain text
   for copy/paste and for the CSV export. */
.mkt-namelink {
  color: inherit; text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--primary) 40%, transparent);
  transition: color .15s, border-color .15s;
}
.mkt-namelink:hover, .mkt-namelink:focus-visible { color: var(--primary); border-bottom-color: var(--primary); }
.mkt-namelink:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
/* A real glyph rather than a CSS-border chevron: borders give a caret, not an
   arrow, and the direction is what carries "this leaves the site". */
.mkt-ext {
  font-style: normal;
  margin-left: .25rem;
  font-size: .8em; line-height: 1;
  opacity: .5;
}
.mkt-ext::before { content: '\2197'; }
.mkt-namelink:hover .mkt-ext { opacity: 1; }

/* Hover preview of the watch. Fixed, because the table scrolls. */
.mkt-preview {
  position: fixed; z-index: 70; pointer-events: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
  width: 13rem; padding: .5rem;
  background: hsl(220 13% 13% / .97);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: 0 16px 32px -12px rgb(0 0 0 / .85);
}
.mkt-preview.is-on { opacity: 1; transform: none; }
.mkt-preview img {
  display: block; width: 100%; height: 9rem;
  object-fit: contain;
  border-radius: .25rem;
  background: rgb(255 255 255 / .04);
}
.mkt-preview span {
  display: block; margin-top: .375rem;
  font-size: .6875rem; color: var(--ink-muted); text-align: center;
}
.mkt-preview span[hidden] { display: none; }

@media (hover: none) {
  /* No pointer to hover with; the thumbnail column already carries the image. */
  .mkt-preview { display: none; }
}

.mkt-thumb {
  width: 1.75rem; height: 1.75rem;
  object-fit: contain; vertical-align: middle;
  margin-right: .5rem;
  border-radius: .25rem;
  background: rgb(255 255 255 / .04);
}
.mkt-table .mkt-base {
  font-size: .625rem; padding: .0625rem .3125rem; border-radius: 9999px;
  background: color-mix(in oklab, var(--primary) 16%, transparent);
  color: var(--primary); margin-left: .375rem;
}

/* ─── Footnote ───────────────────────────────────── */
.mkt-note {
  margin-top: 1.25rem; padding: 1rem 1.125rem;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-sunk);
  font-size: .75rem; line-height: 1.6; color: var(--ink-muted);
}
.mkt-note b { color: var(--ink-2); font-weight: 600; }
.mkt-note a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* ─── Section heading ────────────────────────────── */
.mkt-sec { margin: 1.75rem 0 .875rem; display: flex; align-items: baseline; gap: .75rem; }
.mkt-sec h2 { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.mkt-sec::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── Motion ─────────────────────────────────────── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mkt-card, .mkt-kpi, .mkt-callout, .mkt-tablewrap {
      animation: mkt-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}
@keyframes mkt-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-plot, .mkt-tip, .mkt-mark { transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

::view-transition-old(mkt-charts), ::view-transition-new(mkt-charts) {
  animation-duration: .22s;
}

/* Texture — the backup identity channel when hue can't carry it. */
@media (forced-colors: active) {
  .mkt-plot .mkt-mark[data-sign="above"] { fill: url(#mkt-tex-above) !important; }
  .mkt-plot .mkt-mark[data-sign="below"] { fill: url(#mkt-tex-below) !important; }
}
@media print {
  .mkt-filters, .mkt-card-tools { display: none; }
  .mkt-card, .mkt-kpi { break-inside: avoid; }
}
