/* QXLSMP market — one stylesheet, no build step.
 *
 * Same family as smp.qxl.io and qxl.io (qxlio-site/STYLE.md): Archivo, near-black,
 * zero radius, hairlines instead of shadows, one flat accent: qxl.io's orange.
 *
 * Dark, single-theme by decision: this is a trading screen that people leave
 * open on a second monitor at night. Colours are the validated data-viz palette
 * stepped for a dark surface; series slots are fixed and assigned by entity, so
 * filtering a chart never repaints the survivors.
 */

@font-face { font-family: 'Archivo'; font-weight: 500; src: url('/landing/fonts/archivo-500.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; font-weight: 700; src: url('/landing/fonts/archivo-700.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; font-weight: 900; src: url('/landing/fonts/archivo-900.woff2') format('woff2'); font-display: swap; }
/* Monocraft (SIL OFL 1.1): the Minecraft voice for small type, as on the landing page. */
@font-face { font-family: 'Monocraft'; font-weight: 400; src: url('/landing/fonts/monocraft-400.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Monocraft'; font-weight: 700; src: url('/landing/fonts/monocraft-700.woff2') format('woff2'); font-display: swap; }

:root {
  /* surfaces */
  --plane:      #0a0a0a;
  --surface-1:  #0f0f0f;   /* cards, chart surface */
  --surface-2:  #161616;   /* raised rows, inputs */
  --surface-3:  #1f1f1f;   /* hover */
  --hairline:   #262626;
  --hairline-2: #333333;

  /* ink */
  --ink:        #f2f2f2;
  --ink-2:      #b4b4b4;
  --ink-3:      #8a8a8a;

  /* categorical series, dark steps, fixed order */
  --series-1: #3987e5;  --series-2: #d95926;  --series-3: #199e70;  --series-4: #c98500;
  --series-5: #d55181;  --series-6: #008300;  --series-7: #9085e9;  --series-8: #e66767;

  /* status — reserved, never reused as a series */
  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;

  --good-wash:     rgba(12,163,12,.13);
  --critical-wash: rgba(208,59,59,.13);
  --warning-wash:  rgba(250,178,25,.13);
  --accent:      #ff4d1a;   /* qxl.io's orange, the family's one accent */
  --accent-wash: rgba(255,77,26,.12);

  --radius:   0;
  --radius-s: 0;
  --shadow:   none;

  --font: 'Archivo', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --topbar-h: 58px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0 0 .6em; }
small { font-size: 12px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

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

/* ── top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px;
  height: var(--topbar-h); display: flex; align-items: center; gap: 22px;
}

.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { color: var(--accent); display: flex; }
.brand-text { font-weight: 700; letter-spacing: -.02em; font-size: 16px; display: flex; align-items: baseline; gap: 3px; }
.brand-text em { font-style: normal; color: var(--ink-2); font-weight: 600; }
.brand-text small { color: var(--ink-3); font-weight: 500; margin-left: 4px; letter-spacing: .04em; text-transform: uppercase; font-size: 10px; }

/* overflow: visible so the Market dropdown is never clipped; the hamburger
   menu takes over below 940px, so the nav never needs to scroll sideways. */
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow: visible; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 11px; border-radius: var(--radius-s); color: var(--ink-2);
  font-size: 14px; font-weight: 520; white-space: nowrap; transition: color .12s, background .12s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: var(--surface-3); }
.nav-account { margin-left: auto; }

/* The Market group: a toggle button plus a dropdown of the market pages. */
.nav-group { position: relative; }
.nav-group-toggle {
  display: flex; align-items: center; gap: 5px;
  background: none; border: 0; color: var(--ink-2);
  font: inherit; font-size: 14px; font-weight: 520;
  padding: 7px 11px; border-radius: var(--radius-s);
  cursor: pointer; white-space: nowrap; transition: color .12s, background .12s;
}
.nav-group-toggle:hover { color: var(--ink); background: var(--surface-2); }
.nav-group.active .nav-group-toggle { color: var(--ink); background: var(--surface-3); }
.nav-caret { font-size: 9px; transition: transform .12s; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-menu {
  position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 168px; padding: 6px;
  background: var(--surface-1); border: 1px solid var(--hairline-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: none; flex-direction: column; gap: 2px;
}
.nav-group.open .nav-menu { display: flex; }
.nav-menu a { padding: 8px 10px; border-radius: var(--radius-s); }

.topbar-right { display: flex; align-items: center; gap: 10px; flex: none; }

.tick {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2);
  background: var(--surface-1); border: 1px solid var(--hairline);
  padding: 5px 11px; border-radius: 100px; font-variant-numeric: tabular-nums;
}
.tick-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.tick-dot.ok   { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.tick-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-wash); }
.tick-dot.bad  { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-wash); }

/* .btn sets display later in this file; the extra class keeps the menu
   button hidden on wide screens, where the nav is always shown. */
.btn.nav-toggle { display: none; }

.mockbar {
  background: var(--warning-wash); border-top: 1px solid rgba(250,178,25,.25);
  color: #f0d9a8; font-size: 12.5px; padding: 6px 20px; text-align: center;
}
.mockbar b { color: var(--warning); }
.mockbar button {
  background: none; border: 1px solid rgba(250,178,25,.4); color: inherit;
  border-radius: 5px; padding: 1px 8px; font: inherit; font-size: 12px; cursor: pointer; margin-left: 8px;
}

/* ── layout ──────────────────────────────────────────────────────────────── */

.view { max-width: 1360px; margin: 0 auto; padding: 26px 20px 60px; min-height: 70vh; }
.page { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h1 { font-size: 25px; }
.page-head .sub { color: var(--ink-3); font-size: 13.5px; margin: 5px 0 0; }

.sort-label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-3); font-size: 13px;
}
.sort-label select {
  background: var(--surface-1); color: var(--ink-1);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 6px 10px; font-size: 13px; cursor: pointer;
}

