/* Trade page (v2/pages/trade.js). Built only from app.css tokens. Every class is tr-* because
 * sheets render outside the page and all page stylesheets are global. */

/* ── symbol chips: held → signals → recently closed, one scroller ───────── */
.tr-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: -6px -6px 18px; padding: 6px 6px 8px; scroll-padding: 0 6px; }
.tr-bar::-webkit-scrollbar { display: none; }
.tr-bar.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tr-bar.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px); mask-image: linear-gradient(to right, transparent, #000 48px); }
.tr-bar.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.tr-bi { flex: none; display: flex; }
.tr-sk-chip { height: 40px; border-radius: var(--r-pill); }
.tr-bi + .tr-bi > .tr-gl { margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--hair-2); }
.tr-gl { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding-right: 2px; font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.tr-gl b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tr-s { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px 0 16px; border: 0; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap;
  transition: box-shadow var(--t-fast) var(--ease), transform .15s var(--spring), background var(--t-fast); -webkit-tap-highlight-color: transparent; }
.tr-s:hover { box-shadow: inset 0 0 0 1px var(--hair-2); }
.tr-s:active { transform: scale(.96); }
.tr-s[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.tr-s[aria-pressed="true"] .tr-s-sym { color: var(--accent); }
.tr-s-sym { font-weight: 600; letter-spacing: -.01em; }
.tr-s .side { font-size: 10px; padding: 2px 6px; }
.tr-s-v { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tr-s-v.up { color: var(--up); } .tr-s-v.down { color: var(--down); }
.tr-s-ago { font-size: 12px; color: var(--text-3); }
.tr-s .dot { width: 7px; height: 7px; }
.tr-bi[data-k="find"] { margin-left: 4px; }
.tr-find-b { gap: 6px; padding: 0 15px 0 12px; color: var(--text-2); background: var(--surface-2); }
.tr-find-b svg { width: 16px; height: 16px; }
.tr-find-b:hover { color: var(--text); }

/* find-a-coin sheet */
.tr-find { display: flex; flex-direction: column; gap: 18px; }
.tr-find-in { height: 44px; padding: 0 14px; font-size: 16px; border-radius: 12px; }
.tr-find-in::-webkit-search-cancel-button { cursor: pointer; }
.tr-find-list { display: flex; flex-direction: column; gap: 18px; }
.tr-fg .tr-h4 { margin-bottom: 10px; }
.tr-fcs { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-fc { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair); color: var(--text); font: 600 14px var(--font); letter-spacing: -.01em; cursor: pointer; transition: box-shadow var(--t-fast), background var(--t-fast); }
.tr-fc:hover { box-shadow: inset 0 0 0 1px var(--hair-2); background: var(--surface); }
.tr-fc.on { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); background: var(--surface); }
.tr-fc svg { width: 15px; height: 15px; }
.tr-fc-go { align-self: flex-start; background: var(--accent-fill); color: var(--accent); box-shadow: none; }

/* ── main: chart card + side card ───────────────────────────────────────── */
.tr-main { align-items: stretch; }
.tr-card { display: flex; flex-direction: column; padding: 26px 28px 20px; }
.tr-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "id tf det"; align-items: start; gap: 12px 12px; }
.tr-id { grid-area: id; min-width: 0; }
.tr-tf { grid-area: tf; }
.tr-det { grid-area: det; }
.tr-tf .seg > button { padding: 7px 13px; font-variant-numeric: tabular-nums; }
.tr-det { gap: 6px; height: 36px; }
.tr-det svg { width: 15px; height: 15px; }
.tr-det.on { background: var(--accent-fill); color: var(--accent); }
.tr-det.on:hover { background: rgba(0, 113, 227, .16); }
.tr-sym { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 32px; }
.tr-sym-t { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }
.tr-sym-t span { font-size: 17px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.tr-px { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.tr-px-v { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -.022em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-px-s { white-space: nowrap; }
.tr-id .sk.big { height: 38px; width: 45%; }

/* replay banner */
.tr-replay { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px 10px 14px; border-radius: var(--r-sm); background: var(--accent-fill); }
.tr-rp-ico { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--accent); }
.tr-rp-ico.warn { color: var(--warn); }
.tr-rp-ico svg { width: 16px; height: 16px; }
.tr-rp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tr-rp-t b { font-size: 14px; font-weight: 600; }
.tr-rp-t span { font-size: 12.5px; color: var(--text-2); }
.tr-rp-n { font-size: 17px; font-weight: 600; white-space: nowrap; }
.tr-rp-n small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 4px; }

/* chart: fills the card height next to the ladder; 280 px on phones */
.tr-wrap { position: relative; flex: 1 1 auto; min-height: 440px; margin: 16px -6px 0 -8px; }
.tr-wrap > .tr-chart { position: absolute; inset: 0; height: auto; cursor: crosshair; }
.tr-sk-chart { position: absolute; inset: 8px 10px 26px 10px; border-radius: var(--r-sm); }
.tr-chart .fc-msg { font-size: 14px; }
/* while the crosshair card is up, the chart's own one-line readout would say the same thing */
.tr-chart.is-hover .fc-xhair > text:first-child { visibility: hidden; }
.tr-tip { position: absolute; top: 6px; left: 12px; z-index: 5; pointer-events: none; min-width: 176px; padding: 10px 13px 9px;
  border-radius: 12px; background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(0, 0, 0, .05); font-size: 12px; color: var(--text-2); }
.tr-tip-t { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; margin-bottom: 6px; }
.tr-tip-g { display: grid; grid-template-columns: auto 1fr; gap: 1px 14px; }
.tr-tip-g b { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tr-tip-f { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--hair); white-space: nowrap; }
.tr-tip-f .num { font-weight: 600; }

/* legend + stamp */
.tr-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--hair); min-height: 30px; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.tr-lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tr-lg i { display: inline-block; flex: none; }
.tr-lg-tp, .tr-lg-sl, .tr-lg-en, .tr-lg-lq, .tr-lg-path { width: 14px; height: 0; border-top: 2px solid; }
.tr-lg-tp { border-color: var(--up); }
.tr-lg-sl { border-color: var(--down); }
.tr-lg-en { border-color: var(--chart-entry); }
.tr-lg-lq { border-color: var(--warn); }
.tr-lg-path { border-top-width: 1px; border-color: var(--down); }
.tr-lg-box { width: 8px; height: 11px; border: 1px solid var(--up); border-radius: 1px; }
.tr-lg-vol { width: 9px; height: 9px; background: var(--up); opacity: .4; border-radius: 1px; }
.tr-lg-tick { width: 2px; height: 8px; background: var(--text); opacity: .8; }
.tr-lg-in { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--up); }
.tr-lg-in.short { border-bottom: 0; border-top: 8px solid var(--down); }
.tr-lg-out { width: 9px; height: 9px; border-radius: 50%; background: var(--text-2); }
.tr-lg-out.up { background: var(--up); }
.tr-lg-out.down { background: var(--down); }
.tr-lg-held { width: 14px; height: 10px; border-radius: 2px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--hair); }
.tr-lg-held.up { background: var(--up-fill); box-shadow: none; }
.tr-lg-held.down { background: var(--down-fill); box-shadow: none; }
.tr-stamp { white-space: nowrap; }

