/* =====================================================================
   PADDOCK · Carbon theme · screens
   Every content screen except the simulator and the compete views:
   home hub, Academy (tracks, lesson reader, quizzes, glossary), Drills,
   Trend Spotter, Stats and coach report, Journal. Plus the global pieces:
   section labels, grade letters, tags, tables, progress, form fields,
   modals, toasts, empty states, scrollbars and the Edge assistant.
   CSS only. Every rule is scoped under .tf.cb (presentation only: no
   trading, saving or scoring behaviour lives here).
   Classes shared with the simulator (.tfqt, .tfgs, .tfsp, .tfpc) are
   always scoped to their screen so the cockpit is never touched.
   ===================================================================== */

/* ---------- 1. scrollbars (thin graphite, no arrows) ---------- */
:where(.tf.cb, .tf.cb *) { scrollbar-width: thin; scrollbar-color: var(--tp4) transparent; }
.tf.cb ::-webkit-scrollbar { width: 10px; height: 10px; }
.tf.cb ::-webkit-scrollbar-track { background: transparent; }
.tf.cb ::-webkit-scrollbar-thumb { background: var(--tp4); border: 3px solid transparent; background-clip: padding-box; border-radius: 0; }
.tf.cb ::-webkit-scrollbar-thumb:hover { background-color: var(--cb-line-3); }
.tf.cb ::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 2. section labels: small Michroma with an angled orange tick ---------- */
.tf.cb .tfsh {
  display: flex; align-items: center; gap: 10px;
  margin: 30px 0 12px; padding: 0;
  font: 400 10px/1.2 var(--cb-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--tt2);
}
.tf.cb .tfsh::before { content: ""; flex: none; width: 3px; height: 11px; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
.tf.cb .tfsh::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--tline2), transparent 85%); }
.tf.cb .tfsh .tfi { display: none; }

/* ---------- 3. hero headers (hub hero + the foundation's .tfahead) ---------- */
.tf.cb .tfhero,
.tf.cb .tfahead {
  border-radius: 6px; border: 1px solid var(--tline);
  background:
    radial-gradient(70% 120% at 100% 0%, var(--cb-accent-a10), transparent 60%),
    linear-gradient(160deg, var(--tpan2), var(--tp0) 55%, var(--tbg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 24px 60px -30px rgba(0, 0, 0, .9);
  position: relative; overflow: hidden; isolation: isolate;
}
.tf.cb .tfhero { padding: 34px 34px 32px; gap: 28px; margin-bottom: 8px; align-items: center; }
.tf.cb .tfahead { padding: 30px 32px; gap: 26px; margin-bottom: 20px; }
/* the livery stripe down the left edge (also undoes the original 1px gold top line) */
.tf.cb .tfhero::before,
.tf.cb .tfahead::before {
  content: ""; position: absolute; z-index: 1; left: 0; right: auto; top: 0; bottom: 0; width: 3px; height: auto;
  background: linear-gradient(180deg, var(--cb-accent-hi), var(--cb-accent) 45%, var(--cb-ember));
}
/* carbon weave fading in from the right, behind the numbers */
.tf.cb .tfhero::after,
.tf.cb .tfahead::after {
  content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 56%; pointer-events: none;
  background-color: var(--cb-cf-0);
  background-image:
    linear-gradient(180deg, var(--cb-gloss), transparent 45%, var(--cb-shade)),
    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%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
  background-position: 0 0, 0 5px, 10px 0, 0 10px, 10px 5px, 0 0, 0 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, .55) 45%, #000);
  mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, .55) 45%, #000);
  opacity: .9;
}
.tf.cb .tfhero > *, .tf.cb .tfahead > * { position: relative; z-index: 2; }
.tf.cb .tfhero .tfk, .tf.cb .tfahead .tfk { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tf.cb .tfhero h1 {
  font: 700 clamp(34px, 4.4vw, 56px)/1.02 var(--tsans); letter-spacing: -.035em; color: var(--tink);
}
.tf.cb .tfahead h1 { font: 700 clamp(28px, 3.4vw, 42px)/1.04 var(--tsans); letter-spacing: -.03em; color: var(--tink); }
.tf.cb .tfhero p, .tf.cb .tfahead p { color: var(--tt2); font-size: 15px; line-height: 1.6; max-width: 60ch; margin: 14px 0 22px; }
.tf.cb .tfahead > div:first-child > p:last-child { margin-bottom: 0; }
.tf.cb .tfhb { gap: 10px; }
.tf.cb .tfhero .tfstats, .tf.cb .tfahead .tfstats { gap: 8px; }
.tf.cb .tfhero .tfstats div, .tf.cb .tfahead .tfstats div {
  padding: 14px 14px 12px; border-radius: 4px; background: var(--cb-glass);
  border: 1px solid var(--tline2); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tf.cb .tfstats span { margin-bottom: 8px; }
.tf.cb .tfstats b { display: block; color: var(--tink); letter-spacing: -.02em; }
.tf.cb .tfstats b.tfsm { font: 600 15px/1.3 var(--tsans); letter-spacing: 0; }

/* progress ring (Academy, Drills): segmented, like a rev counter */
.tf.cb .tfring {
  position: relative; width: 136px; height: 136px; background: none; border-radius: 50%;
}
.tf.cb .tfring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--cb-ember), var(--cb-accent) calc(var(--p) * .7%), var(--cb-accent-hi) calc(var(--p) * 1%), var(--tp4) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)), repeating-conic-gradient(#000 0 5.2deg, transparent 5.2deg 6deg);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px)) intersect, repeating-conic-gradient(#000 0 5.2deg, transparent 5.2deg 6deg);
}
.tf.cb .tfring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid var(--tline); }
.tf.cb .tfring > div { position: relative; width: 100px; height: 100px; background: transparent; gap: 4px; }
.tf.cb .tfring b { font: 600 28px/1 var(--tmono); font-variant-numeric: tabular-nums; letter-spacing: -.03em; color: var(--tink); }
.tf.cb .tfring span { font: 400 7.5px/1.4 var(--cb-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--tmut); margin-top: 2px; }

/* ---------- 4. cards, grids, clickable cards ---------- */
.tf.cb .tfgrid { gap: 12px; margin-bottom: 8px; }
.tf.cb .tfcard { padding: 20px; }
.tf.cb .tfcard h3 { gap: 10px; margin-bottom: 8px; color: var(--tink); }
.tf.cb .tfcard h3 .tfi { width: 17px; height: 17px; }
.tf.cb .tfcard p { color: var(--tt2); font-size: 13.5px; line-height: 1.55; }
.tf.cb .tfcard p b { color: var(--tink); font-weight: 600; }
/* clickable cards: the border brightens, nothing jumps */
.tf.cb :is(.tftc, .tfmcard, .tfdcard, .tflc, .tfprac .tfpc, .tfjn) {
  position: relative; cursor: pointer; transform: none;
  transition: border-color .2s var(--cb-ease), background-color .2s var(--cb-ease);
}
.tf.cb :is(.tftc, .tfmcard, .tfdcard, .tflc, .tfprac .tfpc, .tfjn):hover { transform: none; border-color: var(--cb-line-3); background-color: var(--tpan2); }
.tf.cb :is(.tftc, .tfmcard, .tfdcard, .tflc, .tfprac .tfpc)::after {
  content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; background: var(--cb-accent);
  transform: scaleY(0); transition: transform .25s var(--cb-ease);
}
.tf.cb :is(.tftc, .tfmcard, .tfdcard, .tflc, .tfprac .tfpc):hover::after,
.tf.cb :is(.tftc, .tfmcard, .tfdcard, .tflc, .tfprac .tfpc):focus-visible::after { transform: scaleY(1); }

