/* Trade Overlay — TradingView-style order tabs over the live chart.
   Isolated layer. Does not restyle candles, rails, or existing overlays. */

.hc-trade-overlay-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
  background: transparent;
}

.hc-to-tab {
  position: absolute;
  right: 52px;
  transform: translateY(-50%);
  display: flex;
  align-items: stretch;
  height: 22px;
  pointer-events: auto;
  user-select: none;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  border-radius: 2px 0 0 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  transition: top 80ms linear;
}

.hc-to-tab__label {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #0b0e11;
  text-transform: uppercase;
}

.hc-to-tab__price {
  display: flex;
  align-items: center;
  padding: 0 8px;
  min-width: 64px;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.28);
  color: #f4f7fb;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.hc-to-tab__qty {
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.18);
  color: #0b0e11;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hc-to-tab--entry {
  background: #2962ff;
}
.hc-to-tab--entry .hc-to-tab__label,
.hc-to-tab--entry .hc-to-tab__qty {
  color: #fff;
}

.hc-to-tab--stop {
  background: #f23645;
}
.hc-to-tab--stop .hc-to-tab__label,
.hc-to-tab--stop .hc-to-tab__qty {
  color: #fff;
}

.hc-to-tab--trail {
  background: #ff9800;
}
.hc-to-tab--trail .hc-to-tab__label,
.hc-to-tab--trail .hc-to-tab__qty {
  color: #111;
}

.hc-to-tab--target {
  background: #089981;
}
.hc-to-tab--target .hc-to-tab__label,
.hc-to-tab--target .hc-to-tab__qty {
  color: #fff;
}

.hc-to-tab--ride {
  background: #7c4dff;
}
.hc-to-tab--ride .hc-to-tab__label,
.hc-to-tab--ride .hc-to-tab__qty {
  color: #fff;
}

.hc-to-tab--protect {
  background: #ff6d00;
}
.hc-to-tab--protect .hc-to-tab__label,
.hc-to-tab--protect .hc-to-tab__qty {
  color: #fff;
}

.hc-to-brain {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 168px;
  overflow-x: hidden;
  overflow-y: auto;
}

.hc-to-tab__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed currentColor;
  opacity: 0.85;
  pointer-events: none;
  transform: translateY(-50%);
  transition: top 80ms linear;
}

.hc-to-tab__line--entry {
  color: #2962ff;
}
.hc-to-tab__line--stop {
  color: #f23645;
}
.hc-to-tab__line--trail {
  color: #ff9800;
}
.hc-to-tab__line--target {
  color: #089981;
}

.hc-to-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 29;
  pointer-events: auto;
  min-width: 188px;
  max-width: 280px;
  max-height: calc(100% - 20px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 16, 22, 0.82);
  color: #e8eef7;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 11px;
  backdrop-filter: blur(4px);
}
.hc-to-size-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hc-to-size-bar__label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  color: #9fb3c8;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.hc-to-size-bar__label input {
  width: 64px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
  color: #e8eef7;
  font-weight: 700;
}
.hc-to-size-bar__btn {
  margin: 0;
  padding: 4px 8px;
  white-space: nowrap;
}
.hc-to-hud__btn--ghost {
  width: 100%;
  margin-top: 4px;
  opacity: 0.85;
  font-size: 10px;
}

.hc-to-harvest {
  margin: 6px 0 8px;
  padding: 6px 7px 5px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 6px;
  background: rgba(6, 28, 20, 0.55);
}
.hc-to-harvest__desk {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(250, 204, 21, 0.35);
}
.hc-to-pnl-proof {
  margin: 6px 0 8px;
  padding: 6px 7px 5px;
  border: 1px dashed rgba(250, 204, 21, 0.45);
  border-radius: 6px;
  background: rgba(36, 28, 7, 0.55);
}
.hc-to-pnl-proof__title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #facc15;
  margin-bottom: 3px;
}
.hc-to-pnl-proof .hc-to-hud__row {
  font-size: 11px;
}
.hc-to-pnl-proof .hc-to-hud__val {
  font-variant-numeric: tabular-nums;
}

.hc-to-slip {
  margin: 8px 0 6px;
  padding: 7px 8px 6px;
  border: 1px solid rgba(27, 220, 255, 0.28);
  border-radius: 6px;
  background: rgba(7, 24, 36, 0.55);
}
.hc-to-slip__title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7ee8fa;
  margin-bottom: 4px;
}
.hc-to-slip .hc-to-hud__row {
  font-size: 11px;
}
.hc-to-slip .hc-to-hud__val {
  font-variant-numeric: tabular-nums;
}

