/* ── House selections: the desk's whole book on one card, banded by ROI. Every rule
   is scoped to .hs so nothing here reaches the rest of the site. ── */

@keyframes hs-in-card {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hs-in-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hs-in-row {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hs-beam-run {
  to {
    offset-distance: 100%;
  }
}

.hs {
  --hs-pad: clamp(14px, 3cqi, 24px);
  --hs-line: hsl(var(--border) / 0.9);
  --hs-soft: hsl(var(--border) / 0.6);
  --hs-dim: hsl(var(--muted-foreground));
  --hs-row-hover: linear-gradient(90deg, hsl(var(--card)) 0%, hsl(var(--secondary)) 51%, hsl(var(--card)) 100%);
  --hs-row-line: linear-gradient(90deg, transparent, hsl(var(--brand) / 0.55), transparent);
  --hs-chip-fill: linear-gradient(180deg, hsl(var(--secondary)) 0%, hsl(var(--card)) 100%);
  --hs-btn-fill: linear-gradient(180deg, hsl(var(--secondary)) 0%, hsl(var(--background)) 100%);
  display: block;
  container-type: inline-size;
  container-name: hs;
}

.hs-card {
  border: 1px solid var(--hs-line);
  border-radius: 26px;
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
  overflow: hidden;
}

.hs-shell {
  position: relative;
}

/* ── Head ─────────────────────────────────────────────────────────────── */
.hs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px clamp(12px, 3cqi, 28px);
  padding: clamp(16px, 3cqi, 24px) var(--hs-pad) 14px;
}

.hs-titles {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.hs-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.95rem + 1.5cqi, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
}

.hs-meta {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--hs-dim);
  white-space: nowrap;
}

.hs-head > .hs-export {
  margin-left: auto;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.hs-card[data-bulk="on"] .hs-head > .hs-export {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Buttons, and the beam that runs the Export pill's ring ───────────── */
.hs-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 22px 10px;
  border: 1px solid var(--hs-line);
  border-radius: 999px;
  background: var(--hs-btn-fill);
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.hs-btn:hover {
  border-color: hsl(var(--brand) / 0.5);
}

.hs-btn--primary {
  border-color: hsl(var(--brand) / 0.6);
}

.hs-btn--ghost {
  background: none;
  border-color: transparent;
  color: var(--hs-dim);
}

.hs-btn--ghost:hover {
  color: hsl(var(--foreground));
}

.hs-beam-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}

.hs-beam {
  position: absolute;
  width: 40px;
  aspect-ratio: 1;
  offset-path: border-box;
  offset-anchor: 50% 50%;
  background: linear-gradient(90deg, hsl(var(--brand)) 0%, hsl(var(--chart-2)) 50%, hsl(var(--chart-3)) 100%);
  filter: blur(4px);
  animation: hs-beam-run 5s linear infinite;
}

@supports not (offset-path: border-box) {
  .hs-beam {
    animation: none;
    inset: 0 auto auto 0;
  }
}

/* ── The band pills: three wide cards, each flooding with its own colour ─ */
.hs-toolwrap {
  position: relative;
  display: grid;
  padding: 0 var(--hs-pad) 6px;
}

.hs-tools {
  grid-area: 1 / 1;
  min-width: 0;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.hs-card[data-bulk="on"] .hs-tools {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hs-chip {
  --hs-fc: hsl(var(--brand));
  --hs-fc-fill: linear-gradient(180deg, hsl(var(--brand)) 0%, hsl(var(--brand) / 0.72) 100%);
  --hs-fc-ink: hsl(var(--brand-foreground));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 91px;
  padding: 8px 14px;
  border: 1px solid var(--hs-soft);
  border-radius: 32px;
  background: var(--hs-chip-fill);
  color: hsl(var(--foreground));
  font: inherit;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.hs-chip[data-band="b30"] {
  --hs-fc: hsl(var(--chart-2));
  --hs-fc-fill: linear-gradient(180deg, hsl(var(--chart-2)) 0%, hsl(var(--chart-2) / 0.72) 100%);
  --hs-fc-ink: hsl(var(--brand-foreground));
}

.hs-chip[data-band="b20"] {
  --hs-fc: hsl(var(--chart-3));
  --hs-fc-fill: linear-gradient(180deg, hsl(var(--chart-3)) 0%, hsl(var(--chart-3) / 0.72) 100%);
  --hs-fc-ink: hsl(var(--brand-foreground));
}

.hs-chip[data-band="b10"] {
  --hs-fc: hsl(var(--chart-4));
  --hs-fc-fill: linear-gradient(180deg, hsl(var(--chart-4)) 0%, hsl(var(--chart-4) / 0.72) 100%);
  --hs-fc-ink: hsl(var(--brand-foreground));
}

.hs-chip[data-band="b1"] {
  --hs-fc: hsl(var(--muted-foreground));
  --hs-fc-fill: linear-gradient(180deg, hsl(var(--muted-foreground)) 0%, hsl(var(--muted-foreground) / 0.72) 100%);
  --hs-fc-ink: hsl(var(--background));
}

.hs-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 2px 0 26.8px 0 hsl(0 0% 100% / 0.05), inset 0 2px 4px 0 hsl(0 0% 100% / 0.05);
}

.hs-chip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--hs-fc-fill);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: width 0.85s cubic-bezier(0.16, 1, 0.3, 1), height 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.85s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.hs-chip > * {
  position: relative;
  z-index: 1;
}

.hs-chip:hover::before,
.hs-chip[aria-pressed="true"]::before {
  opacity: 1;
  width: 100%;
  height: 100%;
  border-radius: 32px;
}

.hs-chip:hover,
.hs-chip[aria-pressed="true"] {
  color: var(--hs-fc-ink);
  border-color: var(--hs-fc);
}

.hs-chip-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hs-fc);
}

