/* =================================================================
   MIZORA TERMINAL v2 - institutional cut.
   Density is the aesthetic: more data per pixel, numerals right-
   aligned on a strict tabular grid, color rationed to meaning.
   Type scale: 19/13/11/10/9/8.5/8/7.5 - nothing between.
   ================================================================= */
:root {
  --ground: #070404;
  --panel:  #0c0807;
  --head:   #0a0605;
  --input:  #120b09;
  --hover:  #170e0b;

  --line:   #221410;
  --line-soft: rgba(34, 20, 16, .55);
  --line2:  #331c14;

  --ink:    #ece4d8;
  --dim:    #9d9084;
  --faint:  #675a4f;
  --ghost:  #3b322b;

  --red:    #e0281e;
  --red-2:  #b0170f;
  --red-dim: rgba(224, 40, 30, .1);
  --label:  rgba(220, 72, 52, .78);

  --green:  #2fbf68;
  --green-dim: rgba(47, 191, 104, .1);
  --warn:   #c07f28;
  --up-flash: rgba(47, 191, 104, .16);
  --dn-flash: rgba(224, 40, 30, .16);

  --pill: rgba(12, 8, 7, .94);

  --mono: 'DM Mono', 'SF Mono', Consolas, monospace;
  --sans: 'Inter', -apple-system, sans-serif;
  --jp: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

/* ---------- the day desk: paper and ink, same vermillion ---------- */
[data-theme="light"] {
  --ground: #ece6da;
  --panel:  #f6f1e7;
  --head:   #efe8db;
  --input:  #fdfaf3;
  --hover:  #e9e1d1;

  --line:   #d9cdba;
  --line-soft: rgba(120, 100, 78, .16);
  --line2:  #c3b29a;

  --ink:    #191009;
  --dim:    #57493c;
  --faint:  #8b7c6b;
  --ghost:  #b4a58f;

  --red:    #cf1812;
  --red-2:  #a01009;
  --red-dim: rgba(207, 24, 18, .07);
  --label:  rgba(168, 42, 24, .9);

  --green:  #0e7f3e;
  --green-dim: rgba(14, 127, 62, .09);
  --warn:   #8a5a12;
  --up-flash: rgba(14, 127, 62, .16);
  --dn-flash: rgba(207, 24, 18, .13);

  --pill: rgba(253, 250, 243, .95);
}
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.pos { color: var(--green) !important; }
.neg { color: var(--red) !important; }
::selection { background: var(--red); color: #fff; }

/* the hidden attribute must always win: several components set their own
   display and were silently defeating it (the bell panel bug, twice) */
[hidden] { display: none !important; }
* { scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 1.5px solid var(--red); outline-offset: 1px;
}

/* =================================================================
   TOP BAR - 44px, one line of truth
   ================================================================= */
.tbar {
  display: flex; align-items: center; gap: 18px;
  height: 50px; padding: 0 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.tbar__brand { display: flex; align-items: center; gap: 9px; }
.tbar__logo { width: 22px; height: 22px; }
.tbar__lockup { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.tbar__name { font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .26em; color: var(--ink); }
.tbar__product {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 7px; font-weight: 500;
  letter-spacing: .4em; text-transform: uppercase; color: var(--faint);
}
.tbar__product i { font-style: normal; font-family: var(--jp); font-size: 7.5px; letter-spacing: .1em; color: var(--label); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.tbar__nav { display: flex; gap: 20px; margin: 0 auto; }
@media (max-width: 1680px) { .tbar__nav { gap: 13px; } .tbar__nav a { letter-spacing: .1em; } }
@media (max-width: 1560px) { .tbar__nav .tag, .tbar__nav .nav-k { display: none; } .tbar__nav { gap: 11px; } }
@media (max-width: 1460px) { .tbar__nav a { font-size: 8.5px; letter-spacing: .08em; } }
.tbar__nav a {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .17em; text-transform: uppercase;
  color: var(--faint); text-decoration: none;
  padding: 14px 1px;
  transition: color .15s;
}
.nav-k {
  font-family: var(--jp); font-style: normal; font-weight: 700;
  font-size: 10px; line-height: 1; letter-spacing: 0;
  color: var(--label); opacity: .7;
  transition: color .15s, opacity .15s;
}
.tbar__nav a:hover .nav-k { opacity: 1; }
.tbar__nav a.active .nav-k { color: var(--red); opacity: 1; }
.tbar__nav a:hover { color: var(--dim); }
.tbar__nav a.active { color: var(--ink); }
.tbar__nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--red);
}

.tbar__right { display: flex; align-items: center; gap: 14px; }
.tbar__account {
  padding: 6px 11px; border: 1px solid var(--line);
  font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); cursor: default; white-space: nowrap;
}
.tbar__account .chev { color: var(--ghost); margin-left: 3px; }
.tbar__acct {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; margin-right: 14px;
  border: 1px solid var(--line); text-decoration: none;
  transition: border-color .15s;
}
.tbar__acct:hover { border-color: var(--red); }
.tbar__acct-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.tbar__acct-t {
  display: flex; flex-direction: column; gap: 2px; line-height: 1;
  font-family: var(--mono); font-size: 6.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint);
}
.tbar__acct-t b { font-size: 10px; font-weight: 500; letter-spacing: .06em; color: var(--ink); }
.tbar__stats { display: flex; gap: 18px; }
.tbar__stat { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.tbar__stat span {
  font-family: var(--sans); font-size: 6.5px; font-weight: 700;
  letter-spacing: .28em; text-transform: uppercase; color: var(--faint);
}
.tbar__stat b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tbar__vr { width: 1px; height: 20px; background: var(--line); margin: 0 14px; }
.tbar__icons { display: flex; gap: 6px; }
.tbar__theme {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  color: var(--dim); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tbar__theme:hover { border-color: var(--line2); color: var(--ink); }
.tbar__theme svg { width: 13px; height: 13px; }
.tbar__theme .ic-sun { display: none; }
[data-theme="light"] .tbar__theme .ic-sun { display: block; }
[data-theme="light"] .tbar__theme .ic-moon { display: none; }

.tbar__execute {
  padding: 11px 24px;
  background: var(--red); border: 1px solid var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.tbar__execute:hover { background: var(--red-2); }
.tbar__execute:active { transform: translateY(1px); }

/* =================================================================
   GRID - 6px gutters, tabbed desk spans the full width below
   ================================================================= */
.grid {
  flex: 1; min-height: 0;
  display: grid;
  gap: 6px; padding: 6px;
  grid-template-columns: 292px 1fr 300px;
  grid-template-rows: minmax(0, 1fr) 236px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  transition: box-shadow .3s;
}
.panel.focused { box-shadow: 0 0 0 1px var(--red), 0 0 22px rgba(224, 40, 30, .1); }

.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px 8px;
  background: var(--head);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.panel__head h2 {
  font-family: var(--sans);
  font-size: 10px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 8px;
  white-space: nowrap;
}
.panel__kanji { font-family: var(--jp); font-size: 9px; font-weight: 700; letter-spacing: .16em; color: rgba(220, 72, 52, .42); }
.panel__foot {
  padding: 5px 10px; border-top: 1px solid var(--line);
  font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost);
  flex-shrink: 0;
}

.lrail { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.lrail .panel--watch { flex: 0 1 auto; min-height: 0; }
.lrail .panel--book { flex: 1 1 auto; min-height: 210px; }
.lrail .bk-pane { flex: 1; min-height: 0; }
.panel--chart { grid-column: 2; grid-row: 1; }
.rail { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.rail .panel:first-child { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.bk-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.bk-pane.on { display: flex; }

.panel--desk { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; }
.desk-tabs {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  padding: 0 8px; border-bottom: 1px solid var(--line);
  background: var(--head);
}
.desk-tabs button {
  padding: 8px 12px; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; color: var(--dim); cursor: pointer;
  font-family: var(--sans); font-size: 9px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
}
.desk-tabs button:hover { color: var(--ink); }
.desk-tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.desk-tabs .cnt { color: var(--faint); font-weight: 500; }
.desk-tabs__sp { flex: 1; }
.desk-foot { font-family: var(--mono); font-size: 9px; color: var(--faint); letter-spacing: .06em; padding-right: 6px; }
.desk-pane { display: none; flex: 1; min-height: 0; overflow: auto; }
.desk-pane.on { display: flex; flex-direction: column; }
.kv--wide { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 22px; align-content: start; padding: 8px 14px; }
.kv--wide > div { border-bottom: 0; padding: 6px 0; }
.pf-split { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: center; flex: 1; min-height: 0; padding-right: 12px; }
.pf-split .pf-spark { width: 100%; height: 60px; margin: 0; }


/* =================================================================
   MARKET WATCH - 30px rows, numerals on the right rail
   ================================================================= */
.market-tabs { display: flex; gap: 1px; }
.market-tabs button {
  background: transparent; border: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono); font-size: 7.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 6px; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.market-tabs button:hover { color: var(--dim); }
.market-tabs button.on { color: var(--ink); border-color: rgba(224, 40, 30, .55); background: var(--red-dim); }

.watch-cols {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 82px 54px;
  gap: 6px; padding: 6px 11px 5px;
  font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ghost);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.watch-cols span:nth-child(2), .watch-cols span:nth-child(3), .watch-cols span:nth-child(4) { text-align: right; }

.watch { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.watch-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 82px 54px;
  gap: 6px; align-items: center;
  height: 29px; padding: 0 11px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
}
.watch-row:nth-child(odd) { background: rgba(255, 252, 245, .012); }
.watch-row:hover { background: var(--hover); }
.watch-row.on { background: rgba(224, 40, 30, .07); }
.watch-row.on::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: -1px;
  width: 2px; background: var(--red);
}
.w-id { min-width: 0; overflow: hidden; }
.w-id b { font-family: var(--sans); font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.w-last {
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
  text-align: right; padding: 2px 3px; margin: 0 -3px;
  transition: background .25s;
}
.w-last.f-up { background: var(--up-flash); transition: none; }
.w-last.f-dn { background: var(--dn-flash); transition: none; }
.w-chg { font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.w-last.stale { color: var(--faint); }
.w-chg.stale { color: var(--ghost); font-size: 7.5px; letter-spacing: .12em; text-transform: uppercase; }
.chart-chg .stale { color: var(--faint); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.chart-stats .warn { color: var(--warn); }
.mkt-closed {
  padding: 6px 14px; flex-shrink: 0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  background: rgba(192, 127, 40, .07);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--warn);
}
.mkt-closed b { font-weight: 700; letter-spacing: .1em; }
.tk-side.closed { opacity: .38; cursor: not-allowed; }
.tk-side.closed:hover { filter: none; border-color: var(--line2); }
.tk-side--buy.closed:hover { background: var(--red); }

.watch-foot {
  padding: 5px 10px; border-top: 1px solid var(--line);
  font-size: 7.5px; letter-spacing: .16em; color: var(--ghost);
  display: flex; justify-content: flex-end;
  flex-shrink: 0;
}

/* =================================================================
   CHART - the head earns its height, then gets out of the way
   ================================================================= */
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px 6px; flex-shrink: 0;
}
.chart-id { display: flex; align-items: center; gap: 11px; }
.chart-sym {
  font-family: var(--sans); font-size: 34px; font-weight: 800; letter-spacing: 0; line-height: .9;
  padding-right: 11px; border-right: 1px solid var(--line2);
}
.chart-id__mid { display: flex; flex-direction: column; gap: 1px; }
.chart-sub { font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.chart-px { font-family: var(--sans); font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.chart-chg { display: flex; flex-direction: column; gap: 1px; font-size: 11px; font-variant-numeric: tabular-nums; text-align: left; }
.chart-stats { display: flex; gap: 16px; }
.chart-stats > div { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.chart-stats span { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; color: var(--label); }
.chart-stats b { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

.chart-tools {
  display: flex; align-items: center;
  padding: 0 12px 4px; flex-shrink: 0; gap: 14px;
}
.tf-row { display: flex; gap: 0; }
.tf-row button {
  background: transparent; border: 0;
  color: var(--faint);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  padding: 4px 7px; cursor: pointer;
}
.tf-row button:hover { color: var(--dim); }
.tf-row button.on { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
.chart-note { font-size: 7.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-left: auto; }

.chart-legend {
  padding: 0 12px 5px; flex-shrink: 0;
  font-size: 9.5px; color: var(--dim); font-variant-numeric: tabular-nums;
  display: flex; gap: 13px; flex-wrap: wrap;
  min-height: 14px;
}
.chart-legend .lg-ohlc { color: var(--dim); letter-spacing: .02em; }
.chart-legend .lg-ema20 { color: #e0281e; }
.chart-legend .lg-ema50 { color: #c9a227; }
.chart-legend .lg-ema200 { color: #837a70; }

.chart-host { flex: 1; min-height: 0; position: relative; overflow: hidden; }

.session-strip {
  display: flex; align-items: center; gap: 3px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint);
}
.ss-label { color: var(--ghost); margin-right: 6px; }
.session-strip [data-sess] { padding: 3px 8px; border: 1px solid transparent; white-space: nowrap; }
.session-strip [data-sess].on {
  color: var(--ink);
  border-color: rgba(224, 40, 30, .5);
  background: var(--red-dim);
}
.ss-clock { margin-left: auto; color: var(--dim); letter-spacing: .08em; }


.tl-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.draw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; touch-action: none; }
.draw-canvas.armed { pointer-events: auto; cursor: crosshair; z-index: 7; }
.draw-tools { display: flex; gap: 2px; align-items: center; }
.draw-tools button {
  display: grid; place-items: center;
  width: 24px; height: 22px; padding: 0;
  background: none; border: 1px solid transparent;
  color: var(--faint); cursor: pointer;
}
.draw-tools button svg { width: 12px; height: 12px; }
.draw-tools button:hover { color: var(--ink); }
.draw-tools button.on { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.draw-tools #drawClear {
  width: auto; padding: 0 8px;
  font-family: var(--sans); font-size: 8px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.draw-sep { width: 1px; height: 14px; background: var(--line); margin: 0 8px; }
.tl-pill {
  position: absolute; left: 8px; transform: translateY(-50%);
  display: flex; align-items: center; gap: 7px;
  pointer-events: auto;
  background: var(--pill);
  border: 1px solid var(--line2);
  padding: 3px 8px;
  font-size: 10px; letter-spacing: .06em; font-variant-numeric: tabular-nums;
  color: var(--dim);
  white-space: nowrap;
  user-select: none;
}
.tl-pill b { font-weight: 500; letter-spacing: .12em; }
.tl-pill.entry b.side-long { color: var(--green); }
.tl-pill.entry b.side-short { color: var(--red); }
.tl-uppl.up { color: var(--green); }
.tl-uppl.dn { color: var(--red); }
.tl-pill.tp { border-color: rgba(47, 191, 104, .55); color: var(--green); cursor: ns-resize; }
.tl-pill.sl { border-color: rgba(224, 40, 30, .6); color: var(--red); cursor: ns-resize; }
.tl-pill .tl-x {
  cursor: pointer; opacity: .55; padding: 0 1px;
  font-size: 10px; line-height: 1;
}
.tl-pill .tl-x:hover { opacity: 1; }
.tl-pill.dragging { border-style: dashed; opacity: .85; }

/* =================================================================
   ORDER ENTRY - four fields, two rows, zero waste
   ================================================================= */
.ticket { padding: 9px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ticket-tabs { display: flex; border: 1px solid var(--line); flex-shrink: 0; }
.ticket-tabs button {
  flex: 1; padding: 8px 0;
  background: transparent; border: 0;
  color: var(--faint);
  font-family: var(--sans); font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
}
.ticket-tabs button.on { background: var(--red); color: #fff; }

.ticket-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.t-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.t-field span { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; color: var(--label); }
.t-field input {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
  padding: 6px 8px;
}
.t-field input:disabled { color: var(--faint); background: rgba(18, 11, 9, .5); border-style: dashed; }
.t-field input::-webkit-inner-spin-button, .t-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.t-field input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.t-field input:focus { border-color: var(--red); outline: none; }
.t-field input::placeholder { color: var(--ghost); }
.t-calc {
  position: absolute; right: 7px; bottom: 7px;
  font-style: normal; font-size: 7.5px; color: var(--faint); font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.tk-sides { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 9px; }
.tk-side {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 6px 7px; cursor: pointer;
  font-family: var(--sans);
  transition: filter .12s, transform .05s;
}
.tk-side:active { transform: translateY(1px); }
.tk-side span { font-size: 8px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.tk-side b { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tk-side--sell { background: transparent; border: 1px solid var(--line2); color: var(--ink); }
.tk-side--sell b { color: var(--green); }
.tk-side--sell:hover { border-color: var(--red); }
.tk-side--buy { background: var(--red); border: 1px solid var(--red); color: #fff; }
.tk-side--buy b { color: #fff; }
.tk-side--buy:hover { background: var(--red-2); }
.tk-spread {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 2px 7px; font-style: normal;
  background: var(--pill); border: 1px solid var(--line2);
  font-family: var(--mono); font-size: 8.5px; color: var(--dim);
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.ticket-kv { margin-top: 9px; border-top: 1px solid var(--line-soft); padding-top: 7px; display: grid; row-gap: 5px; }
.ticket-kv div { display: flex; justify-content: space-between; align-items: baseline; }
.ticket-kv dt {
  font-family: var(--sans); font-size: 8.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.ticket-kv dd { font-family: var(--mono); font-size: 10.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
#p-ticket .panel__head h2 span#tkSym { color: var(--red); margin-left: 4px; }

.ticket-risk, .ticket-quotes {
  display: flex; justify-content: space-between;
  font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.ticket-risk b, .ticket-quotes b { color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 5px; letter-spacing: 0; font-size: 11px; }
.ticket-quotes b#tBid { color: var(--green); }
.ticket-quotes b#tAsk { color: var(--red); }

.ticket-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ticket-actions button {
  padding: 12px 4px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .08em;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: background .15s, border-color .15s, transform .1s;
}
.ticket-actions button:active { transform: translateY(1px); }
.ticket-actions small { font-size: 6.5px; font-weight: 700; letter-spacing: .24em; opacity: .65; }
.btn-buy { background: var(--red); border: 1px solid var(--red); color: #fff; }
.btn-buy:hover { background: var(--red-2); }
.btn-sell { background: transparent; border: 1px solid var(--line2); color: var(--ink); }
.btn-sell:hover { border-color: var(--red); }
.ticket-note { font-size: 6.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost); text-align: center; }

/* =================================================================
   POSITIONS
   ================================================================= */
.positions { overflow-y: auto; min-height: 0; }
.positions .empty {
  padding: 16px 10px; text-align: center;
  font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost);
}
.pos-card { padding: 7px 10px 8px; border-bottom: 1px solid var(--line-soft); }
.pos-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.pos-card__sym { font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .03em; }
.pos-card__tag { font-size: 7px; font-weight: 500; letter-spacing: .14em; padding: 2px 6px; }
.pos-card__tag.long { color: var(--green); border: 1px solid rgba(47, 191, 104, .4); }
.pos-card__tag.short { color: var(--red); border: 1px solid rgba(224, 40, 30, .45); }
.pos-card__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pos-card__grid > div { display: flex; flex-direction: column; gap: 1px; }
.pos-card__grid span { font-size: 7.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ghost); }
.pos-card__grid b { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pos-card__close {
  margin-top: 6px; width: 100%;
  background: transparent; border: 1px solid var(--line2);
  color: var(--faint);
  font-family: var(--mono); font-size: 7px; letter-spacing: .2em; text-transform: uppercase;
  padding: 4px 0; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pos-card__close:hover { border-color: var(--red); color: var(--ink); }

/* =================================================================
   BOTTOM BAND
   ================================================================= */
.kv { padding: 3px 10px; overflow-y: auto; }
.kv > div {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5.5px 0;
  border-bottom: 1px solid var(--line-soft);
}
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.kv dd { font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }

.pf-spark { width: calc(100% - 20px); height: 34px; margin: 0 10px 7px; flex-shrink: 0; }

.trades-scroll { overflow: auto; min-height: 0; }
.trades { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.trades th {
  position: sticky; top: 0; background: var(--panel); z-index: 1;
  padding: 5px 11px; text-align: right;
  font-size: 8px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ghost);
  border-bottom: 1px solid var(--line);
}
.trades th:nth-child(1), .trades th:nth-child(2), .trades th:nth-child(3) { text-align: left; }
.trades td { padding: 4.5px 11px; font-size: 11px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: right; }
.trades td:nth-child(1), .trades td:nth-child(2), .trades td:nth-child(3) { text-align: left; }
.trades tbody tr:nth-child(odd) { background: rgba(255, 252, 245, .012); }
.trades .empty-row td { text-align: center; color: var(--ghost); font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; padding: 16px; }

.book-cols {
  display: grid; grid-template-columns: 1fr .7fr .7fr;
  padding: 5px 11px; gap: 5px;
  font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--ghost);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.book-cols span:nth-child(2), .book-cols span:nth-child(3) { text-align: right; }
.book { flex: 1; overflow-y: auto; min-height: 0; font-variant-numeric: tabular-nums; }
.book-row {
  position: relative;
  display: grid; grid-template-columns: 1fr .7fr .7fr;
  gap: 5px; padding: 3px 11px;
  font-size: 10.5px;
}
.book-row span:nth-child(2), .book-row span:nth-child(3) { text-align: right; }
.book-row .depth {
  position: absolute; top: 1px; bottom: 1px; right: 0;
  max-width: 58px;
  opacity: .13; pointer-events: none;
}
.book-row.ask { color: var(--red); }
.book-row.ask .depth { background: var(--red); }
.book-row.bid { color: var(--green); }
.book-row.bid .depth { background: var(--green); }
.book-row.mid {
  background: var(--head); color: var(--dim);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-weight: 500; font-size: 10.5px;
  padding: 4px 10px;
  margin: 1px 0;
}

.act-spark { width: calc(100% - 20px); height: 28px; margin: 6px 10px 3px; flex-shrink: 0; }
.activity { flex: 1; overflow-y: auto; min-height: 0; }
.act-row--big b { font-weight: 700; }
.act-row {
  display: grid; grid-template-columns: 52px 44px 1fr auto;
  gap: 7px; padding: 4.5px 11px;
  font-size: 10px; font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
}
.act-row b { color: var(--ink); font-weight: 500; }
.act-row .side-buy { color: var(--green); }
.act-row .side-sell { color: var(--red); }

/* =================================================================
   FOOTER - 28px colophon
   ================================================================= */
.tfoot {
  display: flex; align-items: center; gap: 13px;
  height: 32px; padding: 0 12px;
  border-top: 1px solid var(--line);
  font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
  flex-shrink: 0;
}
.tfoot__jp { font-family: var(--jp); font-size: 9px; font-weight: 700; letter-spacing: .36em; color: var(--label); }
.tfoot__sep { width: 1px; height: 11px; background: var(--line2); }
.tfoot__grow { flex: 1; }
.tfoot b { color: var(--dim); font-weight: 500; letter-spacing: .06em; }
.tfoot__clock { color: var(--dim); letter-spacing: .08em; }
.tfoot__seal {
  font-family: var(--jp); font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  color: var(--red);
  border: 1px solid rgba(224, 40, 30, .5);
  padding: 2px 8px;
}

/* =================================================================
   VIEWS - six workspaces on one core
   ================================================================= */
.views { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { display: none; flex: 1; min-height: 0; }
.view.on { display: flex; flex-direction: column; }
.view .grid { flex: 1; }
.vwrap { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.vwrap > .panel, .ov-grid, .an-grid { flex-shrink: 0; }

.ov-grid, .an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ov-grid .panel, .an-grid .panel { min-height: 240px; }

.ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 4px 0; }
.ov-stats > div { padding: 14px 16px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.ov-stats > div:nth-child(3n) { border-right: 0; }
.ov-stats span { display: block; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.ov-stats b { font-family: var(--sans); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.an-stats { grid-template-columns: repeat(4, 1fr); }
.an-stats > div:nth-child(3n) { border-right: 1px solid var(--line-soft); }
.an-stats > div:nth-child(4n) { border-right: 0; }

.ov-curve { flex: 1; min-height: 0; width: calc(100% - 24px); margin: 10px 12px; }

.ov-movers { flex: 1; overflow-y: auto; }
.ov-mover { display: grid; grid-template-columns: 74px 1fr 92px 64px; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; cursor: pointer; }
.ov-mover:hover { background: var(--hover); }
.ov-mover b { font-family: var(--sans); font-size: 12px; font-weight: 800; }
.ov-mover .nm { font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--ghost); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ov-mover .px { text-align: right; font-size: 11.5px; }
.ov-mover .dc { text-align: right; font-size: 10.5px; }

.ov-last { flex: 1; overflow-y: auto; }
.ov-last .empty { padding: 18px; text-align: center; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost); }

.mv-cols { display: grid; grid-template-columns: 1.2fr 100px 96px 96px 70px 90px 90px 90px; gap: 8px; padding: 7px 14px; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--ghost); border-bottom: 1px solid var(--line); }
.mv-cols span:not(:first-child) { text-align: right; }
.mv { overflow-y: auto; }
.mv-row { display: grid; grid-template-columns: 1.2fr 100px 96px 96px 70px 90px 90px 90px; gap: 8px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.mv-row:nth-child(odd) { background: rgba(255,252,245,.012); }
.mv-row:hover { background: var(--hover); }
.mv-row .id b { font-family: var(--sans); font-size: 12px; font-weight: 800; display: block; }
.mv-row .id i { font-style: normal; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: var(--ghost); }
.mv-row > span { text-align: right; font-size: 11.5px; }
.mv-row .px { padding: 1px 3px; transition: background .25s; }
.mv-row .px.f-up { background: var(--up-flash); transition: none; }
.mv-row .px.f-dn { background: var(--dn-flash); transition: none; }
.mv-row .sess { font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.mv-row canvas { width: 90px; height: 24px; justify-self: end; }
.mv-row .go { justify-self: end; }

.mini-btn, .mini-sel {
  background: transparent; border: 1px solid var(--line);
  color: var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 10px;
}
.mini-btn:hover { border-color: var(--red); color: var(--ink); }
.mini-sel { text-transform: none; letter-spacing: .04em; }
.jr-tools { display: flex; gap: 6px; align-items: center; }
.jr-note-th { min-width: 200px; }
.jr-note {
  width: 100%; min-width: 180px;
  background: transparent; border: 0; border-bottom: 1px dashed var(--line);
  color: var(--dim); font-family: var(--mono); font-size: 10px;
  padding: 2px 0;
}
.jr-note:focus { outline: none; border-bottom-color: var(--red); color: var(--ink); }

@media (max-width: 1100px) {
  .ov-grid, .an-grid { grid-template-columns: 1fr; }
  .mv-cols, .mv-row { grid-template-columns: 1fr 90px 66px 80px; }
  .mv-cols span:nth-child(3), .mv-cols span:nth-child(4), .mv-cols span:nth-child(6),
  .mv-row .bid, .mv-row .ask, .mv-row .sess { display: none; }
}

/* =================================================================
   ACCOUNT STRIP (the Edge metric band above the desk)
   ================================================================= */
.acct-strip {
  display: flex; align-items: stretch; flex-shrink: 0;
  /* Fixed. The futures metrics carry a progress bar and the predictions ones
     do not, so a content-sized band jumped 8px whenever the desk changed.
     border-box, so this is the outer height including the 1px rules. */
  height: 66px;
  margin: 6px 6px 0; background: var(--panel); border: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;                 /* a gutter here would eat the height */
}
.acct-strip::-webkit-scrollbar { display: none; }
.mkt-sw {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
  padding: 0 12px; border-right: 1px solid var(--line);
}
.mkt-sw button, .mkt-link {
  padding: 6px 10px; background: none; border: 1px solid transparent;
  color: var(--dim); cursor: pointer;
  font-family: var(--sans); font-size: 9px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  white-space: nowrap;
}
.mkt-sw button:hover, .mkt-link:hover { color: var(--ink); }
.mkt-sw button.on { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.mkt-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--faint); }
.mkt-link svg { width: 9px; height: 9px; }
@media (max-width: 1660px) { .metric--o1 { display: none; } }
@media (max-width: 1540px) { .metric--o2 { display: none; } }
@media (max-width: 1420px) { .metric--o3 { display: none; } .mkt-sw button, .mkt-link { padding: 6px 7px; } .metric { padding: 7px 10px; min-width: 96px; } }
.metric__v.pos { color: var(--green); }
.metric__v.neg { color: var(--red); }
.metric {
  display: grid; align-content: center; row-gap: 2px;
  padding: 7px 13px; min-width: 108px;
  flex: 0 0 auto;
  border-right: 1px solid var(--line-soft);
}
.metric:last-child { border-right: 0; }
.metric__l {
  font-family: var(--sans); font-size: 8px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--faint);
  white-space: nowrap;
}
.metric__v { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.metric__s { font-family: var(--mono); font-size: 8.5px; color: var(--faint); white-space: nowrap; }
.bar { display: block; height: 3px; background: var(--line-soft); margin-top: 3px; min-width: 90px; }
.bar i { display: block; height: 100%; width: 0; background: var(--dim); transition: width .3s; }
.bar.bad i { background: var(--red); }
.bar.warn i { background: #c07f28; }
.bar.ok i { background: var(--green); }

/* ---- ticket foot: the order priced before it exists ---- */
.ticket-foot {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  display: grid; row-gap: 5px;
}
.ticket-foot div { display: flex; justify-content: space-between; align-items: baseline; }
.ticket-foot dt {
  font-family: var(--sans); font-size: 8.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.ticket-foot dd { font-family: var(--mono); font-size: 10.5px; color: var(--ink); }

/* ---- data credit ---- */
.ss-credit { margin-left: 10px; color: var(--faint); text-decoration: none; letter-spacing: .1em; }
.ss-credit:hover { color: var(--red); }

/* ---- support threads (the Edge anatomy) ---- */
.sup-chip {
  padding: 2px 8px; border: 1px solid var(--warn); color: var(--warn);
  font-family: var(--sans); font-size: 7.5px; font-weight: 800; letter-spacing: .2em;
}
.sup-chip--closed { border-color: var(--line2); color: var(--faint); }
.sup-turn { padding: 8px 14px; font-size: 10px; color: var(--faint); border-bottom: 1px solid var(--line-soft); line-height: 1.6; }
.sup-msgs { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.sup-bubble {
  align-self: flex-end; max-width: 78%;
  background: var(--head); border: 1px solid var(--line);
  border-right: 2px solid var(--red);
  padding: 8px 11px;
}
.sup-bubble .who { display: block; font-size: 7.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.sup-bubble p { font-size: 11px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.sup-bubble .when { display: block; font-family: var(--mono); font-size: 8px; color: var(--ghost); margin-top: 4px; text-align: right; }
.sup-reply { padding: 10px 14px; border-top: 1px solid var(--line); }
.sup-reply textarea {
  width: 100%; padding: 8px 10px; resize: vertical;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--sans); font-size: 11px;
}
.sup-reply textarea:focus { border-color: var(--red); outline: none; }
.sup-clear { background: none; border: 0; color: var(--red); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; }
.sup-row__top { display: flex; align-items: center; gap: 8px; }
.sup-row__top b { flex: 1; }

/* =================================================================
   SETTINGS
   ================================================================= */
.setrail { display: flex; flex-direction: column; padding: 6px 0; }
.setrail button {
  padding: 9px 14px; background: none; border: 0; border-left: 2px solid transparent;
  color: var(--dim); cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.setrail button:hover { color: var(--ink); }
.setrail button.on { color: var(--ink); border-left-color: var(--red); background: var(--red-dim); }
.setpane { display: none; }
.setpane.on { display: block; }
.setrow {
  display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.setrow:last-child { border-bottom: 0; }
.setrow__l h3 { font-family: var(--sans); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; margin-bottom: 3px; }
.setrow__l p { font-size: 10px; color: var(--faint); line-height: 1.6; }
.setrow__c { justify-self: end; display: flex; justify-content: flex-end; }
.setrow__c input[type=text] {
  width: 240px; padding: 8px 10px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11px;
}
.setrow__c input:focus { border-color: var(--red); outline: none; }
.set-danger { border-color: rgba(224,40,30,.5); color: var(--red); }
.set-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
html[data-noflash] .f-up, html[data-noflash] .f-dn { background: transparent !important; }
@media (max-width: 1100px) { .setrow { grid-template-columns: 1fr; } .setrow__c { justify-self: start; } }

/* =================================================================
   SUPPORT
   ================================================================= */
.sup-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.sup-tally { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ghost); padding: 4px 4px 0; }
.sup-self { display: flex; gap: 10px; align-items: center; padding: 12px 14px; flex-wrap: wrap; }
.sup-self input[type=search] {
  flex: 1; min-width: 220px; padding: 10px 12px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11.5px;
}
.sup-self input:focus { border-color: var(--red); outline: none; }
.sup-links { display: flex; gap: 6px; }
.sup-links a { text-decoration: none; }
.sup-new__b { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sup-new__row { display: grid; grid-template-columns: 1fr 180px; gap: 8px; }
.sup-new__b input, .sup-new__b select, .sup-new__b textarea {
  padding: 9px 11px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11.5px;
}
.sup-new__b :focus { border-color: var(--red); outline: none; }
.sup-acts { display: flex; align-items: center; gap: 12px; }
.sup-count { font-size: 8.5px; color: var(--ghost); font-variant-numeric: tabular-nums; }
.sup-msg { flex: 1; font-size: 9.5px; color: var(--green); }
.sup-find {
  width: 160px; padding: 5px 9px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 9.5px;
}
.sup-rows { overflow-y: auto; }
.sup-row { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.sup-row:hover { background: var(--hover); }
.sup-row__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.sup-row__top b { font-family: var(--sans); font-size: 11.5px; font-weight: 700; }
.sup-row__top .st { font-size: 7.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--green); border: 1px solid rgba(47,191,104,.4); padding: 2px 7px; align-self: flex-start; }
.sup-row__m { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ghost); }
.sup-row__body { display: none; padding-top: 8px; font-size: 11px; color: var(--dim); line-height: 1.65; white-space: pre-wrap; }
.sup-row.open .sup-row__body { display: block; }

/* =================================================================
   RULES - the help centre
   ================================================================= */
.rl-body { display: grid; grid-template-columns: 240px 1fr; gap: 8px; align-items: start; }
.rl-rail { position: sticky; top: 8px; padding-bottom: 6px; }
.rl-search { padding: 12px 12px 8px; }
.rl-search input {
  width: 100%; padding: 8px 10px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11px;
}
.rl-search input:focus { border-color: var(--red); outline: none; }
.rl-count { padding: 0 12px 8px; font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ghost); }
.rl-nav { display: flex; flex-direction: column; }
.rl-nav button {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: none; border: 0; border-left: 2px solid transparent;
  color: var(--dim); cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.rl-nav button:hover { color: var(--ink); }
.rl-nav button.on { color: var(--ink); border-left-color: var(--red); background: var(--red-dim); }
.rl-nav [data-n] { font-family: var(--mono); font-size: 9px; color: var(--ghost); }
.rl-note { padding: 10px 12px 6px; font-size: 9px; color: var(--ghost); line-height: 1.6; border-top: 1px solid var(--line-soft); margin-top: 6px; }
.rl-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rl-art { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; }
.rl-art h3 { font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.rl-art p { font-size: 11.5px; line-height: 1.65; margin-bottom: 6px; }
.rl-rule { color: var(--ink); }
.rl-plain { color: var(--dim); }
.rl-ex { color: var(--dim); border-left: 2px solid var(--line2); padding-left: 10px; font-variant-numeric: tabular-nums; }
.rl-broke { color: var(--faint); font-size: 10.5px; }
.rl-broke::before { content: 'IF BROKEN '; font-size: 7.5px; letter-spacing: .18em; color: var(--label); }
.ui-empty-line { padding: 20px; text-align: center; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--ghost); }
@media (max-width: 1100px) { .rl-body { grid-template-columns: 1fr; } .rl-rail { position: static; } }

/* =================================================================
   REFERRALS
   ================================================================= */
.idrow { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; flex-wrap: wrap; }
.ref-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); padding: 7px 11px;
  font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.ref-chip b { font-size: 11px; letter-spacing: .08em; color: var(--ink); }
.ref-chip--ok { color: var(--green); border-color: rgba(47,191,104,.4); }
.ref-chip--ok i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.codeform { display: flex; gap: 6px; margin-left: auto; }
.codeform input {
  width: 180px; padding: 7px 10px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 11px;
}
.codeform input:focus { border-color: var(--red); outline: none; }
.linkrow { display: flex; gap: 8px; padding: 6px 16px; }
.linkrow input {
  flex: 1; padding: 9px 11px;
  background: var(--input); border: 1px solid var(--line); color: var(--dim);
  font-size: 11px;
}
.linkmeta { display: flex; justify-content: space-between; padding: 2px 16px 8px; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--ghost); }
.copy-note { display: block; padding: 0 16px 12px; font-size: 9px; color: var(--green); min-height: 14px; }

/* =================================================================
   POINTS - the ledger is the balance
   ================================================================= */
.pt-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 16px 4px; }
.pt-bal { font-family: var(--sans); font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.pt-bal span { font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--label); margin-left: 8px; }
.pt-tier { text-align: right; }
.tierbadge { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); }
.tierbadge b { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.tiers { display: flex; gap: 4px; margin-top: 9px; justify-content: flex-end; }
.tiers span {
  padding: 3px 9px; border: 1px solid var(--line);
  font-size: 7.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.tiers span.on { border-color: var(--red); color: var(--ink); background: var(--red-dim); }
.prog { padding: 12px 16px 16px; }
.prog__row { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.prog__foot { margin-top: 6px; font-size: 8.5px; letter-spacing: .1em; color: var(--ghost); }

/* =================================================================
   COMPETITIONS - the Edge anatomy
   ================================================================= */
.cph h1 { font-family: var(--sans); font-size: 22px; font-weight: 800; text-transform: uppercase; padding: 8px 4px 0; }
.cph p { color: var(--faint); font-size: 11px; padding: 4px 4px 2px; }
.feat { position: relative; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.feat__glow { position: absolute; top: -120px; right: -80px; width: 420px; height: 320px; background: radial-gradient(ellipse, rgba(224,40,30,.12), transparent 68%); pointer-events: none; }
.feat__in { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; padding: 22px 22px 24px; }
.feat__l h2 { font-family: var(--sans); font-size: 24px; font-weight: 800; text-transform: uppercase; margin: 10px 0 8px; }
.feat__l p { color: var(--dim); font-size: 12px; line-height: 1.7; max-width: 52ch; margin-bottom: 16px; }
.feat__ctas { display: flex; gap: 10px; align-items: center; }
.feat__ctas a { text-decoration: none; }
.feat__nums { display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-content: center; }
.feat__nums > div { padding: 12px 16px; border-left: 1px solid var(--line-soft); }
.feat__nums dt { font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--label); margin-bottom: 6px; }
.feat__nums dd { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }
.feat__nums dd.cd { color: var(--ink); }
.feat__nums dd.cd.is-soon { color: var(--red); }
.state-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border: 1px solid var(--line2);
  font-size: 7.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint);
}
.state-chip--live { color: var(--green); border-color: rgba(47,191,104,.45); }
.state-chip--live i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); animation: blink 2s infinite; }
.state-chip--up { color: #c9a227; border-color: rgba(201,162,39,.45); }
.grp__h { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); padding: 8px 4px 8px; }
.grp__h .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot--live { background: var(--green); }
.dot--up { background: #c9a227; }
.cgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.comp { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; }
.comp--dim { opacity: .75; }
.comp__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.comp__top h3 { font-family: var(--sans); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.num__l { display: block; font-size: 7.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ghost); margin-bottom: 4px; }
.num__v { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.comp__foot { display: flex; gap: 8px; }
.cbtn {
  padding: 8px 16px; border: 1px solid var(--line2);
  color: var(--dim); text-decoration: none;
  font-family: var(--sans); font-size: 8.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.cbtn:hover { color: var(--ink); border-color: var(--red); }
.cbtn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.cbtn--primary:hover { background: var(--red-2); color: #fff; }
@media (max-width: 1100px) { .feat__in { grid-template-columns: 1fr; } .cgrid { grid-template-columns: 1fr; } .nums { grid-template-columns: repeat(2, 1fr); } }

/* =================================================================
   METRICS - the Edge anatomy
   ================================================================= */
.mxh p { padding: 6px 4px 0; font-family: var(--sans); font-size: 15px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.mx-ctrls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mx-sp { flex: 1; }
.acctsel {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); padding: 7px 11px;
  font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--green);
}
.acctsel b { color: var(--ink); font-weight: 500; letter-spacing: .06em; }
.acct-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.hero-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.hcard { background: var(--panel); border: 1px solid var(--line); padding: 13px 14px; }
.hcard span { display: block; font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--label); margin-bottom: 7px; }
.hcard b { font-family: var(--sans); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.grid2 .panel { min-height: 240px; }
.risk-rows { padding: 8px 14px; }
.risk-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.risk-row:last-child { border-bottom: 0; }
.risk-row .rr-top { display: flex; justify-content: space-between; margin-bottom: 7px; }
.risk-row .rr-top span { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.risk-row .rr-top b { font-size: 10.5px; font-variant-numeric: tabular-nums; }
.risk-meter { height: 4px; background: var(--line); }
.risk-meter i { display: block; height: 100%; background: var(--green); transition: width .5s ease; }
.risk-meter i.warn { background: #c9a227; }
.risk-meter i.bad { background: var(--red); }
@media (max-width: 1100px) { .hero-cards { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }

/* =================================================================
   EVALUATIONS - the Edge configurator, Mizora catalogue
   ================================================================= */
.evh { padding: 8px 4px 2px; }
.evh h1 { font-family: var(--sans); font-size: 22px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.evh p { color: var(--faint); font-size: 11px; margin-top: 4px; }
.cfg { display: grid; grid-template-columns: 292px 1fr; gap: 8px; align-items: start; }
.rail-cfg {
  position: sticky; top: 8px;
  background: var(--panel); border: 1px solid var(--line);
  max-height: calc(100vh - 140px); overflow-y: auto;
  display: flex; flex-direction: column;
}
.rail-hd { padding: 11px 13px 9px; border-bottom: 1px solid var(--line); }
.rail-hd span { font-family: var(--sans); font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; display: block; }
.rail-hd i { font-style: normal; display: block; margin-top: 5px; font-size: 9.5px; color: var(--faint); line-height: 1.5; }
.cfg-st { padding: 10px 13px 12px; border-bottom: 1px solid var(--line-soft); }
.cfg-st__h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cfg-st__h b {
  width: 16px; height: 16px; display: grid; place-items: center;
  background: var(--red); color: #fff;
  font-family: var(--sans); font-size: 9px; font-weight: 800;
}
.cfg-st__h span { font-size: 8.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.cfg-st__h em { font-style: normal; margin-left: auto; font-size: 7.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ghost); }
.seg { display: flex; gap: 3px; flex-wrap: wrap; }
.seg button {
  padding: 6px 10px;
  background: var(--input); border: 1px solid var(--line);
  color: var(--dim); cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em;
}
.seg button:hover { color: var(--ink); }
.seg button.on { border-color: var(--red); color: var(--ink); background: var(--red-dim); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.cfg-ad label {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0; cursor: pointer;
  font-size: 10.5px; color: var(--dim);
}
.cfg-ad label:hover { color: var(--ink); }
.cfg-ad input { accent-color: var(--red); }
.cfg-ad b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.cfg-sum { padding: 12px 13px; }
.cfg-sum .row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cfg-sum .tot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.cfg-sum .tot span { font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--label); }
.cfg-sum .tot b { font-family: var(--sans); font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.stage-cfg { min-width: 0; }
.stage-hd { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 10px; }
.stage-hd h2 { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.stage-hd span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.cmp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cmp-card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  padding: 14px; cursor: pointer;
  transition: border-color .15s, translate .2s;
}
.cmp-card:hover { translate: 0 -2px; }
.cmp-card.on { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.cmp-card .rec {
  position: absolute; top: -1px; right: -1px;
  background: var(--red); color: #fff;
  font-size: 6.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 7px;
}
.cmp-card h3 { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 3px; }
.cmp-card .sub { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.cmp-card .px { font-family: var(--sans); font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-card .per { font-size: 8px; letter-spacing: .16em; text-transform: uppercase; color: var(--ghost); margin-top: 2px; }
.cmp-card .go {
  display: block; margin-top: 11px; padding: 9px 0;
  background: var(--red); border: 1px solid var(--red); color: #fff;
  text-align: center; text-decoration: none;
  font-family: var(--sans); font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.cmp-card .go:hover { background: var(--red-2); }
.cmp-card:not(.on) .go { visibility: hidden; }
.legal-line { padding: 10px 2px; font-size: 9px; color: var(--ghost); }
.legal-line a { color: var(--label); text-decoration: none; }
.ev-detail { margin-top: 2px; }
.ev-detail .dt-h { padding: 10px 14px 9px; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 14px; }
.ev-detail .dt-h i { font-style: normal; color: var(--faint); font-weight: 500; letter-spacing: .1em; text-transform: none; }

/* the phase table: one column per step, so the rule that applies in each
   phase is read across rather than inferred from prose */
.ph-wrap { overflow-x: auto; }
.ph-tbl { width: 100%; border-collapse: collapse; }
.ph-tbl th, .ph-tbl td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
.ph-tbl thead th {
  border-bottom: 1px solid var(--line); vertical-align: bottom; white-space: nowrap;
  font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--ink);
}
.ph-tbl thead th em {
  display: block; font-style: normal; margin-bottom: 3px;
  font-size: 7.5px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--label);
}
.ph-tbl tbody th {
  width: 32%; white-space: nowrap; font-weight: 500;
  font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.ph-tbl td { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.ph-tbl td s { display: block; margin-top: 2px; text-decoration: none; font-size: 9px; color: var(--ghost); }
.ph-tbl td u { text-decoration: none; color: var(--ghost); }
.ph-tbl td i { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ph-tbl td i.yes { color: var(--green); }
.ph-tbl td i.no { color: var(--faint); }
.ph-tbl tbody tr:last-child th, .ph-tbl tbody tr:last-child td { border-bottom: 0; }
.ph-tbl--one td { white-space: normal; }

.cmp--2 { grid-template-columns: repeat(2, 1fr); }
.cmp-blurb { margin-top: 9px; font-size: 9.5px; line-height: 1.65; color: var(--faint); }
.cfg-none { padding: 3px 0 1px; font-size: 9.5px; color: var(--ghost); }
.cfg-ad b.cr { color: var(--green); }
.cfg-go {
  display: block; margin-top: 12px; padding: 11px 0;
  background: var(--red); border: 1px solid var(--red); color: #fff;
  text-align: center; text-decoration: none;
  font-family: var(--sans); font-size: 9.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.cfg-go:hover { background: var(--red-2); }

/* Phone sizing, scoped to .cfg so it cannot reach another page's .seg.
   Kept inside this block deliberately: everything of mine lives between the
   two markers, so a transplant of my region carries all of it. */
@media (max-width: 620px) {
  .cmp, .cmp--2 { grid-template-columns: 1fr; }
  .ph-tbl th, .ph-tbl td { padding: 9px 11px; }
  .ph-tbl tbody th { width: auto; white-space: normal; }
  .cfg .seg button { padding: 15px 14px; font-size: 11px; }
  .cfg .cfg-ad label { min-height: 46px; padding: 10px 0; font-size: 12px; }
  .cfg .cfg-ad input { width: 17px; height: 17px; }
  .cfg .cfg-go { padding: 15px 0; font-size: 10.5px; }
  .cfg .cmp-card .go { padding: 15px 0; font-size: 10px; }
  .cfg .cmp-card { padding: 16px; }
  .cfg .cfg-sum .row { font-size: 11px; padding: 4px 0; }
}
.sim-note { padding: 12px 2px; font-size: 9px; letter-spacing: .06em; color: var(--ghost); }
@media (max-width: 1100px) {
  .cfg { grid-template-columns: 1fr; }
  .rail-cfg { position: static; max-height: none; }
  .cmp { grid-template-columns: repeat(2, 1fr); }
  .ev-rules { grid-template-columns: 1fr; }
}

/* =================================================================
   EDGE SHELL - sub-lockup, opt links, icons, bell, pages
   ================================================================= */
.tbar__nav a .tag {
  font-size: 6.5px; font-weight: 800; letter-spacing: .12em;
  color: var(--red); border: 1px solid rgba(224, 40, 30, .5);
  padding: 1px 4px; margin-left: 5px; vertical-align: 2px;
}
.tbar__icon {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  color: var(--dim); cursor: pointer; position: relative;
  transition: border-color .15s, color .15s;
}
.tbar__icon:hover { border-color: var(--line2); color: var(--ink); }
a.tbar__icon { text-decoration: none; }
a.tbar__icon.active { border-color: var(--red); color: var(--red); }
.tbar__icon svg { width: 13px; height: 13px; }
.bell-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.bell-panel[hidden] { display: none; }
.bell-panel {
  position: absolute; top: 46px; right: 130px; z-index: 300;
  width: 300px; max-height: 340px;
  background: var(--panel); border: 1px solid var(--line2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px; border-bottom: 1px solid var(--line);
  font-family: var(--sans); font-size: 9px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}
.bell-list { overflow-y: auto; }
.bell-list .empty { padding: 18px; text-align: center; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost); }
.bell-item { padding: 8px 11px; border-bottom: 1px solid var(--line-soft); font-size: 10.5px; color: var(--dim); }
.bell-item b { color: var(--ink); font-weight: 500; }
.bell-item .t { display: block; font-size: 8px; color: var(--ghost); margin-top: 2px; letter-spacing: .1em; }

.view--fold { display: none !important; }

.mx-tabs { display: flex; gap: 1px; flex-shrink: 0; }
.mx-tabs button {
  padding: 8px 18px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--sans); font-size: 8.5px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
}
.mx-tabs button.on { color: var(--ink); border-bottom-color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
.mx-pane { display: none; flex-direction: column; gap: 8px; }
.mx-pane.on { display: flex; }

.pg-note { padding: 12px 18px; color: var(--dim); font-size: 12px; line-height: 1.7; max-width: 84ch; }
.pg-ctas { display: flex; gap: 10px; align-items: center; padding: 6px 18px 18px; flex-wrap: wrap; }
.pg-ctas a { text-decoration: none; display: inline-block; }
.ev-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 6px 18px 12px; }
.ev-card {
  background: var(--input); border: 1px solid var(--line);
  padding: 14px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, translate .2s;
}
a.ev-card:hover { border-color: var(--red); translate: 0 -2px; }
.ev-card b { font-family: var(--sans); font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ev-card i { font-style: normal; font-size: 10px; color: var(--faint); line-height: 1.55; }
.ev-card .ev-px { margin-top: auto; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 1100px) { .ev-grid { grid-template-columns: repeat(2, 1fr); } .bell-panel { right: 12px; } }

/* =================================================================
   DOJO
   ================================================================= */
.dj-head-panel .dj-intro { padding: 10px 14px 12px; color: var(--dim); font-size: 11.5px; line-height: 1.7; max-width: 86ch; }
.dj-belt { display: flex; align-items: center; gap: 10px; }
.dj-belt span { font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.dj-beltbar { width: 130px; height: 4px; background: var(--line); }
.dj-beltbar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .6s cubic-bezier(.22,1,.3,1); }
.dj-belt b { font-size: 9.5px; font-variant-numeric: tabular-nums; color: var(--faint); }

.dj-grid { display: grid; grid-template-columns: 300px 1fr; gap: 8px; flex: 1; min-height: 420px; }
.dj-grid .panel { min-height: 0; }
.dj-list { overflow-y: auto; }
.dj-card { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .15s; }
.dj-card:hover { background: var(--hover); }
.dj-card.on { background: var(--red-dim); box-shadow: inset 2px 0 0 var(--red); }
.dj-card b { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.dj-card p { font-size: 10px; color: var(--faint); line-height: 1.55; margin-bottom: 7px; }
.dj-marks { display: flex; align-items: center; gap: 5px; }
.dj-marks i { width: 7px; height: 7px; border: 1px solid var(--line2); }
.dj-marks i.got { background: var(--red); border-color: var(--red); }
.dj-marks em { font-style: normal; margin-left: auto; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--ghost); }

.dj-room { display: flex; flex-direction: column; }
.dj-chart { flex: 1; min-height: 260px; position: relative; }
.dj-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ghost); line-height: 2.2;
}
.dj-ctl { display: flex; gap: 6px; }
.dj-deskbar {
  display: flex; align-items: center; gap: 18px;
  padding: 9px 13px; border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.dj-stat span { display: block; font-size: 7.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.dj-stat b { font-family: var(--sans); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dj-actions { margin-left: auto; display: flex; gap: 6px; }
.dj-actions .btn-buy, .dj-actions .btn-sell { padding: 9px 22px; font-family: var(--sans); font-size: 11px; font-weight: 800; }
.dj-actions .mini-btn { padding: 9px 16px; }
.dj-coach { max-height: 92px; overflow-y: auto; border-top: 1px solid var(--line); flex-shrink: 0; }
.dj-msg { display: flex; gap: 9px; padding: 6px 13px; font-size: 10.5px; color: var(--dim); border-bottom: 1px solid var(--line-soft); animation: paneIn .3s ease; }
.dj-msg::before { content: '道'; font-family: var(--jp); color: var(--red); font-size: 10px; }
.dj-msg.warn { color: var(--red); }
.dj-msg.good { color: var(--green); }

/* pending order furniture on the live chart */
.tl-pill.ord { border-color: rgba(201, 162, 39, .6); color: #c9a227; }

@media (max-width: 1100px) { .dj-grid { grid-template-columns: 1fr; } }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1100px) {
  body { overflow: auto; }
  .grid { display: flex; flex-direction: column; height: auto; }
  .panel { min-height: 190px; }
  .panel--chart { min-height: 400px; }
  .panel--desk { min-height: 300px; }
  .tbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .tbar__nav { order: 3; width: 100%; justify-content: flex-start; gap: 16px; overflow-x: auto; }
  .tbar__nav a { padding: 8px 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-last.f-up, .w-last.f-dn { background: transparent; }
}

/* =================================================================
   PREDICTIONS - Polymarket odds on the paper desk
   ================================================================= */
/* on /trade both desks share the view; the switcher decides which renders */
.mode-wrap { display: contents; }
#view-trade.pm-on .mode-futures { display: none; }
#view-trade:not(.pm-on) .mode-predictions { display: none; }
.pm-search { padding: 8px 10px 0; }
.pm-search input {
  width: 100%; padding: 7px 10px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 10.5px;
}
.pm-search input:focus { border-color: var(--red); outline: none; }
.pm-cols { grid-template-columns: 1fr 44px 52px !important; display: grid; }
.pm-list { flex: 1; overflow-y: auto; min-height: 0; }
.pm-list .empty { padding: 20px; text-align: center; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost); }
.pm-row {
  display: grid; grid-template-columns: 1fr 44px 52px; gap: 6px; align-items: center;
  width: 100%; padding: 8px 11px; background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent; color: var(--dim); cursor: pointer; text-align: left;
  font-family: var(--sans);
}
.pm-row:hover { background: var(--hover); }
.pm-row.on { border-left-color: var(--red); background: rgba(224, 40, 30, .07); }
.pm-row__q { font-size: 10px; font-weight: 600; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-row__px { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--green); text-align: right; }
.pm-row__v { font-family: var(--mono); font-size: 9px; color: var(--faint); text-align: right; }

.pm-id { min-width: 0; }
.pm-q { font-family: var(--sans); font-size: 14px; font-weight: 800; letter-spacing: 0; line-height: 1.25; display: block; max-width: 640px; }
.pm-big { display: flex; align-items: baseline; gap: 6px; }
.pm-big #pmYesPx { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.pm-big #pmYesLbl { font-size: 8px; font-weight: 800; letter-spacing: .24em; color: var(--faint); }
.pm-ladder { display: flex; align-items: center; gap: 10px; flex: 1; }
#p-pmlist { flex: 1 1 auto; min-height: 0; }
.pml { font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; color: var(--dim); }
.pml--yes { color: var(--green); }
.pml--no { color: var(--red); }
.pml--closed { color: var(--warn); font-weight: 700; }

.pm-sides { grid-template-columns: 1fr 1fr; }
.pm-side {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 6px 7px; cursor: pointer;
  background: transparent; border: 1px solid var(--line2); color: var(--ink);
  font-family: var(--sans);
}
.pm-side span { font-size: 8px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; }
.pm-side b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.pm-side--yes.on { border-color: var(--green); background: var(--green-dim); }
.pm-side--yes b { color: var(--green); }
.pm-side--no.on { border-color: var(--red); background: var(--red-dim); }
.pm-side--no b { color: var(--red); }
.pm-range { display: flex; align-items: center; gap: 8px; }
.pm-range input[type=range] { flex: 1; accent-color: var(--red); }
.pm-pctbox {
  width: 40px; padding: 5px 6px; text-align: right;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 10px;
}
.pm-place {
  width: 100%; padding: 11px; cursor: pointer;
  background: var(--green); border: 1px solid var(--green); color: #06130a;
  font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.pm-place--no { background: var(--red); border-color: var(--red); color: #fff; }
.pm-place:disabled { opacity: .4; cursor: not-allowed; }
.pm-warn { color: var(--red); }
.pm-cell-q { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* =================================================================
   AUTH + ACCOUNT
   ================================================================= */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-panel { width: 360px; }
.auth-b { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.auth-err { color: var(--red); }
.auth-go { width: 100%; padding: 12px; }
.auth-alt { font-size: 10px; color: var(--faint); line-height: 1.7; text-align: center; }
.auth-alt a { color: var(--red); }
.tbar__acct-dot--off { background: var(--ghost); }
.acc-claims { display: flex; gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
.acc-claim {
  flex: 1; min-width: 96px; padding: 14px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .15s;
}
.acc-claim:hover { border-color: var(--red); }
.acc-claim:disabled { opacity: .5; cursor: wait; }
.acc-claim b { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.acc-claim span { font-size: 7.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }

/* ---- account menu ---- */
.tbar__acctwrap { position: relative; margin-right: 14px; }
.tbar__acctwrap .tbar__acct { margin-right: 0; cursor: pointer; background: transparent; font-family: inherit; }
.tbar__acct svg { width: 10px; height: 10px; color: var(--faint); }
.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 320;
  width: 230px;
  background: var(--panel); border: 1px solid var(--line2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.acct-menu__who { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.acct-menu__who b { display: block; font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--ink); }
.acct-menu__who span { display: block; font-family: var(--mono); font-size: 9px; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.acct-menu a, .acct-menu button {
  display: block; width: 100%; padding: 9px 13px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  color: var(--dim); text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.acct-menu a:hover, .acct-menu button:hover { color: var(--ink); background: var(--hover); }
.acct-menu button#acctLogout { border-bottom: 0; color: var(--red); }

/* ---- the guest gate ---- */
.gate {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 2, 2, .78); backdrop-filter: blur(3px);
}
.gate[hidden] { display: none; }
.gate__panel {
  width: 400px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line2);
  padding: 28px 28px 22px; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.gate__brand { font-family: var(--sans); font-size: 15px; font-weight: 800; letter-spacing: .3em; color: var(--ink); }
.gate__brand span {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: 7px; font-weight: 500;
  letter-spacing: .44em; text-transform: uppercase; color: var(--faint);
}
.gate__brand i { font-style: normal; font-family: var(--jp); color: var(--label); letter-spacing: .1em; }
.gate__panel h2 {
  margin: 20px 0 8px;
  font-family: var(--sans); font-size: 16px; font-weight: 800; letter-spacing: .02em;
}
.gate__panel > p { font-size: 11px; color: var(--dim); line-height: 1.7; }
.gate__acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 14px; }
.gate__go {
  padding: 12px 10px; text-decoration: none;
  background: var(--red); border: 1px solid var(--red); color: #fff;
  font-family: var(--sans); font-size: 9.5px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}
.gate__go:hover { background: var(--red-2); }
.gate__go--alt { background: transparent; color: var(--ink); border-color: var(--line2); }
.gate__go--alt:hover { background: transparent; border-color: var(--red); color: var(--red); }
.gate__guest {
  background: none; border: 0; cursor: pointer;
  color: var(--faint); text-decoration: underline;
  font-family: var(--sans); font-size: 10px;
}
.gate__guest:hover { color: var(--ink); }
.gate__truth { font-size: 9px; color: var(--faint); line-height: 1.6; margin-top: 8px; }

/* ---- auth modal ---- */
.authmodal .auth-panel { width: 360px; max-width: calc(100vw - 32px); text-align: left; }
.am-tabs { margin: 0; }

/* =================================================================
   DOJO - BELT LADDER + BACKTEST WING (appended)
   ================================================================= */
#djBeltJp { font-family: var(--jp); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--label); }
.dj-req { padding: 9px 14px 0; font-size: 10px; letter-spacing: .03em; color: var(--faint); font-variant-numeric: tabular-nums; }
.dj-req:empty { display: none; }

.bt-grid { display: grid; grid-template-columns: 380px 1fr; gap: 8px; flex: 1; min-height: 420px; }
.bt-grid .panel { min-height: 0; }

#btSetup { display: flex; flex-direction: column; }
.bt-form {
  padding: 12px 13px; display: flex; flex-direction: column; gap: 9px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.t-field select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono); font-size: 12px;
  padding: 6px 26px 6px 8px;
  border-radius: 0; cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5'><path d='M0 0l4 5 4-5z' fill='%23907f6d'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.t-field select:focus { border-color: var(--red); outline: none; }
.bt-form .cbtn { margin-top: 3px; text-align: center; cursor: pointer; }

.bt-record { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bt-record__label { padding: 10px 13px 5px; font-size: 8px; letter-spacing: .2em; text-transform: uppercase; color: var(--ghost); flex-shrink: 0; }
.bt-record .trades-scroll { flex: 1; min-height: 0; }
.bt-record .trades th, .bt-record .trades td { padding: 5px 9px; }
.bt-record .trades td { font-size: 10.5px; }
.bt-record .trades th:nth-child(2), .bt-record .trades td:nth-child(2),
.bt-record .trades th:nth-child(3), .bt-record .trades td:nth-child(3) { text-align: right; }

.bt-room { display: flex; flex-direction: column; }
.bt-prog { height: 2px; background: var(--line); flex-shrink: 0; }
.bt-prog i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s linear; }

@media (max-width: 1100px) { .bt-grid { grid-template-columns: 1fr; } }


/* ---- dojo verify fixes ---- */
.bt-record .trades th, .bt-record .trades td { padding: 5px 7px; }
.bt-record .trades .empty-row td { font-size: 7.5px; }

/* ---- ticket margin slider ---- */
.tk-ms { display: flex; flex-direction: column; gap: 4px; }
.tk-ms__l {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: 8px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}
.tk-ms__l i { font-style: normal; font-family: var(--mono); font-size: 8.5px; letter-spacing: .02em; text-transform: none; }
.tk-ms__row { display: flex; align-items: center; gap: 8px; }
.tk-ms__row input[type=range] { flex: 1; accent-color: var(--red); height: 3px; }
.tk-ms__box {
  width: 38px; padding: 4px 6px; text-align: right;
  background: var(--input); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 10px;
}

/* ---- predictions header fit ---- */
.pm-id { min-width: 0; overflow: hidden; }
.pm-q { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }
.pm-big { flex-shrink: 0; margin-left: 12px; }
.chart-head .chart-stats { flex-shrink: 0; }

/* ---- phones: the topbar must not force sideways scroll ---- */
@media (max-width: 380px) {
  /* the seal and motto are ornament; a 320px phone needs the row to fit */
  .tfoot__seal, .tfoot__jp, .tfoot__sep { display: none; }
}

/* ---- phones: the trade desk itself must fit the viewport ---- */
@media (max-width: 700px) {
  .chart-head { flex-wrap: wrap; row-gap: 6px; }
  .chart-stats { flex-wrap: wrap; gap: 8px 12px; justify-content: flex-start; }
  .chart-tools { flex-wrap: wrap; row-gap: 4px; }
  .draw-sep { display: none; }
  .chart-id { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
  /* the session schedule is desktop chrome; the clock and credit stay */
  .session-strip { flex-wrap: wrap; row-gap: 3px; }
  .session-strip [data-sess] { display: none; }
  .ss-clock { margin-left: 0; }
  .tk-sides { grid-template-columns: 1fr 1fr; }
  .ticket-fields { grid-template-columns: 1fr 1fr; }
  .acct-strip { height: auto; min-height: 58px; }
  .mkt-sw { flex-wrap: wrap; padding: 4px 8px; }
  .desk-tabs { flex-wrap: wrap; }
  .desk-tabs button { padding: 7px 8px; font-size: 8px; letter-spacing: .08em; }
  .desk-tabs__sp { display: none; }
  .desk-foot { width: 100%; order: 9; padding: 2px 0 6px; }
}
@media (max-width: 700px) {
  .tbar { flex-wrap: wrap; row-gap: 4px; }
  .tbar__stats, .tbar__acctwrap, .tbar__acct, .tbar__vr { display: none; }
  .tbar__nav { order: 3; width: 100%; overflow-x: auto; }
  .tbar__icons { margin-left: auto; }
}

/* ---- desk switcher in the account menu ---- */
.acct-menu__desks { border-bottom: 1px solid var(--line-soft); padding: 4px 0; }
.acct-menu__lbl {
  display: block; padding: 6px 13px 4px;
  font-family: var(--sans); font-size: 7px; font-weight: 800;
  letter-spacing: .24em; text-transform: uppercase; color: var(--ghost);
}
.acct-desk {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 13px; background: none; border: 0; border-left: 2px solid transparent;
  cursor: pointer; text-align: left; font-family: var(--sans);
}
.acct-desk:hover { background: var(--hover); }
.acct-desk.on { border-left-color: var(--red); background: var(--red-dim); cursor: default; }
.acct-desk__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.acct-desk__dot.is-funded { background: var(--red); }
.acct-desk__t { flex: 1; min-width: 0; }
.acct-desk__t b { display: block; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--ink); }
.acct-desk__t em { display: block; font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--faint); margin-top: 1px; }
.acct-desk__on { font-size: 6.5px; font-weight: 800; letter-spacing: .2em; color: var(--red); }
.acct-desk:disabled { opacity: .5; cursor: wait; }

/* per-market instrument spec line + 24/7 session */
.inst-spec { font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; color: var(--faint); align-self: center; margin-left: 14px; white-space: nowrap; }
.ss-always { display: none; color: var(--green); }
.session-strip.is-crypto [data-sess]:not([data-sess="always"]) { display: none; }
.session-strip.is-crypto .ss-always { display: inline; }
@media (max-width: 700px) { .inst-spec { display: none; } }
