/* Disciply Execution Console — chart refinement.
   Mobile-only visual refinement: removes the visible frame around TradingView,
   lets the page surface show through, and gives the chart a slightly closer,
   more vivid first impression without changing MT5, orders or timeframe logic. */

:root,
:host {
  --ec-chart-edge-mask: #07101d;
}

.execution-console .chart-zone,
.execution-console .chart-stage,
.execution-console .chart-mount,
.execution-console .tradingview-widget-container,
.execution-console .tradingview-widget-container__widget,
.execution-console .chart-mount iframe {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.execution-console .chart-zone,
.execution-console .chart-stage,
.execution-console .chart-mount,
.execution-console .tradingview-widget-container,
.execution-console .tradingview-widget-container__widget {
  background: transparent !important;
}

.execution-console .chart-stage {
  position: relative;
  overflow: hidden !important;
  isolation: isolate;
}

/* The hairline still visible on iPhone is painted inside TradingView's
   cross-origin iframe, so CSS on the Disciply wrappers cannot remove it.
   Mask only the 3px perimeter with the same Disciply chart surface. */
.execution-console .chart-stage::after {
  content: "";
  position: absolute;
  z-index: 30;
  inset: 0;
  pointer-events: none;
  border: 3px solid var(--ec-chart-edge-mask);
  box-shadow: inset 0 0 0 1px var(--ec-chart-edge-mask);
}

/* Remove the remaining separator lines so the chart reads as part of the
   Disciply page instead of as a boxed widget. */
.execution-console .chart-toolbar {
  border-top-color: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
}

::slotted(.disciply-execution-modal-chart) {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

@media (max-width: 720px) {
  /* Oversize the iframe slightly so its internal frame remains behind the
     host mask while keeping the selected timeframe and touch behavior intact. */
  .execution-console .chart-mount iframe {
    width: calc(100% + 6px) !important;
    height: calc(100% + 4px) !important;
    min-height: calc(100% + 4px) !important;
    margin: -2px -3px !important;

    /* Slight horizontal zoom: fewer bars are visible at first load, so candles
       read closer and more immediate while the selected timeframe stays intact. */
    transform: scaleX(1.07);
    transform-origin: 100% 50%;

    /* The free Advanced Chart widget does not expose candle palette controls.
       A restrained filter makes the existing red/green candles more vivid
       without replacing TradingView or changing market data. */
    filter: saturate(1.22) contrast(1.035) brightness(1.015);
    will-change: transform, filter;
  }
}

@media (max-width: 430px) {
  .execution-console .chart-mount iframe {
    transform: scaleX(1.08);
  }
}