.hs-chip:hover .hs-chip-dot,
.hs-chip[aria-pressed="true"] .hs-chip-dot {
  background: var(--hs-fc-ink);
}

.hs-chip-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.hs-chip-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hs-chip-note {
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hs-chip-n {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.07);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.hs-chip:hover .hs-chip-n,
.hs-chip[aria-pressed="true"] .hs-chip-n {
  background: hsl(0 0% 0% / 0.16);
  color: inherit;
}

/* ── The bulk bar, laid over the pills while rows are selected ─────────── */
.hs-bulk {
  position: absolute;
  inset: 0 var(--hs-pad) 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.hs-card[data-bulk="on"] .hs-bulk {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hs-bulk-n {
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  padding-right: 4px;
}

.hs-spacer {
  flex: 1 1 auto;
}

/* ── The data block ───────────────────────────────────────────────────── */
.hs-tablewrap {
  position: relative;
  margin: 0 var(--hs-pad);
  border: 1px solid var(--hs-line);
  border-radius: 18px;
  background: hsl(var(--card) / 0.55);
  overflow: hidden;
}

.hs-headrow {
  display: none;
}

.hs-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name roi"
    "odds pnl";
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  border-bottom: 1px solid hsl(var(--border) / 0.45);
  transition: background-image 0.18s ease;
}

.hs-row:last-child {
  border-bottom: 0;
}

.hs-row:hover,
.hs-row[data-sel="1"] {
  background-image: var(--hs-row-hover);
}

.hs-c {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hs-c--pick {
  grid-area: pick;
}

.hs-c--name {
  grid-area: name;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.hs-c--roi {
  grid-area: roi;
  justify-content: flex-end;
}

.hs-c--pnl {
  grid-area: pnl;
  justify-content: flex-end;
}

.hs-c--odds {
  grid-area: odds;
}

.hs-c--settled,
.hs-c--link {
  display: none;
}

.hs-name {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  transition: color 0.14s ease;
}

.hs-name:hover {
  color: hsl(var(--brand));
}

.hs-sub {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hs-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.hs-num {
  font-size: 0.8125rem;
}

/* Checkbox: a drawn box over a real input, ticked in the brand colour. */
.hs-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.hs-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.hs-check-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid hsl(var(--foreground) / 0.28);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: transparent;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.hs-check:hover .hs-check-box {
  border-color: hsl(var(--foreground) / 0.5);
}

.hs-check-input:checked + .hs-check-box {
  border-color: hsl(var(--brand));
  background: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
}

.hs-check-input:focus-visible + .hs-check-box {
  outline: 2px solid hsl(var(--brand) / 0.65);
  outline-offset: 2px;
}

/* Column sorts (table mode only) */
.hs-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hs-dim);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.14s ease;
}

.hs-sort:hover {
  color: hsl(var(--foreground));
}

.hs-sort--right {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.hs-sort-ind {
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.18s ease;
}

.hs-sort[data-sorted="1"] .hs-sort-ind {
  opacity: 1;
}

.hs-sort[data-asc="1"] .hs-sort-ind {
  transform: rotate(180deg);
}

/* ── Empty state ──────────────────────────────────────────────────────── */
.hs-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: clamp(30px, 6cqi, 52px) 20px;
  text-align: center;
}

.hs-empty-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hs-line);
  border-radius: 50%;
  color: var(--hs-dim);
}

.hs-empty-t {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.hs-empty-p {
  margin: 0;
  max-width: 40ch;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--hs-dim);
}

/* ── Footer: range, meter, pager ──────────────────────────────────────── */
.hs-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  -moz-column-gap: 10px;
       column-gap: 10px;
  row-gap: 8px;
  padding: 18px var(--hs-pad) 20px;
}