/* icon tiles on cards (.tflci): a small chamfered graphite tile with an orange glyph */
.tf.cb .tflci {
  width: 38px; height: 38px; border-radius: 0; color: var(--cb-accent);
  background: linear-gradient(160deg, var(--tp4), var(--tpan2));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.tf.cb .tflci .tfi { width: 18px; height: 18px; stroke-width: 1.7; }

/* ---------- 5. home hub ---------- */
.tf.cb .tfhero > div:first-child { flex: 1 1 420px; }
.tf.cb .tfhero .tfstats { flex: 0 1 360px; }
.tf.cb .tfmkts { margin-bottom: 0; }
.tf.cb .tfmcard { gap: 10px; padding: 20px; }
.tf.cb .tfmcard h3 { font: 600 16px/1.25 var(--tsans); gap: 10px; margin: 0; }
.tf.cb .tfmcard p { color: var(--tt2); }
.tf.cb .tfmcard.on {
  border-color: var(--cb-accent-a50);
  background: linear-gradient(180deg, var(--cb-accent-a10), transparent 70%), var(--tpan);
  box-shadow: inset 0 1px 0 var(--cb-accent-a25);
}
.tf.cb .tfmcard.on::after { transform: scaleY(1); }
.tf.cb .tfmeq { padding-top: 10px; border-top: 1px solid var(--tline); color: var(--tmut); font-size: 12px; }
.tf.cb .tfmeq b { font: 600 13px var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); margin-left: 4px; }
/* "You're here", "New best": angled orange chips */
.tf.cb .tfmnow,
.tf.cb .tfnb {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border-radius: 0;
  background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent));
  color: var(--cb-ink); font: 400 8px/1.2 var(--cb-brand); letter-spacing: .1em; text-transform: uppercase; font-style: normal;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.tf.cb .tfnb { font-size: 9px; padding: 6px 14px 6px 12px; margin-left: 12px; vertical-align: middle; }
.tf.cb .tfnb .tfi { width: 13px; height: 13px; }
.tf.cb .tftrain .tfgrid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tf.cb .tftc { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 128px; }
.tf.cb .tftc h3 { font: 600 15px/1.25 var(--tsans); }
.tf.cb .tftc p { font-size: 13px; }
.tf.cb .tftrain + .tfgrid { margin-top: 30px; }

/* recent trades list (hub, stats): a telemetry table */
.tf.cb .tftr { gap: 0; margin-top: 6px; border-top: 1px solid var(--tline); }
.tf.cb .tftrr {
  border-radius: 0; padding: 10px 8px; border-bottom: 1px solid var(--tline);
  font: 500 12.5px var(--tmono); font-variant-numeric: tabular-nums; color: var(--tt1);
  transition: background-color .2s;
}
.tf.cb .tftrr:hover { background: var(--tpan2); }
.tf.cb .tftrr b { font: 600 13px var(--tsans); color: var(--tink); letter-spacing: .02em; }
.tf.cb .tftrr em { font-weight: 600; }
.tf.cb .tftrr > span:last-child { color: var(--tt2); text-align: right; }

/* disclaimers and other callouts: graphite box, orange left edge */
.tf.cb .tfdisc {
  max-width: none; margin: 22px 0 0; padding: 12px 16px; border-radius: 0 4px 4px 0;
  background: var(--tpan); border: 1px solid var(--tline); border-left: 2px solid var(--cb-accent);
  color: var(--tmut); font-size: 12.5px; line-height: 1.55;
}
.tf.cb .tfdisc .tfi { color: var(--cb-steel); margin-top: 2px; }

/* ---------- 6. Academy: tabs, tracks, lesson cards ---------- */
/* angled tabs whose text stays upright: the slant lives on a pseudo-element */
.tf.cb .tfatabs { gap: 4px; margin: 4px 0 22px; }
.tf.cb .tfatabs button {
  position: relative; z-index: 0; height: 32px; padding: 0 18px; transform: none;
  background: transparent; border: 0; color: var(--tmut); font: 600 12.5px/1 var(--tsans); letter-spacing: .01em;
}
.tf.cb .tfatabs button::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;
}
.tf.cb .tfatabs button:hover { color: var(--tink); }
.tf.cb .tfatabs button:hover::before { border-color: var(--tline2); }
.tf.cb .tfatabs button[aria-pressed="true"] { color: var(--tink); background: transparent; }
.tf.cb .tfatabs button[aria-pressed="true"]::before { background: linear-gradient(180deg, var(--cb-accent-a25), var(--cb-accent-a10)); border-color: var(--cb-accent); }

.tf.cb .tftrk { margin-bottom: 30px; }
.tf.cb .tftrkh { margin-bottom: 12px; gap: 14px; }
.tf.cb .tftrkh h2 {
  flex: 1; min-width: 0; gap: 10px;
  font: 400 10.5px/1.3 var(--cb-brand); letter-spacing: .14em; text-transform: uppercase; color: var(--tink);
}
.tf.cb .tftrkh h2 .tfi { display: none; }
.tf.cb .tftrkh h2::before { content: ""; flex: none; width: 3px; height: 11px; background: var(--cb-accent); transform: skewX(var(--cb-skew)); }
.tf.cb .tftrkh h2::after { content: ""; flex: 1; height: 1px; min-width: 20px; background: linear-gradient(90deg, var(--tline2), transparent); }
.tf.cb .tftrkh > span { font: 500 11.5px var(--tmono); color: var(--tmut); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf.cb .tflgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: 8px; }
.tf.cb .tflc { gap: 14px; padding: 14px 16px 14px 14px; border-radius: 5px; background: var(--tpan); border: 1px solid var(--tline); }
.tf.cb .tflct b { font: 600 14px/1.3 var(--tsans); color: var(--tink); }
.tf.cb .tflct em { font-size: 12px; color: var(--tmut); margin-top: 4px; }
/* finished lessons: an orange edge and the best score (progress is orange, never green) */
.tf.cb .tflc.done { border-color: var(--tline); box-shadow: inset 2px 0 0 var(--cb-accent); }
.tf.cb .tflc.done .tflci { color: var(--cb-ink); background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 55%, var(--cb-ember)); }
.tf.cb .tflcs { font: 600 11.5px var(--tmono); color: var(--cb-accent-hi); gap: 5px; }
.tf.cb .tfok { color: var(--cb-accent-hi); font-weight: 600; }

/* ---------- 7. lesson reader ---------- */
.tf.cb .tfles { max-width: 780px; counter-reset: cbsec; }
.tf.cb .tfback {
  height: 32px; padding: 0 14px 0 10px; border-radius: 3px; border: 1px solid var(--tline2); background: transparent;
  color: var(--tt2); font: 600 12.5px/1 var(--tsans); gap: 6px; transition: color .2s, border-color .2s, background .2s;
}
.tf.cb .tfback:hover { color: var(--tink); border-color: var(--cb-line-3); background: var(--tpan2); }
.tf.cb .tfback .tfi { width: 15px; height: 15px; }
.tf.cb .tflh { position: relative; margin: 6px 0 30px; padding: 0 0 26px; border-bottom: 1px solid var(--tline); }
.tf.cb .tflh::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 2px; background: linear-gradient(90deg, var(--cb-accent), var(--cb-accent-hi)); }
.tf.cb .tflh .tfk { margin-bottom: 14px; }
.tf.cb .tflh h1 { font: 700 clamp(30px, 4.2vw, 46px)/1.05 var(--tsans); letter-spacing: -.035em; color: var(--tink); }
.tf.cb .tflm { gap: 8px; margin-top: 14px; font: 500 12.5px var(--tsans); color: var(--tmut); }
.tf.cb .tflm .tfi { width: 14px; height: 14px; color: var(--cb-steel); }
.tf.cb .tflm > span { color: var(--tline2); }