.card {
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.card-head h2 { font-size: 15px; }
.card-head .sub { color: var(--ink-3); font-size: 12.5px; margin: 3px 0 0; font-weight: 400; }

.cols { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .cols-2, .cols-3, .cols-2-1 { grid-template-columns: 1fr; } }

.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── stat tiles ──────────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 15px;
}
.tile-label { color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tile-value { font-size: 25px; font-weight: 640; margin-top: 6px; letter-spacing: -.02em; }
.tile-foot { color: var(--ink-3); font-size: 12px; margin-top: 5px; display: flex; gap: 7px; align-items: center; }

/* the hero number on the portfolio page */
.hero { padding: 22px 24px; }
.hero .tile-value { font-size: 42px; }
@media (max-width: 640px) { .hero .tile-value { font-size: 32px; } }

/* ── controls ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline-2); border-radius: var(--radius-s);
  padding: 7px 13px; font: inherit; font-size: 13.5px; font-weight: 520;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover { background: #4c93e8; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-icon { padding: 7px; }
.btn-danger { color: var(--critical); border-color: rgba(208,59,59,.35); }
.btn-danger:hover { background: var(--critical-wash); }

input, select, textarea {
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hairline-2); border-radius: var(--radius-s);
  padding: 7px 11px; font: inherit; font-size: 13.5px; min-width: 0;
}
input::placeholder { color: var(--ink-3); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }

.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; color: var(--ink-3); font-weight: 520; }

/* Filters sit in one row above the content they filter. */
.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 16px;
}
.filters .field input, .filters .field select { min-width: 108px; }

.search { position: relative; flex: 1; min-width: 190px; }
.search input { width: 100%; padding-left: 32px; }
.search::before {
  content: ''; position: absolute; left: 11px; top: 50%; width: 13px; height: 13px;
  margin-top: -6px; border: 1.8px solid var(--ink-3); border-radius: 50%;
  box-shadow: 5px 5px 0 -4.2px var(--ink-3); pointer-events: none;
}

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--hairline-2); border-radius: var(--radius-s); padding: 2px; }
.segmented button {
  background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 520;
  padding: 5px 11px; border-radius: 5px; cursor: pointer; white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }

/* ── badges ──────────────────────────────────────────────────────────────── */