.hs-range {
  font-size: 0.8125rem;
  color: var(--hs-dim);
}

.hs-meter {
  width: min(100%, 220px);
  min-width: 64px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: hsl(var(--foreground) / 0.07);
}

.hs-meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: hsl(var(--brand));
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.hs-pager {
  grid-area: 1 / 2 / span 2 / 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hs-page {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--hs-line);
  border-radius: 999px;
  background: hsl(var(--secondary) / 0.6);
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.hs-page:hover:not(:disabled) {
  border-color: hsl(var(--brand) / 0.5);
}

.hs-page[aria-current="page"] {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
}

.hs-page:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.hs-toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 10px);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  border: 1px solid var(--hs-line);
  border-radius: 999px;
  background: hsl(var(--popover));
  box-shadow: 0 10px 24px -14px hsl(0 0% 0% / 0.95);
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.hs-toast svg {
  color: hsl(var(--brand));
  flex: 0 0 auto;
}

.hs-toast[data-on="1"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Entrance: the card, then its surfaces, then the rows ─────────────── */
.hs[data-hs-enter] .hs-card {
  animation: hs-in-card 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hs[data-hs-enter] .hs-titles {
  animation: hs-in-up 380ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}

.hs[data-hs-enter] .hs-export {
  animation: hs-in-up 340ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.hs[data-hs-enter] .hs-chip {
  animation: hs-in-up 340ms cubic-bezier(0.22, 1, 0.36, 1) calc(120ms + var(--hs-i, 0) * 30ms) both;
}

.hs[data-hs-enter] .hs-tablewrap {
  animation: hs-in-up 400ms cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}

.hs[data-hs-enter] .hs-row {
  animation: hs-in-row 360ms cubic-bezier(0.22, 1, 0.36, 1) calc(240ms + var(--hs-i, 0) * 28ms) both;
}

.hs[data-hs-enter] .hs-foot {
  animation: hs-in-up 360ms cubic-bezier(0.22, 1, 0.36, 1) 320ms both;
}

/* ── Narrow: the pills stack, the row reads as a card ─────────────────── */
@container hs (max-width: 620px) {
  .hs-chips {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .hs-chip {
    min-height: 64px;
    border-radius: 24px;
    justify-content: flex-start;
    padding-left: 18px;
  }

  .hs-chip::before,
  .hs-chip:hover::before,
  .hs-chip[aria-pressed="true"]::before {
    border-radius: 24px;
  }
}

/* ── Table mode: the header band and the full column set ──────────────── */
@container hs (min-width: 700px) {
  .hs-headrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 62px 92px 96px 16px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--hs-soft);
    background: hsl(var(--secondary) / 0.45);
  }

  .hs-row {
    grid-template-columns: minmax(0, 1fr) 58px 62px 92px 96px 16px;
    grid-template-areas: none;
    gap: 10px;
    padding: 11px 16px;
  }

  .hs-row > .hs-c {
    grid-area: auto;
  }

  .hs-c--settled {
    display: flex;
    justify-content: flex-end;
  }

  .hs-c--link {
    display: flex;
    justify-content: flex-end;
  }

  .hs-c--odds {
    justify-content: flex-end;
  }

  /* The underline opens from the middle as the row is pointed at. */
  .hs-row::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 1px;
    background: var(--hs-row-line);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    pointer-events: none;
  }

  .hs-row:hover::after {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs[data-hs-enter] .hs-card,
  .hs[data-hs-enter] .hs-titles,
  .hs[data-hs-enter] .hs-export,
  .hs[data-hs-enter] .hs-chip,
  .hs[data-hs-enter] .hs-tablewrap,
  .hs[data-hs-enter] .hs-row,
  .hs[data-hs-enter] .hs-foot,
  .hs-beam {
    animation: none;
  }

  .hs-chip::before {
    transition: none;
  }
}/* The bet log: a trading-desk ledger. One bright card holds the whole record — the
   filter pills, the figures, the open positions and the closed trades — so the page
   reads as a single instrument rather than a pile of panels. Every colour comes from
   the app's own tokens. */

.bl {
  container-type: inline-size;
}

.bl-card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 26px;
  background:
    radial-gradient(120% 90% at 4% -10%, hsl(var(--brand) / 0.14), transparent 58%),
    radial-gradient(90% 80% at 100% 0%, hsl(var(--chart-2) / 0.1), transparent 62%),
    linear-gradient(158deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%) padding-box,
    linear-gradient(150deg, hsl(var(--brand) / 0.4), hsl(var(--border)) 46%, hsl(var(--chart-2) / 0.28)) border-box;
  box-shadow: 0 40px 90px -60px hsl(var(--brand) / 0.6);
  animation: bl-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes bl-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Head ─────────────────────────────────────────────────────────────── */
.bl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding: clamp(20px, 3.4cqi, 30px) clamp(16px, 3.2cqi, 26px) 16px;
}

.bl-eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: hsl(var(--brand));
}