/* ── side card: order ladder / result / signal ──────────────────────────── */
.tr-side { display: flex; flex-direction: column; padding: 26px 26px 20px; }
.tr-side > * + * { margin-top: 16px; }
.tr-side > .card-h { margin-bottom: 0; }
.tr-side .empty { flex: 1; }
.tr-ld-pnl { display: flex; flex-direction: column; gap: 2px; }
.tr-ld-u { font-size: 34px; line-height: 1.08; font-weight: 600; letter-spacing: -.024em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tr-ld-u .unit { font-size: 15px; }
.tr-ld-pnl .t-cap b { font-weight: 600; }

.tr-ld { list-style: none; margin-left: 0; margin-right: 0; margin-bottom: 0; padding: 0; }
.tr-ld-h, .tr-ld-r { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 62px 58px; align-items: center; gap: 8px; }
.tr-ld-h { padding: 0 10px 7px; margin-bottom: 3px; border-bottom: 1px solid var(--hair); font-size: 11px; color: var(--text-3); }
.tr-side > .tr-ld { margin-top: 20px; }
.tr-ld-h span:not(:first-child) { text-align: right; }
.tr-ld-r { position: relative; padding: 8px 10px; border-top: 1px solid var(--hair); font-size: 14px; }
.tr-ld-r:first-of-type, .tr-ld-h + .tr-ld-r { border-top: 0; }
.tr-ld-l { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); white-space: nowrap; }
.tr-ld-l i { flex: none; width: 12px; height: 0; border-top: 2px solid var(--text-3); }
.tr-ld-l small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.tr-ld-p { text-align: right; font-weight: 600; }
.tr-ld-d { text-align: right; font-size: 12.5px; color: var(--text-2); }
.tr-ld-rv { text-align: right; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.tr-ld-2 .tr-ld-r { grid-template-columns: minmax(0, 1fr) auto; }
.tr-ld-2 .tr-ld-l small { overflow: visible; }
.tr-cl-mini { margin: 0 -10px; }
.tr-cl-mini .tr-cl-r { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.tr-cl-mini .tr-cl-t { font-size: 13px; }
.tr-ld-r.tp .tr-ld-l i { border-color: var(--up); }
.tr-ld-r.sl .tr-ld-l i { border-color: var(--down); }
.tr-ld-r.en .tr-ld-l i { border-color: var(--chart-entry); }
.tr-ld-r.lq .tr-ld-l i { border-color: var(--warn); border-top-style: dashed; }
.tr-ld-r.mk { border-radius: 10px; background: var(--surface-3); border-top-color: transparent; }
.tr-ld-r.mk + .tr-ld-r { border-top-color: transparent; }
.tr-ld-r.mk .tr-ld-l i { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--text); margin: 0 2px; }
.tr-ld-r.mk .tr-ld-l { font-weight: 600; }
.tr-ld-r.lq { color: var(--text-2); }
.tr-side .rp-legs { display: none; }       /* the ladder above already lists stop / entry / target */
.tr-side .rp.big { padding-top: 20px; }

.tr-prot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-prot .error { flex: 1 1 100%; }
.tr-prot-l { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.tr-pt { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px 0 9px; border-radius: var(--r-pill); background: var(--up-fill); color: var(--up); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tr-pt svg { width: 14px; height: 14px; }
.tr-pt b { font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.tr-pt.bad { background: var(--down-fill); color: var(--down); }
.tr-pt.warn { background: var(--warn-fill); color: var(--warn); }
.tr-prot-ids code { font: 11.5px var(--mono); color: var(--text-3); margin-right: 8px; }
.tr-kv { margin-left: 0; margin-right: 0; margin-bottom: 0; display: grid; }
.tr-kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--hair); }
.tr-side > .tr-kv { margin-top: 12px; }
.tr-kv dt { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tr-kv dd { margin: 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tr-kv dd small { display: inline; margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.tr-kv .warn dd, .tr-kv .warn dt { color: var(--warn); }
.tr-side .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tr-side .dl > div { padding: 10px 12px; }
.tr-side .dl .v { font-size: 14px; }
.tr-side-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto !important; padding-top: 14px; border-top: 1px solid var(--hair); }
.tr-side > .dl + .tr-side-f, .tr-side > div + .tr-side-f { margin-top: 18px; }
.tr-h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }

/* if the TP / the stop fills: one line in the side card, the whole sum in the card under the chart */
.tr-exq { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tr-exq b { margin-left: 2px; font-size: 15px; font-weight: 600; }
.tr-exq small { font-size: 11.5px; color: var(--up); }
.tr-exq-u { display: inline-flex; align-items: center; margin-left: auto; font-size: 12px; color: var(--text-3); }
.tr-exq-u svg { width: 13px; height: 13px; }
.tr-exq:hover .tr-exq-u { color: var(--accent); }
.tr-exs.sec { margin-top: var(--gap); }

/* max profit reached + give-back (FX.mfe), under the ladder */
.tr-mfe { display: grid; gap: 3px; padding: 11px 12px 10px; border-radius: var(--r-sm); background: var(--surface-3); font-size: 13px; color: var(--text-2); }
.tr-mfe-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tr-mfe-h > span:first-child { font-weight: 500; color: var(--text); }
.tr-mfe-v { display: flex; align-items: baseline; gap: 6px; }
.tr-mfe-v b { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.tr-mfe-v .unit { font-size: 12px; color: var(--text-3); margin-right: 6px; }
.tr-mfe-v .num:last-child { font-weight: 600; }
.tr-mfe-g b { font-weight: 600; color: var(--text); }
.tr-mfe.warn .tr-mfe-g, .tr-mfe.warn .tr-mfe-g b { color: var(--warn); }

/* exit rules: four tiles + the evidence line */
.tr-rls.sec { margin-top: var(--gap); }
.tr-rules { padding: 26px 28px 20px; }
.tr-rl-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tr-rl { display: flex; gap: 11px; align-items: flex-start; min-width: 0; padding: 14px 14px 12px; border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.tr-rl-i { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--hair); }
.tr-rl-i svg { width: 16px; height: 16px; }
.tr-rl b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin: 3px 0 4px; }
.tr-rl p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.tr-rl p.t-cap2 { margin-top: 6px; color: var(--text-3); font-size: 12px; }
.tr-rl-ev { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--up-fill); font-size: 13.5px; line-height: 1.45; color: var(--text); }
.tr-rl-ev svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--up); }
.tr-rl-ev b { font-weight: 600; }
.tr-rl-ev code { font: 12px var(--mono); color: var(--text-2); }
.tr-rules .card-f span { white-space: normal; }
@media (max-width: 1080px) { .tr-rl-g { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tr-rules { padding: 18px 16px 14px; } .tr-rl-g { grid-template-columns: minmax(0, 1fr); } }
.tr-exc { padding: 26px 28px 20px; }
.tr-ex-b { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px; align-items: start; }
.tr-ex-one, .tr-ex-all { display: grid; gap: 14px; min-width: 0; }
.tr-ex-id { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.tr-ex-id > b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.tr-ex-id .t-cap { flex: 1 1 100%; }
.tr-ex-id .t-cap b { font-weight: 600; }
.tr-ex-pick .empty { padding: 28px 12px; }
.tr-exl tbody tr { cursor: pointer; }
.tr-exl tbody tr:hover th, .tr-exl tbody tr:hover td { background: var(--surface-2); }
.tr-exl tbody tr.on th, .tr-exl tbody tr.on td { background: var(--surface-3); }
.tr-exl tbody th[scope="row"] { padding-left: 6px; }
.tr-exl .side { margin-left: 4px; vertical-align: 1px; }
.tr-exl-b { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.tr-exl-b[aria-pressed="true"] { color: var(--accent); }
.tr-exc .card-f span { white-space: normal; }
@media (max-width: 900px) { .tr-ex-b { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (max-width: 760px) { .tr-exc { padding: 18px 16px 14px; } }

/* signal verdict */
.tr-vd { display: flex; align-items: center; gap: 12px; }
.tr-vd-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tr-vd-ico svg { width: 20px; height: 20px; }
.tr-vd-a { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tr-vd.open .tr-vd-ico { background: var(--up-fill); color: var(--up); }
.tr-vd.open .tr-vd-a { color: var(--up); }
.tr-vd.rot .tr-vd-ico { background: var(--accent-fill); color: var(--accent); }
.tr-vd.no .tr-vd-ico { background: var(--warn-fill); color: var(--warn); }
.tr-vd-why { margin: 10px 0 0 !important; font-size: 14.5px; line-height: 1.45; }

/* ── events timeline ────────────────────────────────────────────────────── */
.tr-evc { display: flex; flex-direction: column; }
.tr-lower { align-items: start; }
.tr-evc > .tr-ev, .tr-evc > .empty { margin-bottom: 18px; }
.tr-ev { position: relative; list-style: none; margin: 0; padding: 0; }
.tr-ev::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 14px; width: 2px; border-radius: 1px; background: var(--track); }
.tr-ev-r { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 10px 0; }
.tr-ev-r + .tr-ev-r { border-top: 1px solid var(--hair); }
.tr-ev-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--text-3); }
.tr-ev-r.k-open .tr-ev-dot { box-shadow: inset 0 0 0 6px var(--text); }
.tr-ev-r.k-plan .tr-ev-dot { box-shadow: inset 0 0 0 2px var(--text); }
.tr-ev-r.k-stop .tr-ev-dot, .tr-ev-r.k-trail .tr-ev-dot { box-shadow: inset 0 0 0 2px var(--down-mark); }
.tr-ev-r.k-target .tr-ev-dot { box-shadow: inset 0 0 0 2px var(--up-mark); }
.tr-ev-r.k-close .tr-ev-dot, .tr-ev-r.k-exit .tr-ev-dot { box-shadow: inset 0 0 0 6px var(--text-2); }
.tr-ev-r.k-close.tone-up .tr-ev-dot { box-shadow: inset 0 0 0 6px var(--up-mark); }
.tr-ev-r.k-close.tone-down .tr-ev-dot { box-shadow: inset 0 0 0 6px var(--down-mark); }
.tr-ev-r.k-now .tr-ev-dot { background: var(--ok-mark); box-shadow: 0 0 0 4px var(--up-fill); }
.tr-ev-r.k-now.tone-down .tr-ev-dot { background: var(--down-mark); box-shadow: 0 0 0 4px var(--down-fill); }
.tr-ev-m { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-ev-m b { font-size: 14.5px; font-weight: 600; }
.tr-ev-m span { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.tr-ev-s { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.tr-ev-s .num { font-size: 14px; font-weight: 600; }
.tr-ev-s time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tr-ev-r.k-now { background: linear-gradient(90deg, transparent, var(--surface-2)); }

/* ── closed trades ──────────────────────────────────────────────────────── */
.tr-clc { display: flex; flex-direction: column; }
.tr-cl-ctl { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: space-between; }
.tr-cl-ctl .seg > button { padding: 6px 12px; font-size: 13px; }
.tr-cl-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tr-cl-custom label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); min-width: 0; }
.tr-in { height: 36px; width: 100%; min-width: 0; padding: 0 10px; border: 0; border-radius: var(--r-xs); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text); font: 13.5px var(--font); font-variant-numeric: tabular-nums; }
.tr-in:focus { outline: none; box-shadow: var(--focus); }
#tr-cl-list { margin-top: 14px; }
.tr-cl-sum { display: flex; justify-content: space-between; gap: 10px; padding: 0 2px 8px; }
.tr-cl-sum b { font-weight: 600; }
.tr-cl { list-style: none; margin: 0 -10px; padding: 0; }
.tr-cl-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; width: 100%; padding: 11px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; color: var(--text); font: inherit; transition: background var(--t-fast); }
.tr-cl li + li .tr-cl-r { box-shadow: 0 -1px 0 var(--hair); }
.tr-cl li + li .tr-cl-r:hover, .tr-cl li + li .tr-cl-r.on { box-shadow: none; }
.tr-cl-r:hover { background: var(--surface-2); }
.tr-cl-r.on { background: var(--accent-fill); }
.tr-cl-r.on + * { box-shadow: none; }
.tr-cl-a { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-cl-a b { font-size: 15px; font-weight: 600; }
.tr-cl-n { text-align: right; font-size: 15px; font-weight: 600; }
.tr-cl-t { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-cl-p { text-align: right; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.tr-cl-more { margin: 8px auto 0; display: flex; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .tr-main > .tr-card, .tr-main > .tr-side, .tr-lower > .card { grid-column: 1 / -1; }
  /* the side card goes full width: two columns, named areas per state */
  .tr-side.is-ladder, .tr-side.is-result { display: grid; column-gap: 32px; row-gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-side.is-ladder > *, .tr-side.is-result > * { margin-top: 0 !important; }
  .tr-side.is-ladder { grid-template-areas: "h h" "p rp" "ld ex" "ld mf" "ld pt" "ld dl" "f f"; }
  .tr-side > .tr-exq { grid-area: ex; }
  .tr-side > .tr-mfe { grid-area: mf; }
  .tr-side.is-result { grid-template-areas: "h h" "p dl" "ld dl" "f f"; }
  .tr-side > .card-h { grid-area: h; }
  .tr-side > .tr-ld-pnl { grid-area: p; }
  .tr-side > .tr-ld { grid-area: ld; }
  .tr-side > .rp { grid-area: rp; align-self: end; }
  .tr-side > .tr-prot { grid-area: pt; }
  .tr-side > .dl, .tr-side > .tr-kv { grid-area: dl; }
  .tr-side > .tr-side-f { grid-area: f; }
}
@media (max-width: 760px) {
  .tr-bar { margin: -6px calc(-1 * var(--gutter)) 12px; padding: 6px var(--gutter) 8px; scroll-padding: 0 var(--gutter); gap: 6px; }
  .tr-bi + .tr-bi > .tr-gl { margin-left: 8px; padding-left: 10px; }
  .tr-s { height: 38px; padding: 0 13px 0 14px; font-size: 13.5px; gap: 7px; }
  .tr-gl { height: 38px; font-size: 12px; }
  .tr-card { padding: 18px 16px 14px; }
  .tr-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id det" "tf tf"; gap: 12px 10px; }
  .tr-tf .seg { display: flex; width: 100%; }
  .tr-tf .seg > button { flex: 1; padding: 7px 0; }
  .tr-det { height: 32px; padding: 0 12px; }
  .tr-sym-t { font-size: 24px; }
  .tr-px-v { font-size: 28px; }
  .tr-px { margin-top: 4px; }
  .tr-replay { flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; }
  .tr-rp-t { flex-basis: calc(100% - 42px); }
  .tr-rp-n { margin-left: 40px; }
  .tr-replay .btn { margin-left: auto; }
  .tr-wrap { flex: none; min-height: 0; height: 280px; margin: 12px -4px 0 -6px; }
  .tr-tip { min-width: 150px; padding: 8px 10px 7px; font-size: 11.5px; }
  .tr-tip-t { font-size: 12px; margin-bottom: 4px; }
  .tr-tip-g { grid-template-columns: auto 1fr auto 1fr; gap: 1px 8px; }
  .tr-tip-f { margin-top: 4px; padding-top: 4px; }
  .tr-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tr-legend { gap: 4px 12px; font-size: 11.5px; }
  .tr-stamp { white-space: normal; }
  /* back to one column: stretch again (the 2-column tablet grid above sets align-items: start) */
  .tr-side, .tr-side.is-ladder, .tr-side.is-result { display: flex; align-items: stretch; padding: 18px 16px 16px; }
  .tr-side.is-ladder > * + *, .tr-side.is-result > * + *, .tr-side > * + * { margin-top: 16px !important; }
  .tr-ld-u { font-size: 34px; }
  .tr-ld-h, .tr-ld-r { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 58px 52px; gap: 6px; padding-left: 8px; padding-right: 8px; }
  .tr-ld-r { font-size: 13.5px; }
  .tr-ev-r { gap: 12px; }
  .tr-ev-m b { font-size: 14px; }
  .tr-cl-custom { grid-template-columns: 1fr; }
  .tr-cl-ctl { flex-direction: column; align-items: stretch; }
  .tr-cl-ctl .seg { display: flex; width: 100%; }
  .tr-cl-ctl .seg > button { flex: 1; padding: 6px 6px; }
  .tr-cl { margin: 0 -6px; }
  .tr-cl-r { padding: 11px 6px; }
  .tr-side > .rp { align-self: stretch; }
  .tr-cl-t { grid-column: 1 / -1; white-space: normal; }
  .tr-cl-p { grid-column: 1 / -1; text-align: left; }
  .tr-cl-mini .tr-cl-t { grid-column: auto; }
}
