/* =====================================================================
   PADDOCK · Carbon theme · cockpit (the trading screen, view "sim")
   Owns everything inside .tfbody.sim plus the phone order bar (.tfmbar).
   Every rule is scoped under .tf.cb so it out-ranks tradingfloor.css and
   crypto.css without editing them. Markup and ids are untouched; the only
   added pieces (Edge badge, drawer handle, risk-to-reward bar) come from
   js/carbon/cockpit.js.

   Layout
     >= 1180px  fills the viewport under the HUD, no page scroll:
                watchlist rail 68px | centre column | right panel 340px
     861-1179   same, right panel 300px, Edge badge folds to its hexagon
     <= 860px   stacked phone layout with the fixed Buy / Sell bar

   Colour rules: green and red only for profit / loss, up / down and
   buy / sell. Orange is the brand accent and never signals a loss.
   Warnings that are not a loss (tilt, weak ratio, coach cautions) use amber.
   ===================================================================== */

/* ---------- local tokens ---------- */
.tf.cb .tfsim,
.tf.cb .tfmbar {
  --ck-up-a: color-mix(in srgb, var(--tup) 12%, transparent);
  --ck-dn-a: color-mix(in srgb, var(--tdn) 13%, transparent);
  --ck-up-deep: color-mix(in srgb, var(--tup) 72%, #000);
  --ck-dn-deep: color-mix(in srgb, var(--tdn) 78%, #000);
  --ck-orb-core: #FFE6D6;
  --ck-chamfer: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  --ck-chamfer-s: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  --ck-hex: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

/* carbon-fibre weave (same recipe as the foundation's .cbcf) for the bars that carry it */
.tf.cb .tfsim .tfwh,
.tf.cb .tfsim .tfstab,
.tf.cb .tfsim .tfbot::before,
.tf.cb .tfsim .tfacctx,
.tf.cb .tfmbar {
  background-color: var(--cb-cf-0);
  background-image:
    linear-gradient(180deg, var(--cb-gloss), transparent 45%, var(--cb-shade)),
    repeating-linear-gradient(115deg, transparent 0 18px, var(--cb-clear) 18px 19px),
    linear-gradient(27deg, var(--cb-cf-1) 5px, transparent 5px),
    linear-gradient(207deg, var(--cb-cf-1) 5px, transparent 5px),
    linear-gradient(27deg, var(--cb-cf-3) 5px, transparent 5px),
    linear-gradient(207deg, var(--cb-cf-3) 5px, transparent 5px),
    linear-gradient(90deg, var(--cb-cf-2) 10px, transparent 10px),
    linear-gradient(var(--cb-cf-2) 25%, var(--cb-cf-1) 25%, var(--cb-cf-1) 50%, transparent 50%, transparent 75%, var(--cb-cf-4) 75%, var(--cb-cf-4));
  background-size: 100% 100%, 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: 0 0, 0 0, 0 5px, 10px 0, 0 10px, 10px 5px, 0 0, 0 0;
}

/* ---------- angled chips ----------
   The foundation skews the whole .tfseg button, which slants plain-text labels.
   In the cockpit the skewed plate is drawn by ::before instead, so labels stay upright. */
.tf.cb .tfsim .tfseg { gap: 6px; padding: 0 3px; border: 0; border-radius: 0; background: transparent; box-shadow: none; flex-wrap: nowrap; }
.tf.cb .tfsim .tfseg button,
.tf.cb .tfsim .tftools .tfmenu summary,
.tf.cb .tfsim .tfsides button,
.tf.cb .tfsim .tflive,
.tf.cb .tfsim .cbdrh {
  position: relative; isolation: isolate; transform: none;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.tf.cb .tfsim .tfseg button > * { transform: none; }
.tf.cb .tfsim .tfseg button::before,
.tf.cb .tfsim .tftools .tfmenu summary::before,
.tf.cb .tfsim .tfsides button::before,
.tf.cb .tfsim .tflive::before,
.tf.cb .tfsim .cbdrh::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  transform: skewX(var(--cb-skew));
  background: var(--tpan2); border: 1px solid var(--tline);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.tf.cb .tfsim .tfseg button { color: var(--tmut); transition: color .2s; }
.tf.cb .tfsim .tfseg button:hover { color: var(--tink); }
.tf.cb .tfsim .tfseg button:hover::before,
.tf.cb .tfsim .tftools .tfmenu summary:hover::before,
.tf.cb .tfsim .tfsides button:hover::before,
.tf.cb .tfsim .tflive:hover::before,
.tf.cb .tfsim .cbdrh:hover::before { border-color: var(--cb-line-3); }
.tf.cb .tfsim .tfseg button[aria-pressed="true"] { color: var(--tink); box-shadow: none; background: transparent; }
.tf.cb .tfsim .tfseg button[aria-pressed="true"]::before {
  background: linear-gradient(180deg, var(--cb-accent-a25), var(--cb-accent-a10));
  border-color: var(--cb-accent);
}

/* main call to action inside the cockpit: chamfer on a layer, so the focus ring is never clipped */
.tf.cb .tfsim .tfbtn.gold { clip-path: none; background: transparent; isolation: isolate; }
.tf.cb .tfsim .tfbtn.gold::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 45%, var(--cb-accent-lo));
  clip-path: var(--ck-chamfer-s); transition: filter .2s;
}
.tf.cb .tfsim .tfbtn.gold:hover:not(:disabled) { background: transparent; }
.tf.cb .tfsim .tfbtn.gold:hover:not(:disabled)::before { filter: brightness(1.1); }

/* ---------- layout ---------- */
.tf.cb .tfbody.sim { padding: 0; }
.tf.cb .tfsim { gap: 0; }

@media (min-width: 861px) {
  .tf.cb .tfbody.sim { height: calc(100dvh - var(--cb-hud-h)); min-height: 560px; }
  .tf.cb .tfsim {
    display: grid; grid-template-columns: 68px minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr);
    gap: 0; height: 100%; align-items: stretch;
  }
  .tf.cb .tfsim .tfmain {
    order: 0; display: grid; gap: 0; min-width: 0; min-height: 0; height: 100%;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(240px, 1fr) auto;
    grid-template-areas: "q q" "m t" "b b" "c c" "d d";
    overflow-x: hidden; overflow-y: auto; scrollbar-width: thin;
    background: var(--tbg);
  }
  .tf.cb .tfsim .tfqbar { grid-area: q; }
  .tf.cb .tfsim .tfmktrow { grid-area: m; }
  .tf.cb .tfsim .tftools { grid-area: t; }
  .tf.cb .tfsim .tfbanner { grid-area: b; }
  .tf.cb .tfsim .tfchartw { grid-area: c; min-height: 0; }
  .tf.cb .tfsim .tfbot { grid-area: d; }
  /* the chart host takes the cell's size, so the canvas (sized by tfChartMount's ResizeObserver) follows it */
  .tf.cb .tfsim .tfchart { position: absolute; inset: 0; height: auto; min-height: 0; }
  .tf.cb .tfsim .tfside {
    order: 0; grid-column: auto; position: relative; top: auto; height: 100%; max-height: none;
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  }
}
@media (min-width: 861px) and (max-width: 1179.98px) {
  .tf.cb .tfsim { grid-template-columns: 68px minmax(0, 1fr) 300px; }
}
/* 1180-1383px: the centre column is too narrow for the market switcher and the tools on one row,
   so the switcher moves up beside the quote bar and the tools get the full width (one row, not two) */
@media (min-width: 1180px) and (max-width: 1383.98px) {
  .tf.cb .tfsim .tfmain { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "q m" "t t" "b b" "c c" "d d"; }
  .tf.cb .tfsim .tfmktrow { align-items: flex-start; padding: 16px 14px 10px; border-left: 1px solid var(--tline); }
  .tf.cb .tfsim .tfmktrow::after { display: none; }
}

/* ---------- watchlist rail ---------- */
@media (min-width: 861px) {
  .tf.cb .tfsim .tfwatch {
    order: 0; grid-column: auto; justify-self: start; align-self: stretch;
    position: relative; top: auto; z-index: 15;
    display: grid; grid-template-columns: 256px; grid-template-rows: 44px minmax(0, 1fr);
    gap: 0; width: 68px; height: 100%; max-height: none; overflow: hidden;
    flex-direction: column;
    background: var(--tpan); border-right: 1px solid var(--tline2);
    transition: width .32s var(--cb-ease), box-shadow .32s;
  }
  /* opens as an overlay above the chart: the grid track stays 68px, so nothing reflows */
  .tf.cb .tfsim .tfwatch:hover,
  .tf.cb .tfsim .tfwatch:focus-within { width: 256px; box-shadow: 28px 0 48px rgba(0, 0, 0, .6); }

  .tf.cb .tfsim .tfwh {
    grid-row: 1; width: 256px; display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 0 12px 0 12px; border: 0; border-bottom: 1px solid var(--tline); border-radius: 0; box-shadow: none;
  }
  .tf.cb .tfsim .tfwh::before { content: ""; width: 3px; height: 11px; flex: none; margin-right: -3px; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
  /* "Watch" while folded, the full "Watchlist" when open (the real text stays in the DOM for screen readers) */
  .tf.cb .tfsim .tfwh > span { font-size: 0; letter-spacing: .08em; color: var(--tink); white-space: nowrap; }
  .tf.cb .tfsim .tfwh > span::before { content: "Watch"; content: "Watch" / ""; font: 400 7.5px/1 var(--cb-brand); letter-spacing: .06em; text-transform: uppercase; }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) .tfwh > span { font: 400 8.5px/1 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) .tfwh > span::before { content: none; }
  .tf.cb .tfsim .tfwh .tfidx {
    margin-left: auto; padding: 0; gap: 7px; align-items: baseline; border: 0; border-radius: 0; background: none;
    font: 500 11px/1 var(--tmono); opacity: 0; transition: opacity .2s;
  }
  .tf.cb .tfsim .tfwh .tfidx span { flex: none; font: 500 10.5px/1 var(--tsans); color: var(--tmut); }
  .tf.cb .tfsim .tfwh .tfidx b { font-size: 11.5px; font-weight: 500; color: var(--tt1); }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) .tfidx { opacity: 1; transition-delay: .1s; }

  .tf.cb .tfsim .tfwl {
    grid-row: 2; width: 256px; min-height: 0; display: flex; flex-direction: column; gap: 0;
    overflow-x: hidden; overflow-y: auto; padding: 4px 0 58px; scrollbar-width: none;
  }
  .tf.cb .tfsim .tfwl::-webkit-scrollbar { display: none; }
  /* view tabs: a strip over the bottom of the list, only while the rail is open */
  .tf.cb .tfsim .tfwatch > .tfwseg {
    position: absolute; left: 0; bottom: 0; z-index: 2; width: 256px; align-self: auto;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 14px 12px;
    background: var(--tpan); border-top: 1px solid var(--tline);
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s;
  }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) > .tfwseg { opacity: 1; visibility: visible; transition-delay: .08s, 0s; }
  .tf.cb .tfsim .tfwseg button { height: 26px; min-width: 0; padding: 0 6px; font: 600 11.5px/1 var(--tsans); }

  .tf.cb .tfsim .tfwr {
    position: relative; flex: none; width: 256px; height: 44px; margin: 0;
    display: grid; grid-template-columns: 7px auto minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr;
    column-gap: 6px; row-gap: 0; align-items: center;
    padding: 0 12px 0 11px; border: 0; border-radius: 0; background: transparent; text-align: left;
    transition: background .2s;
  }
  .tf.cb .tfsim .tfwr:focus-visible { outline-offset: -3px; }
  .tf.cb .tfsim .tfwr:hover,
  .tf.cb .tfsim .tfwr.on { background: var(--tpan2); border: 0; }
  .tf.cb .tfsim .tfwr.on::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--cb-accent); }
  /* direction marker: a tiny triangle coloured by the row's change */
  .tf.cb .tfsim .tfwr::before {
    content: ""; grid-area: 1 / 1 / 3 / 2; width: 7px; height: 6px;
    background: var(--tmut); clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }
  .tf.cb .tfsim .tfwr:has(> .tfwc.up)::before { background: var(--tup); }
  .tf.cb .tfsim .tfwr:has(> .tfwc.dn)::before { background: var(--tdn); clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .tf.cb .tfsim .tfwt { grid-area: 1 / 2 / 3 / 3; display: flex; align-items: center; gap: 5px; min-width: 0; }
  .tf.cb .tfsim .tfwt b { font: 400 9.5px/1 var(--cb-brand); letter-spacing: .04em; color: var(--tink); }
  .tf.cb .tfsim .tfwr .tfpd { position: absolute; left: 24px; bottom: 9px; width: 14px; height: 2px; border-radius: 0; }
  .tf.cb .tfsim .tfwn { grid-area: 1 / 3 / 3 / 4; font: 500 11px/1.2 var(--tsans); color: var(--tmut); }
  .tf.cb .tfsim .tfwp { grid-area: 1 / 4 / 2 / 5; align-self: end; margin: 0 -3px 1px 0; border-radius: 0; font: 500 12.5px/1.1 var(--tmono); color: var(--tt1); text-align: right; }
  .tf.cb .tfsim .tfwc { grid-area: 2 / 4 / 3 / 5; align-self: start; margin-top: 1px; font: 500 11px/1.2 var(--tmono); text-align: right; }
  .tf.cb .tfsim .tfwn,
  .tf.cb .tfsim .tfwp,
  .tf.cb .tfsim .tfwc,
  .tf.cb .tfsim .tfwt .tfhot,
  .tf.cb .tfsim .tfwt .tfh8 { opacity: 0; transition: opacity .2s; }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) :is(.tfwn, .tfwp, .tfwc, .tfhot, .tfh8) { opacity: 1; transition-delay: .1s; }
  .tf.cb .tfsim .tfwl .tfempty { width: 256px; padding: 16px 14px; text-align: left; font-size: 12px; opacity: 0; }
  .tf.cb .tfsim .tfwatch:is(:hover, :focus-within) .tfwl .tfempty { opacity: 1; }
}
.tf.cb .tfsim .tfhot { color: var(--thot); }
.tf.cb .tfsim .tfh8 { border-radius: 0; font: 400 7.5px/1 var(--cb-brand); letter-spacing: .06em; padding: 3px 4px; }