.bl-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1rem + 2.2cqi, 2.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: hsl(var(--foreground));
}

.bl-meta {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.bl-lede {
  margin: 10px 0 0;
  max-width: 58ch;
  font-size: 13px;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

/* ── The export pill, with a light running its ring ───────────────────── */
.bl-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 20px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease;
}

.bl-btn:hover {
  border-color: hsl(var(--brand) / 0.55);
}

.bl-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.bl-beam-track {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.bl-beam {
  position: absolute;
  width: 40px;
  aspect-ratio: 1;
  offset-path: border-box;
  offset-anchor: 50% 50%;
  background: linear-gradient(90deg, hsl(var(--brand)), hsl(var(--chart-2)) 50%, hsl(var(--chart-3)));
  filter: blur(4px);
  animation: bl-beam-run 5s linear infinite;
}

@supports not (offset-path: border-box) {
  .bl-beam {
    animation: none;
    inset: 0 auto auto 0;
  }
}

@keyframes bl-beam-run {
  to {
    offset-distance: 100%;
  }
}

/* ── Filter pills: the market picker, five wide cards ─────────────────── */
.bl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 clamp(16px, 3.2cqi, 26px) 10px;
}

.bl-pill {
  --bl-fill: hsl(var(--brand));
  --bl-ink: hsl(var(--brand-foreground));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: 1 1 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: 28px;
  background: linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* The fill floods out of the dot when a pill is picked. */
.bl-pill::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bl-fill);
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 0;
  transition:
    width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
}

.bl-pill > * {
  position: relative;
  z-index: 1;
}

.bl-pill:hover::before,
.bl-pill[aria-pressed="true"]::before {
  opacity: 1;
  width: 100%;
  height: 100%;
  border-radius: 28px;
}

.bl-pill:hover,
.bl-pill[aria-pressed="true"] {
  color: var(--bl-ink);
  border-color: var(--bl-fill);
}

.bl-pill-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bl-fill);
}

.bl-pill:hover .bl-pill-dot,
.bl-pill[aria-pressed="true"] .bl-pill-dot {
  background: var(--bl-ink);
}

.bl-pill-n {
  padding: 1px 8px;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.07);
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.3s ease, color 0.3s ease;
}

.bl-pill:hover .bl-pill-n,
.bl-pill[aria-pressed="true"] .bl-pill-n {
  background: hsl(0 0% 0% / 0.16);
  color: inherit;
}

/* ── The smaller chip rows: type and result ───────────────────────────── */
.bl-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 clamp(16px, 3.2cqi, 26px) 16px;
}

.bl-chips-label {
  margin-right: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.bl-chip {
  padding: 7px 13px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card) / 0.7);
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.bl-chip:hover {
  color: hsl(var(--foreground));
  border-color: hsl(var(--foreground) / 0.24);
}

.bl-chip[aria-pressed="true"] {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
  box-shadow: 0 0 0 4px hsl(var(--brand) / 0.12);
}

.bl-chips-gap {
  width: 14px;
}