/* figures and drill charts sit in black panels with hairlines */
.tf.cb .tffig { margin: 0 0 32px; padding: 14px; border-radius: 4px; background: var(--tbg); border: 1px solid var(--tline2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.tf.cb .tfdg { stroke: var(--tline); }
.tf.cb .tfdax { font: 500 11px var(--tmono); fill: var(--tmut); }
.tf.cb .tfdax.b { fill: var(--tt1); }
.tf.cb .tfdl { font: 600 11px var(--tsans); stroke: var(--tbg); }
.tf.cb .tfdtag { font: 600 11px var(--tmono); fill: var(--tbg); }
.tf.cb .tfdleg { gap: 16px; padding: 10px 4px 0; font: 500 11.5px var(--tsans); color: var(--tmut); }
.tf.cb .tfdleg i { width: 14px; height: 2px; border-radius: 0; }

.tf.cb .tfls { margin-bottom: 30px; }
.tf.cb .tfls h2 {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px;
  font: 600 20px/1.3 var(--tsans); letter-spacing: -.015em; color: var(--tink);
}
.tf.cb .tfls h2::before {
  counter-increment: cbsec; content: counter(cbsec, decimal-leading-zero);
  flex: none; font: 400 10px/1 var(--cb-brand); letter-spacing: .08em; color: var(--cb-accent); transform: translateY(-2px);
}
.tf.cb .tfls p { font: 400 16.5px/1.72 var(--tsans); color: var(--tt1); max-width: 68ch; }
.tf.cb .tfls b { color: var(--tink); font-weight: 600; }

/* quiz */
.tf.cb .tfquiz {
  position: relative; margin: 40px 0 30px; padding: 24px 24px 18px; border-radius: 6px;
  background: linear-gradient(180deg, var(--tpan2), var(--tpan) 120px); border: 1px solid var(--tline2);
}
.tf.cb .tfquiz::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, var(--cb-accent), transparent 70%); }
.tf.cb .tfqh { margin-bottom: 8px; }
.tf.cb .tfqh h2 { gap: 10px; font: 400 11px/1.2 var(--cb-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--tink); }
.tf.cb .tfqh h2 .tfi, .tf.cb .tfprac h2 .tfi { color: var(--cb-accent); width: 17px; height: 17px; }
.tf.cb .tfqh span { font: 500 11.5px var(--tmono); color: var(--tmut); }
.tf.cb .tfqq { padding: 18px 0; border-top: 1px solid var(--tline); }
.tf.cb .tfqq .tfqt { display: block; margin: 0 0 12px; font: 600 15.5px/1.5 var(--tsans); color: var(--tink); }
.tf.cb .tfqq .tfqt b { font: 600 13px var(--tmono); color: var(--cb-accent); margin-right: 6px; }
.tf.cb .tfqo { gap: 8px; }
.tf.cb .tfqo button {
  align-items: center; gap: 12px; padding: 12px 14px; border-radius: 4px; min-height: 50px;
  border: 1px solid var(--tline2); background: var(--tp0); color: var(--tt1); font: 500 14px/1.4 var(--tsans);
  transition: border-color .2s, background-color .2s, color .2s, opacity .2s;
}
.tf.cb .tfqo button:hover:not(:disabled) { border-color: var(--cb-line-3); background: var(--tpan2); color: var(--tink); }
.tf.cb .tfqo button:active:not(:disabled) { border-color: var(--cb-accent); background: var(--cb-accent-a10); }
.tf.cb .tfqo button i {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0; margin: 0; border: 0; border-radius: 0;
  font: 400 9px/1 var(--cb-brand); color: var(--tt2); background: var(--tp4);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.tf.cb .tfqo button.ok { border-color: var(--tup); background: color-mix(in srgb, var(--tup) 10%, var(--tp0)); color: var(--tink); }
.tf.cb .tfqo button.ok i { color: var(--tbg); background: var(--tup); }
.tf.cb .tfqo button.bad { border-color: var(--tdn); background: color-mix(in srgb, var(--tdn) 9%, var(--tp0)); color: var(--tink); }
.tf.cb .tfqo button.bad i { color: var(--tbg); background: var(--tdn); }
.tf.cb .tfqo button.dim { opacity: .45; }
.tf.cb .tfqw {
  gap: 10px; margin: 12px 0 0; padding: 12px 14px; border-radius: 0 4px 4px 0;
  background: var(--tpan2); border: 1px solid var(--tline); border-left: 2px solid var(--tmut);
  font-size: 14px; line-height: 1.55; color: var(--tt1);
}
.tf.cb .tfqw.ok { border-left-color: var(--tup); }
.tf.cb .tfqw.bad { border-left-color: var(--tdn); }
.tf.cb .tfqres { margin-top: 10px; padding: 16px 18px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline2); }
.tf.cb .tfqres b { font: 600 16px var(--tsans); color: var(--tink); }
.tf.cb .tfqres span { font: 500 12px var(--tmono); color: var(--tmut); margin-top: 3px; }
.tf.cb .tfqres.perfect { border-color: var(--cb-accent-a50); background: linear-gradient(120deg, var(--cb-accent-a25), var(--cb-accent-a10) 40%, var(--tp0)); }
.tf.cb .tfqres.perfect b { color: var(--cb-accent-hi); }

/* practice links and the prev / next row */
.tf.cb .tfprac { margin-bottom: 30px; }
.tf.cb .tfprac h2 { gap: 10px; margin-bottom: 12px; font: 400 11px/1.2 var(--cb-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--tink); }
.tf.cb .tfpracg { gap: 8px; }
.tf.cb .tfprac .tfpc { padding: 14px; border-radius: 5px; border: 1px solid var(--tline); background: var(--tpan); column-gap: 14px; }
.tf.cb .tfprac .tfpc b { font: 600 14px/1.3 var(--tsans); color: var(--tink); }
.tf.cb .tfprac .tfpc em { color: var(--tmut); font-size: 12.5px; }
.tf.cb .tflnav { padding-top: 22px; border-top: 1px solid var(--tline); gap: 10px; }
.tf.cb .tflnav .tfbtn { min-height: 44px; gap: 10px; }
.tf.cb .tflnav .tfbtn:not(.ghost) { border-color: var(--cb-accent-a50); }
.tf.cb .tflnav .tfbtn:not(.ghost):hover:not(:disabled) { border-color: var(--cb-accent); background: var(--cb-accent-a10); }

