/* UmbraTrade · shared/tradechart.css — график сделки «как на главной» (TODO 27.5, shared/tradechart.js).
   .tchart — сам SVG (лендинг: консоль первого экрана, кабинет и админка — карточка сделки); цвета — токены shared/tokens.css,
   фон подложки подписей — --con-bg (лендинг задаёт свой, карточки — .tc ниже). Без inline-стилей (CSP). */

/* ---------------------------------------------------------------- SVG: сетка, уровни, путь цены, стоп ступенькой, метки */
.tchart { direction: ltr; unicode-bidi: isolate; display: block; touch-action: pan-y; }
.tchart .gx { stroke: var(--con-grid); stroke-width: 1; }
.tchart .vg { stroke: var(--con-grid); stroke-width: 1; }
.tchart .axt { fill: var(--ink-3); font: 500 10.5px var(--mono); }
.tchart .lv { stroke-width: 1; fill: none; }
.tchart .lv--tp { stroke: var(--pos); stroke-dasharray: 3 5; opacity: .75; }
.tchart .lv--tp.is-hit { stroke-dasharray: none; opacity: .55; }
.tchart .lv--entry { stroke: var(--ink-3); opacity: .7; }
.tchart .lv--sl { stroke: var(--neg); stroke-dasharray: 3 5; opacity: .7; }
.tchart .lname { font: 600 10.5px var(--ui); paint-order: stroke; stroke: var(--con-bg); stroke-width: 4px; stroke-linejoin: round; }
.tchart .lname--tp { fill: var(--pos); } .tchart .lname--entry { fill: var(--ink-2); } .tchart .lname--sl { fill: var(--neg); } .tchart .lname--stop { fill: var(--warn); }
.tchart .tag rect { rx: 5px; }
.tchart .tag text { font: 700 10.5px var(--mono); }
.tchart .tag--tp rect { fill: color-mix(in srgb, var(--pos) 22%, var(--con-bg)); stroke: color-mix(in srgb, var(--pos) 55%, transparent); }
.tchart .tag--tp text { fill: var(--pos); }
.tchart .tag--entry rect { fill: color-mix(in srgb, var(--ink) 10%, var(--con-bg)); stroke: var(--line-2); }
.tchart .tag--entry text { fill: var(--ink-2); }
.tchart .tag--stop rect { fill: var(--warn); stroke: none; }
.tchart .tag--stop text { fill: var(--warn-ink); }
.tchart .tag--sl rect { fill: color-mix(in srgb, var(--neg) 18%, var(--con-bg)); stroke: color-mix(in srgb, var(--neg) 50%, transparent); }
.tchart .tag--sl text { fill: var(--neg); }
.tchart .tag--px rect { fill: var(--acc); stroke: none; }
.tchart .tag--px text { fill: var(--acc-ink); }
.tchart .tag--xh rect { fill: var(--ink); stroke: none; }
.tchart .tag--xh text { fill: var(--bg); }
.tchart .rng { fill: var(--acc); opacity: .16; }
.tchart .parea { opacity: .9; }
.tchart .cg0 { stop-color: var(--acc); stop-opacity: .2; } .tchart .cg1 { stop-color: var(--acc); stop-opacity: 0; }
.tchart .pline { fill: none; stroke: var(--acc); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--acc) 55%, transparent)); }
.tchart .stopl { fill: none; stroke: var(--warn); stroke-width: 1.3; stroke-linejoin: round; opacity: .55; stroke-dasharray: 6 4; }
.tchart .hit { stroke: var(--con-bg); stroke-width: 2; }
.tchart .hit--pos { fill: var(--pos); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--pos) 70%, transparent)); } .tchart .hit--neg { fill: var(--neg); } .tchart .hit--be { fill: var(--warn); }
.tchart .hitl { font: 700 10.5px var(--mono); paint-order: stroke; stroke: var(--con-bg); stroke-width: 4px; stroke-linejoin: round; }
.tchart .hitl--pos { fill: var(--pos); } .tchart .hitl--neg { fill: var(--neg); } .tchart .hitl--be { fill: var(--warn); }
.tchart .far rect { fill: color-mix(in srgb, var(--pos) 14%, var(--con-bg)); stroke: color-mix(in srgb, var(--pos) 45%, transparent); rx: 6px; }
.tchart .far text { fill: var(--pos); font: 700 10.5px var(--mono); }
.tchart .far--sl rect { fill: color-mix(in srgb, var(--neg) 14%, var(--con-bg)); stroke: color-mix(in srgb, var(--neg) 45%, transparent); }
.tchart .far--sl text { fill: var(--neg); }
.tchart .lv--tpx { stroke: var(--pos); stroke-dasharray: 1 4; stroke-width: 1.4; opacity: .55; }
.tchart .xh { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
/* карточка сделки (статичный график): жизнь сделки, путь после выхода, вход, открытая часть */
.tchart .life { fill: var(--acc); opacity: .035; }
.tchart .pline--post { stroke-width: 1.6; opacity: .55; filter: none; }
.tchart .hit--entry { fill: var(--ink); }
.tchart .hit--open { fill: var(--con-bg); stroke: var(--acc); stroke-width: 2; }
.tchart .hitl--open { fill: var(--acc); }
.tchart .axt--x { fill: var(--ink-3); }
.tchart .hit, .tchart .far { cursor: default; }

/* ---------------------------------------------------------------- обёртка карточки: слои «что если», график, легенда */
.tc { --con-bg: var(--surface-solid); --con-grid: var(--grid); display: grid; gap: 10px; min-width: 0; }
.tc__box { position: relative; min-width: 0; border-radius: var(--r-sm); background: var(--con-bg); border: 1px solid var(--line); padding: 8px 0 2px; overflow: hidden; }
.tc__box .tchart { width: 100%; height: auto; }
.tc__seg { display: flex; flex-wrap: wrap; gap: 6px; }
.tc__opt { display: inline-flex; align-items: baseline; gap: 8px; min-height: 36px; padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); font: 600 var(--fs-sm)/1.2 var(--ui); cursor: pointer; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1); }
.tc__opt:hover { border-color: color-mix(in srgb, var(--acc) 45%, var(--line-2)); color: var(--ink); }
.tc__opt[aria-checked="true"] { background: var(--acc-soft); border-color: color-mix(in srgb, var(--acc) 60%, transparent); color: var(--ink); }
.tc__opt:focus-visible { outline: none; box-shadow: var(--focus); }
.tc__r { font: 700 var(--fs-sm) var(--mono); }
.tc__r.pos { color: var(--pos); } .tc__r.neg { color: var(--neg); } .tc__r.zero { color: var(--ink-3); }
.tc__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--ink-3); }
.tc__li { display: inline-flex; align-items: center; gap: 6px; }
.tc__li i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--acc); }
.tc__li--stop i { border-top: 2px dashed var(--warn); }
.tc__li--tp i { border-top: 2px dashed var(--pos); }
.tc__li--tpx i { border-top: 2px dotted var(--pos); opacity: .7; }
.tc__li--exit i { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--pos); }
.tc__li--pre i { border-top: 2px solid color-mix(in srgb, var(--acc) 30%, transparent); }
@media (max-width: 560px) {
  .tc__opt { padding: 6px 10px; gap: 6px; font-size: var(--fs-xs); flex: 1 1 calc(50% - 6px); justify-content: space-between; }
  .tc__opt--wide { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .tc__opt { transition: none; } }