/* ── The figures ──────────────────────────────────────────────────────── */
.bl-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  padding: 0 clamp(16px, 3.2cqi, 26px) 22px;
}

.bl-stat {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: linear-gradient(160deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
}

.bl-stat::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--brand) / 0.18), transparent 70%);
  pointer-events: none;
}

.bl-stat-label {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.bl-stat-value {
  position: relative;
  margin: 7px 0 0;
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

/* ── Section heads ────────────────────────────────────────────────────── */
.bl-section {
  padding: 0 clamp(16px, 3.2cqi, 26px);
}

.bl-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
}

.bl-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--foreground));
}

.bl-section-n {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

/* ── Open positions ───────────────────────────────────────────────────── */
.bl-positions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 10px;
  padding-bottom: 22px;
}

.bl-pos {
  position: relative;
  overflow: hidden;
  padding: 14px 16px 14px 18px;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: linear-gradient(150deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
}

.bl-pos::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, hsl(var(--brand)), hsl(var(--chart-2)));
}

.bl-pos-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bl-pos-fixture {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: hsl(var(--foreground));
}

.bl-pos-sub {
  margin: 3px 0 0;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.bl-pos-market {
  margin: 11px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--brand));
}

.bl-pos-pick {
  margin: 3px 0 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.bl-pos-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.bl-pos-figures b {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ── Result badges ────────────────────────────────────────────────────── */
.bl-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bl-badge--won {
  border: 1px solid hsl(var(--profit) / 0.4);
  background: hsl(var(--profit) / 0.16);
  color: hsl(var(--profit));
}

.bl-badge--lost {
  border: 1px solid hsl(var(--loss) / 0.4);
  background: hsl(var(--loss) / 0.14);
  color: hsl(var(--loss));
}

.bl-badge--pending {
  border: 1px solid hsl(var(--brand) / 0.42);
  background: hsl(var(--brand) / 0.14);
  color: hsl(var(--brand));
}

.bl-badge--void {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--foreground) / 0.05);
  color: hsl(var(--muted-foreground));
}

/* ── The closed trades table ──────────────────────────────────────────── */
.bl-tablewrap {
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 18px;
  background: hsl(var(--card) / 0.5);
}

.bl-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.bl-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  text-align: left;
}

.bl-th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.86);
  backdrop-filter: blur(6px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.bl-th--right {
  text-align: right;
}

.bl-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 0.14s ease;
}

.bl-sort:hover,
.bl-sort[data-on="1"] {
  color: hsl(var(--foreground));
}

.bl-sort svg {
  width: 11px;
  height: 11px;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.18s ease;
}

.bl-sort[data-on="1"] svg {
  opacity: 1;
}

.bl-sort[data-dir="asc"] svg {
  transform: rotate(180deg);
}

.bl-row td {
  padding: 12px 14px;
  border-bottom: 1px solid hsl(var(--border) / 0.55);
  vertical-align: middle;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.bl-row:last-child td {
  border-bottom: 0;
}

.bl-row:hover td {
  background-color: hsl(var(--brand) / 0.045);
  box-shadow: inset 0 -1px 0 hsl(var(--brand) / 0.45);
}

.bl-date {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.bl-match {
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.bl-comp {
  margin-top: 2px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.bl-type {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  vertical-align: middle;
}

.bl-market {
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.bl-pick {
  margin-top: 2px;
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

.bl-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

.bl-pnl {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.bl-pnl--up {
  color: hsl(var(--profit));
}

.bl-pnl--down {
  color: hsl(var(--loss));
}

.bl-empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
}

/* ── Footer: range, meter, pager ──────────────────────────────────────── */
.bl-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 0 24px;
}

.bl-range {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.bl-meter {
  flex: 1 1 120px;
  max-width: 220px;
  height: 5px;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.08);
  overflow: hidden;
}

.bl-meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(var(--brand)), hsl(var(--chart-2)));
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.bl-pager {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.bl-page {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.bl-page:hover:not(:disabled) {
  color: hsl(var(--foreground));
  border-color: hsl(var(--brand) / 0.5);
}

.bl-page[aria-current="page"] {
  background: hsl(var(--brand));
  border-color: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
}

.bl-page:disabled {
  opacity: 0.35;
  cursor: default;
}

.bl-page svg {
  width: 13px;
  height: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .bl-card,
  .bl-beam {
    animation: none;
  }
  .bl-pill::before {
    transition: none;
  }
}