/* Direction is carried by the arrow glyph as well as the colour. */
.delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: 100px; white-space: nowrap;
}
.delta-arrow { font-size: 9px; line-height: 1; }
.delta-up   { color: var(--good);     background: var(--good-wash); }
.delta-down { color: var(--critical); background: var(--critical-wash); }
.delta-flat { color: var(--ink-3);    background: var(--surface-2); }
.delta.sm { font-size: 11.5px; padding: 1px 6px; }

.pill {
  display: inline-block; min-width: 26px; text-align: center;
  font-size: 11.5px; font-weight: 640; padding: 2px 6px; border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.pill-good { color: var(--good); background: var(--good-wash); }
.pill-warn { color: var(--warning); background: var(--warning-wash); }
.pill-bad  { color: var(--serious); background: rgba(236,131,90,.13); }
.pill-unknown { color: var(--ink-3); background: var(--surface-2); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 560; letter-spacing: .02em;
  padding: 2px 7px; border-radius: 5px; background: var(--surface-2);
  color: var(--ink-2); border: 1px solid var(--hairline-2);
}
.tag-ench { color: var(--series-7); border-color: rgba(144,133,233,.35); background: rgba(144,133,233,.1); }
.tag-warn { color: var(--warning); border-color: rgba(250,178,25,.3); background: var(--warning-wash); }
.tag-ah   { color: var(--series-2); border-color: rgba(217,89,38,.35); background: rgba(217,89,38,.1); }
.tag-orders { color: var(--series-1); border-color: rgba(57,135,229,.35); background: var(--accent-wash); }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-1); border: 1px solid var(--hairline);
  border-left: 2px solid var(--ink-3);
  border-radius: var(--radius-s); padding: 11px 14px; font-size: 13px; color: var(--ink-2);
}
.note-warn { border-left-color: var(--warning); }
.note b { color: var(--ink); font-weight: 600; }

/* ── icons ───────────────────────────────────────────────────────────────── */

.icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex: none; border-radius: 6px; overflow: hidden;
  width: 32px; height: 32px;
  background:
    linear-gradient(150deg,
      hsl(var(--icon-h, 210) 26% 34%) 0%,
      hsl(var(--icon-h, 210) 30% 22%) 62%,
      hsl(calc(var(--icon-h, 210) + 22) 28% 17%) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
.icon-mono {
  font: 640 11px/1 var(--font); letter-spacing: .01em;
  color: hsl(var(--icon-h, 210) 45% 88%); opacity: .82;
  transform: rotate(var(--icon-tilt, 0deg));
  user-select: none;
}
.icon img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; image-rendering: pixelated;
  background: var(--surface-2);
}
.icon-20 { width: 20px; height: 20px; border-radius: 4px; }
.icon-20 .icon-mono { font-size: 8px; }
.icon-24 { width: 24px; height: 24px; border-radius: 5px; }
.icon-24 .icon-mono { font-size: 9px; }
.icon-40 { width: 40px; height: 40px; border-radius: 8px; }
.icon-40 .icon-mono { font-size: 13px; }
.icon-56 { width: 56px; height: 56px; border-radius: 10px; }
.icon-56 .icon-mono { font-size: 17px; }