/* ---------- quote bar: the symbol header ---------- */
.tf.cb .tfsim .tfqbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  min-height: 60px; margin: 0; padding: 10px 16px;
  border: 0; border-bottom: 1px solid var(--tline); border-radius: 0; box-shadow: none;
  background: radial-gradient(70% 160% at 85% 0%, color-mix(in srgb, var(--cb-steel) 7%, transparent), transparent 65%), var(--tbg);
  container: ckq / inline-size;
}
/* ticker, kind and halt chips on one line, the company name under them */
.tf.cb .tfsim .tfqt { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: start; justify-items: start; align-items: center; column-gap: 8px; row-gap: 5px; max-width: 230px; }
.tf.cb .tfsim .tfqt > * { grid-row: 1; }
.tf.cb .tfsim .tfqt b { font: 600 18px/1 var(--tsans); letter-spacing: .02em; color: var(--tink); }
.tf.cb .tfsim .tfqt > span { grid-row: 2; grid-column: 1 / span 3; max-width: 100%; font: 400 11.5px/1.2 var(--tsans); color: var(--tmut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf.cb .tfsim .tfkind {
  padding: 3px 6px 2px; border-radius: 0; border: 1px solid var(--tline2); background: transparent;
  font: 400 7.5px/1 var(--cb-brand); letter-spacing: .08em; color: var(--cb-steel);
}
.tf.cb .tfsim .tfkind.k-halt { border-color: color-mix(in srgb, var(--twarn) 55%, transparent); color: var(--twarn); background: color-mix(in srgb, var(--twarn) 10%, transparent); }
.tf.cb .tfsim .tfqp { display: flex; align-items: center; gap: 10px; }
.tf.cb .tfsim .tfqp b,
.tf.cb .tfsim .tfqp b.up,
.tf.cb .tfsim .tfqp b.dn { font: 600 26px/1 var(--tmono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--tink); }
.tf.cb .tfsim .tfqp > span { padding: 4px 7px; font: 500 12px/1 var(--tmono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf.cb .tfsim .tfqp > span.up { background: var(--ck-up-a); }
.tf.cb .tfsim .tfqp > span.dn { background: var(--ck-dn-a); }
/* the motion layer (js/fx) wraps changed price digits in spans inside the price: keep them at the price's size */
.tf.cb .tfsim .tfqp > b span { padding: 0; font: inherit; background: none; }
.tf.cb .tfsim .tfqs { display: flex; flex-wrap: wrap; gap: 6px 16px; flex: 0 0 auto; max-width: 100%; font-size: 0; }
.tf.cb .tfsim .tfqs span {
  display: flex; flex-direction: column; gap: 4px;
  font: 400 7.5px/1.2 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); white-space: nowrap;
}
.tf.cb .tfsim .tfqs b { font: 500 12.5px/1.1 var(--tmono); font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; color: var(--tt1); }
.tf.cb .tfsim .tfqs b.hot { color: var(--thot); }
.tf.cb .tfsim .tfclock { margin-left: auto; gap: 7px; font: 400 11.5px/1.3 var(--tsans); color: var(--tmut); }
.tf.cb .tfsim .tfclock b { font: 500 12px var(--tmono); color: var(--tink); }
.tf.cb .tfsim .tfclock .tfi { width: 14px; height: 14px; color: var(--cb-accent); }
/* when the header cannot hold everything on one line: name, price and clock on top, the numbers below */
@container ckq (max-width: 960px) {
  .tf.cb .tfsim .tfclock { order: 3; }
  .tf.cb .tfsim .tfqs { order: 4; }
}
@container ckq (max-width: 1240px) {
  .tf.cb .tfsim .tfqbar:has(.tfutc) .tfclock { order: 3; }
  .tf.cb .tfsim .tfqbar:has(.tfutc) .tfqs { order: 4; }
}
@container ckq (min-width: 520px) and (max-width: 720px) {
  .tf.cb .tfsim .tfclock > span { font-size: 0; }
  .tf.cb .tfsim .tfclock b { font-size: 12px; }
  .tf.cb .tfsim .tfclock .tfutc { display: none; }
}

/* ---------- market switcher + tools row ---------- */
.tf.cb .tfsim .tfmktrow {
  display: flex; align-items: flex-start; flex-wrap: nowrap; gap: 10px; margin: 0; align-self: stretch;
  padding: 9px 0 8px 14px; border-bottom: 1px solid var(--tline); background: var(--tbg);
}
.tf.cb .tfsim .tfmktrow::after { content: ""; align-self: stretch; width: 1px; margin: 2px 0 2px 2px; background: var(--tline2); }
.tf.cb .tfsim .tfmkt button { min-width: 0; height: 28px; padding: 0 10px; gap: 7px; font: 600 12px/1 var(--tsans); }
.tf.cb .tfsim .tfdot { width: 6px; height: 6px; background: var(--tmut); box-shadow: none; animation: none; }
.tf.cb .tfsim .tfdot.on { background: var(--cb-accent); box-shadow: 0 0 0 3px var(--cb-accent-a25); animation: ckblink 1.4s ease-in-out infinite; }
.tf.cb .tfsim .tfdot.warn { background: var(--twarn); }
@keyframes ckblink { 50% { opacity: .35; } }
.tf.cb .tfsim .tflivep { height: 28px; padding: 0 6px; gap: 8px; border-radius: 0; font: 600 12px/1 var(--tsans); color: var(--tt1); }
.tf.cb .tfsim .tflivep.warn { color: var(--twarn); }

.tf.cb .tfsim .tftools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0;
  min-height: 46px; padding: 8px 14px 8px 12px;
  border-bottom: 1px solid var(--tline); background: var(--tbg);
  /* size container (it also becomes a stacking context: keep its menus above the Edge badge) */
  container: cktools / inline-size; position: relative; z-index: 6;
}
.tf.cb .tfsim .tftools > .tfseg button { height: 26px; min-width: 30px; padding: 0 7px; font: 500 11.5px/1 var(--tmono); }
.tf.cb .tfsim .tftools .tfmenu summary { height: 28px; padding: 0 12px; gap: 7px; font: 600 12px/1 var(--tsans); color: var(--tt1); }
.tf.cb .tfsim .tftools .tfmenu summary .tfi { width: 15px; height: 15px; }
.tf.cb .tfsim .tftools .tfmenu[open] summary { color: var(--tink); }
.tf.cb .tfsim .tftools .tfmenu[open] summary::before { border-color: var(--cb-accent-a50); }
.tf.cb .tfsim .tftools .tfmenu summary.on { color: var(--cb-accent-hi); }
.tf.cb .tfsim .tftools .tfmenu summary.on::before { border-color: var(--cb-accent); background: var(--cb-accent-a10); }
.tf.cb .tfsim .tfspeed button { min-width: 28px; padding: 0 7px; font: 500 11.5px/1 var(--tmono); }
.tf.cb .tfsim .tfspeed .tfi { width: 13px; height: 13px; }
.tf.cb .tfsim .tftools .tfbtn.sm { height: 30px; }
/* tools row narrower than its one-line width (about 824px of content with labels): Draw and
   Indicators fold to their icons (the label stays in the DOM as the name, cockpit.js adds a title) */
@container cktools (max-width: 823.98px) {
  .tf.cb .tfsim .tftools .tfmenu summary { padding: 0 10px; gap: 0; font-size: 0; }
  .tf.cb .tfsim .tftools .tfmenu summary .tfi { width: 16px; height: 16px; }
}
/* and when the row has to wrap anyway, the Edge chip drops its word label (the score stays) */
@container cktools (max-width: 560px) {
  .tf.cb .tfsim .cbec-lbl { display: none; }
  .tf.cb .tfsim .cbedgechip { padding-right: 11px; }
}
/* drop-down menus (Draw, Indicators) */
.tf.cb .tfsim .tfmenub {
  top: 36px; border-radius: 0; padding: 8px; gap: 2px;
  background: rgba(18, 19, 22, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--tline2); box-shadow: 0 18px 44px rgba(0, 0, 0, .7);
}
.tf.cb .tfsim .tfmenub label { border-radius: 0; font-size: 12.5px; color: var(--tt1); }
.tf.cb .tfsim .tfmenub label:hover { background: var(--tpan2); }
.tf.cb .tfsim .tfmenub label i { border-radius: 0; height: 2px; }
.tf.cb .tfsim .tfmenub input[type="checkbox"] { accent-color: var(--cb-accent); }
.tf.cb .tfsim .tfdrawb button { border-radius: 0; font-size: 12.5px; }
.tf.cb .tfsim .tfdrawb button:hover { background: var(--tpan2); }
.tf.cb .tfsim .tfdrawb button[aria-pressed="true"] { background: var(--cb-accent-a10); color: var(--cb-accent-hi); box-shadow: inset 2px 0 0 var(--cb-accent); }
.tf.cb .tfsim .tfdrawb .tfdclr { border-radius: 0; border-top-color: var(--tline); }
.tf.cb .tfsim .tfsubsel { border-top-color: var(--tline); }
.tf.cb .tfsim .tfsubsel span { font: 400 8px/1.3 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); }
.tf.cb .tfsim .tfsubsel button { border-radius: 0; border-color: var(--tline2); font: 500 11.5px/1.2 var(--tsans); }
.tf.cb .tfsim .tfsubsel button[aria-pressed="true"] { background: var(--cb-accent-a10); border-color: var(--cb-accent); color: var(--tink); }

/* ---------- setup banner ---------- */
.tf.cb .tfsim .tfbanner {
  position: relative; margin: 0; gap: 8px 14px; padding: 10px 16px 10px 19px;
  border: 0; border-bottom: 1px solid var(--cb-accent-a25); border-radius: 0;
  background: linear-gradient(90deg, var(--cb-accent-a10), transparent 75%), var(--tbg);
}
.tf.cb .tfsim .tfbanner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--cb-accent-hi), var(--cb-accent) 50%, var(--cb-ember)); }
.tf.cb .tfsim .tfbanner > div:first-child { font-size: 13px; line-height: 1.45; color: var(--tt1); }
.tf.cb .tfsim .tfbanner b { color: var(--tink); font-weight: 600; }
.tf.cb .tfsim .tfbanner .tfi { color: var(--cb-accent); }
.tf.cb .tfsim .tfbanner .tfx .tfi { color: var(--tmut); }
.tf.cb .tfsim .tfbanner .tfx:hover .tfi { color: var(--tink); }
.tf.cb .tfsim .tfbh { border-radius: 0; background: rgba(0, 0, 0, .35); border-left: 2px solid var(--cb-accent-a50); font-size: 13px; color: var(--tt1); }
.tf.cb .tfsim .tfx { border-radius: 0; }