/* ---------- 8. glossary ---------- */
.tf.cb .tfgloss { max-width: 880px; }
.tf.cb .tfgloss .tfgs {
  height: 48px; gap: 12px; padding: 0 16px; margin-bottom: 22px; border-radius: 4px;
  border: 1px solid var(--tline2); background: var(--cb-glass); color: var(--tmut);
  transition: border-color .2s;
}
.tf.cb .tfgloss .tfgs:hover { border-color: var(--cb-line-3); }
.tf.cb .tfgloss .tfgs:focus-within { border-color: var(--cb-accent-a50); outline: 2px solid var(--cb-focus); outline-offset: 2px; }
.tf.cb .tfgloss .tfgs input { font: 400 15px var(--tsans); color: var(--tink); }
.tf.cb .tfgloss .tfgs input:focus-visible { outline: none; }
.tf.cb .tfgloss .tfgs input::placeholder { color: var(--tmut); }
.tf.cb .tfglg { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; margin-bottom: 20px; }
.tf.cb .tfgll {
  position: sticky; top: calc(var(--cb-hud-h) + 12px); align-self: start;
  padding-top: 12px; font: 400 20px/1 var(--cb-brand); color: var(--cb-accent);
}
.tf.cb .tfglc { gap: 6px; }
.tf.cb .tfgt { padding: 14px 16px; border-radius: 4px; background: var(--tpan); border: 1px solid var(--tline); }
.tf.cb .tfgt b { font: 600 14.5px var(--tsans); color: var(--tink); }
.tf.cb .tfgt p { margin-top: 5px; color: var(--tt2); font-size: 14px; line-height: 1.6; }

/* ---------- 9. Drills ---------- */
.tf.cb .tfdgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.tf.cb .tfdcard { gap: 6px; padding: 18px; border-radius: 5px; background: var(--tpan); border: 1px solid var(--tline); }
.tf.cb .tfdcard b { font: 600 15.5px/1.3 var(--tsans); color: var(--tink); margin-top: 10px; }
.tf.cb .tfdcard em { color: var(--tt2); font-size: 13px; line-height: 1.5; }
.tf.cb .tfdm {
  align-self: stretch; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--tline);
  font: 500 11.5px var(--tmono); color: var(--tmut);
}

.tf.cb .tfdr { max-width: 920px; }
.tf.cb .tfdrh { gap: 12px 16px; margin-bottom: 16px; }
.tf.cb .tfdrh h1 { gap: 10px; font: 600 21px/1.2 var(--tsans); letter-spacing: -.02em; color: var(--tink); }
.tf.cb .tfdrh h1 .tfi { width: 19px; height: 19px; color: var(--cb-accent); }
.tf.cb .tfdrsc { gap: 6px; }
.tf.cb .tfdrsc span {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 14px; border-radius: 0; border: 0;
  background: var(--tpan2); color: var(--tmut); font: 500 12px var(--tsans);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.tf.cb .tfdrsc b { margin: 0; font: 600 13px var(--tmono); color: var(--tink); font-variant-numeric: tabular-nums; }
.tf.cb .tfdrq { padding: 20px; border-radius: 6px; background: var(--tpan); border: 1px solid var(--tline2); }
.tf.cb .tfdrp { margin: 0 0 14px; font: 500 16px/1.55 var(--tsans); color: var(--tt1); }
.tf.cb .tfdrp b { color: var(--tink); font-weight: 600; }
.tf.cb .tfdrv { padding: 10px; border-radius: 4px; background: var(--tbg); border: 1px solid var(--tline2); }
.tf.cb .tfdrv .tffig { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.tf.cb .tfdro { gap: 8px; margin-top: 14px; }
.tf.cb .tfdro .tfbtn { min-height: 50px; padding: 10px 14px; gap: 12px; font: 600 14px/1.35 var(--tsans); border-radius: 4px; }
.tf.cb .tfdro .tfbtn.ghost { background: var(--tp0); border-color: var(--tline2); color: var(--tt1); }
.tf.cb .tfdro .tfbtn.ghost:hover:not(:disabled) { background: var(--tpan2); border-color: var(--cb-line-3); color: var(--tink); }
.tf.cb .tfkb {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid currentColor; border-radius: 2px;
  font: 600 10.5px/1 var(--tmono); opacity: .6;
}
.tf.cb .tfdrtap { gap: 8px; margin: 14px 0 0; color: var(--cb-accent-hi); font: 600 13.5px var(--tsans); }
.tf.cb .tffb { margin-top: 14px; padding: 18px; border-radius: 0 4px 4px 0; background: var(--tp0); border: 1px solid var(--tline); border-left-width: 2px; }
.tf.cb .tffb.ok { border-color: var(--tline); border-left-color: var(--tup); }
.tf.cb .tffb.bad { border-color: var(--tline); border-left-color: var(--tdn); }
.tf.cb .tffbh { gap: 10px; font: 600 16px var(--tsans); }
.tf.cb .tffb p { margin: 8px 0 16px; color: var(--tt1); font-size: 14.5px; line-height: 1.65; }

/* buy / sell answer buttons (drills and Trend Spotter): green and red are allowed here */
.tf.cb :is(.tfdro, .tfspb) .tfbtn.buy,
.tf.cb :is(.tfdro, .tfspb) .tfbtn.sell { justify-content: center; font-weight: 700; border-width: 1px; border-style: solid; }
.tf.cb :is(.tfdro, .tfspb) .tfbtn.buy { background: linear-gradient(180deg, color-mix(in srgb, var(--tup) 24%, var(--tp0)), color-mix(in srgb, var(--tup) 10%, var(--tp0))); border-color: var(--tup); color: var(--tup); }
.tf.cb :is(.tfdro, .tfspb) .tfbtn.sell { background: linear-gradient(180deg, color-mix(in srgb, var(--tdn) 22%, var(--tp0)), color-mix(in srgb, var(--tdn) 9%, var(--tp0))); border-color: var(--tdn); color: var(--tdn); }
.tf.cb :is(.tfdro, .tfspb) .tfbtn.buy:hover:not(:disabled) { background: color-mix(in srgb, var(--tup) 26%, var(--tp0)); color: var(--tink); }
.tf.cb :is(.tfdro, .tfspb) .tfbtn.sell:hover:not(:disabled) { background: color-mix(in srgb, var(--tdn) 24%, var(--tp0)); color: var(--tink); }

/* stat tiles (drill results, stats, practice summary) */
.tf.cb .tftiles { gap: 8px; }
.tf.cb .tftiles div { padding: 14px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); }
.tf.cb .tftiles span { margin-bottom: 8px; font: 400 8px/1.3 var(--cb-brand); letter-spacing: .1em; color: var(--tmut); }
.tf.cb .tftiles b { font: 600 19px/1.15 var(--tmono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--tink); }
.tf.cb .tftiles b.up { color: var(--tup); }
.tf.cb .tftiles b.dn { color: var(--tdn); }
.tf.cb .tftiles.big { gap: 8px; margin-bottom: 14px; }
.tf.cb .tftiles.big div { background: var(--tpan); padding: 16px; }
.tf.cb .tftiles.big b { font-size: 21px; }

/* ---------- 10. Trend Spotter ---------- */
.tf.cb .tfbody > .tfsp { max-width: 1000px; }
.tf.cb .tfsphud { gap: 6px; margin-bottom: 10px; }
.tf.cb .tfsphud > div { padding: 10px 16px 10px 14px; border-radius: 4px; background: var(--tpan); border: 1px solid var(--tline); min-width: 104px; }
.tf.cb .tfsphud span { margin-bottom: 6px; font: 400 8px/1.3 var(--cb-brand); letter-spacing: .1em; color: var(--tmut); }
.tf.cb .tfsphud b { font: 600 22px/1.1 var(--tmono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--tink); }
.tf.cb .tfsphud > div:first-child { border-color: var(--cb-accent-a50); background: linear-gradient(180deg, var(--cb-accent-a25), var(--tpan) 80%); }
/* the AI rival reads in neutral steel (the original !important needs matching) */
.tf.cb .tfriv { border-color: color-mix(in srgb, var(--cb-steel) 40%, transparent) !important; }
.tf.cb .tfriv span { color: var(--cb-steel) !important; }
.tf.cb .tfspc { padding: 12px; border-radius: 4px; background: var(--tbg); border: 1px solid var(--tline2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03); }
.tf.cb .tfspt { gap: 12px; padding: 2px 4px 8px; }
.tf.cb .tfspt b { font: 400 11px/1 var(--cb-brand); letter-spacing: .08em; color: var(--tink); }
.tf.cb .tfspt span { font: 500 11.5px var(--tsans); color: var(--tmut); }
.tf.cb .tfspfx { font: 700 46px var(--tmono); letter-spacing: -.03em; }
.tf.cb .tfspfx.mid { color: var(--tt1); font: 600 20px var(--tsans); }
.tf.cb .tfspb { gap: 8px; margin-top: 10px; }
.tf.cb .tfspb .tfbtn { height: 60px; font-size: 16.5px; border-radius: 4px; }
.tf.cb .tfsphint { margin-top: 12px; font-size: 12px; color: var(--tmut); }

.tf.cb .tfmodes { gap: 10px; margin-bottom: 8px; }
.tf.cb .tfmode { gap: 10px; padding: 20px; border-radius: 6px; background: var(--tpan); border: 1px solid var(--tline); }
.tf.cb .tfmode h3 { font: 600 16px/1.25 var(--tsans); color: var(--tink); margin-top: 6px; }
.tf.cb .tfmode p { color: var(--tt2); font-size: 13.5px; line-height: 1.55; }
.tf.cb .tfmode p b { font-family: var(--tmono); color: var(--tink); }
.tf.cb .tfmode.gold {
  position: relative; overflow: hidden; border-color: var(--cb-accent-a50);
  background: radial-gradient(100% 80% at 100% 0%, var(--cb-accent-a25), transparent 60%), linear-gradient(160deg, var(--tpan2), var(--tpan));
}
.tf.cb .tfmode.gold::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 .tfmode.gold .tflci { color: var(--cb-ink); background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 55%, var(--cb-ember)); }
.tf.cb .tfcode { gap: 6px; }
.tf.cb .tfcode input {
  height: 40px; padding: 0 12px; border-radius: 3px; border: 1px solid var(--tline2); background: var(--tp0);
  font: 500 13.5px var(--tmono); letter-spacing: .06em; color: var(--tink); transition: border-color .2s;
}
.tf.cb .tfcode input:hover { border-color: var(--cb-line-3); }
.tf.cb .tfcode input:focus { border-color: var(--cb-accent); }
.tf.cb .tfcode input::placeholder { color: var(--tmut); }
.tf.cb .tfshare .tfcode input { color: var(--cb-accent-hi); font-size: 15px; }
.tf.cb .tfcode .tfbtn { height: 40px; }
.tf.cb .tfspdone h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; }