/* ── tables ──────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface-1); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-1); color: var(--ink-3);
  font-size: 11.5px; font-weight: 640; text-transform: uppercase; letter-spacing: .05em;
  text-align: left; padding: 0; border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.th-btn {
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding: 10px 12px; width: 100%; text-align: inherit; display: flex; gap: 5px; align-items: center;
}
thead th.sorted { color: var(--ink); }
.th-dir { font-size: 10px; }
th.right, td.right { text-align: right; }
th.right .th-btn { justify-content: flex-end; }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { font-variant-numeric: tabular-nums; }
.cell-item { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-item-name { font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { color: var(--ink-3); font-size: 11.5px; font-family: var(--mono); }
.item-link:hover { color: var(--accent); }

/* ── item grid ───────────────────────────────────────────────────────────── */

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.icard {
  display: block; background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 13px; transition: border-color .12s, transform .12s;
}
.icard:hover { border-color: var(--hairline-2); transform: translateY(-1px); }
.icard-top { display: flex; gap: 10px; align-items: center; margin-bottom: 11px; }
.icard-name { font-weight: 560; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard-id { color: var(--ink-3); font-size: 11px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.icard-price b { font-size: 19px; font-weight: 640; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.icard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.icard-meta { color: var(--ink-3); font-size: 11.5px; display: flex; gap: 9px; font-variant-numeric: tabular-nums; }
.icard-unpriced b { color: var(--ink-3); font-size: 15px; font-weight: 520; }

/* ── charts ──────────────────────────────────────────────────────────────── */

.ch-host { position: relative; width: 100%; }
.chart { display: block; width: 100%; overflow: visible; touch-action: pan-y; }

.ch-grid     { stroke: var(--hairline); stroke-width: 1; }
.ch-axis     { stroke: var(--hairline-2); stroke-width: 1; }
.ch-baseline { stroke: var(--ink-3); stroke-width: 1; opacity: .6; }
.ch-tick     { fill: var(--ink-3); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.ch-tick-y   { font-size: 10.5px; }

.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-series-1 { stroke: var(--series-1); } .ch-series-1.ch-end-dot, circle.ch-series-1 { fill: var(--series-1); }
.ch-series-2 { stroke: var(--series-2); } circle.ch-series-2 { fill: var(--series-2); }
.ch-series-3 { stroke: var(--series-3); } circle.ch-series-3 { fill: var(--series-3); }
.ch-series-4 { stroke: var(--series-4); } circle.ch-series-4 { fill: var(--series-4); }
.ch-series-5 { stroke: var(--series-5); } circle.ch-series-5 { fill: var(--series-5); }
.ch-series-6 { stroke: var(--series-6); } circle.ch-series-6 { fill: var(--series-6); }
.ch-series-7 { stroke: var(--series-7); } circle.ch-series-7 { fill: var(--series-7); }
.ch-series-8 { stroke: var(--series-8); } circle.ch-series-8 { fill: var(--series-8); }
circle.ch-end-dot { stroke: var(--surface-1); stroke-width: 2; }

.ch-area { fill: url(#none); fill: rgba(57,135,229,.13); stroke: none; }
.ch-vol  { fill: var(--ink-3); opacity: .32; }

.ch-body.ch-up   { fill: var(--good); }
.ch-body.ch-down { fill: var(--critical); }
.ch-wick.ch-up   { stroke: var(--good); stroke-width: 1.2; }
.ch-wick.ch-down { stroke: var(--critical); stroke-width: 1.2; }

.ch-depth-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.ch-depth-area { fill: rgba(57,135,229,.15); stroke: none; }
.ch-marker { stroke: var(--series-4); stroke-width: 1.5; }
.ch-marker-label { fill: var(--series-4); font: 600 10.5px var(--font); }

.ch-cross line { stroke: var(--ink-3); stroke-width: 1; }
.ch-cross-dot { fill: var(--ink); stroke: var(--surface-1); stroke-width: 2; }
.ch-capture { cursor: crosshair; }

.ch-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface-2); border: 1px solid var(--hairline-2);
  border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow);
  font-size: 12px; min-width: 132px; max-width: 260px;
}
.ch-tip-t { color: var(--ink-3); font-size: 11px; margin-bottom: 5px; }
.ch-tip-row { display: flex; justify-content: space-between; gap: 14px; line-height: 1.7; }
.ch-tip-row span { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.ch-tip-row b { font-variant-numeric: tabular-nums; font-weight: 620; }
.ch-tip-row em { color: var(--ink-3); font-style: normal; font-weight: 400; font-size: 11px; }
.ch-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ch-swatch.ch-series-1 { background: var(--series-1); } .ch-swatch.ch-series-2 { background: var(--series-2); }
.ch-swatch.ch-series-3 { background: var(--series-3); } .ch-swatch.ch-series-4 { background: var(--series-4); }
.ch-swatch.ch-series-5 { background: var(--series-5); } .ch-swatch.ch-series-6 { background: var(--series-6); }
.ch-swatch.ch-series-7 { background: var(--series-7); } .ch-swatch.ch-series-8 { background: var(--series-8); }

.ch-empty { color: var(--ink-3); font-size: 13px; padding: 34px 12px; text-align: center; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 3px; border-radius: 2px; }

.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark-up   .spark-line { stroke: var(--good); }     .spark-up   .spark-end { fill: var(--good); }
.spark-down .spark-line { stroke: var(--critical); } .spark-down .spark-end { fill: var(--critical); }
.spark-flat .spark-line { stroke: var(--ink-3); }    .spark-flat .spark-end { fill: var(--ink-3); }
.spark-area { stroke: none; opacity: .13; }
.spark-up   .spark-area { fill: var(--good); }
.spark-down .spark-area { fill: var(--critical); }
.spark-flat .spark-area { fill: var(--ink-3); }
.spark-empty { display: inline-block; }

/* ── bar lists ───────────────────────────────────────────────────────────── */

.barlist { display: grid; gap: 7px; }
.barlist-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 10px; align-items: center; font-size: 13px; }
.barlist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.barlist-fill { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.barlist-value { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; min-width: 62px; text-align: right; }
@media (max-width: 520px) { .barlist-row { grid-template-columns: minmax(0,1fr) 56px auto; } }

/* ── item detail ─────────────────────────────────────────────────────────── */

.item-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.item-hero-meta { min-width: 0; }
.item-hero-name { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.item-hero-id { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.item-hero-price { margin-left: auto; text-align: right; }
.item-hero-price b { font-size: 30px; font-weight: 660; font-variant-numeric: tabular-nums; letter-spacing: -.02em; display: block; }
@media (max-width: 640px) { .item-hero-price { margin-left: 0; text-align: left; } }

.book { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--radius-s); overflow: hidden; }
.book-row { display: grid; grid-template-columns: 1fr 74px 84px; gap: 10px; padding: 6px 11px; background: var(--surface-1); font-size: 13px; font-variant-numeric: tabular-nums; position: relative; }
.book-row.head { background: var(--surface-2); color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 640; }
.book-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-wash); z-index: 0; }
.book-row > span { position: relative; z-index: 1; }
.book-price { font-weight: 600; }
.book-row.out { opacity: .45; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 520; }

/* ── craft ───────────────────────────────────────────────────────────────── */

.recipe { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-1); overflow: hidden; }
.recipe + .recipe { margin-top: 10px; }
.recipe-head { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 12px 14px; cursor: pointer; }
.recipe-head:hover { background: var(--surface-2); }
.recipe-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.recipe-name { font-weight: 560; }
.recipe-ing { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-fig { text-align: right; font-variant-numeric: tabular-nums; }
.recipe-fig small { display: block; color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.recipe-fig b { font-size: 14.5px; font-weight: 620; }
.recipe-body { padding: 0 14px 14px; border-top: 1px solid var(--hairline); }
@media (max-width: 760px) {
  .recipe-head { grid-template-columns: 1fr auto; row-gap: 10px; }
  .recipe-title { grid-column: 1 / -1; }
}

.ingredients { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--radius-s); overflow: hidden; margin-top: 12px; }
.ing-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; background: var(--surface-1); padding: 7px 11px; font-size: 13px; }
.ing-row.head { background: var(--surface-2); color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ing-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ing-sub { margin-left: 22px; }

.prices-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.price-mode { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; }
.price-mode small { display: block; color: var(--ink-3); font-size: 11px; margin-bottom: 3px; }
.price-mode b { font-size: 15px; font-variant-numeric: tabular-nums; }
.price-mode p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
@media (max-width: 620px) { .prices-3 { grid-template-columns: 1fr; } }

/* ── account ─────────────────────────────────────────────────────────────── */

.auth-wrap { max-width: 940px; margin: 0 auto; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 820px) { .auth-grid { grid-template-columns: 1fr; } }

.code-input {
  font: 640 26px/1 var(--mono); letter-spacing: .3em; text-align: center;
  text-transform: uppercase; padding: 14px 10px; width: 100%;
}
.code-input::placeholder { letter-spacing: .3em; color: var(--hairline-2); }

.steps { counter-reset: step; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; font-size: 13.5px; color: var(--ink-2); }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--hairline-2); color: var(--ink); font-size: 12px; font-weight: 640;
}
.steps b { color: var(--ink); font-weight: 600; }
.steps code {
  font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--hairline-2);
  padding: 1px 6px; border-radius: 4px; font-size: 12.5px; color: var(--series-3);
}