/* ---------- chart ---------- */
.tf.cb .tfsim .tfchartw { position: relative; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--tbg); overflow: hidden; }
.tf.cb .tfsim .tflive {
  right: 76px; bottom: 32px; z-index: 3; height: 30px; padding: 0 14px; gap: 6px;
  font: 600 12px/1 var(--tsans); color: var(--tink);
}
.tf.cb .tfsim .tflive::before { background: var(--cb-glass); border-color: var(--tline2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tf.cb .tfsim .tflive .tfi { width: 14px; height: 14px; color: var(--cb-accent); }

/* grade card after a trade closes */
.tf.cb .tfsim .tfgrade {
  left: 12px; bottom: 34px; z-index: 5; width: min(360px, calc(100% - 24px)); padding: 14px 16px 12px;
  border-radius: 0; border: 1px solid var(--tline2);
  background: var(--cb-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6); clip-path: var(--ck-chamfer);
}
.tf.cb .tfsim .tfgrade::before,
.tf.cb .tfsim .tfgrade::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  background: linear-gradient(-45deg, transparent calc(50% - .75px), var(--cb-accent) calc(50% - .75px), var(--cb-accent) calc(50% + .75px), transparent calc(50% + .75px));
}
.tf.cb .tfsim .tfgrade::before { top: -1px; left: -1px; }
.tf.cb .tfsim .tfgrade::after { bottom: -1px; right: -1px; }
.tf.cb .tfsim .tfgch b { font: 600 14px/1.3 var(--tsans); }
.tf.cb .tfsim .tfgch em { font: 600 14px/1.3 var(--tmono); }
.tf.cb .tfsim .tfgrade li { padding-left: 15px; font-size: 12.5px; color: var(--tt1); }
.tf.cb .tfsim .tfgrade li::before { top: .5em; width: 5px; height: 5px; border-radius: 0; background: var(--tmut); transform: skewX(var(--cb-skew)); }
.tf.cb .tfsim .tfgrade li.ok::before { background: var(--cb-steel); }
.tf.cb .tfsim .tfgrade li.mid::before { background: var(--tt2); }
.tf.cb .tfsim .tfgrade li.bad::before { background: var(--twarn); }
/* .tfgs is also the glossary search box in tradingfloor.css; undo that here */
.tf.cb .tfsim .tfgrade .tfgs { display: block; height: auto; margin: 10px 0 0; padding: 9px 0 0; border: 0; border-top: 1px solid var(--tline); border-radius: 0; background: none; font: 500 11.5px/1.3 var(--tmono); color: var(--tmut); }

/* grade tiles: hexagons on an orange-to-graphite scale (no green / red: a grade is not a profit or a loss) */
.tf.cb .tfsim .tfgr {
  width: 28px; height: 26px; border-radius: 0; clip-path: var(--ck-hex); box-shadow: none;
  font: 400 11px/1 var(--cb-brand); letter-spacing: 0; color: var(--tmut); background: var(--tp4);
}
.tf.cb .tfsim .tfgr.big { width: 56px; height: 50px; font-size: 21px; border-radius: 0; clip-path: var(--ck-hex); box-shadow: none; }
.tf.cb .tfsim .tfgr:is(.gA, .gB, .gC, .gD, .gF) { box-shadow: none; }
.tf.cb .tfsim .tfgr.gA { background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 55%, var(--cb-ember)); color: var(--cb-ink); }
.tf.cb .tfsim .tfgr.gB { background: linear-gradient(135deg, color-mix(in srgb, var(--cb-ember) 55%, #000), var(--cb-ember-deep)); color: var(--cb-accent-hi); }
.tf.cb .tfsim .tfgr.gC { background: var(--tp4); color: var(--cb-steel); }
.tf.cb .tfsim .tfgr.gD { background: var(--tpan2); color: var(--tt2); }
.tf.cb .tfsim .tfgr.gF { background: var(--tpan2); color: var(--tmut); }

/* ---------- Edge score (cockpit.js): a chip in the tools row + the "Edge" panel tab ----------
   Nothing is drawn over the chart. The hexagon's gradient, weave and score stroke come from the
   SVG's own attributes (each SVG carries its own ids), so no rule here sets fill or stroke to a url(). */
.tf.cb .tfsim .cbedgechip {
  position: relative; isolation: isolate; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; margin: 0 2px; padding: 0 13px 0 5px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--tink); cursor: pointer; white-space: nowrap;
}
.tf.cb .tfsim .cbedgechip::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--cb-skew));
  background: linear-gradient(90deg, var(--cb-accent-a10), transparent 75%), var(--tpan2);
  border: 1px solid var(--cb-accent-a25);
  transition: background .2s, border-color .2s;
}
.tf.cb .tfsim .cbedgechip:hover::before { border-color: var(--cb-accent-a50); }
.tf.cb .tfsim .cbedgechip[aria-expanded="true"]::before { border-color: var(--cb-accent); background: linear-gradient(180deg, var(--cb-accent-a25), var(--cb-accent-a10)); }
.tf.cb .tfsim .cbec-hex { width: 28px; height: 28px; flex: none; margin: -2px 0; filter: drop-shadow(0 0 6px var(--cb-accent-a25)); }
.tf.cb .tfsim .cbec-hex svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tf.cb .tfsim .cbedgechip .cbhex-track,
.tf.cb .tfsim .cbedgechip .cbhex-score { stroke-width: 4.4; }
.tf.cb .tfsim .cbedgechip .cbhex-grade { font-size: 25px; }
.tf.cb .tfsim .cbec-lbl { font: 400 7.5px/1 var(--cb-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--cb-accent-hi); }
.tf.cb .tfsim .cbec-num { min-width: 2ch; font: 600 13px/1 var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); text-align: right; }
/* side of the best setup: a tiny up / down marker (green long, red short); hidden with no clear edge */
.tf.cb .tfsim .cbec-dir { display: none; width: 7px; height: 6px; flex: none; }
.tf.cb .tfsim .cbec-dir.cbl { display: block; background: var(--tup); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tf.cb .tfsim .cbec-dir.cbs { display: block; background: var(--tdn); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.tf.cb .tfsim .cbedgechip.cbscan .cbec-num { color: var(--tmut); }

/* shared hexagon parts (chip and panel) */
.tf.cb .cbhex-orbit { fill: none; stroke: var(--cb-accent-a50); stroke-width: .8; stroke-dasharray: 1.5 3.5; transform-origin: 32px 32px; animation: ckspin 30s linear infinite; }
.tf.cb .cbhex-track { fill: none; stroke: var(--tline2); stroke-width: 2.6; }
.tf.cb .cbhex-score { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dasharray .8s var(--cb-ease); }
.tf.cb .cbhex-grade { font: 400 21px var(--cb-brand); text-anchor: middle; dominant-baseline: central; }
.tf.cb .cbhex-scan { stroke: var(--cb-accent-hi); stroke-width: 1.2; stroke-linecap: round; opacity: 0; }
.tf.cb .cbgs-a { stop-color: var(--cb-accent-hi); }
.tf.cb .cbgs-b { stop-color: var(--cb-ember); }
.tf.cb .cbcfp-a { fill: var(--cb-cf-2); }
.tf.cb .cbcfp-b { fill: var(--cb-cf-4); }
/* still reading: a scan line sweeps the hexagon, the grade waits in grey */
.tf.cb .cbscan .cbhex-scan { opacity: .9; animation: ckscan 1.8s ease-in-out infinite; }
.tf.cb .cbscan .cbhex-grade { fill: var(--tmut); }
@keyframes ckscan { 0%, 100% { transform: translateY(-15px); } 50% { transform: translateY(15px); } }
@keyframes ckfade { 50% { opacity: .45; } }
@keyframes ckspin { to { transform: rotate(360deg); } }

/* the Edge tab: a chamfered card with orange corner ticks, like the prototype's badge */
.tf.cb .tfsim #tfpane_edge { padding: 14px 16px 18px; }
.tf.cb .cbedge {
  position: relative; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 13px 14px 14px;
  border: 1px solid var(--tline2);
  background: radial-gradient(120% 70% at 0% 0%, var(--cb-accent-a10), transparent 60%), var(--tp0);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.tf.cb .cbedge::before,
.tf.cb .cbedge::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  background: linear-gradient(-45deg, transparent calc(50% - .75px), var(--cb-accent) calc(50% - .75px), var(--cb-accent) calc(50% + .75px), transparent calc(50% + .75px));
}
.tf.cb .cbedge::before { top: -1px; left: -1px; }
.tf.cb .cbedge::after { bottom: -1px; right: -1px; }
.tf.cb .cbedge-ph { display: flex; align-items: center; gap: 8px; }
.tf.cb .cbedge-ph::before { content: ""; width: 3px; height: 10px; flex: none; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
.tf.cb .cbedge-ph h3 { margin: 0; color: var(--tink); }
.tf.cb .cbedge-card { display: flex; align-items: center; gap: 14px; }
.tf.cb .cbhex { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 0 12px var(--cb-accent-a25)); }
.tf.cb .cbhex svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tf.cb .cbedge-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tf.cb .cbedge-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tf.cb .cbedge-top .cblbl { color: var(--cb-accent-hi); }
.tf.cb .cbedge-num { font: 600 18px/1 var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); white-space: nowrap; }
.tf.cb .cbedge-num b { font-weight: 600; }
.tf.cb .cbedge-num small { margin-left: 1px; font-size: 11px; font-weight: 400; color: var(--tmut); }
.tf.cb .cbedge-side { font: 600 14px/1.25 var(--tsans); color: var(--tt2); }
.tf.cb .cbedge-side.cbl { color: var(--tup); }
.tf.cb .cbedge-side.cbs { color: var(--tdn); }
.tf.cb .cbedge.cbscan .cbedge-side { color: var(--tmut); animation: ckfade 1.8s ease-in-out infinite; }
.tf.cb .cbedge-why { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 11px 0 0; list-style: none; border-top: 1px solid var(--tline); }
.tf.cb .cbedge-why:not(:has(.cbwhy:not([hidden]))) { display: none; }
.tf.cb .cbwhy { position: relative; min-width: 0; padding-left: 14px; font: 400 12.5px/1.4 var(--tsans); color: var(--tt1); }
.tf.cb .cbwhy[hidden] { display: none; }
.tf.cb .cbwhy::before { content: ""; position: absolute; left: 1px; top: .52em; width: 5px; height: 5px; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
/* the six-factor radar */
.tf.cb .cbradar { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; padding-top: 4px; border-top: 1px solid var(--tline); }
.tf.cb .cbrd-ring { fill: none; stroke: var(--tline2); }
.tf.cb .cbrd-ring.o { stroke: var(--cb-line-3); }
.tf.cb .cbrd-axis { stroke: var(--tline); }
/* grows in each time the tab opens (the pane goes from display:none to shown, which restarts the animation) */
.tf.cb .cbrd-g { transform-origin: 150px 116px; animation: ckradar .7s cubic-bezier(.2, .9, .25, 1.1) .1s both; }
@keyframes ckradar { from { transform: scale(.25); opacity: 0; } }
.tf.cb .cbrd-val { fill: url(#cbrdG); stroke: var(--cb-accent); stroke-width: 1.5; stroke-linejoin: round; }
.tf.cb .cbrd-dot { fill: var(--tbg); stroke: var(--cb-accent-hi); stroke-width: 1.5; }
.tf.cb .cbrd-lbl { font: 500 10.5px var(--tsans); fill: var(--tt2); }
.tf.cb .cbrd-num { font: 600 10.5px var(--tmono); fill: var(--tink); }
.tf.cb .cbrd-s1 { stop-color: var(--cb-accent); stop-opacity: .55; }
.tf.cb .cbrd-s2 { stop-color: var(--cb-ember); stop-opacity: .12; }
.tf.cb .cbedge-note { margin: 0; padding-top: 10px; border-top: 1px solid var(--tline); font-size: 11.5px; line-height: 1.5; color: var(--tmut); }

/* ---------- bottom drawer ---------- */
.tf.cb .tfsim .tfbot {
  position: relative; isolation: isolate; display: grid; margin: 0;
  grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 40px minmax(0, 1fr); align-items: center; column-gap: 12px;
  height: 184px; padding: 0; overflow: hidden;
  border: 0; border-top: 1px solid var(--tline2); border-radius: 0; box-shadow: none; background: var(--tpan);
  transition: height .35s var(--cb-ease);
}
.tf.cb .tfsim .tfbot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40px; z-index: -1; border-bottom: 1px solid var(--tline); }
.tf.cb .tfsim .tfbot > .tfseg { grid-area: 1 / 1 / 2 / 2; margin: 0; padding: 0 0 0 14px; min-width: 0; }
.tf.cb .tfsim .tfbot > .tfseg button { height: 26px; padding: 0 12px; font: 600 12px/1 var(--tsans); flex: none; }
.tf.cb .tfsim .cbdrsum { grid-area: 1 / 2 / 2 / 3; font: 500 11.5px/1 var(--tmono); color: var(--tt2); white-space: nowrap; }
.tf.cb .tfsim .cbdrh { grid-area: 1 / 3 / 2 / 4; width: 34px; height: 26px; margin-right: 12px; display: grid; place-items: center; color: var(--tt2); }
.tf.cb .tfsim .cbdrh:hover { color: var(--tink); }
.tf.cb .tfsim .cbdrh svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s; }
.tf.cb .tfsim .tfbot.cbcol .cbdrh svg { transform: rotate(180deg); }
.tf.cb .tfsim #tfbotb { grid-area: 2 / 1 / 3 / 4; align-self: stretch; min-height: 0; overflow: auto; scrollbar-width: thin; }
.tf.cb .tfsim .tfbot.cbcol { height: 41px; }
.tf.cb .tfsim .tfbot.cbcol #tfbotb { display: none; }
/* tables in the drawer: mono rows on hairlines */
.tf.cb .tfsim #tfbotb .tftab { min-width: 600px; font: 400 12.5px/1.3 var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfsim #tfbotb .tfth,
.tf.cb .tfsim #tfbotb .tftd { gap: 10px; padding: 8px 16px; }
.tf.cb .tfsim #tfbotb .tfth {
  position: sticky; top: 0; z-index: 1; background: var(--tpan); border-bottom: 1px solid var(--tline);
  font: 400 8px/1.25 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut);
}
.tf.cb .tfsim #tfbotb .tftd { border-top: 0; border-bottom: 1px solid var(--tline); transition: background .15s; }
.tf.cb .tfsim #tfbotb .tftd:hover { background: var(--tpan2); }
.tf.cb .tfsim #tfbotb .tftd > b { font-weight: 600; }
.tf.cb .tfsim #tfbotb .tflink { font: 600 12.5px/1 var(--tmono); text-decoration: none; color: var(--tink); }
.tf.cb .tfsim #tfbotb .tflink:hover { color: var(--cb-accent-hi); }
.tf.cb .tfsim #tfbotb .tfempty { padding: 16px; text-align: left; font-size: 12.5px; color: var(--tmut); }
.tf.cb .tfsim #tfbotb .tftr { gap: 0; }
.tf.cb .tfsim #tfbotb .tftrr { min-width: 600px; padding: 7px 16px; border-radius: 0; border-bottom: 1px solid var(--tline); font: 400 12.5px/1.3 var(--tmono); }
.tf.cb .tfsim #tfbotb .tftrr:hover { background: var(--tpan2); }
.tf.cb .tfsim #tfbotb .tftrr b { font-weight: 600; }
.tf.cb .tfsim #tfbotb .tfnews { gap: 0; }
.tf.cb .tfsim #tfbotb .tfnw { padding: 8px 16px; border-top: 0; border-bottom: 1px solid var(--tline); font-size: 12.5px; }
.tf.cb .tfsim #tfbotb .tfnw > span { font: 500 11.5px var(--tmono); }
.tf.cb .tfsim #tfbotb .tfnw b { font: 400 8px/1.3 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); }
.tf.cb .tfsim #tfbotb .tfnw.up .tflink { color: var(--tup); }
.tf.cb .tfsim #tfbotb .tfnw.dn .tflink { color: var(--tdn); }