/* ---------- 11. Stats and coach report ---------- */
.tf.cb .tfsg2 { gap: 12px; margin-bottom: 12px; }
.tf.cb .tfeqw, .tf.cb .tfgb { margin-top: 6px; }
.tf.cb .tftip {
  padding: 9px 12px; border-radius: 4px; background: var(--cb-glass); border: 1px solid var(--tline2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 14px 34px rgba(0, 0, 0, .6);
}
.tf.cb .tftip b { font: 600 12.5px var(--tsans); color: var(--tink); }
.tf.cb .tftip span { font: 500 12px var(--tmono); }
.tf.cb .tfcoach ul { gap: 6px; }
.tf.cb .tfcoach li {
  gap: 12px; padding: 12px 14px; border-radius: 0 4px 4px 0; background: var(--tp0);
  border: 1px solid var(--tline); border-left: 2px solid var(--twarn); font-size: 14px; line-height: 1.55; color: var(--tt1);
}
.tf.cb .tfcoach li.ok { border-left-color: var(--tup); }
.tf.cb .tfcoach li.bad { border-left-color: var(--tdn); }
.tf.cb .tfst { margin: 4px -4px 0; }
.tf.cb .tfstr { padding: 10px 6px; border-top: 1px solid var(--tline); font-size: 13px; color: var(--tt1); }
.tf.cb .tfstr.h { padding-block: 6px 8px; border-top: 0; font: 400 8px/1.3 var(--cb-brand); letter-spacing: .1em; color: var(--tmut); }
.tf.cb .tfstr.h > *:not(:first-child) { font-family: var(--cb-brand); }
.tf.cb .tfstr > *:not(:first-child) { font-variant-numeric: tabular-nums; }
.tf.cb .tfstr:not(.h):hover { background: var(--tpan2); }
.tf.cb .tfmist { gap: 6px; }
.tf.cb .tfmist div { gap: 14px; padding: 12px 14px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); }
.tf.cb .tfmist b { font: 600 15px var(--tmono); color: var(--tdn); min-width: 36px; }
.tf.cb .tfmist strong { font: 600 13.5px var(--tsans); color: var(--tink); margin-bottom: 2px; }
.tf.cb .tfmist span { line-height: 1.5; }
.tf.cb .tfjl { gap: 8px; margin-top: 14px; }
.tf.cb .tfjn { padding: 14px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); box-shadow: inset 2px 0 0 var(--cb-accent-a50); }
.tf.cb .tfjn b { font: 600 13px var(--tsans); color: var(--tink); }
.tf.cb .tfjn p { margin-top: 6px; color: var(--tt2); font-size: 13px; line-height: 1.55; }
.tf.cb .tfcorg { gap: 8px; }
.tf.cb .tfcorg div { padding: 14px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); gap: 4px; }
.tf.cb .tfcorg span { font-size: 12px; color: var(--tmut); }
.tf.cb .tfcorg span:first-child { margin-bottom: 4px; font: 400 8px/1.4 var(--cb-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--tt2); }
.tf.cb .tfcorg b { font: 600 16px var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); }