/* ── skeletons, empty states, toasts ─────────────────────────────────────── */

.sk { display: grid; gap: 8px; }
.sk-row { display: grid; grid-template-columns: repeat(var(--sk-cols, 4), 1fr); gap: 12px; }
.sk-cell, .sk-card {
  height: 15px; border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 37%, var(--surface-1) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite;
}
.sk-card { height: 118px; border-radius: var(--radius); }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-cell, .sk-card { animation: none; } }

.empty { text-align: center; padding: 54px 20px; color: var(--ink-3); }
.empty h2 { font-size: 17px; color: var(--ink-2); margin-bottom: 7px; }
.empty p { font-size: 13.5px; max-width: 52ch; margin: 0 auto .8em; }
.empty-error h2 { color: var(--critical); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--surface-2); border: 1px solid var(--hairline-2); border-left: 2px solid var(--ink-3);
  border-radius: var(--radius-s); padding: 10px 13px; font-size: 13px; box-shadow: var(--shadow);
  display: grid; gap: 2px; animation: slide .2s ease;
}
.toast strong { font-size: 13px; }
.toast-ok   { border-left-color: var(--good); }
.toast-err  { border-left-color: var(--critical); }
.toast-warn { border-left-color: var(--warning); }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes slide { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── live feed ───────────────────────────────────────────────────────────── */

.feed { display: grid; gap: 1px; background: var(--hairline); border-radius: var(--radius-s); overflow: hidden; }
.feed-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; background: var(--surface-1); padding: 8px 11px; font-size: 13px; }
.feed-row.new { animation: flash 1.1s ease; }
@keyframes flash { from { background: var(--accent-wash); } to { background: var(--surface-1); } }
.feed-qty { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.feed-price { font-variant-numeric: tabular-nums; font-weight: 560; }
.feed-time { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── footer ──────────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--hairline); margin-top: 40px; }
.footer-inner { max-width: 1360px; margin: 0 auto; padding: 22px 20px 40px; color: var(--ink-3); font-size: 12.5px; }
.footer-inner p { max-width: 80ch; }
.footer strong { color: var(--ink-2); font-weight: 600; }
.footer-meta { opacity: .8; }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 940px) {
  .topbar-inner { gap: 12px; }
  .nav {
    position: absolute; top: var(--topbar-h); left: 0; right: 0;
    background: var(--plane); border-bottom: 1px solid var(--hairline);
    flex-direction: column; padding: 8px; gap: 2px; display: none;
    box-shadow: var(--shadow); overflow: visible;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
  .nav-account { margin-left: 0; }
  .btn.nav-toggle { display: inline-flex; }
  .tick { display: none; }
}

@media (max-width: 560px) {
  .view { padding: 18px 14px 48px; }
  .topbar-inner { padding: 0 14px; }
  .page-head h1 { font-size: 21px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); }
  .tile-value { font-size: 21px; }
  .filters { padding: 11px; }
}