/* ---------- right panel ---------- */
.tf.cb .tfsim .tfside { background: var(--tpan); border-left: 1px solid var(--tline2); scrollbar-width: thin; }
/* prop firm test strip */
.tf.cb .tfsim #tfprop:empty { display: none; }
.tf.cb .tfsim .tfpropc {
  position: relative; margin: 0; padding: 12px 16px 12px 19px; border: 0; border-bottom: 1px solid var(--tline); border-radius: 0;
  background: linear-gradient(90deg, var(--cb-accent-a10), transparent 75%);
}
.tf.cb .tfsim .tfpropc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cb-accent); }
.tf.cb .tfsim .tfpropc .tftm { margin-bottom: 10px; }
.tf.cb .tfsim .tfpropc .tftm > span { font: 400 8.5px/1.2 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tink); }
.tf.cb .tfsim .tfpropc .tftm .tfi { width: 14px; height: 14px; color: var(--cb-accent); }
.tf.cb .tfsim .tfpropc .tfmore { font-size: 12px; color: var(--cb-accent-hi); }
.tf.cb .tfsim .tfpb { margin-bottom: 9px; }
.tf.cb .tfsim .tfpbl { font-size: 12px; color: var(--tt2); }
.tf.cb .tfsim .tfpbl b { font: 500 12px var(--tmono); }
/* skewed telemetry bars (tilt, prop limits, coach) */
.tf.cb .tfsim .tftb { height: 7px; margin: 0; border-radius: 0; background: var(--tp4); transform: skewX(var(--cb-skew)); overflow: hidden; }
.tf.cb .tfsim .tftb i { border-radius: 0; }
.tf.cb .tfsim #tftilt .tftb i,
.tf.cb .tfsim .tfpb .tftb i {
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px);
  mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px);
}
/* tilt strip: calm is steel, heating up and tilted are amber (a warning, not a loss) */
.tf.cb .tfsim #tftilt { margin: 0; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--tline); border-radius: 0; background: transparent; box-shadow: none; }
.tf.cb .tfsim #tftilt .tftm { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; }
.tf.cb .tfsim #tftilt .tftm > span { font: 400 8.5px/1.2 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); }
.tf.cb .tfsim #tftilt .tftm .tfi { width: 14px; height: 14px; color: var(--cb-steel); }
.tf.cb .tfsim #tftilt .tftb i.up { background: linear-gradient(90deg, color-mix(in srgb, var(--cb-steel) 55%, transparent), var(--cb-steel)); }
.tf.cb .tfsim #tftilt .tftb i.warn,
.tf.cb .tfsim #tftilt .tftb i.dn { background: linear-gradient(90deg, color-mix(in srgb, var(--twarn) 55%, transparent), var(--twarn)); }
.tf.cb .tfsim #tftilt .tftb i.dn { animation: ckfade 1.6s ease-in-out infinite; }
.tf.cb .tfsim #tftilt .tftm b { font: 600 12.5px/1 var(--tsans); }
.tf.cb .tfsim #tftilt .tftm b.up { color: var(--tt1); }
.tf.cb .tfsim #tftilt .tftm b.dn { color: var(--twarn); }
.tf.cb .tfsim #tftilt .tftw { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--twarn); }
/* panel tabs: the header bar of the panel */
.tf.cb .tfsim .tfstab {
  position: sticky; top: 0; z-index: 3; flex: none; width: 100%; margin: 0;
  /* one row for however many tabs there are (Order, Position, Level 2, Coach, Edge) */
  display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px;
  padding: 9px 14px; border-bottom: 1px solid var(--tline);
  /* opaque, so the ticket never shows through while the panel scrolls */
  background: var(--tpan);
  box-shadow: 0 8px 12px -8px rgba(0, 0, 0, .6);
}
.tf.cb .tfsim .tfstab button { height: 28px; min-width: 0; padding: 0 4px; font: 600 12px/1 var(--tsans); }
.tf.cb .tfsim .tfstab .tfdot { position: absolute; top: 4px; right: 7px; width: 5px; height: 5px; background: var(--cb-accent); box-shadow: 0 0 0 2px var(--cb-accent-a25); animation: none; }
.tf.cb .tfsim #tfpane_pos,
.tf.cb .tfsim #tfpane_l2,
.tf.cb .tfsim #tfpane_coach { padding: 14px 16px 18px; }
/* account footer */
.tf.cb .tfsim .tfacctx {
  position: sticky; bottom: 0; z-index: 3; flex: none; margin: auto 0 0;
  /* columns sized to their content, so "Buying power" is not cut at the 300px panel width */
  display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: space-between; gap: 8px 12px;
  padding: 10px 16px 11px; border: 0; border-top: 1px solid var(--tline2); border-radius: 0; box-shadow: none;
}
.tf.cb .tfsim .tfacctx div { gap: 4px; }
.tf.cb .tfsim .tfacctx span { font: 400 7.5px/1.2 var(--cb-brand); letter-spacing: .06em; color: var(--tmut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf.cb .tfsim .tfacctx b { font: 600 12.5px/1.1 var(--tmono); font-variant-numeric: tabular-nums; }

/* ---------- order ticket ---------- */
.tf.cb .tfsim .tfticket { scroll-margin-top: calc(var(--cb-hud-h) + 12px); padding: 14px 16px 16px; gap: 11px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.tf.cb .tfsim .tfsides { gap: 9px; padding: 0 3px; }
.tf.cb .tfsim .tfsides button { height: 38px; gap: 6px; color: var(--tt2); font: 600 13px/1 var(--tsans); }
.tf.cb .tfsim .tfsides button::before { border-color: var(--tline2); }
.tf.cb .tfsim .tfsides button:hover { color: var(--tink); }
.tf.cb .tfsim .tfsides .buy[aria-pressed="true"] { color: var(--tup); background: transparent; border: 0; }
.tf.cb .tfsim .tfsides .buy[aria-pressed="true"]::before { background: var(--ck-up-a); border-color: var(--tup); }
.tf.cb .tfsim .tfsides .sell[aria-pressed="true"] { color: var(--tdn); background: transparent; border: 0; }
.tf.cb .tfsim .tfsides .sell[aria-pressed="true"]::before { background: var(--ck-dn-a); border-color: var(--tdn); }
.tf.cb .tfsim .tfsides .tfi { width: 15px; height: 15px; }
/* order type: underline tabs */
.tf.cb .tfsim .tfseg.tfot { display: flex; gap: 2px; width: 100%; padding: 0; border-bottom: 1px solid var(--tline); }
.tf.cb .tfsim .tfseg.tfot button { flex: 1; height: 32px; padding: 0 8px; font: 500 12.5px/1 var(--tsans); color: var(--tmut); }
.tf.cb .tfsim .tfseg.tfot button::before { inset: 5px 0; background: transparent; border: 0; }
.tf.cb .tfsim .tfseg.tfot button:hover::before { background: var(--tpan2); }
.tf.cb .tfsim .tfseg.tfot button[aria-pressed="true"] { color: var(--tink); }
.tf.cb .tfsim .tfseg.tfot button[aria-pressed="true"]::before { background: transparent; border: 0; }
.tf.cb .tfsim .tfseg.tfot button[aria-pressed="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
/* fields */
.tf.cb .tfsim .tff { gap: 7px; }
.tf.cb .tfsim .tff > span { gap: 7px; font: 400 8.5px/1.3 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); }
.tf.cb .tfsim .tff input[type="checkbox"] { width: 13px; height: 13px; margin: 0; accent-color: var(--cb-accent); }
.tf.cb .tfsim .tfin { border: 1px solid var(--tline2); border-radius: 0; background: var(--tp0); transition: border-color .2s; }
.tf.cb .tfsim .tfin:hover { border-color: var(--cb-line-3); }
/* the field wrapper clips its contents, so the focus ring is drawn on the wrapper */
.tf.cb .tfsim .tfin:focus-within { border-color: var(--cb-accent); outline: 2px solid var(--cb-focus); outline-offset: 2px; }
.tf.cb .tfsim .tfin :focus-visible { outline: none; }
.tf.cb .tfsim .tfin input { height: 34px; padding: 0 10px; font: 500 13.5px/1 var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); }
.tf.cb .tfsim .tfin input:disabled { opacity: .35; }
.tf.cb .tfsim .tfin:has(input:disabled) { border-style: dashed; }
.tf.cb .tfsim .tfin:has(input[readonly]) { border-style: dashed; background: transparent; }
.tf.cb .tfsim .tfin input[readonly] { color: var(--tt2); }
.tf.cb .tfsim .tfin button { border-left: 1px solid var(--tline2); background: var(--tpan2); color: var(--tt2); font: 600 11.5px/1 var(--tsans); padding: 0 12px; }
.tf.cb .tfsim .tfin button:hover { color: var(--tink); }
/* stop and target fields carry a loss / profit marker */
.tf.cb .tfsim .tfrow2 { gap: 10px; }
.tf.cb .tfsim .tfrow2 > .tff:first-child .tfin { box-shadow: inset 2px 0 0 var(--tdn); }
.tf.cb .tfsim .tfrow2 > .tff:last-child .tfin { box-shadow: inset 2px 0 0 var(--tup); }
.tf.cb .tfsim .tff select {
  height: 36px; padding: 0 10px; border-radius: 0; border: 1px solid var(--tline2);
  background-color: var(--tp0); font: 500 13px/1 var(--tsans); color: var(--tink);
}
.tf.cb .tfsim .tff select:hover { border-color: var(--cb-line-3); }
.tf.cb .tfsim .tflinkbtn { gap: 7px; font: 500 12px/1.35 var(--tsans); color: var(--cb-accent-hi); }
.tf.cb .tfsim .tflinkbtn:hover { color: var(--tink); }
.tf.cb .tfsim .tflinkbtn .tfi { width: 14px; height: 14px; flex: none; }
/* risk chips */
.tf.cb .tfsim .tfseg.tfrk { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr); gap: 7px; }
.tf.cb .tfsim .tfseg.tfrk button { height: 30px; min-width: 0; padding: 0 4px; font: 500 12px/1 var(--tmono); }
.tf.cb .tfsim .tfseg.tfrk button:last-child { font-family: var(--tsans); font-weight: 600; }
.tf.cb .tfsim .tfseg.tfrk button[aria-pressed="true"]::before { background: var(--cb-accent-a10); box-shadow: inset 0 -2px 0 var(--cb-accent); }
/* numbers: entry, cost, risk, reward, ratio */
.tf.cb .tfsim .tfcalc { grid-template-columns: 1fr 1fr; gap: 11px 14px; padding: 13px 0 2px; border: 0; border-top: 1px solid var(--tline); border-radius: 0; background: transparent; }
.tf.cb .tfsim .tfcalc div { gap: 5px; }
.tf.cb .tfsim .tfcalc span { font: 400 7.5px/1.25 var(--cb-brand); letter-spacing: .08em; color: var(--tmut); }
.tf.cb .tfsim .tfcalc b { font: 600 13px/1.1 var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfsim .tfcalc .wide { border-top: 0; padding-top: 2px; align-items: center; }
.tf.cb .tfsim .tfcalc .wide b { font-size: 19px; }
/* the ratio is a plan quality, not a profit or loss: plain when good, amber when weak */
.tf.cb .tfsim .tfcalc > div.wide b.up,
.tf.cb .tfsim .tfcalc > div:nth-child(6):not(.cbrr) b.up { color: var(--tink); }
.tf.cb .tfsim .tfcalc > div.wide b.dn,
.tf.cb .tfsim .tfcalc > div:nth-child(6):not(.cbrr) b.dn { color: var(--twarn); }
.tf.cb .tfsim .tfcalc div.cbrr { grid-column: 1 / -1; display: flex; flex-direction: row; gap: 3px; height: 7px; margin: 0 3px 2px; transition: opacity .3s; }
.tf.cb .tfsim .cbrr i { display: block; min-width: 0; flex: 1 1 0; transform: skewX(var(--cb-skew)); transition: flex-grow .45s var(--cb-ease); }
.tf.cb .tfsim .cbrr-r { background: var(--tdn); }
.tf.cb .tfsim .cbrr-w { background: linear-gradient(90deg, var(--ck-up-deep), var(--tup)); }
.tf.cb .tfsim .cbrr.off { opacity: .2; }
/* check my trade */
.tf.cb .tfsim .tfchk2 { height: 38px; gap: 8px; border-radius: 0; border: 1px solid var(--cb-accent-a50); background: var(--cb-accent-a10); color: var(--cb-accent-hi); font: 600 13px/1 var(--tsans); }
.tf.cb .tfsim .tfchk2:hover { background: var(--cb-accent-a25); border-color: var(--cb-accent); color: var(--tink); }
.tf.cb .tfsim .tfchk2 .tfi { width: 16px; height: 16px; }
/* the order button: the action that matters. Green to buy, crimson to sell, chamfered. */
.tf.cb .tfsim .tfsubmit {
  position: relative; isolation: isolate; overflow: hidden; height: 50px; padding: 0 18px;
  border: 0; border-radius: 0; background: transparent; color: var(--cb-ink);
  font: 700 14.5px/1.2 var(--tsans); letter-spacing: .01em; transition: transform .15s;
}
.tf.cb .tfsim .tfsubmit::before,
.tf.cb .tfsim .tfsubmit::after { content: ""; position: absolute; inset: 0; clip-path: var(--ck-chamfer); }
.tf.cb .tfsim .tfsubmit::before { z-index: -2; transition: filter .2s; }
.tf.cb .tfsim .tfsubmit.buy::before { background: linear-gradient(100deg, color-mix(in srgb, var(--tup) 72%, #fff), var(--tup) 50%, var(--ck-up-deep)); }
.tf.cb .tfsim .tfsubmit.sell::before { background: linear-gradient(100deg, color-mix(in srgb, var(--tdn) 72%, #fff), var(--tdn) 50%, var(--ck-dn-deep)); }
.tf.cb .tfsim .tfsubmit::after { z-index: -1; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%); transform: translateX(-110%); transition: transform .8s var(--cb-ease); }
.tf.cb .tfsim .tfsubmit:hover::before { filter: brightness(1.08); }
.tf.cb .tfsim .tfsubmit:hover::after { transform: translateX(110%); }
.tf.cb .tfsim .tfsubmit:active { transform: translateY(1px); }
/* hotkey hint */
.tf.cb .tfsim .tfhkh { margin: 0; gap: 6px; font-size: 11.5px; color: var(--tmut); }
.tf.cb .tfsim .tfhkh .tfi { width: 13px; height: 13px; }
.tf.cb .tfsim .tfhkh b { padding: 1px 5px; border-radius: 0; border: 1px solid var(--tline2); font: 500 10.5px/1.3 var(--tmono); color: var(--tt2); }
.tf.cb .tfsim .tfhkh .tfmore { font-size: 11.5px; color: var(--tt2); text-decoration-color: var(--tline2); }
.tf.cb .tfsim .tfhkh .tfmore:hover { color: var(--cb-accent-hi); }

/* ---------- position pane ---------- */
.tf.cb .tfsim .tfpempty { padding: 22px 16px; border-radius: 0; border: 1px dashed var(--tline2); background: transparent; }
.tf.cb .tfsim .tfpempty .tfi { color: var(--cb-accent); }
.tf.cb .tfsim .tfpempty b { font: 600 14px/1.3 var(--tsans); }
.tf.cb .tfsim .tfplist > span { font: 400 8px/1.3 var(--cb-brand); letter-spacing: .08em; color: var(--tmut); }
.tf.cb .tfsim .tfplist button { border-radius: 0; border-color: var(--tline); background: var(--tp0); font: 500 12.5px var(--tmono); }
.tf.cb .tfsim .tfplist button:hover { border-color: var(--cb-line-3); }
/* .tfpc is also an Academy card class in tradingfloor.css (two-column grid); reset it here */
.tf.cb .tfsim .tfpc { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; align-items: stretch; text-align: left; gap: 10px; padding: 14px; border-radius: 0; color: var(--tink); border: 1px solid var(--tline2); border-left: 3px solid var(--tmut); background: var(--tp0); box-shadow: none; }
.tf.cb .tfsim .tfpc.up { border-color: var(--tline2); border-left-color: var(--tup); }
.tf.cb .tfsim .tfpc.dn { border-color: var(--tline2); border-left-color: var(--tdn); }
.tf.cb .tfsim .tfpch b { font: 600 13.5px/1.3 var(--tsans); }
.tf.cb .tfsim .tfpch span { font: 500 11.5px var(--tmono); color: var(--tmut); }
.tf.cb .tfsim .tfpcp b { font: 600 24px/1 var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfsim .tfpcp span { font: 500 12px var(--tmono); color: var(--tt2); }
.tf.cb .tfsim .tfpcl { font: 400 8px/1.3 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; }
.tf.cb .tfsim .tfpcl b { margin-left: 4px; font: 500 12px var(--tmono); text-transform: none; letter-spacing: 0; }
.tf.cb .tfsim .tfhint { font-size: 11.5px; line-height: 1.45; color: var(--tmut); }

/* ---------- Level 2 and time and sales ---------- */
.tf.cb .tfsim .tfl2w,
.tf.cb .tfsim .tftpw { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.tf.cb .tfsim .tftpw { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--tline); }
.tf.cb .tfsim .tfl2h { align-items: baseline; margin-bottom: 10px; font: 400 8px/1.3 var(--cb-brand); letter-spacing: .08em; text-transform: uppercase; color: var(--tmut); }
.tf.cb .tfsim .tfl2h b { font: 600 12px var(--tmono); letter-spacing: 0; color: var(--tink); }
.tf.cb .tfsim .tfl2i { margin-bottom: 10px; font: 500 11px var(--tmono); }
.tf.cb .tfsim .tfl2i > div { height: 6px; border-radius: 0; transform: skewX(var(--cb-skew)); background: color-mix(in srgb, var(--tdn) 55%, transparent); }
.tf.cb .tfsim .tfl2g { gap: 8px; }
.tf.cb .tfsim .tfl2r { padding: 3px 8px; border-radius: 0; border-bottom: 1px solid var(--tline); font: 500 12px/1.35 var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfsim .tfl2r i { opacity: .13; }
.tf.cb .tfsim .tfl2r.hd { border-bottom-color: var(--tline2); font: 400 7.5px/1.6 var(--cb-brand); letter-spacing: .08em; color: var(--tmut); }
.tf.cb .tfsim .tftape2 { max-height: 300px; scrollbar-width: thin; }
.tf.cb .tfsim .tftp { padding: 3px 8px; border-radius: 0; font: 500 12px/1.35 var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfsim .tftp.h { background: var(--tpan); border-bottom: 1px solid var(--tline2); font: 400 7.5px/1.6 var(--cb-brand); letter-spacing: .08em; color: var(--tmut); }
.tf.cb .tfsim .tftp.big { background: var(--cb-accent-a10); }
.tf.cb .tfsim .tftp.big span:last-child { color: var(--cb-accent-hi); font-weight: 600; }

/* ---------- coach pane ---------- */
.tf.cb .tfsim .tfco { gap: 12px; }
.tf.cb .tfsim .tfcoh { padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--tline); border-radius: 0; background: none; }
.tf.cb .tfsim .tfcoh > b { gap: 9px; font: 400 9.5px/1 var(--cb-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--tink); }
.tf.cb .tfsim .tfcoh > b .tfi { width: 15px; height: 15px; color: var(--cb-accent); }
.tf.cb .tfsim .tfsw { font-size: 11.5px; color: var(--tt2); }
.tf.cb .tfsim .tfsw i { width: 30px; height: 16px; border-radius: 0; background: var(--tp4); border-color: var(--tline2); transform: skewX(var(--cb-skew)); }
.tf.cb .tfsim .tfsw i::after { top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 0; background: var(--tmut); }
.tf.cb .tfsim .tfsw input:checked + i { background: var(--cb-accent-a25); border-color: var(--cb-accent); }
.tf.cb .tfsim .tfsw input:checked + i::after { transform: translateX(14px); background: var(--cb-accent-hi); }
.tf.cb .tfsim .tfsw input:focus-visible + i { outline: 2px solid var(--cb-focus); outline-offset: 2px; }
/* the coach's voice: a breathing orange orb next to its message */
.tf.cb .tfsim .tfcobias::before,
.tf.cb .tfsim .tfcocall::before {
  content: ""; width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, var(--ck-orb-core) 0 7%, var(--cb-accent-hi) 22%, var(--cb-accent) 42%, var(--cb-ember) 68%, var(--cb-ember-deep) 100%);
  box-shadow: 0 0 0 1px var(--cb-accent-a25), 0 0 22px var(--cb-accent-a25);
  animation: ckbreathe 4.8s ease-in-out infinite;
}
@keyframes ckbreathe {
  0%, 100% { transform: scale(.93); box-shadow: 0 0 0 1px var(--cb-accent-a25), 0 0 14px var(--cb-accent-a10); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 1px var(--cb-accent-a50), 0 0 30px var(--cb-accent-a25); }
}
.tf.cb .tfsim .tfcobias {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 3px; align-items: center;
  padding: 14px; border-radius: 0; border: 1px solid var(--tline); border-left: 3px solid var(--tmut); background: var(--tp0);
}
.tf.cb .tfsim .tfcobias::before { grid-row: 1 / 3; grid-column: 1; }
.tf.cb .tfsim .tfcobias > span,
.tf.cb .tfsim .tfcobias > p { grid-column: 2; }
.tf.cb .tfsim .tfcobias > span { align-self: end; font: 400 8.5px/1.2 var(--cb-brand); letter-spacing: .08em; }
.tf.cb .tfsim .tfcobias > p { align-self: start; margin: 0; font-size: 13px; line-height: 1.5; color: var(--tt1); }
.tf.cb .tfsim .tfcocall { gap: 10px; padding: 18px 14px 16px; border-radius: 0; border: 1px solid var(--tline2); background: var(--tp0); }
.tf.cb .tfsim .tfcocall::before { width: 44px; height: 44px; }
.tf.cb .tfsim .tfcocall b { font: 600 16px/1.3 var(--tsans); }
.tf.cb .tfsim .tfcocb { gap: 8px; }
.tf.cb .tfsim .tfcocb button { height: 38px; border-radius: 0; font: 600 13px/1 var(--tsans); color: var(--tt1); }
.tf.cb .tfsim .tfcocb .buy { background: var(--ck-up-a); border-color: var(--tup); color: var(--tup); }
.tf.cb .tfsim .tfcocb .sell { background: var(--ck-dn-a); border-color: var(--tdn); color: var(--tdn); }
.tf.cb .tfsim .tfcores { border-radius: 0; }
.tf.cb .tfsim .tfcores.ok { border-color: var(--tline2); background: var(--tp0); }
.tf.cb .tfsim .tfcores.ok > .tfi { color: var(--cb-steel); }
.tf.cb .tfsim .tfcores.bad { border-color: color-mix(in srgb, var(--twarn) 40%, transparent); background: color-mix(in srgb, var(--twarn) 6%, transparent); }
.tf.cb .tfsim .tfcores.bad > .tfi { color: var(--twarn); }
.tf.cb .tfsim .tfcobs { gap: 8px; }
.tf.cb .tfsim .tfcob { border-radius: 0; background: var(--tp0); border-color: var(--tline); }
.tf.cb .tfsim .tfcob.best { border-color: var(--cb-accent-a50); background: linear-gradient(160deg, var(--cb-accent-a10), transparent 70%), var(--tp0); }
.tf.cb .tfsim .tfcobh b { font: 600 13px/1 var(--tsans); }
.tf.cb .tfsim .tfcobh .tfgr { width: 26px; height: 23px; font-size: 10px; }
.tf.cb .tfsim .tfcobq { font: 400 7px/1.3 var(--cb-brand); letter-spacing: .08em; }
.tf.cb .tfsim .tfcobq .tftb { height: 5px; }
/* setup quality is the brand's scale; risk is steel when low, amber when it climbs */
.tf.cb .tfsim .tfcobq > .tftb:nth-of-type(1) i { background: linear-gradient(90deg, var(--cb-ember), var(--cb-accent) 70%, var(--cb-accent-hi)); }
.tf.cb .tfsim .tfcobq > .tftb:nth-of-type(2) i.up { background: var(--cb-steel); }
.tf.cb .tfsim .tfcobq > .tftb:nth-of-type(2) i.warn,
.tf.cb .tfsim .tfcobq > .tftb:nth-of-type(2) i.dn { background: var(--twarn); }
.tf.cb .tfsim .tfcosec { gap: 8px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--tline); border-radius: 0; background: none; }
.tf.cb .tfsim .tfco h4 { font: 600 13px/1.3 var(--tsans); }
.tf.cb .tfsim .tfco h4 .tfi { color: var(--cb-accent); }
.tf.cb .tfsim .tfcosec .ok .tfi { color: var(--cb-steel); }
.tf.cb .tfsim .tfcosec .bad .tfi,
.tf.cb .tfsim .tfcosec .bad b { color: var(--twarn); }
.tf.cb .tfsim .tfcosec .mid .tfi { color: var(--tmut); }
.tf.cb .tfsim .tfcoplan { border-radius: 0; border: 1px solid var(--cb-accent-a25); background: linear-gradient(160deg, var(--cb-accent-a10), transparent 60%), var(--tp0); }
.tf.cb .tfsim .tfcopg div { border-radius: 0; background: var(--tpan); border-color: var(--tline); }
.tf.cb .tfsim .tfcopg span { font: 400 7px/1.4 var(--cb-brand); letter-spacing: .08em; }
.tf.cb .tfsim .tfcopg b { font: 600 12.5px/1.2 var(--tmono); }
.tf.cb .tfsim .tfcopg div:last-child b.up { color: var(--tt1); }
.tf.cb .tfsim .tfcopg div:last-child b.dn { color: var(--twarn); }
.tf.cb .tfsim .tfcoscan { border-radius: 0; border-color: var(--tline); background: transparent; }
.tf.cb .tfsim .tfcopk { border-radius: 0; background: var(--tp0); }
.tf.cb .tfsim .tfcopk:hover { border-color: var(--cb-accent-a50); }
.tf.cb .tfsim .tfcopn { border-radius: 0; clip-path: var(--ck-hex); width: 26px; background: var(--cb-accent-a25); color: var(--cb-accent-hi); font: 600 11.5px var(--tmono); }
.tf.cb .tfsim .tfcopr.up { color: var(--cb-steel); }
.tf.cb .tfsim .tfcopr.dn { color: var(--twarn); }
.tf.cb .tfsim .tfcodisc { font-size: 11.5px; color: var(--tmut); }

@media (min-width: 861px) {
  /* the order button stays in reach while the panel scrolls: it rides just above the account footer */
  .tf.cb .tfsim .tfacctx { height: 54px; }
  .tf.cb .tfsim .tfsubmit { position: sticky; bottom: 62px; z-index: 2; background: var(--tpan); box-shadow: 0 -14px 18px var(--tpan), 0 8px 0 var(--tpan); }
}
@media (min-width: 861px) and (max-height: 860px) {
  .tf.cb .tfsim .tfbot { height: 156px; }
}

/* ---------- phone bar (Buy / Sell) ---------- */
.tf.cb .tfmbar { display: none; }

/* ---------- toasts: keep them off the order ticket while trading ---------- */
@media (min-width: 1180px) { .tf.cb:has(.tfbody.sim) .tftoasts { right: 356px; } }
@media (min-width: 861px) and (max-width: 1179.98px) { .tf.cb:has(.tfbody.sim) .tftoasts { right: 316px; } }

/* =====================================================================
   phone (<= 860px): stacked, fixed Buy / Sell bar
   ===================================================================== */
@media (max-width: 860px) {
  /* bottom space clears the fixed Buy / Sell bar and the assistant's floating button above it */
  .tf.cb .tfbody.sim { height: auto; min-height: 0; padding: 12px 0 calc(150px + env(safe-area-inset-bottom, 0px)); }
  .tf.cb .tfsim { display: flex; flex-direction: column; align-items: stretch; gap: 12px; height: auto; }

  /* watchlist: a horizontal strip of tickers */
  .tf.cb .tfsim .tfwatch {
    order: 0; position: static; display: block; width: auto; height: auto; max-height: none; overflow: hidden;
    border: 1px solid var(--tline2); background: var(--tpan); box-shadow: none;
  }
  .tf.cb .tfsim .tfwh,
  .tf.cb .tfsim .tfwatch > .tfwseg { display: none; }
  .tf.cb .tfsim .tfwl { display: flex; flex-direction: row; gap: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tf.cb .tfsim .tfwl::-webkit-scrollbar { display: none; }
  .tf.cb .tfsim .tfwr {
    position: relative; flex: none; width: auto; height: 48px; margin: 0;
    display: grid; grid-template-columns: 7px auto auto; grid-template-rows: 1fr 1fr; column-gap: 8px; align-items: center;
    padding: 0 14px; border: 0; border-right: 1px solid var(--tline); border-radius: 0; background: transparent; text-align: left;
  }
  .tf.cb .tfsim .tfwr.on { background: var(--tpan2); }
  .tf.cb .tfsim .tfwr.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--cb-accent); }
  .tf.cb .tfsim .tfwr::before { content: ""; grid-area: 1 / 1 / 3 / 2; width: 7px; height: 6px; background: var(--tmut); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  .tf.cb .tfsim .tfwr:has(> .tfwc.up)::before { background: var(--tup); }
  .tf.cb .tfsim .tfwr:has(> .tfwc.dn)::before { background: var(--tdn); clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .tf.cb .tfsim .tfwt { grid-area: 1 / 2 / 3 / 3; display: flex; align-items: center; gap: 4px; }
  .tf.cb .tfsim .tfwt b { font: 400 9.5px/1 var(--cb-brand); letter-spacing: .04em; color: var(--tink); }
  .tf.cb .tfsim .tfwt .tfhot .tfi { width: 12px; height: 12px; }
  .tf.cb .tfsim .tfwr .tfpd { position: absolute; left: 29px; bottom: 9px; width: 14px; height: 2px; border-radius: 0; }
  .tf.cb .tfsim .tfwn { display: none; }
  .tf.cb .tfsim .tfwp { grid-area: 1 / 3 / 2 / 4; align-self: end; margin: 0; border-radius: 0; font: 500 12.5px/1.1 var(--tmono); text-align: right; color: var(--tt1); }
  .tf.cb .tfsim .tfwc { grid-area: 2 / 3 / 3 / 4; align-self: start; margin-top: 1px; font: 500 11px/1.2 var(--tmono); text-align: right; }
  .tf.cb .tfsim .tfwl .tfempty { padding: 14px; font-size: 12px; }

  /* centre column */
  .tf.cb .tfsim .tfmain { order: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; border: 1px solid var(--tline2); background: var(--tbg); }
  .tf.cb .tfsim .tfqbar { gap: 8px 16px; padding: 10px 12px; }
  .tf.cb .tfsim .tfqt { max-width: none; }
  .tf.cb .tfsim .tfqp b,
  .tf.cb .tfsim .tfqp b.up,
  .tf.cb .tfsim .tfqp b.dn { font-size: 22px; }
  .tf.cb .tfsim .tfqs { flex-basis: 100%; gap: 8px 16px; }
  .tf.cb .tfsim .tfclock { margin-left: 0; }
  .tf.cb .tfsim .tfmktrow { padding: 8px 12px; }
  .tf.cb .tfsim .tfmktrow::after { display: none; }
  .tf.cb .tfsim .tftools { padding: 8px 12px; gap: 8px; }
  .tf.cb .tfsim .tftools > .tfseg { flex-wrap: wrap; }
  .tf.cb .tfsim .tfchartw { flex: none; }
  .tf.cb .tfsim .tfchart { position: relative; height: 52vh; min-height: 300px; }
  .tf.cb .tfsim .tflive { right: 70px; bottom: 30px; }
  .tf.cb .tfsim .tfbot { height: auto; grid-template-rows: 40px auto; }
  .tf.cb .tfsim .tfbot.cbcol { height: auto; }
  .tf.cb .tfsim #tfbotb { max-height: 320px; }
  .tf.cb .tfsim .cbdrsum { display: none; }
  .tf.cb .tfsim .tfbot > .tfseg { padding-left: 10px; }

  /* right panel becomes a section below */
  .tf.cb .tfsim .tfside { order: 2; position: static; display: flex; flex-direction: column; height: auto; max-height: none; overflow: visible; border: 1px solid var(--tline2); }
  .tf.cb .tfsim .tfstab { position: static; }
  .tf.cb .tfsim .tfacctx { position: static; margin: 0; }

  /* fixed order bar */
  .tf.cb .tfmbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 22;
    display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; align-items: center;
    padding: 10px max(14px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--tline2); -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .5);
  }
  .tf.cb .tfmbq { display: flex; flex-direction: column; gap: 4px; line-height: 1.1; }
  .tf.cb .tfmbq b { font: 400 10px/1 var(--cb-brand); letter-spacing: .06em; color: var(--tink); }
  .tf.cb .tfmbq span { font: 600 14px/1 var(--tmono); font-variant-numeric: tabular-nums; }
  .tf.cb .tfmbar button {
    position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 46px; border: 0; border-radius: 0; background: transparent; color: var(--cb-ink); font: 700 15px/1 var(--tsans);
  }
  .tf.cb .tfmbar button::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: filter .2s; }
  .tf.cb .tfmbar .buy,
  .tf.cb .tfmbar .sell { color: var(--cb-ink); background: transparent; }
  .tf.cb .tfmbar .buy::before { background: linear-gradient(100deg, color-mix(in srgb, var(--tup) 72%, #fff), var(--tup) 50%, var(--ck-up-deep)); }
  .tf.cb .tfmbar .sell::before { background: linear-gradient(100deg, color-mix(in srgb, var(--tdn) 72%, #fff), var(--tdn) 50%, var(--ck-dn-deep)); }
  .tf.cb .tfmbar button:active::before { filter: brightness(1.1); }
  .tf.cb .tfmbar .tfi { width: 16px; height: 16px; }
  .tf.cb:has(.tfbody.sim) .tftoasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .tf.cb .tfsim .tftools .tfmenu summary { padding: 0 10px; font-size: 0; gap: 0; }
  .tf.cb .tfsim .tftools .tfmenu summary .tfi { width: 16px; height: 16px; }
  .tf.cb .tfsim .tfqs span { font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .tf.cb .tfsim .tfwatch,
  .tf.cb .tfsim .tfbot,
  .tf.cb .cbhex-score { transition: none; }
  .tf.cb .cbhex-orbit,
  .tf.cb .cbscan .cbhex-scan,
  .tf.cb .cbedge.cbscan .cbedge-side,
  .tf.cb .tfsim #tftilt .tftb i.dn,
  .tf.cb .tfsim .tfcobias::before,
  .tf.cb .tfsim .tfcocall::before,
  .tf.cb .tfsim .tfdot.on { animation: none; }
}