.hc-to-hud[hidden] {
  display: none !important;
}

.hc-to-hud__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0;
}

.hc-to-hud__title {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb3c8;
  margin-bottom: 4px;
}

.hc-to-hud__hint {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #6f8296;
}

.hc-to-hud__val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hc-to-hud__val.is-long {
  color: #089981;
}
.hc-to-hud__val.is-short {
  color: #f23645;
}
.is-x-bull-extreme { color: #3b82f6; border-color: rgba(59, 130, 246, 0.55); }
.is-x-bear-extreme { color: #a855f7; border-color: rgba(168, 85, 247, 0.55); }
.hc-to-hud__val.is-engine {
  color: #4da3ff;
}
.hc-to-hud__val.is-paper {
  color: #4da3ff;
}
.hc-to-hud__val.is-live {
  color: #f23645;
}

.hc-to-scanner {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hc-to-scanner__title {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9fb3c8;
  margin-bottom: 4px;
}
.hc-to-scan-row {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  margin: 2px 0;
}
.hc-to-scan-row.is-ok {
  color: #089981;
}
.hc-to-scan-row.is-miss {
  color: #f23645;
}
.hc-to-scan-mark {
  width: 12px;
  font-weight: 800;
}
.hc-to-scanner__summary {
  margin-top: 4px;
  color: #c5d0dc;
  font-size: 10px;
  line-height: 1.35;
}

/* Delta Accumulation — 10m rolling 5s net_delta. Left sell / right buy. */
.hc-to-delta-accum {
  margin: 2px 0 6px;
  padding: 4px 4px 4px;
}
.hc-to-delta-accum__title {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: #9fb3c8;
  margin-bottom: 2px;
}
.hc-to-delta-accum__sub {
  font-size: 9px;
  color: #7a8a9a;
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}
.hc-to-delta-accum__scale {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  margin-bottom: 3px;
  color: #7a8a9a;
}
.hc-to-delta-accum__end.is-red {
  color: #f23645;
}
.hc-to-delta-accum__end.is-green {
  color: #089981;
}
.hc-to-delta-accum__end.is-zero {
  color: #9fb3c8;
}
.hc-to-delta-accum__track {
  position: relative;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(242, 54, 69, 0.55) 0%,
    rgba(90, 100, 110, 0.35) 50%,
    rgba(8, 153, 129, 0.55) 100%
  );
  overflow: visible;
}
.hc-to-delta-accum__mid {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.45);
  transform: translateX(-50%);
}
.hc-to-delta-accum__fill {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #e8eef7;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  transition: left 0.2s ease-out;
}
.hc-to-delta-accum.is-green .hc-to-delta-accum__fill {
  background: #089981;
}
.hc-to-delta-accum.is-red .hc-to-delta-accum__fill {
  background: #f23645;
}
.hc-to-delta-accum__label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #c5d0dc;
  text-align: center;
}
.hc-to-delta-accum.is-green .hc-to-delta-accum__label {
  color: #089981;
}
.hc-to-delta-accum.is-red .hc-to-delta-accum__label {
  color: #f23645;
}

/* Snapback Pressure Meter — 100% RED ← 0 → 100% GREEN */
.hc-to-snapback {
  margin: 8px 0 6px;
  padding: 6px 4px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hc-to-snapback__title {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: #9fb3c8;
  margin-bottom: 4px;
}
.hc-to-snapback__scale {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  margin-bottom: 3px;
  color: #7a8a9a;
}
.hc-to-snapback__end.is-red {
  color: #f23645;
}
.hc-to-snapback__end.is-green {
  color: #089981;
}
.hc-to-snapback__end.is-zero {
  color: #9fb3c8;
}
.hc-to-snapback__track {
  position: relative;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(242, 54, 69, 0.55) 0%,
    rgba(90, 100, 110, 0.35) 50%,
    rgba(8, 153, 129, 0.55) 100%
  );
  overflow: visible;
}
.hc-to-snapback__mid {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.45);
  transform: translateX(-50%);
}
.hc-to-snapback__fill {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #e8eef7;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  transition: left 0.2s ease-out;
}
.hc-to-snapback.is-green .hc-to-snapback__fill {
  background: #089981;
}
.hc-to-snapback.is-red .hc-to-snapback__fill {
  background: #f23645;
}
.hc-to-snapback__label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #c5d0dc;
  text-align: center;
}
.hc-to-snapback.is-green .hc-to-snapback__label {
  color: #089981;
}
.hc-to-snapback.is-red .hc-to-snapback__label {
  color: #f23645;
}