/* ── insights (home page) ─────────────────────────────────────────────── */

.insight-list { display: grid; gap: 6px; }
.insight-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-s); background: var(--surface-2);
  font-size: 13.5px;
}
.insight-icon { display: inline-flex; flex: none; }

/* ── portfolio trading console (pickup box) ─────────────────────────────── */

.mb-row {
  display: grid; gap: 6px;
  padding: 11px 12px; border: 1px solid var(--hairline);
  border-radius: var(--radius-s); background: var(--surface-1);
}
.mb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mb-form {
  display: grid; gap: 9px; margin-top: 6px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}

/* Touch targets: everything actionable must be easy to hit on a phone. */
@media (max-width: 640px) {
  .btn { min-height: 44px; padding: 10px 14px; }
  .btn-sm { min-height: 40px; padding: 8px 12px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .field > span { font-size: 12.5px; }
  .mb-row { padding: 12px; }
  .mb-head { align-items: flex-start; flex-direction: column; }
}

/* ── leaderboards ─────────────────────────────────────────────────────── */

.board-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.board-tab {
  background: var(--surface-1); color: var(--ink-2);
  border: 1px solid var(--hairline); border-radius: 100px;
  padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 520;
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s;
}
.board-tab:hover { color: var(--ink); background: var(--surface-2); }
.board-tab.active { color: var(--ink); background: var(--surface-3); border-color: var(--hairline-2); }
.board-subtabs { margin-top: -6px; padding-left: 12px; border-left: 2px solid var(--hairline-2); }
.board-subtabs .board-tab { font-size: .85em; }
.board-subtabs[hidden] { display: none; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.lb-bar h2 { font-size: 15px; margin: 0; }
.lb-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px;
}
.lb-pager:empty { display: none; }

/* ── towns (cards keep the team-* class names) ───────────────────────── */

.back { color: var(--ink-3); font-size: 12.5px; text-decoration: none; }
.back:hover { color: var(--ink); }

.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.team-card {
  display: block; background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none;
  color: var(--ink); transition: border-color .12s, transform .12s;
}
.team-card:hover { border-color: var(--hairline-2); transform: translateY(-1px); }
.team-card-name { font-weight: 620; font-size: 15px; letter-spacing: -.01em; }
.town-card-total { font-size: 20px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; }
.team-card-meta {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 12px; margin-top: 8px; font-variant-numeric: tabular-nums;
}

.roster { display: grid; gap: 12px; }
.roster-card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; }
.roster-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.roster-name { font-weight: 620; font-size: 15px; }
.tag-owner { color: var(--warning); border-color: rgba(250,178,25,.35); background: var(--warning-wash); }
.roster-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.rstat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 10px;
}
.rstat span { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.rstat b { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; }

/* The Market dropdown becomes an inline expander when the nav stacks. */
@media (max-width: 940px) {
  .nav-group { width: 100%; }
  .nav-group-toggle { width: 100%; justify-content: space-between; padding: 10px 12px; }
  .nav-menu {
    position: static; box-shadow: none; border: 0;
    padding: 0 0 2px 10px; min-width: 0;
  }
  .nav-menu a { padding: 9px 12px; }
}

/* Guide: readable prose inside cards. */
.guide p, .guide li { color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.guide p { margin: 0 0 10px; }
.guide p:last-child { margin-bottom: 0; }
.guide ol, .guide ul { margin: 0 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.guide b { color: var(--ink); }
.guide td { vertical-align: top; }
.guide code, .page-head code {
  background: var(--surface-3); color: var(--ink); padding: 1px 6px;
  border-radius: 4px; font-size: 12.5px; white-space: nowrap;
}
.guide-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.guide-toc a {
  padding: 5px 10px; border-radius: var(--radius-s); background: var(--surface-2);
  color: var(--ink-2); font-size: 13px;
}
.guide-toc a:hover { color: var(--ink); background: var(--surface-3); }
.guide .card { scroll-margin-top: 80px; }
.guide-banner { display: block; color: var(--ink-2); font-size: 14px; }
.guide-banner:hover { border-color: var(--ink-3); color: var(--ink); }

/* ── QXL family overrides (2026-10-14) ───────────────────────────────────────
 * The rules above predate the shared style; these bring them in line without
 * rewriting every component. Zero radius everywhere, no blur, heavy headings,
 * flat uppercase buttons.
 */
*, *::before, *::after { border-radius: 0 !important; }
.topbar { background: var(--plane); backdrop-filter: none; }
.brand-text { font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
h1, .page-head h1 { font-weight: 900; letter-spacing: -.03em; }
h2, h3 { font-weight: 700; }
.tile-value, .item-hero-price b, .icard-price b { font-weight: 900; letter-spacing: -.02em; }
.tile-label, .book-row.head { font-weight: 700; letter-spacing: .1em; }
.btn { font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.btn-sm { font-size: 11px; }
.btn-primary { color: #0a0a0a; border-color: var(--accent); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.nav a.active, .nav a:hover { box-shadow: inset 0 -2px 0 var(--accent); }
.tick-dot.ok, .tick-dot.warn, .tick-dot.bad { box-shadow: none; }
.icon { background: hsl(var(--icon-h, 210) 18% 18%); box-shadow: inset 0 0 0 1px var(--hairline-2); }
.card { border-color: var(--hairline); }
:focus-visible { outline-color: var(--accent); }

/* Minecraft touches, matching the landing page: the pixel font for chrome and
 * labels (never for tables or prices), and the grass block under the top bar. */
.brand-text, .nav a, .nav-group > button, .tile-label, .btn, .tick, .guide-toc a {
  font-family: 'Monocraft', ui-monospace, monospace;
  letter-spacing: 0; text-transform: none;
}
.brand-text { font-weight: 700; font-size: 17px; }
.brand-text small { font-family: 'Monocraft', ui-monospace, monospace; }
.nav a, .nav-group > button { font-size: 13.5px; font-weight: 400; }
.btn { font-size: 12.5px; font-weight: 700; }
.topbar { border-bottom: none; }
.topbar::after {
  content: ""; display: block; height: 16px;
  background: url('/landing/ground.png') repeat-x 0 0 / 16px 16px;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* Player faces: 8x8 skin pixels, kept sharp. */
.face { image-rendering: pixelated; image-rendering: crisp-edges; flex: none; vertical-align: middle; }
.player { display: inline-flex; align-items: center; gap: 10px; }

/* Minecraft's own menu button for every button: the game's nine-slice sprite
 * (3 px border) at twice its size, white text with the game's drop shadow,
 * the highlighted sprite on hover and the disabled one when disabled. */
.btn, .btn-primary, .btn-ghost {
  background: none; color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
  border-style: solid; border-width: 6px; border-color: transparent;
  border-image: url('/landing/mc/button.png') 3 fill / 6px stretch;
  image-rendering: pixelated; image-rendering: crisp-edges;
  padding: 3px 12px; font-weight: 400;
}
.btn:hover, .btn-primary:hover, .btn-ghost:hover, .btn:focus-visible {
  background: none; border-image-source: url('/landing/mc/button_highlighted.png'); outline: none;
}
.btn:disabled, .btn:disabled:hover {
  border-image-source: url('/landing/mc/button_disabled.png'); color: #a0a0a0; text-shadow: none; opacity: 1;
}
.btn-sm { border-width: 4px; border-image-width: 4px; padding: 1px 8px; }
.btn-danger, .btn-danger:hover { color: #ff5555; background: none; }
.btn.nav-toggle { border-width: 4px; border-image-width: 4px; }

/* Start: the first-steps checklist. */
.start-count { font-family: 'Monocraft', ui-monospace, monospace; font-size: 22px; font-weight: 700; color: var(--accent); }
.start-step { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.start-step .mc-icon { image-rendering: pixelated; image-rendering: crisp-edges; }
.start-step h2 { font-size: 17px; margin-bottom: 6px; }
.start-n { font-family: 'Monocraft', ui-monospace, monospace; color: var(--accent); margin-right: 6px; }
.start-step p { color: var(--ink-2); font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.start-step code { background: var(--surface-3); color: var(--ink); padding: 1px 6px; font-size: 12.5px; }
.start-cmd { display: inline-block; margin-right: 10px; font-family: 'Monocraft', ui-monospace, monospace; }
.start-step.done { opacity: .55; }
.start-step.done h2 { text-decoration: line-through; }
@media (max-width: 640px) { .start-step { grid-template-columns: 32px minmax(0, 1fr); } .start-tick { grid-column: 2; justify-self: start; } }

/* A player's name as chat shows it (ui.js styledName): town, rank, prefix. */
.sn-rank { height: 1em; width: auto; vertical-align: -0.1em; image-rendering: pixelated; }
.sn-prefix { color: #FFD700; }
.sn-town { color: var(--ink-3); }