/* ---------- 12. Journal ---------- */
.tf.cb .tfjrn { gap: 8px; }
.tf.cb .tfjr { gap: 12px; padding: 14px 16px; border-radius: 5px; background: var(--tpan); border: 1px solid var(--tline); transition: border-color .2s; }
.tf.cb .tfjr:focus-within { border-color: var(--tline2); }
.tf.cb .tfjrh { gap: 14px; border-radius: 3px; }
.tf.cb .tfjrh b { font: 600 14px var(--tsans); color: var(--tink); }
.tf.cb .tfjrh .tx em { margin-top: 2px; font: 500 12px var(--tmono); color: var(--tmut); }
.tf.cb .tfjrh .pl { font: 600 14px var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfjrh .pl small { font: 500 11.5px var(--tmono); opacity: .75; }

/* ---------- 13. form fields (low specificity so the cockpit can override) ---------- */
.tf.cb :where(.tfmb, .tfbody:not(.sim)) :where(.tff select, .tff textarea, .tff input[type="text"], .tff input[type="date"], .tff input[type="number"], .tfrpf select, .tfrpf input, .tfjr textarea) {
  border-radius: 3px; border: 1px solid var(--tline2); background: var(--tp0); color: var(--tink);
  font-family: var(--tsans); transition: border-color .2s, background-color .2s;
}
.tf.cb :where(.tfmb, .tfbody:not(.sim)) :where(.tff select, .tff textarea, .tfrpf select, .tfrpf input, .tfjr textarea):hover { border-color: var(--cb-line-3); }
.tf.cb :where(.tfmb, .tfbody:not(.sim)) :where(.tff select, .tff textarea, .tfrpf select, .tfrpf input, .tfjr textarea):focus { border-color: var(--cb-accent); background: var(--tpan2); }
.tf.cb :where(.tfmb, .tfbody:not(.sim)) :where(textarea)::placeholder { color: var(--tmut); }
.tf.cb .tfjr textarea, .tf.cb .tfmb .tff textarea { min-height: 58px; padding: 10px 12px; font-size: 14px; line-height: 1.55; resize: vertical; }
/* the original removes the focus outline on journal notes: give it back */
.tf.cb .tfjr textarea:focus-visible, .tf.cb .tfmb textarea:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 2px; }
.tf.cb .tfmb .tff { gap: 8px; }
.tf.cb .tfmb .tff > span, .tf.cb .tfrpf .tff > span { font: 500 12.5px var(--tsans); color: var(--tt2); }
.tf.cb .tfrpf { gap: 12px; }
.tf.cb .tfrpf select, .tf.cb .tfrpf input { height: 40px; padding: 0 10px; }
.tf.cb .tfrpf input[type="date"] { font-family: var(--tmono); font-size: 13px; color-scheme: dark; }
.tf.cb .tfrpb { gap: 10px; font-size: 13.5px; color: var(--tt1); }
.tf.cb :where(.tfmb, .tfbody:not(.sim)) input[type="checkbox"] { accent-color: var(--cb-accent); width: 16px; height: 16px; }

/* ---------- 14. modals ---------- */
.tf.cb .tfmodal { padding-top: max(48px, calc(var(--cb-hud-h) * .75)); background: rgba(0, 0, 0, .74); }
.tf.cb .tfmb {
  gap: 16px; padding: 28px; border-radius: 6px; background: linear-gradient(180deg, var(--tpan2), var(--tpan) 160px);
  border: 1px solid var(--tline2); box-shadow: 0 40px 90px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: cbmodal .35s var(--cb-ease) backwards;
}
.tf.cb .tfmb::before { content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 1px; background: linear-gradient(90deg, var(--cb-accent), var(--cb-accent-hi) 30%, transparent 75%); }
@keyframes cbmodal { from { opacity: 0; transform: translateY(12px); } }
.tf.cb .tfx { width: 32px; height: 32px; border-radius: 3px; border: 1px solid transparent; color: var(--tmut); transition: color .2s, border-color .2s, background .2s; }
.tf.cb .tfx:hover { color: var(--tink); border-color: var(--tline2); background: var(--tpan2); }
.tf.cb .tfmx { top: 14px; right: 14px; }
.tf.cb .tfmh { gap: 10px; font: 600 21px/1.25 var(--tsans); letter-spacing: -.02em; color: var(--tink); margin: 0 0 2px; padding-right: 36px; }
.tf.cb .tfmh .tfi { width: 19px; height: 19px; color: var(--cb-accent); }
.tf.cb .tfmp { color: var(--tt2); font-size: 14px; line-height: 1.6; }
.tf.cb .tfmb .tfhb { margin-top: 2px; }
.tf.cb .tfmb .tfdisc { margin-top: 0; }
/* trade grade card */
.tf.cb .tfmb > .tfgch { gap: 16px; padding: 4px 40px 18px 0; border-bottom: 1px solid var(--tline); }
.tf.cb .tfmb .tfgch b { font: 600 16px/1.3 var(--tsans); color: var(--tink); }
.tf.cb .tfmb .tfgch em { display: block; margin-top: 4px; font: 600 15px var(--tmono); font-variant-numeric: tabular-nums; }
.tf.cb .tfmg { gap: 6px; }
.tf.cb .tfmg div { padding: 11px 12px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); min-width: 0; }
.tf.cb .tfmg span { margin-bottom: 6px; font: 400 8px/1.3 var(--cb-brand); letter-spacing: .1em; color: var(--tmut); }
.tf.cb .tfmg b { display: block; font: 600 14px var(--tmono); font-variant-numeric: tabular-nums; color: var(--tink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf.cb .tfmg b.up { color: var(--tup); }
.tf.cb .tfmg b.dn { color: var(--tdn); }
.tf.cb .tfnotes { gap: 7px; margin-top: 0; }
.tf.cb .tfnotes li { padding-left: 18px; font-size: 13.5px; line-height: 1.5; color: var(--tt1); }
.tf.cb .tfnotes li::before { top: .5em; width: 7px; height: 7px; border-radius: 0; transform: skewX(var(--cb-skew)); }
/* celebrations (rank up, funded, failed) */
.tf.cb .tfcel { padding: 14px 6px 6px; }
.tf.cb .tfcel h2 { font: 700 28px/1.15 var(--tsans); letter-spacing: -.025em; color: var(--tink); margin: 20px 0 10px; }
.tf.cb .tfcel p { color: var(--tt2); font-size: 15px; line-height: 1.6; }
.tf.cb .tfcelic {
  width: 76px; height: 76px; border-radius: 0; color: var(--cb-accent-hi);
  background: radial-gradient(circle at 50% 35%, var(--cb-accent-a25), var(--cb-accent-a10) 70%);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.tf.cb .tfcelic.bad { color: var(--tdn); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--tdn) 22%, transparent), color-mix(in srgb, var(--tdn) 8%, transparent) 70%); }
/* check-my-trade window (a modal) */
.tf.cb .tfmb .tfckh { gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--tline); }
.tf.cb .tfmb .tfckl { gap: 8px; padding: 14px 16px; border-radius: 4px; background: var(--tp0); border: 1px solid var(--tline); }
.tf.cb .tfmb .tfckw { padding: 12px 14px; border-radius: 0 4px 4px 0; border: 1px solid var(--tline); border-left: 2px solid var(--twarn); background: var(--tp0); }
.tf.cb .tfmb .tfckt > div { border-radius: 2px; }
.tf.cb .tfmb .tfckt .h b { font: 400 8px/1.3 var(--cb-brand); letter-spacing: .1em; }
.tf.cb .tfmb .tfckt .h b.tfcoc { color: var(--cb-accent-hi) !important; }
/* hotkey list */
.tf.cb kbd { font: 600 11.5px var(--tmono); padding: 4px 8px; border-radius: 3px; border: 1px solid var(--tline2); border-bottom-width: 2px; background: var(--tp4); color: var(--tink); }
.tf.cb .tfhkl { gap: 6px; }
.tf.cb .tfhkl > div { padding: 6px 0; border-bottom: 1px solid var(--tline); color: var(--tt1); }

/* ---------- 15. toasts, loading overlay, links, empty states ---------- */
/* on desktop toasts rise from the bottom centre (as in the prototype), clear of the Edge button.
   In the simulator the cockpit places them beside the order ticket, so this skips that view. */