.hc-rsi-meter {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(29, 64, 92, 0.45);
  font: 800 9px/1.2 system-ui, -apple-system, sans-serif;
}
.hc-rsi-meter__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  color: #9fc8d8;
}
.hc-rsi-meter__state {
  color: #ffd22e;
  text-align: right;
}
.hc-rsi-meter__track {
  position: relative;
  height: 7px;
  border-radius: 4px;
  background: #0d1e2a;
  overflow: hidden;
}
.hc-rsi-meter__fill {
  height: 100%;
  width: 0;
  transition: width 0.18s ease;
}
.hc-rsi-meter.is-absorb .hc-rsi-meter__fill {
  background: linear-gradient(90deg, rgba(255, 210, 46, 0.22), rgba(255, 210, 46, 0.9));
}
.hc-rsi-meter.is-pullback .hc-rsi-meter__fill {
  background: linear-gradient(90deg, rgba(61, 126, 255, 0.22), rgba(255, 138, 0, 0.9));
}

/* Pullback Depth — canonical rsi_structure_state only (no new engine). */
.hc-to-pullback {
  margin: 6px 0 4px;
  padding: 6px 4px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hc-to-pullback__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.hc-to-pullback__title {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: #9fb3c8;
}
.hc-to-pullback__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #c5d0dc;
  white-space: nowrap;
}
.hc-to-pullback__track {
  position: relative;
  height: 7px;
  border-radius: 2px;
  background: rgba(70, 82, 96, 0.35);
  overflow: hidden;
}
.hc-to-pullback__fill {
  height: 100%;
  width: 0;
  transition: width 0.18s ease-out, background 0.18s ease-out;
}
.hc-to-pullback.is-none .hc-to-pullback__fill {
  background: rgba(160, 170, 180, 0.45);
}
.hc-to-pullback.is-none .hc-to-pullback__label {
  color: #9fb3c8;
}
.hc-to-pullback.is-shallow .hc-to-pullback__fill {
  background: linear-gradient(90deg, rgba(8, 153, 129, 0.35), #089981);
}
.hc-to-pullback.is-shallow .hc-to-pullback__label {
  color: #089981;
}
.hc-to-pullback.is-deep .hc-to-pullback__fill {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.35), #ff9800);
}
.hc-to-pullback.is-deep .hc-to-pullback__label {
  color: #ff9800;
}
.hc-to-pullback.is-danger .hc-to-pullback__fill {
  background: linear-gradient(90deg, rgba(242, 54, 69, 0.35), #f23645);
}
.hc-to-pullback.is-danger .hc-to-pullback__label {
  color: #f23645;
}

/* RSI Power Bars — under Snapback + Pullback: 5m weather + Fast 1s/5s */
.hc-to-rsi-power {
  margin: 2px 0 6px;
  padding: 4px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.hc-to-rsi-power__row {
  margin: 6px 0 4px;
}
.hc-to-rsi-power__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.hc-to-rsi-power__title {
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 10px;
  color: #9fb3c8;
}
.hc-to-rsi-power__verb {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #c5d0dc;
  white-space: nowrap;
}
.hc-to-rsi-power__sub {
  font-size: 9px;
  color: #6f7f90;
  margin-bottom: 3px;
}
.hc-to-rsi-power__track {
  position: relative;
  height: 7px;
  border-radius: 2px;
  background: rgba(70, 82, 96, 0.35);
  overflow: hidden;
}
.hc-to-rsi-power__mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-50%);
  z-index: 2;
}
.hc-to-rsi-power__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  /* No width remount animation — was flashing bars on/off every HUD paint. */
  transition: background 0.18s ease-out;
  z-index: 1;
}
.hc-to-rsi-power__scale {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  margin-top: 2px;
  color: #7a8a9a;
}
.hc-to-rsi-power__scale .is-bearish {
  color: #f23645;
}
.hc-to-rsi-power__scale .is-bullish {
  color: #089981;
}
.hc-to-rsi-power__scale .is-zero {
  color: #9fb3c8;
}

