/* ============================================================
   TRADE GRADER — themed stylesheet
   Four visual themes scoped via [data-trades-theme="..."] on <body>.
   Default: 'cards'. Themes are non-overlapping — each owns its own
   block; we don't try to share structural styles beyond the page
   wrapper because the four directions are deliberately distinct.
   ============================================================ */

/* ── Layout-only basics (theme-agnostic) ─────────────────────── */
.tr-wrap { max-width: 1100px; margin: 0 auto; padding: 1.4rem 1rem 4rem; }
.tr-list { display: flex; flex-direction: column; gap: 1rem; }
.tr-sides {
  display: grid; grid-template-columns: 1fr; gap: 1px;
}
@media (min-width: 720px) {
  .tr-sides[data-count="2"] { grid-template-columns: 1fr 1fr; }
  .tr-sides[data-count="3"] { grid-template-columns: 1fr 1fr 1fr; }
  .tr-sides[data-count="4"] { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
.tr-side { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .65rem; }
.tr-side-head { display: flex; align-items: center; gap: .65rem; }
.tr-side-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
/* flex-grow:1 so .tr-assets expands to fill whatever vertical space is
   available in its .tr-side flex column. With grid stretch on the row,
   sides have equal height, so the grade block at the bottom of each
   side lines up across the trade — a 2-for-1 no longer has the smaller
   side's grade floating above the larger side's. */
.tr-assets { display: flex; flex-direction: column; gap: .35rem; flex-grow: 1; }
.tr-asset { display: flex; align-items: baseline; gap: .5rem; padding: .35rem .55rem; font-size: .9rem; border-radius: 2px; }
.tr-asset-pos { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; flex-shrink: 0; min-width: 30px; }
.tr-asset-name { flex: 1; }
.tr-asset-team { font-family: var(--mono); font-size: .65rem; letter-spacing: .12em; }
.tr-grade { margin-top: .55rem; padding-top: .65rem; display: flex; flex-direction: column; gap: .4rem; }
.tr-grade-letter { font-family: var(--serif); font-size: 1.8rem; line-height: 1; font-weight: 700; }
.tr-grade-row { display: flex; align-items: center; gap: .55rem; }
.tr-grade-then { font-size: 1.1rem; opacity: .55; }
.tr-grade-arrow { font-size: 1rem; }
.tr-grade-pending {
  margin-top: .55rem; padding-top: .55rem;
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .22em; text-transform: uppercase;
}
.tr-tabs {
  display: flex; overflow-x: auto; scrollbar-width: none;
  margin-bottom: 2rem; gap: 0;
}
.tr-tabs::-webkit-scrollbar { display: none; }
.tr-tab {
  font-family: var(--mono); font-weight: 700;
  font-size: .65rem; letter-spacing: .25em; text-transform: uppercase;
  padding: .85rem 1.6rem;
  border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.tr-section { margin-bottom: 2.5rem; }
.tr-section-head {
  display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap;
  padding-bottom: .8rem; margin-bottom: 1rem;
}
.tr-section-num {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .25em; text-transform: uppercase;
}
.tr-section-title { font-family: var(--serif); font-size: 1.3rem; }
.tr-section-meta {
  margin-left: auto; font-family: var(--mono); font-size: .65rem;
  letter-spacing: .15em; text-transform: uppercase;
}
.tr-section-empty {
  padding: 1.5rem 1rem; text-align: center;
  font-size: .85rem; border-radius: 3px;
}
.tr-empty { text-align: center; padding: 3rem 1rem; }
.tr-empty h2 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: .6rem; }
.tr-lock { text-align: center; padding: 3rem 1rem 4rem; border-radius: 3px; }
.tr-lock-icon { font-size: 2.5rem; letter-spacing: .3em; margin-bottom: 1rem; }
.tr-lock h2 { font-family: var(--serif); font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: .9rem; }
.tr-lock p { max-width: 30rem; margin: 0 auto 1.5rem; font-size: .92rem; line-height: 1.5; }
.tr-lock-cta {
  display: inline-block; font-family: var(--mono);
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  padding: .75rem 1.4rem; border-radius: 2px; text-decoration: none;
}

/* Commissioner-only theme picker (rendered by trades.js).
   All four themes live in a single horizontal button row so the
   commish can scan them and click directly instead of clicking
   through a dropdown. */
.tr-theme-picker {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  margin: -1rem 0 2rem;
  /* Stacking context above the page-head's redrawn bottom border (wire
     theme draws an ::after line that would otherwise paint over the
     buttons). */
  position: relative;
  z-index: 1;
}
.tr-theme-label {
  font-family: var(--mono); font-size: .6rem;
  letter-spacing: .25em; text-transform: uppercase;
  opacity: .65;
}
.tr-theme-options {
  display: flex; gap: 0;
  border-radius: 3px; overflow: hidden;
}
.tr-theme-btn {
  font-family: var(--mono); font-weight: 700;
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  padding: .55rem .9rem;
  /* Fallback colors so the four-button row is always visible even if a
     per-theme rule below misses (e.g. body data-attr not set yet). */
  background: rgba(245,233,200,.04);
  color: #c4b694;
  border: 1px solid rgba(200,164,100,.35);
  border-right-width: 0;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.tr-theme-btn:last-child { border-right-width: 1px; }
.tr-theme-btn:disabled { cursor: wait; opacity: .6; }
.tr-theme-status {
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .2em; text-transform: uppercase;
  opacity: .6;
}

/* ============================================================
   THEME: CARDS  (default — sportscard / kraft + ivory)
   ============================================================ */
body[data-trades-theme="cards"] {
  background: #2a1d11; color: #f5e9c8;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(245,233,200,.04) 0%, transparent 65%),
    repeating-linear-gradient(45deg, rgba(245,233,200,.012) 0px, rgba(245,233,200,.012) 2px, transparent 2px, transparent 8px);
}
body[data-trades-theme="cards"] .tr-page-head { text-align: center; padding: .25rem 0 1.75rem; }
body[data-trades-theme="cards"] .tr-page-sup {
  display: inline-block; font-family: var(--mono); font-size: .58rem;
  letter-spacing: .3em; color: #c8a464; text-transform: uppercase;
  background: #322217; border: 1px solid #c8a464;
  padding: .25rem .8rem; border-radius: 999px; margin-bottom: 1.2rem;
}
body[data-trades-theme="cards"] .tr-page-tier {
  display: none; /* baked into the pin already */
}
body[data-trades-theme="cards"] .tr-page-title {
  font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1;
}
body[data-trades-theme="cards"] .tr-page-title em { color: #c8a464; font-style: italic; }
body[data-trades-theme="cards"] .tr-tabs {
  border-bottom: 1px solid #4c3922; gap: 0;
}
body[data-trades-theme="cards"] .tr-tab {
  color: #9c8665; padding: .85rem 1.6rem;
}
body[data-trades-theme="cards"] .tr-tab:hover { color: #f5e9c8; }
body[data-trades-theme="cards"] .tr-tab.active {
  color: #c8a464; border-bottom-color: #c8a464;
}
/* Themed top chrome: site nav + chapter bar match the page color
   so the masthead doesn't read as "site default navy" while the
   trades content is kraft brown. */
body[data-trades-theme="cards"] .nav {
  background: rgba(42,29,17,.95); border-bottom-color: #4c3922;
}
body[data-trades-theme="cards"] .nav-chapbar {
  background: rgba(50,34,23,.95); border-bottom-color: #4c3922;
}
body[data-trades-theme="cards"] .nav-chapbar-link { color: #9c8665; }
body[data-trades-theme="cards"] .nav-chapbar-link:hover,
body[data-trades-theme="cards"] .nav-chapbar-link.is-active { color: #c8a464; }
body[data-trades-theme="cards"] .nav-chapbar-link.is-active::after { background: #c8a464; }
body[data-trades-theme="cards"] .nav-chapbar-link + .nav-chapbar-link::before { background: #4c3922; }
/* Live sub-rail under the chapbar — secondary accent is the cream the
   back link uses (the brass #c8a464 stays the chapbar's primary). */
/* Cream lift instead of the default black-.22 band — the darkening
   read too heavy against the kraft page. */
body[data-trades-theme="cards"] .nav-subrail { background: rgba(245,233,200,.05); border-top-color: #4c3922; }
body[data-trades-theme="cards"] .nav-subrail-link { color: #9c8665; }
body[data-trades-theme="cards"] .nav-subrail-link:hover,
body[data-trades-theme="cards"] .nav-subrail-link.is-active { color: #f5e9c8; }
body[data-trades-theme="cards"] .nav-subrail-link.is-active::after { background: #f5e9c8; }
body[data-trades-theme="cards"] .nav-subrail-link + .nav-subrail-link::before { background: #4c3922; }
/* Back link sits in cream — distinct from the brass accent the hub uses
   so the Grader's masthead doesn't read identical to /trades/. */
body[data-trades-theme="cards"] .nav-back { color: #c4b694; }
body[data-trades-theme="cards"] .nav-back:hover { color: #f5e9c8; }
/* Trade card head gets a darker bronze strip so it reads as a header
   instead of blending into the card body. Negative margins break it out
   of the card padding so the strip extends edge-to-edge. */
body[data-trades-theme="cards"] .tr-card-head {
  background: #2a1d11; color: #c4b694;
  margin: -1.4rem -1.5rem 1rem;
  padding: .85rem 1.5rem;
  border-bottom: 2px dashed #4c3922;
}
/* Theme picker buttons — inactive bg is bumped up from #322217 to #3d2a1d
   so the three non-active buttons stand off the body bg (#2a1d11) instead
   of blending into it. */
body[data-trades-theme="cards"] .tr-theme-picker { color: #c4b694; }
body[data-trades-theme="cards"] .tr-theme-btn {
  border-color: #6b4f30; color: #c4b694; background: #3d2a1d;
}
body[data-trades-theme="cards"] .tr-theme-btn:hover:not(.active) { color: #f5e9c8; background: #4c3623; }
body[data-trades-theme="cards"] .tr-theme-btn.active {
  background: #f5e9c8; color: #2a1d11; border-color: #f5e9c8;
}
body[data-trades-theme="cards"] .tr-section-num,
body[data-trades-theme="cards"] .tr-section-meta { color: #9c8665; }
body[data-trades-theme="cards"] .tr-section-title { color: #f5e9c8; }
body[data-trades-theme="cards"] .tr-section-title em { color: #c8a464; font-style: italic; }
body[data-trades-theme="cards"] .tr-section-head { border-bottom: 1px solid #4c3922; }
body[data-trades-theme="cards"] .tr-section-empty {
  background: #322217; border: 1px dashed #4c3922; color: #9c8665;
}
body[data-trades-theme="cards"] .tr-card {
  background: #322217; border: 1px solid #4c3922; border-radius: 4px; padding: 1.4rem 1.5rem 1.6rem;
}
body[data-trades-theme="cards"] .tr-card-head {
  display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 1rem; padding-bottom: .85rem;
  border-bottom: 2px dashed #4c3922;
  font-family: var(--mono); font-size: .65rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: #9c8665;
}
body[data-trades-theme="cards"] .tr-date { color: #c4b694; }
body[data-trades-theme="cards"] .tr-week { color: #c8a464; }
body[data-trades-theme="cards"] .tr-plat {
  margin-left: auto; border: 1px solid #4c3922; padding: 1px 6px; border-radius: 2px;
}
body[data-trades-theme="cards"] .tr-summary {
  font-family: var(--serif); font-style: italic;
  font-size: 1rem; line-height: 1.55; color: #ddd0aa;
  margin-bottom: 1.2rem;
}
body[data-trades-theme="cards"] .tr-sides {
  background: transparent; gap: 1.2rem;
}
body[data-trades-theme="cards"] .tr-side {
  background: #f5e9c8; color: #2a1d11;
  border-radius: 6px; padding: 0; overflow: hidden;
  box-shadow: 0 3px 0 rgba(0,0,0,.35), 0 0 0 1px #4c3922;
  position: relative;
}
body[data-trades-theme="cards"] .tr-side::before {
  content: ''; display: block; height: 28px; background: #c8a464;
}
body[data-trades-theme="cards"] .tr-side:nth-child(2)::before { background: #a04830; }
body[data-trades-theme="cards"] .tr-side:nth-child(3)::before { background: #3d6e8e; }
body[data-trades-theme="cards"] .tr-side:nth-child(4)::before { background: #2a6a3c; }
body[data-trades-theme="cards"] .tr-side-head {
  padding: 1rem 1.1rem .6rem; gap: .65rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
body[data-trades-theme="cards"] .tr-side-avatar {
  background: rgba(0,0,0,.07); border: 1px solid rgba(0,0,0,.1);
}
body[data-trades-theme="cards"] .tr-side-name {
  font-family: var(--serif); font-size: 1.1rem; color: #2a1d11; line-height: 1.15;
}
body[data-trades-theme="cards"] .tr-side-team {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  color: #7a623e; text-transform: uppercase;
}
body[data-trades-theme="cards"] .tr-side-label {
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .28em; text-transform: uppercase; color: #7a623e;
  padding: 0 1.1rem;
}
body[data-trades-theme="cards"] .tr-assets {
  padding: 0 1.1rem; gap: .3rem;
}
body[data-trades-theme="cards"] .tr-asset {
  background: rgba(0,0,0,.04); border-left: 3px solid #c8a464; color: #2a1d11;
}
body[data-trades-theme="cards"] .tr-asset-pos { color: #7a623e; }
body[data-trades-theme="cards"] .tr-asset-team { color: #7a623e; }
body[data-trades-theme="cards"] .tr-grade {
  margin: .55rem 1.1rem 1.1rem; padding: .55rem .9rem;
  background: #2a1d11; color: #f5e9c8; border-radius: 3px;
  flex-direction: row; align-items: center; justify-content: space-between;
}
body[data-trades-theme="cards"] .tr-grade::before {
  content: 'Grade';
  font-family: var(--mono); font-size: .62rem;
  letter-spacing: .25em; text-transform: uppercase; color: #9c8665;
}
body[data-trades-theme="cards"] .tr-grade-letter {
  font-family: var(--serif); font-weight: 700; font-size: 1.7rem;
  color: #c8a464; letter-spacing: -.02em;
}
body[data-trades-theme="cards"] .tr-grade-letter.g-a { color: #6dcf8a; }
body[data-trades-theme="cards"] .tr-grade-letter.g-d { color: #ff7a6b; }
body[data-trades-theme="cards"] .tr-grade-pending {
  margin: .55rem 1.1rem 1.1rem; color: #9c8665;
}
body[data-trades-theme="cards"] .tr-grade-then { color: #9c8665; }
body[data-trades-theme="cards"] .tr-grade-arrow { color: #c8a464; }
body[data-trades-theme="cards"] .tr-empty,
body[data-trades-theme="cards"] .tr-lock { color: #ddd0aa; }
body[data-trades-theme="cards"] .tr-empty h2,
body[data-trades-theme="cards"] .tr-lock h2 { color: #f5e9c8; }
body[data-trades-theme="cards"] .tr-lock { background: #322217; border: 1px solid #4c3922; }
body[data-trades-theme="cards"] .tr-lock-icon { color: #c8a464; }
body[data-trades-theme="cards"] .tr-lock-cta { background: #c8a464; color: #2a1d11; }
/* (theme picker styles for cards live in the block above) */

/* ============================================================
   THEME: TRIBUNAL  (mahogany + brass + parchment)
   ============================================================ */
body[data-trades-theme="tribunal"] {
  background: #14100d; color: #ede0c4;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200,164,100,.05) 0%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.008) 0px, rgba(255,255,255,.008) 1px, transparent 1px, transparent 4px);
}
body[data-trades-theme="tribunal"] .tr-page-head { text-align: center; padding: .25rem 0 1.75rem; }
body[data-trades-theme="tribunal"] .tr-page-sup {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .35em; color: #c8a464;
  text-transform: uppercase; margin-bottom: 1.25rem;
}
body[data-trades-theme="tribunal"] .tr-page-tier {
  display: inline-block; margin-left: .5rem;
  font-size: .58rem; letter-spacing: .2em; color: #c8a464;
  border: 1px solid #c8a464; padding: 1px 5px; border-radius: 2px;
}
body[data-trades-theme="tribunal"] .tr-page-title {
  font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: .95;
  color: #ede0c4;
}
body[data-trades-theme="tribunal"] .tr-page-title em { color: #c8a464; font-style: italic; }
body[data-trades-theme="tribunal"] .tr-tabs {
  justify-content: center; border-top: 1px solid #3a2820; border-bottom: 1px solid #3a2820;
}
body[data-trades-theme="tribunal"] .tr-tab { color: #7e6e58; padding: 1rem 2rem; }
body[data-trades-theme="tribunal"] .tr-tab.active { color: #c8a464; border-bottom-color: #c8a464; }
body[data-trades-theme="tribunal"] .tr-tab:hover { color: #ede0c4; }
body[data-trades-theme="tribunal"] .tr-section-num,
body[data-trades-theme="tribunal"] .tr-section-meta { color: #c8a464; }
body[data-trades-theme="tribunal"] .tr-section-title { color: #ede0c4; }
body[data-trades-theme="tribunal"] .tr-section-title em { color: #c8a464; font-style: italic; }
body[data-trades-theme="tribunal"] .tr-section-head { border-bottom: 1px solid #2a1f18; }
body[data-trades-theme="tribunal"] .tr-section-empty {
  background: #1f1714; border: 1px dashed #3a2820; color: #7e6e58;
}
body[data-trades-theme="tribunal"] .tr-card {
  background: #1f1714; border: 1px solid #3a2820; border-top: 2px solid #c8a464;
  border-radius: 2px; box-shadow: 0 1px 0 rgba(0,0,0,.4); overflow: hidden;
}
body[data-trades-theme="tribunal"] .tr-card-head {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: .9rem 1.4rem; border-bottom: 1px solid #2a1f18;
  font-family: var(--mono); font-size: .65rem;
  letter-spacing: .22em; text-transform: uppercase;
}
body[data-trades-theme="tribunal"] .tr-date { color: #c4b694; }
body[data-trades-theme="tribunal"] .tr-week { color: #c8a464; }
body[data-trades-theme="tribunal"] .tr-plat {
  margin-left: auto; border: 1px solid #3a2820; padding: 2px 8px;
  color: #7e6e58; border-radius: 2px;
}
body[data-trades-theme="tribunal"] .tr-summary {
  padding: 1.3rem 1.6rem 1.1rem;
  border-bottom: 1px solid #2a1f18;
  font-family: var(--serif); font-style: italic;
  font-size: 1rem; line-height: 1.6; color: #ede0c4;
}
body[data-trades-theme="tribunal"] .tr-sides { background: #2a1f18; }
body[data-trades-theme="tribunal"] .tr-side {
  background: #1f1714; padding: 1.3rem 1.4rem 1.5rem;
}
body[data-trades-theme="tribunal"] .tr-side-avatar {
  background: #271d18; border: 1px solid #8a6f3a;
}
body[data-trades-theme="tribunal"] .tr-side-name {
  font-family: var(--serif); font-size: 1.1rem; color: #ede0c4;
}
body[data-trades-theme="tribunal"] .tr-side-team {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .15em;
  color: #7e6e58; text-transform: uppercase;
}
body[data-trades-theme="tribunal"] .tr-side-label {
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .28em; text-transform: uppercase; color: #8a6f3a;
}
body[data-trades-theme="tribunal"] .tr-asset {
  background: #271d18; border-left: 2px solid #8a6f3a; color: #ede0c4;
}
body[data-trades-theme="tribunal"] .tr-asset-pos { color: #7e6e58; }
body[data-trades-theme="tribunal"] .tr-asset-team { color: #7e6e58; }
body[data-trades-theme="tribunal"] .tr-grade {
  flex-direction: row; align-items: center; gap: 1rem; margin-top: .4rem;
  padding-top: 0; border-top: none;
}
body[data-trades-theme="tribunal"] .tr-grade-letter {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #5a3018 0%, #2a140a 90%);
  border: 2px solid #c8a464; color: #e0bf85; font-size: 1.7rem;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.5);
}
body[data-trades-theme="tribunal"] .tr-grade-letter.g-a { color: #6dcf8a; border-color: #6dcf8a; }
body[data-trades-theme="tribunal"] .tr-grade-letter.g-d { color: #8a3325; border-color: #8a3325; }
body[data-trades-theme="tribunal"] .tr-grade::after {
  content: 'Verdict';
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .28em; text-transform: uppercase; color: #8a6f3a;
}
body[data-trades-theme="tribunal"] .tr-grade-pending {
  margin-top: .55rem; color: #8a6f3a; border-top: 1px solid #2a1f18;
}
body[data-trades-theme="tribunal"] .tr-grade-then {
  width: 40px; height: 40px; font-size: 1.05rem; opacity: .55;
}
body[data-trades-theme="tribunal"] .tr-grade-arrow { color: #8a6f3a; }
body[data-trades-theme="tribunal"] .tr-empty,
body[data-trades-theme="tribunal"] .tr-lock { color: #c4b694; }
body[data-trades-theme="tribunal"] .tr-empty h2,
body[data-trades-theme="tribunal"] .tr-lock h2 { color: #ede0c4; }
body[data-trades-theme="tribunal"] .tr-lock { background: #1f1714; border: 1px solid #3a2820; }
body[data-trades-theme="tribunal"] .tr-lock-icon { color: #c8a464; }
body[data-trades-theme="tribunal"] .tr-lock-cta { background: #c8a464; color: #14100d; }
/* Themed top chrome */
body[data-trades-theme="tribunal"] .nav {
  background: rgba(20,16,13,.95); border-bottom-color: #3a2820;
}
body[data-trades-theme="tribunal"] .nav-chapbar {
  background: rgba(31,23,20,.95); border-bottom-color: #3a2820;
}
body[data-trades-theme="tribunal"] .nav-chapbar-link { color: #7e6e58; }
body[data-trades-theme="tribunal"] .nav-chapbar-link:hover,
body[data-trades-theme="tribunal"] .nav-chapbar-link.is-active { color: #c8a464; }
body[data-trades-theme="tribunal"] .nav-chapbar-link.is-active::after { background: #c8a464; }
body[data-trades-theme="tribunal"] .nav-chapbar-link + .nav-chapbar-link::before { background: #3a2820; }
/* Live sub-rail — parchment cream secondary vs the brass primary. */
body[data-trades-theme="tribunal"] .nav-subrail { border-top-color: #3a2820; }
body[data-trades-theme="tribunal"] .nav-subrail-link { color: #7e6e58; }
body[data-trades-theme="tribunal"] .nav-subrail-link:hover,
body[data-trades-theme="tribunal"] .nav-subrail-link.is-active { color: #ede0c4; }
body[data-trades-theme="tribunal"] .nav-subrail-link.is-active::after { background: #ede0c4; }
body[data-trades-theme="tribunal"] .nav-subrail-link + .nav-subrail-link::before { background: #3a2820; }
body[data-trades-theme="tribunal"] .nav-back { color: #c4b694; }
body[data-trades-theme="tribunal"] .nav-back:hover { color: #ede0c4; }
/* Distinct themed strip on each card head */
body[data-trades-theme="tribunal"] .tr-card-head {
  background: #271d18; color: #c4b694;
}
/* Theme picker — inactive contrast bumped to stand off the body. */
body[data-trades-theme="tribunal"] .tr-theme-picker { color: #c4b694; }
body[data-trades-theme="tribunal"] .tr-theme-btn {
  border-color: #5a3f2e; color: #c4b694; background: #2a1f18;
}
body[data-trades-theme="tribunal"] .tr-theme-btn:hover:not(.active) { color: #ede0c4; background: #34261c; }
body[data-trades-theme="tribunal"] .tr-theme-btn.active {
  background: #c8a464; color: #14100d; border-color: #c8a464;
}

/* ============================================================
   THEME: WIRE  (newsprint — light off-white + black + red)
   ============================================================ */
body[data-trades-theme="wire"] {
  background: #efeae0; color: #1a1612;
  background-image:
    repeating-linear-gradient(0deg, rgba(106,90,60,.03) 0px, rgba(106,90,60,.03) 1px, transparent 1px, transparent 6px),
    radial-gradient(ellipse at 20% 10%, rgba(176,56,48,.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(106,90,60,.06) 0%, transparent 60%);
}
body[data-trades-theme="wire"] .tr-page-head {
  text-align: center; padding: 1rem 1rem 1.75rem;
  border-bottom: 1px solid #c9bea3;
}
body[data-trades-theme="wire"] .tr-page-sup {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .35em; color: #b03830;
  text-transform: uppercase; font-weight: 700; margin-bottom: 1rem;
}
body[data-trades-theme="wire"] .tr-page-tier {
  display: inline-block; margin-left: .5rem;
  font-size: .58rem; letter-spacing: .2em; color: #b03830;
  border: 1px solid #b03830; padding: 1px 5px; border-radius: 2px;
}
body[data-trades-theme="wire"] .tr-page-title {
  font-family: var(--serif); font-size: clamp(2.6rem, 8vw, 5rem); line-height: .95;
  color: #1a1612;
}
body[data-trades-theme="wire"] .tr-page-title em { font-style: italic; }
body[data-trades-theme="wire"] .tr-tabs {
  justify-content: center; gap: 2.5rem; padding: 1.5rem 0;
  border-bottom: 1px solid #c9bea3; border-top: none;
}
body[data-trades-theme="wire"] .tr-tab { color: #6b5e44; padding: .25rem 0; }
body[data-trades-theme="wire"] .tr-tab.active { color: #b03830; border-bottom-color: #b03830; }
body[data-trades-theme="wire"] .tr-section-num,
body[data-trades-theme="wire"] .tr-section-meta { color: #6b5e44; }
body[data-trades-theme="wire"] .tr-section-title { color: #1a1612; }
body[data-trades-theme="wire"] .tr-section-title em { font-style: italic; }
body[data-trades-theme="wire"] .tr-section-head { border-bottom: 1px solid #c9bea3; }
body[data-trades-theme="wire"] .tr-section-empty {
  background: #f6f1e4; border: 1px dashed #c9bea3; color: #6b5e44;
}
body[data-trades-theme="wire"] .tr-card {
  background: #f6f1e4; border-top: 4px solid #1a1612;
  padding: 1.4rem 1.6rem 1.6rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
  border-radius: 0;
}
body[data-trades-theme="wire"] .tr-card-head {
  display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap;
  padding-bottom: .8rem; border-bottom: 1px solid #c9bea3; margin-bottom: 1rem;
  font-family: var(--mono); font-size: .6rem;
  letter-spacing: .25em; text-transform: uppercase;
  color: #6b5e44;
}
body[data-trades-theme="wire"] .tr-date { color: #1a1612; font-weight: 700; }
body[data-trades-theme="wire"] .tr-week { color: #b03830; }
body[data-trades-theme="wire"] .tr-plat { margin-left: auto; border: 1px solid #c9bea3; padding: 1px 6px; }
body[data-trades-theme="wire"] .tr-summary {
  font-size: 1rem; line-height: 1.65; color: #3a342b;
  margin-bottom: 1.6rem;
}
body[data-trades-theme="wire"] .tr-summary::first-letter {
  font-family: var(--serif); font-size: 2.6rem; line-height: 1;
  float: left; padding: .15rem .35rem 0 0; color: #b03830; font-weight: 700;
}
body[data-trades-theme="wire"] .tr-sides {
  background: transparent; border-top: 2px solid #1a1612; padding-top: 1.2rem;
  gap: 1.2rem;
}
body[data-trades-theme="wire"] .tr-side { padding: 0; }
body[data-trades-theme="wire"] .tr-side + .tr-side {
  border-left: 1px solid #c9bea3; padding-left: 1.2rem;
}
@media (max-width: 720px) {
  body[data-trades-theme="wire"] .tr-side + .tr-side {
    border-left: none; padding-left: 0; border-top: 1px solid #c9bea3; padding-top: 1.2rem;
  }
}
body[data-trades-theme="wire"] .tr-side-avatar { background: #d4c9b0; border: 1px solid #c9bea3; }
body[data-trades-theme="wire"] .tr-side-name {
  font-family: var(--serif); font-size: 1.1rem; color: #1a1612;
}
body[data-trades-theme="wire"] .tr-side-team {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .18em;
  color: #6b5e44; text-transform: uppercase;
}
body[data-trades-theme="wire"] .tr-side-label {
  font-family: var(--mono); font-size: .56rem;
  letter-spacing: .3em; text-transform: uppercase; color: #6b5e44;
}
body[data-trades-theme="wire"] .tr-asset {
  background: transparent; border-bottom: 1px dotted #c9bea3;
  border-radius: 0; padding: .3rem 0;
}
body[data-trades-theme="wire"] .tr-asset-pos { color: #6b5e44; }
body[data-trades-theme="wire"] .tr-asset.kind-pick .tr-asset-pos { color: #b03830; }
body[data-trades-theme="wire"] .tr-asset-team { color: #6b5e44; }
body[data-trades-theme="wire"] .tr-grade {
  flex-direction: row; align-items: center; gap: .8rem; margin-top: .6rem;
  padding-top: 0; border-top: none;
}
body[data-trades-theme="wire"] .tr-grade-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  border: 3px double #b03830; color: #b03830;
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem;
  transform: rotate(-4deg); background: #f1d8d3;
  box-shadow: 0 0 0 1px rgba(176,56,48,.15); letter-spacing: -.04em;
}
body[data-trades-theme="wire"] .tr-grade-letter.g-a {
  color: #4d7a2f; border-color: #4d7a2f; background: #e1ecd6;
}
body[data-trades-theme="wire"] .tr-grade::after {
  content: 'Grade';
  font-family: var(--mono); font-size: .6rem;
  letter-spacing: .2em; text-transform: uppercase; color: #6b5e44;
}
body[data-trades-theme="wire"] .tr-grade-pending {
  color: #6b5e44; border-top: 1px solid #c9bea3;
}
body[data-trades-theme="wire"] .tr-grade-then { width: 44px; height: 44px; font-size: 1rem; opacity: .5; }
body[data-trades-theme="wire"] .tr-grade-arrow { color: #6b5e44; }
body[data-trades-theme="wire"] .tr-empty,
body[data-trades-theme="wire"] .tr-lock { color: #3a342b; }
body[data-trades-theme="wire"] .tr-empty h2,
body[data-trades-theme="wire"] .tr-lock h2 { color: #1a1612; }
body[data-trades-theme="wire"] .tr-lock { background: #f6f1e4; border: 1px solid #c9bea3; }
body[data-trades-theme="wire"] .tr-lock-icon { color: #b03830; }
body[data-trades-theme="wire"] .tr-lock-cta { background: #b03830; color: #efeae0; }
/* Themed top chrome */
body[data-trades-theme="wire"] .nav {
  background: rgba(239,234,224,.95); border-bottom-color: #c9bea3;
}
body[data-trades-theme="wire"] .nav-chapbar {
  background: rgba(246,241,228,.95); border-bottom-color: #c9bea3;
}
body[data-trades-theme="wire"] .nav-chapbar-link { color: #6b5e44; }
body[data-trades-theme="wire"] .nav-chapbar-link:hover,
body[data-trades-theme="wire"] .nav-chapbar-link.is-active { color: #b03830; }
body[data-trades-theme="wire"] .nav-chapbar-link.is-active::after { background: #b03830; }
body[data-trades-theme="wire"] .nav-chapbar-link + .nav-chapbar-link::before { background: #c9bea3; }
/* Live sub-rail — the default translucent-black band over the wire's
   paper read as off-white, and the gold fallback active was illegible
   on it. Bright cream band (a notch lighter than the chapbar's
   #f6f1e4 — the earlier grey #e2dfd6 read dirty against the paper);
   ink secondary (the red stays the chapbar's). */
body[data-trades-theme="wire"] .nav-subrail { background: #faf6ea; border-top-color: #c9bea3; }
body[data-trades-theme="wire"] .nav-subrail-link { color: #6b5e44; }
body[data-trades-theme="wire"] .nav-subrail-link:hover,
body[data-trades-theme="wire"] .nav-subrail-link.is-active { color: #1a1612; }
body[data-trades-theme="wire"] .nav-subrail-link.is-active::after { background: #1a1612; }
body[data-trades-theme="wire"] .nav-subrail-link + .nav-subrail-link::before { background: #c9bea3; }
/* Wire's masthead text needs to flip dark since the bg is light */
body[data-trades-theme="wire"] .nav,
body[data-trades-theme="wire"] .nav .nav-title,
body[data-trades-theme="wire"] .nav .nav-back,
body[data-trades-theme="wire"] .nav .nav-link,
body[data-trades-theme="wire"] .nav .nav-drop-btn { color: #1a1612; }
body[data-trades-theme="wire"] .nav .nav-title em { color: #b03830; }
body[data-trades-theme="wire"] .nav .nav-back { color: #6b5e44; }
body[data-trades-theme="wire"] .nav .nav-back:hover { color: #b03830; }
/* Card head: cream sub-strip on the white paper. Negative margins extend
   it to card edges past the article padding. */
body[data-trades-theme="wire"] .tr-card-head {
  background: #efe6d2;
  margin: -1.4rem -1.6rem 1rem;
  padding: .8rem 1.6rem;
}
/* Theme picker */
body[data-trades-theme="wire"] .tr-theme-picker { color: #6b5e44; }
/* The page-head's bottom border runs behind the theme row (the picker
   has a negative top margin so it sits closer to the title). When the
   picker is rendered (commish only), suppress the original border on
   page-head and redraw it via a pseudo that starts a few rem in from
   the left — past the "Theme" label and into the first button area —
   so nothing strikes through the label text. :has() lets us key this
   off the picker actually being present without touching JS. */
body[data-trades-theme="wire"] .tr-page-head:has(~ #theme-picker .tr-theme-picker) {
  border-bottom-color: transparent;
  position: relative;
}
body[data-trades-theme="wire"] .tr-page-head:has(~ #theme-picker .tr-theme-picker)::after {
  content: '';
  position: absolute;
  left: 5.5rem; right: 0; bottom: -1px;
  border-bottom: 1px solid #c9bea3;
}
body[data-trades-theme="wire"] .tr-theme-btn {
  border-color: #c9bea3; color: #6b5e44; background: #f6f1e4;
}
body[data-trades-theme="wire"] .tr-theme-btn:hover:not(.active) { color: #1a1612; }
body[data-trades-theme="wire"] .tr-theme-btn.active {
  background: #b03830; color: #f1d8d3; border-color: #b03830;
}

/* ============================================================
   THEME: FLOOR  (Bloomberg terminal — black + phosphor green)
   ============================================================ */
body[data-trades-theme="floor"] {
  background: #050707; color: #c5d4cb;
  font-family: var(--mono);
  background-image:
    repeating-linear-gradient(0deg, rgba(0,255,159,.018) 0px, rgba(0,255,159,.018) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 50% 0%, rgba(0,255,159,.05) 0%, transparent 60%);
}
body[data-trades-theme="floor"] .tr-page-head {
  border: 1px solid #1c2421; padding: 1.25rem 1.5rem 1.4rem;
  margin-bottom: 1.5rem;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(255,255,255,.015) 39px, rgba(255,255,255,.015) 40px),
    #0a0c0c;
}
body[data-trades-theme="floor"] .tr-page-sup {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .25em;
  color: #00ff9f; margin-bottom: .4rem; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-page-tier {
  display: inline-block; margin-left: .5rem;
  color: #ffb000; border: 1px solid #ffb000; padding: 1px 8px;
  font-size: .56rem; letter-spacing: .25em;
}
body[data-trades-theme="floor"] .tr-page-title {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  color: #c5d4cb; letter-spacing: -.01em; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-page-title em { color: #00ff9f; font-style: normal; }
body[data-trades-theme="floor"] .tr-tabs { border-bottom: 1px solid #243029; }
body[data-trades-theme="floor"] .tr-tab { color: #4a564e; }
body[data-trades-theme="floor"] .tr-tab.active { color: #00ff9f; border-bottom-color: #00ff9f; }
body[data-trades-theme="floor"] .tr-section-num,
body[data-trades-theme="floor"] .tr-section-meta { color: #889084; }
body[data-trades-theme="floor"] .tr-section-title { color: #c5d4cb; font-family: var(--mono); font-weight: 700; text-transform: uppercase; font-size: .9rem; letter-spacing: .12em; }
body[data-trades-theme="floor"] .tr-section-title em { color: #00ff9f; font-style: normal; }
body[data-trades-theme="floor"] .tr-section-head { border-bottom: 1px solid #1c2421; }
body[data-trades-theme="floor"] .tr-section-empty {
  background: #0e1110; border: 1px dashed #1c2421; color: #4a564e;
}
body[data-trades-theme="floor"] .tr-card {
  border: 1px solid #1c2421; background: #0e1110; border-radius: 0;
}
body[data-trades-theme="floor"] .tr-card-head {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: .65rem 1rem; background: #131817;
  border-bottom: 1px solid #1c2421;
  font-family: var(--mono); font-size: .66rem;
  letter-spacing: .15em; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-date { color: #c5d4cb; }
body[data-trades-theme="floor"] .tr-week { color: #00ff9f; }
body[data-trades-theme="floor"] .tr-plat { margin-left: auto; color: #889084; border: 1px solid #1c2421; padding: 1px 8px; }
body[data-trades-theme="floor"] .tr-summary {
  padding: 1rem 1.1rem; border-bottom: 1px solid #1c2421;
  font-size: .82rem; line-height: 1.55; color: #889084;
  font-family: var(--mono);
}
body[data-trades-theme="floor"] .tr-summary::before {
  content: '> '; color: #00ff9f; font-weight: 700;
}
body[data-trades-theme="floor"] .tr-sides { background: #1c2421; }
body[data-trades-theme="floor"] .tr-side { background: #0e1110; padding: 1rem 1.1rem; }
body[data-trades-theme="floor"] .tr-side-avatar { background: #131817; border: 1px solid #1c2421; }
body[data-trades-theme="floor"] .tr-side-name {
  font-family: var(--mono); font-size: .82rem; color: #c5d4cb;
  letter-spacing: .05em; font-weight: 700; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-side-team {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .15em;
  color: #4a564e; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-side-label {
  font-family: var(--mono); font-size: .58rem;
  letter-spacing: .25em; color: #4a564e; text-transform: uppercase;
}
body[data-trades-theme="floor"] .tr-asset {
  background: #0a0c0c; border-left: 2px solid #008f5a; padding: 4px 8px;
}
body[data-trades-theme="floor"] .tr-asset.kind-pick { border-left-color: #ffb000; }
body[data-trades-theme="floor"] .tr-asset-pos { color: #ffb000; font-weight: 700; font-size: .66rem; letter-spacing: .1em; }
body[data-trades-theme="floor"] .tr-asset-name { color: #c5d4cb; }
body[data-trades-theme="floor"] .tr-asset-team { color: #889084; }
body[data-trades-theme="floor"] .tr-grade {
  flex-direction: row; align-items: center; gap: .8rem;
  margin-top: .9rem; padding: .55rem .7rem;
  background: #0a0c0c; border: 1px solid #243029; border-radius: 0;
}
body[data-trades-theme="floor"] .tr-grade::before {
  content: '▲ ';
}
body[data-trades-theme="floor"] .tr-grade-letter {
  font-family: var(--mono); font-weight: 700; font-size: 1.45rem;
  color: #ffb000; letter-spacing: -.02em;
}
body[data-trades-theme="floor"] .tr-grade-letter.g-a { color: #00ff9f; }
body[data-trades-theme="floor"] .tr-grade-letter.g-d { color: #ff3a3a; }
body[data-trades-theme="floor"] .tr-grade.has-a { border-color: #008f5a; }
body[data-trades-theme="floor"] .tr-grade.has-d { border-color: #ff3a3a; }
body[data-trades-theme="floor"] .tr-grade::after {
  content: 'GRADE'; margin-left: auto;
  font-size: .58rem; letter-spacing: .25em; color: #4a564e;
}
body[data-trades-theme="floor"] .tr-grade-pending {
  border-top: 1px solid #1c2421; color: #4a564e;
}
body[data-trades-theme="floor"] .tr-grade-then { color: #4a564e; font-family: var(--mono); font-weight: 700; }
body[data-trades-theme="floor"] .tr-grade-arrow { color: #ff7ad9; }
body[data-trades-theme="floor"] .tr-empty,
body[data-trades-theme="floor"] .tr-lock { color: #889084; font-family: var(--mono); }
body[data-trades-theme="floor"] .tr-empty h2,
body[data-trades-theme="floor"] .tr-lock h2 { color: #c5d4cb; }
body[data-trades-theme="floor"] .tr-lock { background: #0e1110; border: 1px solid #1c2421; }
body[data-trades-theme="floor"] .tr-lock-icon { color: #ffb000; }
body[data-trades-theme="floor"] .tr-lock-cta { background: #00ff9f; color: #050707; }
/* Themed top chrome */
body[data-trades-theme="floor"] .nav {
  background: rgba(5,7,7,.95); border-bottom-color: #1c2421;
}
body[data-trades-theme="floor"] .nav-chapbar {
  background: rgba(14,17,16,.95); border-bottom-color: #1c2421;
}
body[data-trades-theme="floor"] .nav-chapbar-link { color: #4a564e; }
body[data-trades-theme="floor"] .nav-chapbar-link:hover,
body[data-trades-theme="floor"] .nav-chapbar-link.is-active { color: #00ff9f; }
body[data-trades-theme="floor"] .nav-chapbar-link.is-active::after { background: #00ff9f; }
body[data-trades-theme="floor"] .nav-chapbar-link + .nav-chapbar-link::before { background: #1c2421; }
/* Live sub-rail — amber CRT secondary vs the neon-green primary. */
body[data-trades-theme="floor"] .nav-subrail { border-top-color: #1c2421; }
body[data-trades-theme="floor"] .nav-subrail-link { color: #889084; }
body[data-trades-theme="floor"] .nav-subrail-link:hover,
body[data-trades-theme="floor"] .nav-subrail-link.is-active { color: #ffb000; }
body[data-trades-theme="floor"] .nav-subrail-link.is-active::after { background: #ffb000; }
body[data-trades-theme="floor"] .nav-subrail-link + .nav-subrail-link::before { background: #1c2421; }
body[data-trades-theme="floor"] .nav-back { color: #889084; }
body[data-trades-theme="floor"] .nav-back:hover { color: #c5d4cb; }
/* Card head already has its own bg in the base block — boosted contrast */
body[data-trades-theme="floor"] .tr-card-head {
  background: #050707; border-left: 2px solid #00ff9f;
}
/* Theme picker */
body[data-trades-theme="floor"] .tr-theme-picker { color: #889084; }
body[data-trades-theme="floor"] .tr-theme-btn {
  border-color: #1c2421; color: #889084; background: #0e1110;
  font-family: var(--mono);
}
body[data-trades-theme="floor"] .tr-theme-btn:hover:not(.active) { color: #c5d4cb; }
body[data-trades-theme="floor"] .tr-theme-btn.active {
  background: #00ff9f; color: #050707; border-color: #00ff9f;
}