@media (min-width: 861px) {
  .tf.cb:not(:has(.tfbody.sim)) .tftoasts { right: auto; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
.tf.cb .tftoast { padding: 12px 16px 12px 14px; font: 500 13px/1.45 var(--tsans); color: var(--tink); gap: 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tf.cb .tftoast b { font-weight: 600; }
.tf.cb .tftoast[role="button"] { cursor: pointer; }
.tf.cb .tftoast[role="button"]:hover { border-color: var(--cb-line-3); }
.tf.cb .tfcxbusy { background: rgba(5, 5, 5, .78); }
.tf.cb .tfcxbb { padding: 28px; border-radius: 6px; background: var(--tpan); border: 1px solid var(--tline2); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); gap: 12px; }
.tf.cb .tfcxbb b { font: 600 16px var(--tsans); color: var(--tink); }
.tf.cb .tfcxspin { border-color: var(--tp4); border-top-color: var(--cb-accent); border-width: 2px; }
.tf.cb .tfcxbar { height: 6px; border-radius: 0; background: var(--tp4); transform: skewX(var(--cb-skew)); }
.tf.cb .tfcxbar i { background: linear-gradient(90deg, var(--cb-ember), var(--cb-accent), var(--cb-accent-hi)); }
.tf.cb .tflink { color: var(--tink); text-decoration-color: var(--cb-accent-a50); }
.tf.cb .tflink:hover { text-decoration-color: var(--cb-accent); }
.tf.cb .tfmore { color: var(--cb-accent-hi); text-decoration-color: var(--cb-accent-a50); }
.tf.cb .tfmore:hover { color: var(--tink); }
.tf.cb .tfempty { color: var(--tmut); font-size: 13px; }
.tf.cb .tfbody:not(.sim) .tfempty { padding: 26px 18px; font-size: 13.5px; border: 1px dashed var(--tline2); border-radius: 4px; }
/* buttons on these screens never jump on hover: the border or fill brightens instead */
.tf.cb :is(.tfbody:not(.sim), .tfmb) .tfbtn:hover:not(:disabled):not(:active) { transform: none; filter: none; }
.tf.cb .tfemptyc { gap: 10px; padding: 48px 24px; border-style: dashed; border-color: var(--tline2); background: var(--tpan); }
.tf.cb .tfemptyc > .tfi { width: 30px; height: 30px; color: var(--cb-accent); stroke-width: 1.5; }
.tf.cb .tfemptyc h3 { justify-content: center; margin: 4px 0 0; font: 600 17px var(--tsans); }
.tf.cb .tfemptyc p { max-width: 46ch; margin: 0 auto 10px; }

/* ---------- 16. grade letters: A/B green tint, C steel, D/F crimson tint ---------- */
.tf.cb .tfgr {
  --g: var(--cb-steel);
  width: 28px; height: 28px; border-radius: 3px;
  font: 400 11px/1 var(--cb-brand); letter-spacing: 0; color: var(--g);
  background: color-mix(in srgb, var(--g) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 42%, transparent);
}
.tf.cb .tfgr.gA { --g: var(--tup); background: color-mix(in srgb, var(--tup) 18%, transparent); }
.tf.cb .tfgr.gB { --g: var(--tup); background: color-mix(in srgb, var(--tup) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tup) 30%, transparent); }
.tf.cb .tfgr.gC { --g: var(--cb-steel); }
.tf.cb .tfgr.gD { --g: var(--tdn); background: color-mix(in srgb, var(--tdn) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tdn) 30%, transparent); }
.tf.cb .tfgr.gF { --g: var(--tdn); background: color-mix(in srgb, var(--tdn) 18%, transparent); }
.tf.cb .tfgr.big {
  width: 58px; height: 58px; border-radius: 0; font-size: 22px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  background: linear-gradient(145deg, color-mix(in srgb, var(--g) 26%, transparent), color-mix(in srgb, var(--g) 6%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--g) 45%, transparent);
}