/* Tones: blue extreme up · green bull · red bear · purple extreme down */
.hc-to-rsi-power__row.is-extreme-bull .hc-to-rsi-power__fill {
  background: linear-gradient(90deg, #2f6bff, #5aa0ff);
}
.hc-to-rsi-power__row.is-extreme-bull .hc-to-rsi-power__verb {
  color: #5aa0ff;
}
.hc-to-rsi-power__row.is-bull .hc-to-rsi-power__fill {
  background: linear-gradient(90deg, #0a8f76, #089981);
}
.hc-to-rsi-power__row.is-bull .hc-to-rsi-power__verb {
  color: #089981;
}
.hc-to-rsi-power__row.is-bear .hc-to-rsi-power__fill {
  background: linear-gradient(270deg, #d62839, #f23645);
}
.hc-to-rsi-power__row.is-bear .hc-to-rsi-power__verb {
  color: #f23645;
}
.hc-to-rsi-power__row.is-extreme-bear .hc-to-rsi-power__fill {
  background: linear-gradient(270deg, #6b2bb8, #9b4dff);
}
.hc-to-rsi-power__row.is-extreme-bear .hc-to-rsi-power__verb {
  color: #b57cff;
}
.hc-to-rsi-power__row.is-neutral .hc-to-rsi-power__fill {
  background: rgba(160, 170, 180, 0.55);
}
.hc-to-rsi-power__row.is-neutral .hc-to-rsi-power__verb {
  color: #9fb3c8;
}

.hc-tee-scan-list {
  margin-top: 4px;
}
.hc-tee-scan-row {
  display: flex;
  gap: 6px;
  font-size: 11px;
  margin: 2px 0;
}
.hc-tee-scan-row.is-ok {
  color: #089981;
}
.hc-tee-scan-row.is-miss {
  color: #f23645;
}
.hc-to-hud__val.is-profit {
  color: #089981;
}
.hc-to-hud__val.is-loss {
  color: #f23645;
}

.hc-to-hud__btn {
  margin-top: 6px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef7;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}

.hc-to-hud__btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hc-to-settings {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 6px;
}

.hc-to-settings label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
  color: #c5d0dc;
  font-size: 10px;
}

.hc-to-settings input[type="number"],
.hc-to-settings input[type="text"] {
  width: 72px;
  background: #0b0e11;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e8eef7;
  font-size: 10px;
  padding: 2px 4px;
}

.hc-to-marker {
  position: absolute;
  right: 58px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.85;
}

.hc-to-marker.is-win {
  background: rgba(8, 153, 129, 0.85);
  color: #fff;
}
.hc-to-marker.is-loss {
  background: rgba(242, 54, 69, 0.85);
  color: #fff;
}

.hc-to-waiting-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6b7c;
  opacity: 0.7;
  pointer-events: none;
  z-index: 29;
}

.hc-to-waiting-dot.is-armed {
  background: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
}

.hc-to-waiting-dot.is-active {
  background: #2962ff;
  box-shadow: 0 0 0 3px rgba(41, 98, 255, 0.28);
}

/* RSI Pressure Chain (V6) */
.hc-to-chain,
.hc-tee-chain-ladder {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hc-to-chain__title {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #8a9bb0;
  margin-bottom: 4px;
}
.hc-to-chain__regime {
  font-size: 12px;
  font-weight: 700;
  color: #e7eef7;
  margin-bottom: 4px;
}
.hc-to-chain__meta,
.hc-to-chain__bias,
.hc-to-chain__flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: #a8b6c6;
  margin: 2px 0;
}
.hc-to-chain__meta b,
.hc-to-chain__flags {
  color: #d7e2ee;
}
.hc-to-chain__reason {
  margin-top: 4px;
  font-size: 10px;
  color: #9fb0c2;
  line-height: 1.35;
}
.hc-to-chain__ladder,
.hc-tee-chain-ladder {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}
.hc-to-chain-tf,
.hc-tee-chain-tf {
  display: grid;
  grid-template-columns: 28px 36px 1fr;
  gap: 6px;
  font-size: 10px;
  color: #a8b6c6;
}
.hc-tee-chain-tf {
  grid-template-columns: 28px 36px 1fr;
}
.hc-to-chain-tf.is-long,
.hc-tee-chain-tf.is-long {
  color: #089981;
}
.hc-to-chain-tf.is-short,
.hc-tee-chain-tf.is-short {
  color: #f23645;
}
.hc-to-chain-tf.is-neutral,
.hc-tee-chain-tf.is-neutral {
  color: #9aa8b8;
}
.hc-to-chain-tf__name,
.hc-tee-chain-tf > span:first-child {
  font-weight: 700;
}