/* ---------- 17. generic tags ---------- */
.tf.cb .tftags span {
  padding: 4px 12px 4px 10px; border-radius: 0; border: 0; background: var(--tp4); color: var(--tt1);
  font: 500 11.5px var(--tsans); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

/* ---------- 18. phone and tablet ---------- */
@media (max-width: 860px) {
  .tf.cb .tfhero { padding: 26px 22px 24px; }
  .tf.cb .tfahead { padding: 24px 22px; }
  .tf.cb .tfhero::after, .tf.cb .tfahead::after { width: 80%; opacity: .6; }
  .tf.cb .tfquiz { padding: 20px 18px 14px; }
  .tf.cb .tfquiz::before { left: 18px; right: 18px; }
}
@media (max-width: 560px) {
  .tf.cb .tfhero h1 { font-size: clamp(32px, 9.4vw, 40px); }
  .tf.cb .tfahead h1 { font-size: clamp(27px, 8vw, 34px); }
  .tf.cb .tfhero p, .tf.cb .tfahead p { font-size: 14.5px; }
  .tf.cb .tfhero .tfstats, .tf.cb .tfahead .tfstats { flex: 1 1 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf.cb .tfhero .tfstats b, .tf.cb .tfahead .tfstats b { font-size: 19px; }
  .tf.cb .tfring { width: 112px; height: 112px; }
  .tf.cb .tfring > div { width: 84px; height: 84px; }
  .tf.cb .tfring b { font-size: 22px; }
  .tf.cb .tfring::after { inset: 12px; }
  .tf.cb .tfhb .tfbtn { flex: 1 1 auto; }
  .tf.cb .tfcard { padding: 16px; }
  .tf.cb .tftrr { grid-template-columns: 28px minmax(44px, .8fr) minmax(0, 1fr) minmax(0, 1fr); font-size: 12px; }
  .tf.cb .tftrr > span:nth-child(4), .tf.cb .tftrr > span:last-child { display: none; }
  .tf.cb .tfles .tflh h1 { font-size: clamp(28px, 8.4vw, 36px); }
  .tf.cb .tfls h2 { font-size: 18px; }
  .tf.cb .tfls p { font-size: 16px; line-height: 1.7; }
  .tf.cb .tfqq .tfqt { font-size: 15px; }
  .tf.cb .tfglg { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .tf.cb .tfgll { font-size: 15px; }
  .tf.cb .tfdrq { padding: 14px; }
  .tf.cb .tfdrv { padding: 6px; }
  .tf.cb .tfdrh h1 { flex: 1 1 100%; order: 2; font-size: 19px; }
  .tf.cb .tfdrsc { order: 3; }
  .tf.cb .tfsphud > div { min-width: 0; flex: 1 1 28%; padding: 9px 10px; }
  .tf.cb .tfsphud b { font-size: 18px; }
  .tf.cb .tfsphud .tfbtn { flex: 1 1 100%; }
  .tf.cb .tfspb .tfbtn { height: 54px; }
  .tf.cb .tfmb { padding: 22px 18px; }
  .tf.cb .tfmb::before { left: 18px; right: 18px; }
  .tf.cb .tfgr.big { width: 50px; height: 50px; font-size: 19px; }
  .tf.cb .tfjrh { grid-template-columns: auto minmax(0, 1fr); }
  .tf.cb .tfjrh .pl { grid-column: 2; flex-direction: row; gap: 8px; align-items: baseline; text-align: left; }
  .tf.cb .tftiles.big b { font-size: 18px; }
  /* the strategy table fits the card instead of scrolling sideways */
  .tf.cb .tfstr { min-width: 0; grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 6px; padding-inline: 2px; font-size: 12px; }
  .tf.cb .tfstr.h { font: 600 9.5px/1.2 var(--tsans); letter-spacing: .04em; text-transform: uppercase; }
  .tf.cb .tfstr.h > *:not(:first-child) { font-family: var(--tsans); }
  .tf.cb .tfstr > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- 19. Edge, the in-app assistant (restyle only, same structure) ---------- */
/* the floating button: a dark glass capsule with a molten orb */
.tf.cb .aifab {
  height: 46px; padding: 0 18px 0 8px; gap: 10px; border-radius: 4px;
  border: 1px solid var(--tline2); background: var(--cb-glass); color: var(--tink);
  font: 600 13px/1 var(--tsans); letter-spacing: .01em;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: border-color .2s, background-color .2s, opacity .2s, transform .2s;
}
.tf.cb .aifab .tfi {
  box-sizing: content-box; width: 16px; height: 16px; padding: 7px; border-radius: 50%; color: var(--cb-ink); stroke-width: 2.1;
  background: radial-gradient(circle at 36% 30%, var(--cb-accent-hi), var(--cb-accent) 45%, var(--cb-ember) 80%, var(--cb-ember-deep));
  box-shadow: 0 0 0 1px var(--cb-accent-a25), 0 0 16px var(--cb-accent-a25);
}
.tf.cb .aifab:hover { transform: none; border-color: var(--cb-accent-a50); background: rgba(18, 19, 22, .9); box-shadow: 0 14px 34px rgba(0, 0, 0, .6), 0 0 0 1px var(--cb-accent-a25); }
.tf.cb .aifab.hide { transform: translateY(6px); }
/* Desktop (>= 861px): the shell's HUD carries the assistant launcher and hides this button, so no
   desktop placement lives here. Phones and tablets (<= 860px): in the simulator the button stays
   bottom-right, shrinks to the orb and lifts above the Buy / Sell bar (.tfmbar, shown at this width).
   It keeps its aria-label, so its accessible name is unchanged. */
@media (max-width: 860px) {
  .tf.cb:has(.tfbody.sim) .aifab,
  .tf.cb .aiwrap.sim .aifab {
    left: auto; right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--cb-mbar-h, 80px) + 12px + env(safe-area-inset-bottom, 0px));
    width: 50px; height: 50px; padding: 0; justify-content: center; border-radius: 50%;
  }
  .tf.cb:has(.tfbody.sim) .aifab span,
  .tf.cb .aiwrap.sim .aifab span { display: none; }
  .tf.cb:has(.tfbody.sim) .aifab .tfi,
  .tf.cb .aiwrap.sim .aifab .tfi { padding: 9px; }
}
/* during a timed Trend Spotter round it steps aside so it can't be hit instead of Call up / Call down */
.tf.cb:has(.tfspb) .aifab { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility 0s .2s; }
@media (max-width: 560px) {
  .tf.cb .aifab { width: 50px; height: 50px; padding: 0; justify-content: center; border-radius: 50%; }
  .tf.cb .aifab .tfi { padding: 9px; }
}

/* the panel */
.tf.cb .aipanel {
  border-radius: 6px; background: var(--tpan); border: 1px solid var(--tline2);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .78), inset 0 1px 0 rgba(255, 255, 255, .04);
}
/* on desktop the panel docks under the HUD instead of covering it */
@media (min-width: 701px) {
  .tf.cb .aipanel { top: calc(var(--cb-hud-h) + 10px); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
.tf.cb .aihead {
  position: relative; gap: 12px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--tline2);
  background: radial-gradient(80% 160% at 0% 0%, var(--cb-accent-a10), transparent 60%), linear-gradient(180deg, var(--tpan2), var(--tpan));
}
.tf.cb .aihead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, var(--cb-accent), transparent 60%); }
.tf.cb .aihead b { font: 400 12px/1.3 var(--cb-brand); letter-spacing: .14em; text-transform: uppercase; color: var(--tink); }
.tf.cb .aihead small { margin-top: 3px; font: 500 11.5px var(--tsans); color: var(--tmut); }
.tf.cb .aiib { width: 32px; height: 32px; border-radius: 3px; color: var(--tmut); transition: color .2s, border-color .2s, background .2s; }
.tf.cb .aiib:hover { border-color: var(--tline2); color: var(--tink); background: var(--tpan2); }
.tf.cb .aiav {
  color: var(--cb-ink);
  background: radial-gradient(circle at 36% 30%, var(--cb-accent-hi), var(--cb-accent) 45%, var(--cb-ember) 80%, var(--cb-ember-deep));
  box-shadow: 0 0 0 1px var(--cb-accent-a25);
}
.tf.cb .aiav.big { width: 36px; height: 36px; box-shadow: 0 0 0 1px var(--cb-accent-a25), 0 0 22px var(--cb-accent-a25); }
.tf.cb .aimsgs { padding: 18px 14px 10px; gap: 12px; background: var(--tbg); }
.tf.cb .aib { padding: 11px 14px; border-radius: 4px; font: 400 14px/1.55 var(--tsans); }
.tf.cb .aim.bot .aib { background: var(--tpan2); border: 1px solid var(--tline); border-bottom-left-radius: 0; color: var(--tt1); }
.tf.cb .aim.me .aib { background: var(--cb-accent-a10); border: 1px solid var(--cb-accent-a25); border-bottom-right-radius: 0; color: var(--tink); }
.tf.cb .aib b { color: var(--tink); font-weight: 600; }
.tf.cb .aiwrong { margin-top: 10px; font: 500 11.5px var(--tsans); color: var(--tmut); text-decoration-color: var(--tline2); }
.tf.cb .aiwrong:hover { color: var(--tink); text-decoration-color: var(--cb-accent); }
.tf.cb .aichips { gap: 6px; padding-left: 34px; }
/* angled suggestion chips: the slant is on a pseudo-element so the words stay upright */
.tf.cb .aichip {
  position: relative; z-index: 0; min-height: 32px; padding: 6px 14px; border: 0; border-radius: 0; background: transparent;
  color: var(--tt1); font: 500 12.5px/1.25 var(--tsans);
}
.tf.cb .aichip::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(var(--cb-skew));
  background: var(--tpan2); border: 1px solid var(--tline2); transition: border-color .2s, background .2s;
}
.tf.cb .aichip:hover { color: var(--tink); }
.tf.cb .aichip:hover::before { border-color: var(--cb-accent); background: var(--cb-accent-a10); }
.tf.cb .aichip.pick::before { border-color: var(--cb-accent-a50); }
.tf.cb .aichip .tfi { color: var(--cb-accent); }
.tf.cb .aityping i { background: var(--cb-steel); border-radius: 0; transform: skewX(var(--cb-skew)); }
.tf.cb .aiform { gap: 6px; padding: 12px; border-top: 1px solid var(--tline2); background: var(--tpan); }
.tf.cb .aiform input {
  height: 42px; padding: 0 14px; border-radius: 0; border: 1px solid var(--tline2); background: var(--tpan2);
  font: 400 14px var(--tsans); color: var(--tink); transition: border-color .2s;
}
.tf.cb .aiform input::placeholder { color: var(--tmut); }
.tf.cb .aiform input:hover { border-color: var(--cb-line-3); }
.tf.cb .aiform input:focus { border-color: var(--cb-accent); }
.tf.cb .aiform input:focus-visible { outline: 2px solid var(--cb-focus); outline-offset: 2px; }
.tf.cb .aisend {
  width: 46px; height: 42px; border-radius: 0; color: var(--cb-ink);
  background: linear-gradient(135deg, var(--cb-accent-hi), var(--cb-accent) 50%, var(--cb-accent-lo));
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: filter .2s;
}
.tf.cb .aisend:hover { filter: brightness(1.1); }
/* clip-path would cut the focus ring off, so chamfered controls drop it while focused */
.tf.cb .aisend:focus-visible,
.tf.cb .tfbtn.gold:focus-visible { clip-path: none; }
@media (max-width: 700px) {
  .tf.cb .aipanel { border-radius: 0; border: 0; }
}
