/* =============================================================================
static/dash/account_algo_trading_agent_dashboard.css
ART ARGENTUM — ALGORITHMIC TRADING AGENT DASHBOARD

Dedicated dashboard stylesheet for prompt-built deterministic algorithms.
Trading, backtest, optimization and dashboard chrome are owned here.
Shared Builder/Chat scroll ownership stays in account_algo_trading_agents.css.
============================================================================= */

:root{
  --algo-dash-bg:#050607;
  --algo-dash-shell:rgba(3,4,5,.985);
  --algo-dash-line:rgba(255,255,255,.045);
  --algo-dash-line-strong:rgba(255,255,255,.10);
  --algo-dash-text:rgba(255,255,255,.94);
  --algo-dash-soft:rgba(255,255,255,.66);
  --algo-dash-muted:rgba(255,255,255,.39);
  --algo-dash-faint:rgba(255,255,255,.24);
  --algo-dash-green:#82ddb0;
  --algo-dash-red:#eda6ae;
  --algo-dash-gold:#ddc27f;
  --algo-dash-blue:#bdd9ff;
  --algo-dash-font:var(--ui-font,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
}

.extended-html-body .algoagent--dashboard,
.extended-html-body .algoagent--dashboard *,
.extended-html-body .algoagent--dashboard *::before,
.extended-html-body .algoagent--dashboard *::after{
  box-sizing:border-box;
  min-width:0;
}

.extended-html-body .algoagent--dashboard{
  --algo-market-rgb:215,220,228;
  --algo-market-accent:rgba(215,220,228,.20);

  position:relative;
  isolation:isolate;
  width:min(1320px,calc(100% - 34px));
  max-width:1320px;
  margin:20px auto 44px;
  overflow:visible;
  border:0;
  border-radius:0;
  outline:0;
  background:transparent;
  box-shadow:none;
  color:var(--algo-dash-soft);
  font-family:var(--algo-dash-font);
}

.extended-html-body .algoagent--dashboard.algoagent--market-forex{
  --algo-market-rgb:91,221,155;
  --algo-market-accent:rgba(91,221,155,.34);
}
.extended-html-body .algoagent--dashboard.algoagent--market-stocks{
  --algo-market-rgb:105,166,255;
  --algo-market-accent:rgba(105,166,255,.34);
}
.extended-html-body .algoagent--dashboard.algoagent--market-crypto{
  --algo-market-rgb:222,188,103;
  --algo-market-accent:rgba(222,188,103,.36);
}
.extended-html-body .algoagent--dashboard.algoagent--market-commodities{
  --algo-market-rgb:229,228,226;
  --algo-market-accent:rgba(229,228,226,.32);
}
.extended-html-body .algoagent--dashboard.algoagent--market-indices{
  --algo-market-rgb:174,142,255;
  --algo-market-accent:rgba(174,142,255,.34);
}
.extended-html-body .algoagent--dashboard.algoagent--market-mixed{
  --algo-market-rgb:215,220,228;
  --algo-market-accent:rgba(215,220,228,.20);
}

.extended-html-body .algoagent--dashboard::before{
  content:"";
  position:absolute;
  z-index:0;
  top:-3%;
  right:-4%;
  bottom:-5%;
  left:-4%;
  pointer-events:none;
  background:
    radial-gradient(circle at 82% 24%,rgba(var(--algo-market-rgb),.29) 0%,rgba(var(--algo-market-rgb),.14) 23%,rgba(var(--algo-market-rgb),.048) 48%,transparent 70%),
    radial-gradient(circle at 17% 82%,rgba(var(--algo-market-rgb),.16) 0%,rgba(var(--algo-market-rgb),.055) 32%,transparent 63%);
  filter:blur(48px);
  opacity:.48;
  transform:translate3d(0,2%,0) scale(.98);
  transform-origin:center;
  transition:opacity .28s ease,filter .28s ease,transform .34s ease;
}

.extended-html-body .algoagent--dashboard:hover::before,
.extended-html-body .algoagent--dashboard:focus-within::before{
  opacity:.88;
  filter:blur(58px);
  transform:translate3d(0,0,0) scale(1.045);
}

.extended-html-body .algoagent--dashboard > .algoagent-hero,
.extended-html-body .algoagent--dashboard > .algoagent-body{
  position:relative;
  z-index:1;
}

.extended-html-body .algoagent--dashboard > .algoagent-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:24px;
  align-items:end;
  padding:28px 30px 20px;
  border:0;
  border-radius:0;
  background:
    linear-gradient(145deg,rgba(255,255,255,.050),rgba(255,255,255,.010) 34%,rgba(0,0,0,.14) 78%),
    rgba(2,3,5,.73);
  box-shadow:
    0 46px 132px rgba(0,0,0,.72),
    inset 0 1px 0 rgba(255,255,255,.050);
  backdrop-filter:blur(32px) saturate(118%);
  -webkit-backdrop-filter:blur(32px) saturate(118%);
}

.extended-html-body .algoagent--dashboard > .algoagent-body{
  padding:0 20px 24px;
  border:0;
  border-radius:0;
  background:rgba(2,3,5,.73);
  box-shadow:
    0 46px 132px rgba(0,0,0,.72),
    inset 0 -1px 0 rgba(0,0,0,.58);
  backdrop-filter:blur(32px) saturate(118%);
  -webkit-backdrop-filter:blur(32px) saturate(118%);
}

.extended-html-body .algoagent--dashboard .algoagent-hero__title{
  color:var(--algo-dash-text);
  font-size:clamp(34px,4vw,58px);
  font-weight:510;
  line-height:.98;
  letter-spacing:-.045em;
}

.extended-html-body .algoagent--dashboard .algoagent-hero__lead{
  color:var(--algo-dash-soft);
  font-size:13px;
  line-height:1.5;
}

.extended-html-body .algoagent--dashboard :is(
  .algoagent-status,
  .algoagent-hero__pill,
  .algoagent-btn,
  .algoagent-dashboard-tab,
  .algoagent-metric,
  .algoagent-dashboard-section,
  .algoagent-empty,
  .algoagent-inline-note,
  .algoagent-settings-section,
  .algoagent-settings-tab,
  .algoagent-input,
  .algoagent-choice__summary,
  .algoagent-picker__group,
  .algoagent-picker__chip,
  .algoagent-toggle,
  .algoagent-choice__menu,
  .algoagent-choice__option
){
  border-radius:0 !important;
}

.extended-html-body .algoagent--dashboard .algoagent-status,
.extended-html-body .algoagent--dashboard .algoagent-hero__pill{
  border:0;
  background:rgba(255,255,255,.035);
  box-shadow:none;
}

.extended-html-body .algoagent--dashboard .algoagent-feedback{
  min-height:22px;
  margin:0;
  padding:8px 0;
}

/* =============================================================================
DASHBOARD NAVIGATION
============================================================================= */

.extended-html-body .algoagent--dashboard .algoagent-dashboard-tabs{
  display:flex;
  gap:0;
  margin:0 -20px 16px;
  padding:0 22px;
  overflow-x:auto;
  border:0;
  background:rgba(0,0,0,.14);
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-tab{
  position:relative;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  padding:0 18px;
  border:0;
  background:transparent;
  color:rgba(255,255,255,.39);
  box-shadow:none;
  text-decoration:none;
  font-size:9px;
  font-weight:820;
  letter-spacing:.10em;
  text-transform:uppercase;
  transition:background .16s ease,color .16s ease;
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-tab:hover,
.extended-html-body .algoagent--dashboard .algoagent-dashboard-tab:focus-visible{
  background:rgba(255,255,255,.030);
  color:rgba(255,255,255,.78);
  outline:none;
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-tab.is-active{
  background:rgba(255,255,255,.055);
  color:var(--algo-dash-text);
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-tab.is-active::after{
  content:"";
  position:absolute;
  left:18px;
  right:18px;
  bottom:0;
  height:1px;
  background:rgba(var(--algo-market-rgb),.72);
}

/* =============================================================================
ACTIONS AND METRICS
============================================================================= */

.extended-html-body .algoagent--dashboard .algoagent-dashboard-panel{
  display:grid;
  gap:14px;
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-actions,
.extended-html-body .algoagent--dashboard .algoagent-danger-zone{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.extended-html-body .algoagent--dashboard .algoagent-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 14px;
  border:0;
  outline:0;
  background:rgba(0,0,0,.56);
  color:rgba(255,255,255,.72);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.024),0 8px 22px rgba(0,0,0,.14);
  font-size:9px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}

.extended-html-body .algoagent--dashboard .algoagent-btn:hover,
.extended-html-body .algoagent--dashboard .algoagent-btn:focus-visible{
  transform:translateY(-1px);
  background:rgba(0,0,0,.78);
  color:var(--algo-dash-text);
  outline:none;
}

.extended-html-body .algoagent--dashboard .algoagent-btn--primary{
  background:rgba(var(--algo-market-rgb),.12);
  color:var(--algo-dash-text);
  box-shadow:inset 0 1px 0 rgba(var(--algo-market-rgb),.24),0 10px 24px rgba(0,0,0,.20);
}

.extended-html-body .algoagent--dashboard .algoagent-btn--danger{
  background:rgba(237,166,174,.055);
  color:rgba(237,166,174,.80);
}

.extended-html-body .algoagent--dashboard .algoagent-danger-zone{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid var(--algo-dash-line);
}

.extended-html-body .algoagent--dashboard .algoagent-metrics{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:0;
  padding:14px 0;
  background:rgba(0,0,0,.16);
}

.extended-html-body .algoagent--dashboard .algoagent-metrics--compact{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.extended-html-body .algoagent--dashboard .algoagent-metric{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  padding:2px 16px;
  border:0;
  background:transparent;
  box-shadow:none;
}

.extended-html-body .algoagent--dashboard .algoagent-metric:not(:last-child)::after{
  content:"";
  position:absolute;
  top:1px;
  right:0;
  bottom:1px;
  width:1px;
  background:var(--algo-dash-line);
}

.extended-html-body .algoagent--dashboard .algoagent-metric span,
.extended-html-body .algoagent--dashboard .algoagent-position > div > span,
.extended-html-body .algoagent--dashboard .algoagent-trade > span{
  color:var(--algo-dash-muted);
  font-size:7.5px;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.extended-html-body .algoagent--dashboard .algoagent-metric strong{
  overflow:hidden;
  color:rgba(255,255,255,.86);
  font-size:13px;
  font-weight:560;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* =============================================================================
POSITIONS, TRADES AND RUNTIME
============================================================================= */

.extended-html-body .algoagent--dashboard .algoagent-dashboard-section{
  overflow:hidden;
  border:0;
  background:rgba(0,0,0,.22);
  box-shadow:0 18px 48px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.024);
  backdrop-filter:blur(14px) saturate(106%);
  -webkit-backdrop-filter:blur(14px) saturate(106%);
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-section > header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px 15px;
  border:0;
  background:rgba(255,255,255,.012);
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-section > header h3{
  margin:0;
  color:rgba(255,255,255,.76);
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.extended-html-body .algoagent--dashboard .algoagent-dashboard-section > header span{
  color:var(--algo-dash-muted);
  font-size:9px;
}

.extended-html-body .algoagent--dashboard .algoagent-position-list,
.extended-html-body .algoagent--dashboard .algoagent-trade-list{
  display:grid;
}

.extended-html-body .algoagent--dashboard .algoagent-position,
.extended-html-body .algoagent--dashboard .algoagent-trade{
  display:grid;
  align-items:center;
  gap:12px;
  padding:12px 15px;
  border-top:1px solid rgba(255,255,255,.045);
  background:transparent;
}

.extended-html-body .algoagent--dashboard .algoagent-position{
  grid-template-columns:1.2fr repeat(4,minmax(0,1fr));
}

.extended-html-body .algoagent--dashboard .algoagent-trade{
  grid-template-columns:1fr 1fr auto;
}

.extended-html-body .algoagent--dashboard .algoagent-position:hover,
.extended-html-body .algoagent--dashboard .algoagent-trade:hover{
  background:rgba(255,255,255,.018);
}

.extended-html-body .algoagent--dashboard .algoagent-position > div,
.extended-html-body .algoagent--dashboard .algoagent-position__identity,
.extended-html-body .algoagent--dashboard .algoagent-trade__identity{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.extended-html-body .algoagent--dashboard .algoagent-position strong,
.extended-html-body .algoagent--dashboard .algoagent-trade strong{
  color:rgba(255,255,255,.74);
  font-size:11px;
  font-weight:500;
}

.extended-html-body .algoagent--dashboard .algoagent-position__identity span,
.extended-html-body .algoagent--dashboard .algoagent-trade__identity span{
  color:rgba(var(--algo-market-rgb),.68);
  font-size:9px;
  letter-spacing:.08em;
}

.extended-html-body .algoagent--dashboard .algoagent-empty{
  padding:18px;
  border:0;
  background:rgba(0,0,0,.12);
  color:var(--algo-dash-muted);
  font-size:11px;
  line-height:1.55;
}

.extended-html-body .algoagent--dashboard .algoagent-empty strong{
  display:block;
  margin-bottom:5px;
  color:rgba(255,255,255,.68);
}

.extended-html-body .algoagent--dashboard .algoagent-empty p{margin:0}

/* =============================================================================
SETTINGS INSIDE THE ALGO DASHBOARD
============================================================================= */

.extended-html-body .algoagent--dashboard .algoagent-inline-note{
  border:0;
  background:rgba(0,0,0,.20);
  box-shadow:none;
}


.extended-html-body .algoagent--dashboard .algoagent-settings-section{
  border:0;
  background:rgba(0,0,0,.17);
  box-shadow:none;
}

.extended-html-body .algoagent--dashboard :is(
  .algoagent-input,
  .algoagent-choice__summary,
  .algoagent-picker__group,
  .algoagent-toggle
){
  border:0;
  background:rgba(52,53,56,.76);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}

.extended-html-body .algoagent--dashboard .algoagent-input:focus{
  background:rgba(62,63,67,.94);
  box-shadow:inset 0 0 0 1px rgba(var(--algo-market-rgb),.32);
}

.extended-html-body .algoagent--dashboard .algoagent-choice__option{
  border:0;
  background:rgba(0,0,0,.28);
}

.extended-html-body .algoagent--dashboard .algoagent-choice__option.is-selected{
  background:rgba(var(--algo-market-rgb),.12);
  color:var(--algo-dash-text);
}

.extended-html-body .algoagent--dashboard .algoagent-actions{
  border:0;
  background:rgba(2,3,5,.92);
  box-shadow:0 -12px 38px rgba(0,0,0,.24);
}

/* =============================================================================
STATES
============================================================================= */

.extended-html-body .algoagent--dashboard .algoagent-status--active{color:var(--algo-dash-green)}
.extended-html-body .algoagent--dashboard .algoagent-status--paused,
.extended-html-body .algoagent--dashboard .algoagent-status--draft{color:var(--algo-dash-gold)}
.extended-html-body .algoagent--dashboard .algoagent-status--generation-queued{color:var(--algo-dash-blue)}
.extended-html-body .algoagent--dashboard .algoagent-status--error{color:var(--algo-dash-red)}
.extended-html-body .algoagent--dashboard .is-positive{color:var(--algo-dash-green)!important}
.extended-html-body .algoagent--dashboard .is-negative{color:var(--algo-dash-red)!important}


.extended-html-body .algoagent--dashboard.is-process-locked{
  --algo-process-lock-opacity:.36;
}
.extended-html-body .algoagent--dashboard.is-process-locked [data-process-locked="1"]{
  opacity:var(--algo-process-lock-opacity)!important;
  cursor:not-allowed!important;
  filter:saturate(.45)!important;
  transform:none!important;
}
.extended-html-body .algoagent--dashboard.is-process-locked [data-aa-process-interrupt="1"],
.extended-html-body .algoagent--dashboard.is-process-locked [data-aa-algo-backtest-action="cancel"],
.extended-html-body .algoagent--dashboard.is-process-locked [data-aa-algo-optimization-action="cancel"]{
  opacity:1!important;
  cursor:pointer!important;
  filter:none!important;
}

/* =============================================================================
RESPONSIVE
============================================================================= */

@media(max-width:1100px){
  .extended-html-body .algoagent--dashboard .algoagent-metrics{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px 0;
  }
  .extended-html-body .algoagent--dashboard .algoagent-position{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .extended-html-body .algoagent--dashboard .algoagent-metric:nth-child(3n)::after{
    display:none;
  }
}

@media(max-width:760px){
  .extended-html-body .algoagent--dashboard{
    width:min(100%,calc(100% - 18px));
    margin:12px auto 28px;
  }
  .extended-html-body .algoagent--dashboard::before{
    top:-1%;
    right:-2%;
    bottom:-3%;
    left:-2%;
    filter:blur(34px);
  }
  .extended-html-body .algoagent--dashboard > .algoagent-hero{
    grid-template-columns:1fr;
    padding:20px 17px 15px;
    backdrop-filter:blur(24px) saturate(112%);
    -webkit-backdrop-filter:blur(24px) saturate(112%);
  }
  .extended-html-body .algoagent--dashboard > .algoagent-body{
    padding:0 10px 22px;
    backdrop-filter:blur(24px) saturate(112%);
    -webkit-backdrop-filter:blur(24px) saturate(112%);
  }
  .extended-html-body .algoagent--dashboard .algoagent-dashboard-tabs{
    margin:0 -10px 14px;
    padding:0 8px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-dashboard-tab{
    min-height:46px;
    padding:0 12px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-dashboard-tab.is-active::after{
    left:12px;
    right:12px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-dashboard-actions .algoagent-btn{
    width:100%;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metrics,
  .extended-html-body .algoagent--dashboard .algoagent-metrics--compact{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 0;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metric{
    padding:3px 10px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metric:nth-child(3n)::after{
    display:block;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metric:nth-child(2n)::after{
    display:none;
  }
  .extended-html-body .algoagent--dashboard .algoagent-position,
  .extended-html-body .algoagent--dashboard .algoagent-trade{
    grid-template-columns:1fr;
  }
}

/* =============================================================================
ALGO BACKTEST + OPTIMIZATION CONTROLS
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-backtest-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end;
  gap:16px;
  padding:16px;
  background:rgba(0,0,0,.18);
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-form{
  display:grid;
  grid-template-columns:repeat(2,minmax(160px,260px));
  gap:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-message{
  padding:14px 16px;
  background:rgba(0,0,0,.15);
  color:var(--algo-dash-muted);
  font-size:10px;
  line-height:1.55;
}
.extended-html-body .algoagent--dashboard .algoagent-metrics--backtest{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
}
.extended-html-body .algoagent--dashboard .algoagent-btn:disabled{
  opacity:.36;
  cursor:not-allowed;
  transform:none!important;
}


@media(max-width:760px){
  .extended-html-body .algoagent--dashboard .algoagent-backtest-controls,
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions{
    grid-template-columns:1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-backtest-form{
    grid-template-columns:1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metrics--backtest{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* =============================================================================
CODE PREVIEW, INSTRUMENT VIEWS AND TRANSACTION CHARTS
============================================================================= */


.algoagent-dashboard-section--chart{padding:0!important;overflow:hidden}
.algoagent-dashboard-section--chart>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:15px 16px 12px;
  background:rgba(0,0,0,.18);
}
.algoagent-dashboard-section--chart>header h3{margin:0;color:rgba(255,255,255,.90);font-size:13px}
.algoagent-dashboard-section--chart>header p{margin:5px 0 0;color:rgba(255,255,255,.36);font-size:8.5px}
.algoagent-chart-legend{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;color:rgba(255,255,255,.48);font-size:8px;letter-spacing:.06em;text-transform:uppercase}
.algoagent-chart-legend .is-entry{color:#82ddb0}
.algoagent-chart-legend .is-exit{color:#ddc27f}
.algoagent-price-chart{
  width:100%;
  height:390px;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.012),rgba(0,0,0,.18));
}
.algoagent-price-svg{display:block;width:100%;height:100%;overflow:hidden}

.algoagent-code-panel{
  margin:0 0 18px;
  overflow:hidden;
  background:rgba(0,0,0,.28);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.algoagent-code-panel>summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:48px;
  padding:0 15px;
  list-style:none;
  cursor:pointer;
  background:rgba(255,255,255,.018);
}
.algoagent-code-panel>summary::-webkit-details-marker{display:none}
.algoagent-code-panel>summary strong{color:rgba(255,255,255,.86);font-size:10px;letter-spacing:.08em;text-transform:uppercase}
.algoagent-code-panel>summary span{color:rgba(255,255,255,.38);font-size:8px;text-transform:uppercase}
.algoagent-code-panel.is-failed_candidate>summary span{color:#eda6ae}
.algoagent-code-body{padding:12px 14px 15px}
.algoagent-code-note{margin-bottom:9px;color:rgba(255,255,255,.34);font-size:8.5px}
.algoagent-code-preview{
  max-height:660px;
  margin:0;
  padding:15px;
  overflow:auto;
  background:rgba(2,3,5,.78);
  color:#bdd9ff;
  font-family:var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);
  font-size:10px;
  line-height:1.58;
  tab-size:4;
  white-space:pre;
}

.algoagent-backtest-message.is-warning{
  background:rgba(221,194,127,.075);
  box-shadow:inset 3px 0 0 rgba(221,194,127,.56);
}
.algoagent-metrics--diagnostics{grid-template-columns:repeat(3,minmax(0,1fr))}
.algoagent-diagnostic-list{display:grid;gap:6px;margin-top:13px}
.algoagent-diagnostic-row{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  align-items:start;
  gap:10px;
  padding:9px 10px;
  background:rgba(255,255,255,.018);
}
.algoagent-diagnostic-row strong{color:#ddc27f;font-size:10px;text-align:right}
.algoagent-diagnostic-row span{color:rgba(255,255,255,.52);font-size:9px;line-height:1.45}
.algoagent-diagnostic-row.is-rejected strong,.algoagent-diagnostic-row.is-rejected span{color:#eda6ae}

@media(max-width:820px){


  .algoagent-price-chart{height:330px}
  .algoagent-metrics--diagnostics{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:560px){

  .algoagent-price-chart{height:280px}
  .algoagent-dashboard-section--chart>header{display:grid}
  .algoagent-chart-legend{justify-content:flex-start}
  .algoagent-metrics--diagnostics{grid-template-columns:1fr}
  .algoagent-code-panel>summary{align-items:flex-start;flex-direction:column;justify-content:center;padding:10px 13px}
}

/* =============================================================================
ALGO OPTIMIZATION
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-optimization-missing,
.extended-html-body .algoagent--dashboard .algoagent-optimization-baseline,
.extended-html-body .algoagent--dashboard .algoagent-optimization-result{
  margin-top:14px;
  background:rgba(0,0,0,.16);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-missing{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-baseline>header,
.extended-html-body .algoagent--dashboard .algoagent-optimization-result>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:15px 16px;
  background:rgba(255,255,255,.018);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-baseline>header strong,
.extended-html-body .algoagent--dashboard .algoagent-optimization-result>header strong{
  color:rgba(255,255,255,.88);
  font-size:11px;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-baseline>header p,
.extended-html-body .algoagent--dashboard .algoagent-optimization-result>header p{
  margin:5px 0 0;
  color:rgba(255,255,255,.38);
  font-size:9px;
  line-height:1.5;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instruments{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1px;
  background:rgba(255,255,255,.045);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument{
  min-width:0;
  padding:14px 15px;
  background:rgba(7,9,12,.96);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:11px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument>header strong{
  color:rgba(255,255,255,.92);
  font-size:11px;
  letter-spacing:.10em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument>header span{
  color:rgba(255,255,255,.62);
  font-size:10px;
  font-family:var(--algo-mono,ui-monospace,monospace);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px 12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument-grid div{
  display:grid;
  gap:3px;
  min-width:0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument-grid span,
.extended-html-body .algoagent--dashboard .algoagent-optimization-delta span{
  color:rgba(255,255,255,.30);
  font-size:7.5px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-instrument-grid strong,
.extended-html-body .algoagent--dashboard .algoagent-optimization-delta strong{
  color:rgba(255,255,255,.76);
  font-size:9.5px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-delta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.055);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions{
  margin-top:14px;
  padding:15px 16px;
  background:rgba(0,0,0,.18);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-phase{
  padding:10px 16px;
  color:rgba(255,255,255,.34);
  background:rgba(255,255,255,.012);
  font-size:8px;
  font-family:var(--algo-mono,ui-monospace,monospace);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-verdict{
  padding:6px 9px;
  background:rgba(232,199,127,.09);
  color:#ddc27f;
  font-size:8px;
  font-weight:850;
  letter-spacing:.10em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-verdict.is-recommended{
  background:rgba(127,225,170,.10);
  color:#7fe1aa;
}
.extended-html-body .algoagent--dashboard .algoagent-metrics--optimization-result{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.extended-html-body .algoagent--dashboard .is-positive{color:#7fe1aa!important}
.extended-html-body .algoagent--dashboard .is-negative{color:#eda6ae!important}

@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-instruments{
    grid-template-columns:1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-metrics--optimization-result{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:560px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-missing,
  .extended-html-body .algoagent--dashboard .algoagent-optimization-baseline>header,
  .extended-html-body .algoagent--dashboard .algoagent-optimization-result>header{
    align-items:stretch;
    flex-direction:column;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-instrument-grid,
  .extended-html-body .algoagent--dashboard .algoagent-metrics--optimization-result{
    grid-template-columns:1fr 1fr;
  }
}

/* =============================================================================
ALGO BACKTEST PNL + DIAGNOSTIC OPTIMIZATION
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-pnl-chart{
  width:100%;
  height:310px;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(255,255,255,.012),rgba(0,0,0,.18));
}
.extended-html-body .algoagent--dashboard .algoagent-pnl-svg{
  display:block;
  width:100%;
  height:100%;
}
.extended-html-body .algoagent--dashboard .algoagent-pnl-legend .is-total-pnl{color:#82ddb0}
.extended-html-body .algoagent--dashboard .algoagent-pnl-legend .is-realized-pnl{color:#ddc27f}
.extended-html-body .algoagent--dashboard .algoagent-pnl-summary{
  padding:12px 16px 15px;
  background:rgba(0,0,0,.16);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-method{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px;
  margin-top:14px;
  background:rgba(255,255,255,.045);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-method>div{
  min-width:0;
  padding:14px 15px;
  background:rgba(7,9,12,.96);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-method span{
  display:block;
  color:rgba(255,255,255,.34);
  font-size:8px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-method strong{
  display:block;
  margin-top:6px;
  color:rgba(255,255,255,.86);
  font-size:11px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-method p{
  margin:6px 0 0;
  color:rgba(255,255,255,.42);
  font-size:8.5px;
  line-height:1.5;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-research{
  margin-top:14px;
  padding:15px 16px;
  background:rgba(0,0,0,.18);
  box-shadow:inset 3px 0 0 rgba(130,221,176,.48);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-research h4{
  margin:0 0 8px;
  color:rgba(255,255,255,.88);
  font-size:10px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-research p{
  margin:0;
  color:rgba(255,255,255,.50);
  font-size:9px;
  line-height:1.58;
  white-space:pre-wrap;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-research pre{
  max-height:300px;
  margin:12px 0 0;
  padding:12px 13px;
  overflow:auto;
  color:#bdd9ff;
  background:rgba(2,3,5,.72);
  font:9px/1.55 var(--algo-mono,ui-monospace,monospace);
  white-space:pre-wrap;
}
@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-pnl-chart{height:280px}
  .extended-html-body .algoagent--dashboard .algoagent-optimization-method{grid-template-columns:1fr}
}

/* =============================================================================
ITERATIVE OPTIMIZATION LOOP + CLIENT REGIME
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime>header,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime>header h3,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history>header h3{
  margin:0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime>header>span,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history>header>span{
  padding:5px 8px;
  color:#e6c878;
  background:rgba(230,200,120,.08);
  font-size:8px;
  font-weight:850;
  letter-spacing:.08em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1px;
  margin-top:14px;
  background:rgba(255,255,255,.045);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-grid>div{
  padding:14px 15px;
  background:rgba(5,7,10,.82);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-grid>div>span{
  display:block;
  margin-bottom:9px;
  color:rgba(255,255,255,.38);
  font-size:8px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-chips strong,
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-chips em{
  padding:6px 8px;
  font-size:8px;
  font-style:normal;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-chips.is-trade strong{
  color:#7fe1aa;
  background:rgba(127,225,170,.09);
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-regime-chips em{
  color:rgba(255,255,255,.34);
  background:rgba(255,255,255,.035);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-regime>p{
  margin:12px 0 0;
  color:rgba(255,255,255,.42);
  font-size:9px;
  line-height:1.55;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:14px 0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls label{
  display:block;
  padding:12px 13px;
  background:rgba(0,0,0,.18);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls label>span{
  display:block;
  color:rgba(255,255,255,.62);
  font-size:9px;
  font-weight:750;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls input{
  width:100%;
  margin-top:8px;
  padding:9px 10px;
  border:0;
  color:rgba(255,255,255,.92);
  background:rgba(255,255,255,.055);
  outline:none;
  font:11px/1.2 var(--algo-mono,ui-monospace,monospace);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls small{
  display:block;
  margin-top:7px;
  color:rgba(255,255,255,.34);
  font-size:8px;
  line-height:1.45;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-list{
  display:grid;
  gap:1px;
  margin-top:14px;
  background:rgba(255,255,255,.04);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row{
  padding:14px 15px;
  background:rgba(5,7,10,.92);
  box-shadow:inset 3px 0 0 rgba(255,255,255,.10);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row.is-accepted{
  box-shadow:inset 3px 0 0 rgba(127,225,170,.62);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head span,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head em{
  color:rgba(255,255,255,.36);
  font-size:8px;
  font-style:normal;
  letter-spacing:.08em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head strong{
  color:rgba(255,255,255,.84);
  font-size:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row.is-accepted .algoagent-optimization-history-head em{
  color:#7fe1aa;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>p{
  margin:10px 0 12px;
  color:rgba(255,255,255,.46);
  font-size:8.5px;
  line-height:1.52;
}
@media(max-width:720px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-regime-grid,
  .extended-html-body .algoagent--dashboard .algoagent-optimization-loop-controls{
    grid-template-columns:1fr;
  }
}

/* Comparative optimization PnL history + manual stages. */
.extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header h3{
  margin:0 0 6px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header p{
  margin:0;
  color:rgba(228,234,242,.62);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header>span{
  flex:0 0 auto;
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  color:rgba(235,240,247,.72);
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filters{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:18px 0 12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:10px;
  background:rgba(255,255,255,.025);
  color:rgba(231,237,245,.58);
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,color .16s ease,opacity .16s ease;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter:hover,
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter.is-active{
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.055);
  color:rgba(246,249,252,.92);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter:not(.is-active){
  opacity:.52;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter i{
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--series-color,rgba(255,255,255,.45));
  box-shadow:0 0 12px color-mix(in srgb,var(--series-color,white) 44%,transparent);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter span{
  font-size:12px;
  font-weight:700;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-filter em{
  font-style:normal;
  font-size:9px;
  letter-spacing:.08em;
  color:rgba(255,255,255,.42);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-stack{
  position:relative;
  width:100%;
  height:330px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
  background:rgba(5,9,14,.52);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-layer{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  object-fit:fill;
  pointer-events:none;
  opacity:1;
  transition:opacity .16s ease;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-layer.is-grid{
  z-index:1;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-layer.is-series{
  z-index:2;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-curve-layer.is-hidden{
  opacity:0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card{
  padding:13px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:12px;
  background:rgba(255,255,255,.018);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card.is-baseline{
  border-color:rgba(143,211,255,.22);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card.is-accepted{
  border-color:rgba(131,230,180,.24);
  background:rgba(76,185,132,.035);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card>header strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card>header span{
  flex:0 0 auto;
  color:rgba(255,255,255,.44);
  font-size:9px;
  letter-spacing:.08em;
}
@media(max-width:980px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-stage-cards{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:680px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header{
    display:block;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-comparison>header>span{
    display:inline-block;
    margin-top:10px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-curve-stack{
    height:270px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-stage-cards{
    grid-template-columns:1fr;
  }
}


/* Client-triggered optimization stages. */
.algoagent-optimization-manual-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.algoagent-inline-note--manual-stage{
  border-left:3px solid rgba(125,211,252,.7);
}
.algoagent-btn--danger{
  border-color:rgba(248,113,113,.42);
  color:rgba(254,202,202,.96);
  background:rgba(127,29,29,.20);
}
.algoagent-btn--danger:hover:not(:disabled){
  background:rgba(153,27,27,.30);
}

/* =============================================================================
OPTIMIZATION INTRO LAYOUT
The generic action-row grid used an intrinsic-width auto column. The three-step
method panel expanded that column and squeezed the research note to a few
pixels, producing one-word lines and a very tall empty area. Optimization
content is a vertical document flow, not a two-column action bar.
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap:14px;
  width:100%;
  min-width:0;
  margin-top:14px;
  padding:16px;
  background:rgba(0,0,0,.18);
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions > *{
  width:100%;
  min-width:0;
  max-width:none;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions > .algoagent-inline-note{
  box-sizing:border-box;
  padding:16px 18px;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions > .algoagent-inline-note strong{
  margin-bottom:7px;
  font-size:12px;
  line-height:1.35;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions > .algoagent-inline-note p{
  max-width:1080px;
  color:rgba(255,255,255,.52);
  font-size:10px;
  line-height:1.65;
  overflow-wrap:normal;
  word-break:normal;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions .algoagent-optimization-method{
  width:100%;
  min-width:0;
  margin-top:0;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-actions .algoagent-optimization-method > div{
  min-width:0;
  min-height:96px;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-manual-actions{
  width:auto;
  align-self:flex-start;
  margin-top:0;
}

@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions{
    padding:12px;
    gap:12px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions > .algoagent-inline-note{
    padding:14px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions .algoagent-optimization-method > div{
    min-height:0;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-manual-actions{
    width:100%;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-manual-actions .algoagent-btn{
    flex:1 1 220px;
  }
}

/* Optimization stages, independent samples and cross-market clarity. */
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-list{
  display:grid;
  gap:14px;
  margin-top:16px;
  background:transparent;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row{
  position:relative;
  padding:18px 18px 16px;
  border:1px solid rgba(255,255,255,.095);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(255,255,255,.028),rgba(255,255,255,.012));
  box-shadow:0 18px 44px rgba(0,0,0,.18),inset 3px 0 0 rgba(255,255,255,.10);
  overflow:hidden;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row::before{
  content:"OPTIMIZATION STAGE " attr(data-optimization-stage);
  display:block;
  margin-bottom:10px;
  color:rgba(255,255,255,.30);
  font-size:8px;
  font-weight:800;
  letter-spacing:.13em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row.is-accepted{
  border-color:rgba(127,225,170,.20);
  background:linear-gradient(180deg,rgba(66,176,119,.065),rgba(255,255,255,.012));
  box-shadow:0 18px 44px rgba(0,0,0,.18),inset 3px 0 0 rgba(127,225,170,.62);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>p{
  max-width:1100px;
  margin:12px 0 0;
  font-size:10px;
  line-height:1.62;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row .algoagent-metrics{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.065);
}


/* =============================================================================
INDEPENDENT INSTRUMENT BASELINES + COMPACT OPTIMIZATION HISTORY
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-cards,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-list{
  display:flex;
  flex-direction:column;
  gap:14px;
  width:100%;
  margin-top:16px;
  background:transparent;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row{
  width:100%;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,.09);
  border-radius:15px;
  background:rgba(7,10,14,.86);
  overflow:hidden;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card{
  padding:16px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row{
  padding:18px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card>details,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>details{
  margin-top:14px;
  border-top:1px solid rgba(255,255,255,.065);
  padding-top:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-card>details>summary,
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>details>summary{
  cursor:pointer;
  color:rgba(235,240,247,.68);
  font-size:10px;
  font-weight:750;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-notes{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-notes h4{
  margin:8px 0 0;
  color:rgba(255,255,255,.76);
  font-size:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-stage-notes p{
  margin:0;
  color:rgba(255,255,255,.50);
  font-size:10px;
  line-height:1.55;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact{
  display:flex;
  flex-direction:row;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact>*{
  width:auto;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-action-note{
  color:rgba(255,255,255,.38);
  font-size:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-result--compact>header{
  margin-bottom:12px;
}

@media(max-width:720px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact{
    align-items:stretch;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact>*{
    width:100%;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-manual-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}

/* =============================================================================
JOB LOADERS, STAGE CARDS, OPTIMIZED PROMPT + CODE
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-job-loader{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  width:100%;
  box-sizing:border-box;
  margin:12px 0 16px;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:14px;
  background:rgba(8,12,17,.88);
  box-shadow:0 14px 34px rgba(0,0,0,.20);
}
.extended-html-body .algoagent--dashboard .algoagent-loader-spinner{
  width:18px;
  height:18px;
  box-sizing:border-box;
  border:2px solid rgba(255,255,255,.16);
  border-top-color:rgba(255,255,255,.82);
  border-radius:50%;
  animation:algoagent-loader-spin .8s linear infinite;
}
@keyframes algoagent-loader-spin{to{transform:rotate(360deg)}}
.extended-html-body .algoagent--dashboard .algoagent-job-loader strong{
  display:block;
  margin:0 0 3px;
  color:rgba(255,255,255,.86);
  font-size:11px;
}
.extended-html-body .algoagent--dashboard .algoagent-job-loader p{
  margin:0;
  color:rgba(255,255,255,.48);
  font-size:10px;
  line-height:1.45;
}
.extended-html-body .algoagent--dashboard .algoagent-job-loader em{
  color:rgba(255,255,255,.42);
  font-size:9px;
  font-style:normal;
  font-weight:800;
  letter-spacing:.08em;
  white-space:nowrap;
}

.extended-html-body .algoagent--dashboard .algoagent-code-panel,
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-panel{
  border:1px solid rgba(255,255,255,.09);
  border-radius:14px;
  background:rgba(5,8,12,.76);
  overflow:hidden;
}
.extended-html-body .algoagent--dashboard .algoagent-code-summary{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  box-sizing:border-box;
  padding:11px 14px;
  cursor:pointer;
  list-style:none;
  background:rgba(255,255,255,.025);
  transition:background .16s ease,border-color .16s ease;
}
.extended-html-body .algoagent--dashboard .algoagent-code-summary::-webkit-details-marker{display:none}
.extended-html-body .algoagent--dashboard .algoagent-code-summary:hover{background:rgba(255,255,255,.045)}
.extended-html-body .algoagent--dashboard .algoagent-code-summary strong{
  min-width:0;
  color:rgba(255,255,255,.82);
  font-size:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-code-summary em{
  margin-left:auto;
  color:rgba(255,255,255,.38);
  font-size:9px;
  font-style:normal;
  white-space:nowrap;
}
.extended-html-body .algoagent--dashboard .algoagent-source-badge{
  flex:0 0 auto;
  padding:6px 9px;
  border:1px solid rgba(126,194,255,.20);
  border-radius:999px;
  color:rgba(174,216,255,.88);
  background:rgba(76,143,201,.10);
  font:800 8px/1.1 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.04em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);
  gap:12px;
  padding:14px;
  border-top:1px solid rgba(255,255,255,.07);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid>section{
  min-width:0;
  border:1px solid rgba(255,255,255,.07);
  border-radius:12px;
  background:rgba(0,0,0,.22);
  overflow:hidden;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid>section>header{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid>section>header strong{
  color:rgba(255,255,255,.66);
  font-size:9px;
  letter-spacing:.04em;
}
.extended-html-body .algoagent--dashboard .algoagent-prompt-preview,
.extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid .algoagent-code-preview{
  max-height:560px;
  margin:0;
  padding:14px;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  color:rgba(234,239,245,.74);
  background:transparent;
  font:9px/1.58 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.extended-html-body .algoagent--dashboard .algoagent-dashboard-actions--candidate{
  align-items:flex-start;
}
.extended-html-body .algoagent--dashboard .algoagent-dashboard-actions--candidate>.algoagent-optimization-source-panel{
  flex:1 1 680px;
  min-width:0;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-history-list{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row{
  scroll-margin-top:24px;
  padding:0;
  overflow:hidden;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row::before{display:none;content:none}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head{
  padding:15px 17px;
  border-bottom:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.018);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-head>div{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.extended-html-body .algoagent--dashboard .algoagent-stage-number{
  flex:0 0 auto;
  padding:5px 8px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  color:rgba(255,255,255,.50);
  font-size:8px;
  font-weight:850;
  letter-spacing:.08em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>.algoagent-metrics{
  margin:0;
  padding:15px 17px;
  border-top:0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>details{
  margin:0;
  padding:0 17px 15px;
  border-top:0;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-history-row>details>summary{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:9px;
  background:rgba(255,255,255,.025);
}

@media(max-width:780px){
  .extended-html-body .algoagent--dashboard .algoagent-job-loader{
    grid-template-columns:auto minmax(0,1fr);
  }
  .extended-html-body .algoagent--dashboard .algoagent-job-loader em{
    grid-column:2;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-source-grid{
    grid-template-columns:1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-code-summary{
    flex-wrap:wrap;
  }
  .extended-html-body .algoagent--dashboard .algoagent-code-summary em{
    width:100%;
    margin-left:0;
  }
}

/* =============================================================================
CANCELLABLE OPTIMIZATION LOADER
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-btn--warning{
  border-color:rgba(251,191,36,.42);
  color:rgba(254,240,138,.96);
  background:rgba(120,53,15,.24);
}
.extended-html-body .algoagent--dashboard .algoagent-btn--warning:hover:not(:disabled){
  background:rgba(146,64,14,.34);
}
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-cancelled,
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-failed{
  border-color:rgba(248,113,113,.22);
  background:rgba(20,10,12,.82);
}
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-cancelled .algoagent-loader-spinner,
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-failed .algoagent-loader-spinner{
  animation:none;
  border-color:rgba(255,255,255,.16);
  border-top-color:rgba(255,255,255,.16);
}
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-cancelled .algoagent-loader-spinner::after,
.extended-html-body .algoagent--dashboard .algoagent-job-loader.is-failed .algoagent-loader-spinner::after{
  content:"";
  display:block;
  width:6px;
  height:2px;
  margin:6px auto 0;
  border-radius:2px;
  background:rgba(255,255,255,.52);
}

/* =============================================================================
OPTIONAL CLIENT SUGGESTION FOR ONE OPTIMIZATION STAGE
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion{
  flex:1 1 520px;
  min-width:280px;
  display:grid;
  gap:8px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-head strong{
  color:rgba(255,255,255,.80);
  font-size:11px;
  font-weight:760;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-head span{
  color:rgba(255,255,255,.40);
  font-size:9px;
  font-variant-numeric:tabular-nums;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-head span.is-near-limit{
  color:rgba(253,186,116,.92);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-input{
  display:block;
  width:100%;
  min-height:92px;
  box-sizing:border-box;
  resize:vertical;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  outline:none;
  color:rgba(248,250,252,.92);
  background:rgba(255,255,255,.035);
  font:inherit;
  font-size:11px;
  line-height:1.55;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-input::placeholder{
  color:rgba(255,255,255,.27);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-input:focus{
  border-color:rgba(125,211,252,.42);
  background:rgba(125,211,252,.045);
  box-shadow:0 0 0 3px rgba(125,211,252,.07);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-input:disabled{
  cursor:not-allowed;
  opacity:.48;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-help{
  margin:0;
  color:rgba(255,255,255,.36);
  font-size:9px;
  line-height:1.45;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact{
  align-items:flex-end;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact .algoagent-optimization-manual-actions{
  flex:0 1 auto;
  padding-bottom:20px;
}
@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion{
    flex-basis:100%;
    min-width:0;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-actions--compact .algoagent-optimization-manual-actions{
    width:100%;
    padding-bottom:0;
  }
}


/* Failed-stage suggestion retention and diagnostics. */
.extended-html-body .algoagent--dashboard .algoagent-optimization-suggestion-input:not(:placeholder-shown){
  border-color: rgba(118, 181, 255, .38);
  background: linear-gradient(180deg, rgba(30, 45, 62, .78), rgba(16, 23, 31, .84));
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-message.is-warning strong{
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* =============================================================================
CONTEXT ACTION STRIP, CHART WORKSPACE AND PROCESS DOCK
============================================================================= */
.extended-html-body .algoagent--dashboard > .algoagent-body{
  padding-bottom:122px;
}

.extended-html-body .algoagent--dashboard .algoagent-context-actions{
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  align-items:center;
  gap:18px;
  margin:-8px 0 16px;
  padding:12px 14px;
  border:0;
  background:
    linear-gradient(90deg,rgba(var(--algo-market-rgb),.075),rgba(255,255,255,.018) 42%,rgba(0,0,0,.20));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),inset 0 -1px 0 rgba(0,0,0,.46);
}
.extended-html-body .algoagent--dashboard .algoagent-context-actions__copy{
  min-width:0;
  display:grid;
  gap:3px;
}
.extended-html-body .algoagent--dashboard .algoagent-context-actions__copy strong{
  color:rgba(255,255,255,.82);
  font-size:10px;
  font-weight:820;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-context-actions__copy span{
  overflow:hidden;
  color:rgba(255,255,255,.36);
  font-size:9px;
  line-height:1.45;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.extended-html-body .algoagent--dashboard .algoagent-context-actions__buttons{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:7px;
}
.extended-html-body .algoagent--dashboard .algoagent-context-actions .algoagent-btn{
  min-height:34px;
  padding:0 12px;
}

.extended-html-body .algoagent--dashboard .algoagent-backtest-parameters{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,280px));
  gap:12px;
  align-items:start;
  padding:14px 16px;
  background:rgba(0,0,0,.16);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.extended-html-body .algoagent--dashboard .algoagent-chart-workspace{
  display:grid;
  gap:12px;
  min-width:0;
  padding:0;
}

.extended-html-body .algoagent--dashboard .algoagent-chart-workspace--optimization{
  padding-top:2px;
}

.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-shell{
  display:grid;
  gap:0;
  min-width:0;
  border:1px solid rgba(255,255,255,.065);
  background:rgba(0,0,0,.12);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-shell>header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  background:rgba(0,0,0,.22);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-shell>header h3{
  margin:0;
  color:rgba(255,255,255,.83);
  font-size:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-shell>header p{
  margin:3px 0 0;
  color:rgba(255,255,255,.36);
  font-size:9px;
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode-switch{
  display:flex;
  gap:1px;
  padding:2px;
  background:rgba(255,255,255,.035);
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode{
  min-height:31px;
  padding:0 11px;
  border:0;
  background:transparent;
  color:rgba(255,255,255,.38);
  font-size:8.5px;
  font-weight:820;
  letter-spacing:.075em;
  text-transform:uppercase;
  cursor:pointer;
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode:hover,
.extended-html-body .algoagent--dashboard .algoagent-chart-mode:focus-visible{
  color:rgba(255,255,255,.78);
  outline:none;
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode.is-active{
  background:rgba(var(--algo-market-rgb),.13);
  color:rgba(255,255,255,.91);
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode-panel{
  display:none;
  min-width:0;
  padding:12px;
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode-panel.is-active{
  display:block;
}
.extended-html-body .algoagent--dashboard .algoagent-chart-mode-panel>.algoagent-dashboard-section,
.extended-html-body .algoagent--dashboard .algoagent-chart-mode-panel>.algoagent-optimization-comparison{
  margin:0;
  border:0;
  background:transparent;
}

.extended-html-body .algoagent--dashboard .algoagent-process-dock{
  position:fixed;
  right:auto;
  bottom:12px;
  z-index:1200;
  box-sizing:border-box;
  grid-template-columns:auto minmax(0,1fr) auto;
  min-height:70px;
  margin:0;
  padding:12px 15px;
  border:1px solid rgba(255,255,255,.105);
  border-radius:0;
  background:
    linear-gradient(100deg,rgba(var(--algo-market-rgb),.12),rgba(8,11,15,.96) 28%,rgba(4,6,9,.97));
  box-shadow:0 22px 60px rgba(0,0,0,.62),inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter:blur(24px) saturate(120%);
  -webkit-backdrop-filter:blur(24px) saturate(120%);
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock small{
  display:block;
  margin-top:4px;
  color:rgba(255,255,255,.28);
  font-size:8px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-idle,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-finished,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-completed,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-cancelled,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-failed{
  min-height:58px;
  background:rgba(5,7,10,.93);
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock:is(.is-idle,.is-finished,.is-completed,.is-cancelled,.is-failed) .algoagent-loader-spinner{
  animation:none;
  border-color:rgba(255,255,255,.16);
  border-top-color:rgba(255,255,255,.16);
}
.extended-html-body .algoagent--dashboard .algoagent-danger-zone{
  margin-top:20px;
  padding-bottom:12px;
}

@media(max-width:820px){
  .extended-html-body .algoagent--dashboard > .algoagent-body{
    padding-bottom:138px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-context-actions{
    grid-template-columns:1fr;
    gap:10px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-context-actions__copy span{
    white-space:normal;
  }
  .extended-html-body .algoagent--dashboard .algoagent-context-actions__buttons{
    justify-content:flex-start;
  }
  .extended-html-body .algoagent--dashboard .algoagent-backtest-parameters{
    grid-template-columns:1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-chart-shell>header{
    align-items:flex-start;
    flex-direction:column;
  }
  .extended-html-body .algoagent--dashboard .algoagent-chart-mode-switch{
    width:100%;
  }
  .extended-html-body .algoagent--dashboard .algoagent-chart-mode{
    flex:1 1 50%;
  }
  .extended-html-body .algoagent--dashboard .algoagent-process-dock{
    bottom:8px;
    grid-template-columns:auto minmax(0,1fr);
    min-height:84px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-process-dock em{
    grid-column:2;
  }
}

/* =============================================================================
INLINE PROCESS LOG, SETTINGS SUBNAV AND TRANSACTION RUN SELECTOR
============================================================================= */
.extended-html-body .algoagent--dashboard > .algoagent-body{
  padding-bottom:24px;
}

.extended-html-body .algoagent--dashboard .algoagent-process-dock{
  position:relative;
  inset:auto;
  z-index:1;
  width:100%;
  min-height:62px;
  margin:0 0 16px;
  padding:12px 15px;
  transform:none;
  border:1px solid rgba(255,255,255,.085);
  background:
    linear-gradient(90deg,rgba(var(--algo-market-rgb),.075),rgba(8,11,15,.91) 32%,rgba(4,6,9,.93));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter:blur(18px) saturate(112%);
  -webkit-backdrop-filter:blur(18px) saturate(112%);
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-idle,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-finished,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-completed,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-cancelled,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-failed{
  min-height:58px;
}
.extended-html-body .algoagent--dashboard .algoagent-dashboard-panel--optimization>.algoagent-optimization-actions:first-child{
  margin-top:0;
  margin-bottom:14px;
}
.extended-html-body .algoagent--dashboard .algoagent-control-form+.algoagent-code-panel{
  margin-top:18px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selectors{
  display:grid;
  gap:10px;
  margin:0 0 12px;
  padding:12px;
  background:rgba(0,0,0,.22);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector__copy{
  display:grid;
  gap:3px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector__copy strong{
  color:rgba(255,255,255,.80);
  font-size:10px;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector__copy span{
  color:rgba(255,255,255,.36);
  font-size:9px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector__items{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:32px;
  padding:0 10px;
  border:1px solid rgba(255,255,255,.055);
  background:rgba(255,255,255,.018);
  color:rgba(255,255,255,.48);
  text-decoration:none;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector:hover,
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector:focus-visible{
  border-color:rgba(var(--algo-market-rgb),.30);
  color:rgba(255,255,255,.82);
  outline:none;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector.is-active{
  border-color:rgba(var(--algo-market-rgb),.38);
  background:rgba(var(--algo-market-rgb),.12);
  color:rgba(255,255,255,.92);
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector strong{
  font-size:9px;
  font-weight:780;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector em{
  color:rgba(255,255,255,.30);
  font-size:7px;
  font-style:normal;
  font-weight:820;
  letter-spacing:.08em;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector.is-active em{
  color:rgba(var(--algo-market-rgb),.88);
}
@media(max-width:820px){
  .extended-html-body .algoagent--dashboard > .algoagent-body{
    padding-bottom:22px;
  }

  .extended-html-body .algoagent--dashboard .algoagent-process-dock{
    margin-bottom:14px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-optimization-run-selector__items{
    display:grid;
    grid-template-columns:1fr;
  }
}

/* =============================================================================
FIXED PROCESS BAR
============================================================================= */
.extended-html-body .algoagent--dashboard > .algoagent-body{
  padding-bottom:104px;
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock{
  position:fixed;
  inset:auto auto 0 auto;
  z-index:1800;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  box-sizing:border-box;
  width:auto;
  min-width:280px;
  max-width:none;
  min-height:72px;
  margin:0;
  padding:12px 16px;
  transform:none !important;
  rotate:none;
  clip-path:none;
  border:1px solid rgba(255,255,255,.11);
  border-bottom:0;
  border-radius:0;
  background:
    linear-gradient(100deg,rgba(var(--algo-market-rgb),.13),rgba(8,11,15,.975) 28%,rgba(4,6,9,.985));
  box-shadow:0 -18px 48px rgba(0,0,0,.58),inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter:blur(24px) saturate(120%);
  -webkit-backdrop-filter:blur(24px) saturate(120%);
}
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-idle,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-finished,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-completed,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-cancelled,
.extended-html-body .algoagent--dashboard .algoagent-process-dock.is-failed{
  min-height:62px;
  background:rgba(5,7,10,.97);
}
@media(max-width:820px){
  .extended-html-body .algoagent--dashboard > .algoagent-body{
    padding-bottom:126px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-process-dock{
    bottom:0;
    grid-template-columns:auto minmax(0,1fr);
    min-width:0;
    min-height:92px;
    padding:11px 12px;
  }
  .extended-html-body .algoagent--dashboard .algoagent-process-dock em{
    grid-column:2;
  }
}

/* =============================================================================
PROCESS DOCK PORTAL — EXACT CLIENT BOX GEOMETRY
The dock is moved to document.body by JS, escaping every backdrop-filter or
transform that would otherwise redefine position:fixed coordinates. Its inline
left/width are measured from the real .algoagent--dashboard rectangle.
============================================================================= */
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]{
  position:fixed !important;
  z-index:1800;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  box-sizing:border-box;
  min-width:0 !important;
  max-width:none;
  min-height:72px;
  margin:0;
  padding:12px 16px;
  overflow:hidden;
  transform:none !important;
  rotate:none;
  clip-path:none;
  border:1px solid rgba(255,255,255,.11);
  border-bottom:0;
  border-radius:0;
  background:
    linear-gradient(100deg,rgba(var(--algo-market-rgb,215,220,228),.13),rgba(8,11,15,.975) 28%,rgba(4,6,9,.985));
  box-shadow:0 -18px 48px rgba(0,0,0,.58),inset 0 1px 0 rgba(255,255,255,.045);
  color:rgba(255,255,255,.66);
  font-family:var(--algo-dash-font,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
  backdrop-filter:blur(24px) saturate(120%);
  -webkit-backdrop-filter:blur(24px) saturate(120%);
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] > *{
  min-width:0;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] .algoagent-loader-spinner{
  width:18px;
  height:18px;
  box-sizing:border-box;
  border:2px solid rgba(255,255,255,.16);
  border-top-color:rgba(255,255,255,.82);
  border-radius:50%;
  animation:algoagent-loader-spin .8s linear infinite;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] strong{
  display:block;
  margin:0 0 3px;
  overflow:hidden;
  color:rgba(255,255,255,.86);
  font-size:11px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] p{
  margin:0;
  overflow:hidden;
  color:rgba(255,255,255,.48);
  font-size:10px;
  line-height:1.45;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] small{
  display:block;
  margin-top:4px;
  overflow:hidden;
  color:rgba(255,255,255,.28);
  font-size:8px;
  letter-spacing:.08em;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] em{
  color:rgba(255,255,255,.42);
  font-size:9px;
  font-style:normal;
  font-weight:800;
  letter-spacing:.08em;
  white-space:nowrap;
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]:is(.is-idle,.is-finished,.is-completed,.is-cancelled,.is-failed){
  min-height:62px;
  background:rgba(5,7,10,.97);
}
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]:is(.is-idle,.is-finished,.is-completed,.is-cancelled,.is-failed) .algoagent-loader-spinner{
  animation:none;
  border-color:rgba(255,255,255,.16);
  border-top-color:rgba(255,255,255,.16);
}
@media(max-width:820px){
  .extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]{
    grid-template-columns:auto minmax(0,1fr);
    min-height:92px;
    padding:11px 12px;
  }
  .extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] em{
    grid-column:2;
  }
  .extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] p{
    white-space:normal;
  }
}


/* =============================================================================
FOOTER-AWARE PROCESS DOCK
JS replaces this fallback with the exact visible footer/panel obstruction.
============================================================================= */
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]{
  bottom:var(--aa-internal-footer-h,0px);
  transition:bottom .16s ease;
}

/* =============================================================================
EDIT STRATEGY WORKSPACE
============================================================================= */


.extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-grid{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(420px,.95fr);
  gap:14px;
  align-items:start;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-form,
.extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-code{
  min-width:0;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-code .algoagent-code-panel{
  margin:0;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-code .algoagent-code-preview{
  max-height:680px;
  overflow:auto;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-list,
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-list{
  display:grid;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-row,
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:start;
  padding:11px 14px;
  border-top:1px solid rgba(255,255,255,.045);
  color:var(--algo-dash-muted);
  font-size:9px;
  line-height:1.45;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-row strong,
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row strong{
  color:rgba(255,255,255,.74);
  font-size:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-row em,
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row em{
  color:rgba(var(--algo-market-rgb),.72);
  font-size:8px;
  font-style:normal;
  letter-spacing:.08em;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-row.is-error{
  grid-template-columns:auto 1fr;
  background:rgba(237,166,174,.045);
  color:rgba(237,166,174,.76);
}
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row{
  grid-template-columns:1fr;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row > div{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row p{
  margin:0;
  color:var(--algo-dash-muted);
}
.extended-html-body .algoagent--dashboard .algoagent-edit-optimizer-row.is-accepted{
  background:rgba(130,221,176,.035);
}
@media(max-width:1040px){
  .extended-html-body .algoagent--dashboard .algoagent-edit-dashboard-grid,
  .extended-html-body .algoagent--dashboard .algoagent-edit-log-grid{
    grid-template-columns:1fr;
  }
}

/* =============================================================================
GENERATION MODEL RESPONSE / CONTROL LOG
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-attempt-log{
  border-top:1px solid rgba(255,255,255,.045);
  background:rgba(0,0,0,.08);
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-log > summary{
  list-style:none;
  cursor:pointer;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-log > summary::-webkit-details-marker{display:none;}
.extended-html-body .algoagent--dashboard .algoagent-attempt-log[open]{
  background:rgba(255,255,255,.014);
}
.extended-html-body .algoagent--dashboard .algoagent-edit-log-row.is-accepted{
  background:rgba(130,221,176,.04);
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-log-body{
  display:grid;
  gap:10px;
  padding:12px 14px 16px;
  border-top:1px solid rgba(255,255,255,.035);
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-metrics{
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:10px 0;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-message{
  display:grid;
  gap:5px;
  padding:10px 12px;
  background:rgba(0,0,0,.20);
  color:var(--algo-dash-muted);
  font-size:9px;
  line-height:1.5;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-message strong{
  color:rgba(255,255,255,.72);
  font-size:9px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-message pre{
  max-height:240px;
  margin:0;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
  color:inherit;
  font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-message.is-error{
  background:rgba(237,166,174,.045);
  color:rgba(237,166,174,.78);
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-response-panel{
  background:rgba(0,0,0,.22);
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-response-panel > summary{
  padding:10px 12px;
  cursor:pointer;
  color:rgba(255,255,255,.68);
  font-size:9px;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-attempt-response{
  max-height:680px;
  margin:0;
  padding:14px;
  overflow:auto;
  border-top:1px solid rgba(255,255,255,.04);
  background:#030405;
  color:rgba(255,255,255,.76);
  font:10px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  white-space:pre;
  tab-size:4;
}
@media(max-width:760px){
  .extended-html-body .algoagent--dashboard .algoagent-attempt-metrics{
    grid-template-columns:1fr 1fr;
  }
  .extended-html-body .algoagent--dashboard .algoagent-edit-log-row{
    grid-template-columns:1fr auto;
  }
  .extended-html-body .algoagent--dashboard .algoagent-edit-log-row > span{
    grid-column:1 / -1;
  }
}

/* =============================================================================
PRIMARY DASHBOARD NAVIGATION
The shared Build Strategy workspace is owned by account_algo_trading_agents.css.
This file only owns dashboard/runtime presentation.
============================================================================= */
/* Trading / Build Strategy are the only primary dashboard tabs. */
.extended-html-body .algoagent--dashboard .algoagent-dashboard-tabs .algoagent-dashboard-tab{
  min-width:150px;
}

.extended-html-body .algoagent--dashboard .algoagent-status--ready{
  color:var(--algo-dash-green);
}

/* =============================================================================
CLUSTER NAVIGATION + MULTI-INSTRUMENT CHART STACK
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-cluster-nav{
  display:grid;
  grid-template-columns:minmax(230px,.55fr) minmax(0,1.45fr);
  align-items:center;
  gap:18px;
  margin:0 0 16px;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.045);
  background:rgba(0,0,0,.22);
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-nav__copy{
  display:grid;
  gap:4px;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-nav__copy strong{
  color:rgba(255,255,255,.88);
  font-size:11px;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-nav__copy span{
  color:rgba(255,255,255,.38);
  font-size:8.5px;
  line-height:1.45;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pills{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:6px;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
  min-height:38px;
  padding:7px 11px;
  background:rgba(255,255,255,.028);
  color:rgba(255,255,255,.43);
  text-decoration:none;
  transition:background .16s ease,color .16s ease,transform .16s ease;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill strong{
  color:inherit;
  font-size:8.5px;
  font-weight:820;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill small{
  color:rgba(255,255,255,.30);
  font-size:7px;
  letter-spacing:.05em;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.90);
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill.is-active{
  background:rgba(var(--algo-market-rgb,255,255,255),.12);
  color:rgba(255,255,255,.96);
  box-shadow:inset 0 -1px 0 rgba(var(--algo-market-rgb,255,255,255),.68);
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-pill.is-active small{
  color:rgba(255,255,255,.58);
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-chart-stack{
  display:grid;
  gap:14px;
  min-width:0;
}
.extended-html-body .algoagent--dashboard .algoagent-cluster-chart-stack>.algoagent-dashboard-section--chart{
  margin:0;
}
.extended-html-body .algoagent--dashboard .algoagent-dashboard-section--cluster-pnl{
  margin-bottom:14px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-panel{
  display:none;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-panel.is-active{
  display:block;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-chart-mode-switch,
.extended-html-body .algoagent--dashboard .algoagent-optimization-transaction-runs{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 12px;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-transaction-run{
  padding:8px 10px;
  background:rgba(255,255,255,.025);
  color:rgba(255,255,255,.46);
  font-size:8px;
  text-decoration:none;
}
.extended-html-body .algoagent--dashboard .algoagent-optimization-transaction-run.is-active{
  background:rgba(var(--algo-market-rgb),.12);
  color:rgba(255,255,255,.90);
}
@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-cluster-nav{grid-template-columns:1fr;}
  .extended-html-body .algoagent--dashboard .algoagent-cluster-pills{justify-content:flex-start;}
}

/* =============================================================================
SIMPLE PROCESS LOADER
Only the spinner and the name of the current activity are visible.
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-job-loader,
.extended-html-body .algoagent--dashboard .algoagent-process-dock,
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]{
  grid-template-columns:auto minmax(0,1fr) !important;
  gap:12px !important;
  min-height:58px !important;
  padding:12px 16px !important;
}

.extended-html-body .algoagent--dashboard .algoagent-job-loader strong,
.extended-html-body .algoagent--dashboard .algoagent-process-dock strong,
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] strong{
  margin:0 !important;
  overflow:hidden;
  color:rgba(255,255,255,.86);
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}

.extended-html-body .algoagent--dashboard .algoagent-job-loader :is(p,small,em),
.extended-html-body .algoagent--dashboard .algoagent-process-dock :is(p,small,em),
.extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"] :is(p,small,em){
  display:none !important;
}

@media(max-width:820px){
  .extended-html-body .algoagent--dashboard .algoagent-job-loader,
  .extended-html-body .algoagent--dashboard .algoagent-process-dock,
  .extended-html-body > .algoagent-process-dock[data-aa-process-portal="1"]{
    grid-template-columns:auto minmax(0,1fr) !important;
    min-height:58px !important;
    padding:11px 12px !important;
  }
}

/* Shared Build Strategy / Hard Settings styles live in account_algo_trading_agents.css. */


/* =============================================================================
ALGORITHMIC TRADING TERMINAL — LLM terminal parity v1
Live Trading and Backtest share one market/order/PnL workspace.
============================================================================= */
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-runtime-workspace--terminal,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-trading-terminal{display:grid;gap:14px;min-width:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-summary-metrics{grid-template-columns:repeat(8,minmax(0,1fr));margin:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:11px 13px;border:0;background:linear-gradient(90deg,rgba(var(--algo-market-rgb),.10),rgba(255,255,255,.012) 42%,rgba(0,0,0,.24));box-shadow:inset 3px 0 0 rgba(var(--algo-market-rgb),.58),inset 0 1px 0 rgba(255,255,255,.035)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-copy{display:grid;gap:3px;min-width:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-copy strong{color:rgba(255,255,255,.86);font-size:11px;font-weight:700}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-copy small{color:rgba(255,255,255,.38);font-size:8px;letter-spacing:.08em;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-mode[hidden],.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-panel[hidden]{display:none!important}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-mode{min-width:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;min-width:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-hedge,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-multi:not(.is-hedge){grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card{margin:0;padding:0;border:0;background:rgba(0,0,0,.34);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 46px rgba(0,0,0,.24)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header{min-height:45px;margin:0;padding:9px 12px;border-bottom:1px solid rgba(255,255,255,.05);background:rgba(255,255,255,.012)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head h3,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header h3{margin:0;color:rgba(255,255,255,.90);font-size:12px;font-weight:680;letter-spacing:.02em}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head p,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header p{margin:3px 0 0;color:rgba(255,255,255,.31);font-size:8px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat{display:flex;align-items:baseline;gap:7px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat-label{color:rgba(255,255,255,.30);font-size:7px;letter-spacing:.10em;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat-value{color:rgba(255,255,255,.80);font-family:var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:10px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay{transition:opacity .14s ease,filter .14s ease}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay.is-open{opacity:.72}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay.is-open.is-dimmed{opacity:.17}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay.is-open.is-selected{opacity:1;filter:drop-shadow(0 0 5px rgba(255,255,255,.14))}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay.is-closed{opacity:0;visibility:hidden}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-trade-overlay.is-closed.is-selected{opacity:1;visibility:visible;filter:drop-shadow(0 0 6px rgba(240,200,121,.18))}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-canvas{position:relative;min-height:320px;overflow:hidden;background:#020304}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-canvas .algoagent-pnl-svg{width:100%;min-height:320px;height:auto}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-trade-marker{position:absolute;z-index:5;display:none;align-items:center;gap:7px;transform:translate(-5px,-5px);pointer-events:none}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-trade-marker.is-selected{display:flex}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-marker-dot{width:10px;height:10px;border:2px solid #050607;border-radius:50%!important;background:#f0c879;box-shadow:0 0 0 1px rgba(240,200,121,.60),0 0 15px rgba(240,200,121,.28)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-marker-label{max-width:190px;padding:4px 6px;overflow:hidden;background:rgba(0,0,0,.88);color:rgba(255,255,255,.76);box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);font-size:7px;font-weight:760;letter-spacing:.05em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-deal-box{min-width:0;overflow:hidden;background:rgba(0,0,0,.52);box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 18px 44px rgba(0,0,0,.18)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tabs{display:flex;min-width:0;overflow-x:auto;border-bottom:1px solid rgba(255,255,255,.055);background:rgba(255,255,255,.012)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab{position:relative;display:flex;align-items:center;gap:8px;min-height:43px;padding:0 16px;border:0;border-right:1px solid rgba(255,255,255,.035);border-radius:0!important;background:transparent;color:rgba(255,255,255,.38);cursor:pointer}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab strong{font-size:8px;font-weight:820;letter-spacing:.10em;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab span{display:inline-flex;align-items:center;justify-content:center;min-width:20px;min-height:20px;padding:0 5px;border-radius:999px!important;background:rgba(255,255,255,.045);color:rgba(255,255,255,.46);font-size:7px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab:hover{background:rgba(255,255,255,.025);color:rgba(255,255,255,.72)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab.is-active{background:rgba(var(--algo-market-rgb),.065);color:rgba(255,255,255,.92)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tab.is-active::after{content:"";position:absolute;right:13px;bottom:0;left:13px;height:2px;background:rgba(var(--algo-market-rgb),.76)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-panel{display:grid;gap:1px;min-width:0;padding:0;background:rgba(255,255,255,.025)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-panel-copy{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;padding:0 12px;background:rgba(0,0,0,.42);color:rgba(255,255,255,.36)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-panel-copy strong{color:rgba(255,255,255,.66);font-size:8px;letter-spacing:.10em;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-panel-copy span{font-size:8px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order{min-width:0;padding:0;border:0;border-bottom:1px solid rgba(255,255,255,.045);background:rgba(0,0,0,.44);color:rgba(255,255,255,.62);cursor:pointer;outline:0;transition:background .12s ease,box-shadow .12s ease}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order:hover,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order:focus-visible{background:rgba(255,255,255,.035)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order.is-selected{background:linear-gradient(90deg,rgba(var(--algo-market-rgb),.095),rgba(0,0,0,.52) 34%);box-shadow:inset 3px 0 0 rgba(var(--algo-market-rgb),.72)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order--open{background:linear-gradient(90deg,rgba(var(--algo-market-rgb),.045),rgba(0,0,0,.46) 26%)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line{display:grid;grid-template-columns:minmax(108px,1.05fr) repeat(5,minmax(88px,.72fr)) minmax(112px,.9fr);align-items:center;gap:0;min-height:52px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>*{min-width:0;padding:7px 10px;border-right:1px solid rgba(255,255,255,.035)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>*:last-child{border-right:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-symbol{display:flex;align-items:center;gap:7px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-symbol strong{color:rgba(255,255,255,.91);font-size:11px;font-weight:720}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-symbol span{color:rgb(var(--algo-market-rgb));font-size:7px;font-weight:840;letter-spacing:.09em}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pnl{display:grid;gap:3px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact small,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pnl small{color:rgba(255,255,255,.26);font-size:6.5px;font-weight:780;letter-spacing:.09em;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact strong,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pnl strong{overflow:hidden;color:rgba(255,255,255,.68);font-family:var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace);font-size:8px;font-weight:590;text-overflow:ellipsis;white-space:nowrap}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact.is-sl strong{color:#eda6ae}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact.is-tp strong{color:#82ddb0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-fact.is-reason strong{font-family:inherit;text-transform:uppercase}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pnl strong.is-positive{color:#82ddb0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pnl strong.is-negative{color:#eda6ae}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-audit-fold{margin-top:2px;overflow:hidden;background:rgba(0,0,0,.24);box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-audit-fold>summary{min-height:40px;padding:0 12px;display:flex;align-items:center;color:rgba(255,255,255,.34);font-size:8px;font-weight:800;letter-spacing:.10em;list-style:none;text-transform:uppercase;cursor:pointer}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-audit-fold>summary::-webkit-details-marker{display:none}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-audit-fold[open]>summary{color:rgba(255,255,255,.68);border-bottom:1px solid rgba(255,255,255,.05)}
@media(max-width:1120px){.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-summary-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line{grid-template-columns:minmax(110px,1fr) repeat(3,minmax(88px,.72fr)) minmax(110px,.9fr)}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(4),.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(5){display:none}}
@media(max-width:860px){.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-hedge,.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-multi:not(.is-hedge){grid-template-columns:1fr}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-bar{align-items:flex-start;flex-direction:column}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-runtime-actions{justify-content:flex-start}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line{grid-template-columns:minmax(105px,1fr) repeat(2,minmax(82px,.75fr)) minmax(102px,.9fr)}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(3),.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(4),.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(5){display:none}}
@media(max-width:620px){.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-summary-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line{grid-template-columns:minmax(110px,1fr) minmax(90px,.8fr) minmax(105px,.9fr)}.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-line>.lt-terminal-order-fact:nth-of-type(n+2){display:none}}

/* =============================================================================
NEW MARKET DATA / CANDLE CADENCE v1
Five asset classes, live-source badges, adaptive backtest controls and cluster
creation dialog. Integrated into the canonical account_algo_trading_agents.js.
============================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-cluster-market-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.extended-html-body .algoagent--dashboard .algoagent-market-live-badge,
.algoagent-cluster-modal .algoagent-market-live-badge{
  display:inline-flex;
  align-items:center;
  min-height:18px;
  padding:0 6px;
  border:0;
  background:rgba(91,221,155,.09);
  color:rgba(130,221,176,.88);
  font-size:6.5px;
  font-weight:850;
  letter-spacing:.10em;
  text-transform:uppercase;
  white-space:nowrap;
}
.extended-html-body .algoagent--dashboard .algoagent-market-live-badge.is-pseudo,
.algoagent-cluster-modal .algoagent-market-live-badge.is-pseudo{
  background:rgba(189,217,255,.075);
  color:rgba(189,217,255,.78);
}

.extended-html-body .algoagent--dashboard .algoagent-backtest-form.algoagent-backtest-parameters{
  grid-template-columns:repeat(3,minmax(155px,1fr));
  width:100%;
  max-width:none;
}
.extended-html-body .algoagent--dashboard .algoagent-input--select{
  width:100%;
  min-height:40px;
  padding:0 11px;
  appearance:none;
  -webkit-appearance:none;
  color:rgba(255,255,255,.82);
  background-color:rgba(52,53,56,.76);
  border:0;
  outline:0;
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-availability{
  grid-column:1/-1;
  min-height:34px;
  display:flex;
  align-items:center;
  padding:8px 11px;
  background:rgba(0,0,0,.18);
  color:rgba(255,255,255,.43);
  font-size:8px;
  line-height:1.45;
  letter-spacing:.04em;
}
.extended-html-body .algoagent--dashboard .algoagent-choice__option.is-unavailable{
  opacity:.28;
  pointer-events:none;
}

html.has-algo-cluster-modal,
html.has-algo-cluster-modal body{
  overflow:hidden!important;
}
.algoagent-cluster-modal[hidden]{display:none!important}
.algoagent-cluster-modal{
  position:fixed;
  z-index:10030;
  inset:0;
  display:grid;
  place-items:center;
  padding:22px;
  font-family:var(--algo-dash-font,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
}
.algoagent-cluster-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.76);
  backdrop-filter:blur(13px);
  -webkit-backdrop-filter:blur(13px);
}
.algoagent-cluster-modal__panel{
  position:relative;
  z-index:1;
  width:min(940px,100%);
  max-height:min(820px,calc(100vh - 44px));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.075);
  border-radius:0;
  background:rgba(5,6,8,.975);
  box-shadow:0 40px 120px rgba(0,0,0,.72),inset 0 1px 0 rgba(255,255,255,.035);
  color:rgba(255,255,255,.76);
}
.algoagent-cluster-modal__panel>header,
.algoagent-cluster-modal__panel>footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  background:rgba(255,255,255,.018);
}
.algoagent-cluster-modal__panel>header{
  border-bottom:1px solid rgba(255,255,255,.055);
}
.algoagent-cluster-modal__panel>footer{
  border-top:1px solid rgba(255,255,255,.055);
}
.algoagent-cluster-modal__panel>header>div{
  display:grid;
  gap:4px;
}
.algoagent-cluster-modal__panel>header span,
.algoagent-cluster-modal__panel>footer>span{
  color:rgba(255,255,255,.34);
  font-size:7px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.algoagent-cluster-modal__panel>header strong{
  color:rgba(255,255,255,.92);
  font-size:14px;
  font-weight:650;
}
.algoagent-cluster-modal__panel>footer>div{
  display:flex;
  gap:8px;
}
.algoagent-cluster-modal .algoagent-btn{
  min-height:36px;
  padding:0 12px;
  border:0;
  border-radius:0;
  background:rgba(255,255,255,.055);
  color:rgba(255,255,255,.68);
  cursor:pointer;
  font-size:8px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.algoagent-cluster-modal .algoagent-btn--primary{
  background:rgba(189,217,255,.12);
  color:rgba(255,255,255,.92);
}
.algoagent-cluster-modal .algoagent-btn:disabled{
  opacity:.28;
  cursor:not-allowed;
}
.algoagent-cluster-modal__markets{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1px;
  min-height:0;
  overflow:auto;
  background:rgba(255,255,255,.045);
}
.algoagent-cluster-modal__market{
  min-width:0;
  padding:14px;
  background:rgba(5,7,9,.985);
}
.algoagent-cluster-modal__market:last-child:nth-child(odd){grid-column:1/-1}
.algoagent-cluster-modal__market>.algoagent-cluster-market-heading>strong{
  color:rgba(255,255,255,.62);
  font-size:8px;
  letter-spacing:.12em;
}
.algoagent-cluster-modal__market>div:last-child{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.algoagent-cluster-modal__instrument{
  min-height:30px;
  padding:0 9px;
  border:0;
  border-radius:0;
  background:rgba(255,255,255,.035);
  color:rgba(255,255,255,.48);
  cursor:pointer;
  font-size:8px;
  font-weight:700;
  letter-spacing:.04em;
}
.algoagent-cluster-modal__instrument:hover:not(:disabled){
  background:rgba(255,255,255,.075);
  color:rgba(255,255,255,.82);
}
.algoagent-cluster-modal__instrument.is-selected{
  background:rgba(189,217,255,.14);
  color:#fff;
  box-shadow:inset 0 -1px 0 rgba(189,217,255,.58);
}
.algoagent-cluster-modal__instrument:disabled,
.algoagent-cluster-modal__instrument.is-capacity-blocked:not(.is-selected){
  opacity:.22;
  cursor:not-allowed;
}

@media(max-width:900px){
  .extended-html-body .algoagent--dashboard .algoagent-backtest-form.algoagent-backtest-parameters{
    grid-template-columns:repeat(2,minmax(150px,1fr));
  }
}
@media(max-width:620px){
  .extended-html-body .algoagent--dashboard .algoagent-backtest-form.algoagent-backtest-parameters,
  .algoagent-cluster-modal__markets{
    grid-template-columns:1fr;
  }
  .algoagent-cluster-modal__market:last-child:nth-child(odd){grid-column:auto}
  .algoagent-cluster-modal{padding:8px}
  .algoagent-cluster-modal__panel{max-height:calc(100vh - 16px)}
  .algoagent-cluster-modal__panel>header,
  .algoagent-cluster-modal__panel>footer{align-items:flex-start;flex-direction:column}
  .algoagent-cluster-modal__panel>footer>div{width:100%}
  .algoagent-cluster-modal__panel>footer .algoagent-btn{flex:1 1 0}
}

/* =============================================================================
PENDING LIMIT ORDERS
============================================================================= */
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order--pending{
  background:rgba(221,194,127,.035);
  box-shadow:inset 2px 0 0 rgba(221,194,127,.42);
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order--pending:hover{
  background:rgba(221,194,127,.055);
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order--pending .is-limit strong{
  color:#ddc27f;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pending-badge{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:2px 5px;
  background:rgba(221,194,127,.09);
  color:#ddc27f;
  font-size:7px;
  font-style:normal;
  font-weight:820;
  letter-spacing:.09em;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-order-pending-state strong{
  color:#ddc27f;
  font-size:8px;
  letter-spacing:.06em;
}
.extended-html-body .algoagent--dashboard .algoagent-limit-note{
  margin-top:10px;
  padding:12px 14px;
  box-shadow:inset 2px 0 0 rgba(221,194,127,.36);
}
.extended-html-body .algoagent--dashboard .algoagent-limit-note strong{
  display:block;
  margin-bottom:4px;
  color:#ddc27f;
  font-size:9px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-limit-note span{
  color:rgba(255,255,255,.48);
  font-size:9px;
  line-height:1.55;
}

/* =======================================================================
   Algo terminal live UX — 2026-08-24
   - success/process messages stay in console, not in client UI
   - scrollable candle canvas
   - dedicated Backtest progress bar
   ======================================================================= */
.extended-html-body .algoagent--dashboard .algoagent-feedback[hidden]{display:none!important}

.extended-html-body .algoagent--dashboard .algoagent-backtest-progress{
  margin:8px 0 12px;
  padding:9px 11px 8px;
  background:rgba(255,255,255,.018);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.055);
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress[hidden]{display:none!important}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__track{
  position:relative;
  height:4px;
  overflow:hidden;
  background:rgba(255,255,255,.07);
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__fill{
  height:100%;
  min-width:0;
  background:rgba(130,221,176,.78);
  transition:width .22s linear;
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__track.is-indeterminate .algoagent-backtest-progress__fill{
  width:32%!important;
  animation:aaAlgoBacktestIndeterminate 1.15s ease-in-out infinite;
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:6px;
  color:rgba(255,255,255,.38);
  font-size:8px;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__meta strong{color:rgba(255,255,255,.66);font-size:8px}
.extended-html-body .algoagent--dashboard .algoagent-backtest-progress__meta span{font-family:var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace)}
@keyframes aaAlgoBacktestIndeterminate{
  0%{transform:translateX(-120%)}
  50%{transform:translateX(120%)}
  100%{transform:translateX(310%)}
}

.extended-html-body .algoagent--dashboard .algoagent-feedback:empty{display:none!important}

/* =============================================================================
ALGO / LLM TERMINAL VISUAL PARITY — 2026-08-24
The engine structure may differ, but shared terminal components must render
with the same geometry, surfaces and typography.
============================================================================= */
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-trading-terminal{
  margin:0!important;
  padding:0!important;
  background:#020304!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card{
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:0!important;
  background:#020304!important;
  box-shadow:none!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  min-height:56px!important;
  margin:0!important;
  padding:11px 14px!important;
  border:0!important;
  border-bottom:1px solid rgba(255,255,255,.055)!important;
  background:rgba(255,255,255,.012)!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-titleline{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-live-ticker{
  display:inline-flex!important;
  align-items:center!important;
  min-height:19px!important;
  padding:0 7px!important;
  background:rgba(var(--algo-market-rgb),.075)!important;
  color:rgba(var(--algo-market-rgb),.88)!important;
  font-size:7px!important;
  font-weight:820!important;
  letter-spacing:.10em!important;
  text-transform:uppercase!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head h3,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header h3{
  margin:0!important;
  color:rgba(255,255,255,.90)!important;
  font-size:13px!important;
  font-weight:680!important;
  letter-spacing:.02em!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-head p,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-pnl-card>header p{
  margin:4px 0 0!important;
  color:rgba(255,255,255,.30)!important;
  font-size:8px!important;
  line-height:1.3!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat{
  display:flex!important;
  align-items:baseline!important;
  gap:7px!important;
  white-space:nowrap!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat-label{
  color:rgba(255,255,255,.29)!important;
  font-size:7.5px!important;
  font-weight:760!important;
  letter-spacing:.10em!important;
  text-transform:uppercase!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-stat-value{
  color:rgba(255,255,255,.82)!important;
  font:650 10.5px/1.1 var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace)!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-deal-box{
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:0!important;
  border-top:1px solid rgba(255,255,255,.055)!important;
  background:#030405!important;
  box-shadow:none!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-tabs{
  display:flex!important;
  align-items:stretch!important;
  gap:0!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 8px!important;
  overflow-x:auto!important;
  border:0!important;
  border-bottom:1px solid rgba(255,255,255,.055)!important;
  background:rgba(255,255,255,.012)!important;
}


/* =============================================================================
PRODUCTION TERMINAL CHART CONTRACT — 2026-08-24
Single owner for candle geometry, horizontal history scroll, fixed right price
scale and manual Y scaling. X is never a scale handle.
============================================================================= */
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card{
  --lt-chart-accent:#c5ccd6;
  --lt-chart-accent-rgb:197,204,214;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-market-forex{--lt-chart-accent:#82ddb0;--lt-chart-accent-rgb:130,221,176}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-market-crypto{--lt-chart-accent:#ddc27f;--lt-chart-accent-rgb:221,194,127}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-market-commodities{--lt-chart-accent:#e5e4e2;--lt-chart-accent-rgb:229,228,226}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-market-indices{--lt-chart-accent:#ae8eff;--lt-chart-accent-rgb:174,142,255}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-market-stocks{--lt-chart-accent:#69a6ff;--lt-chart-accent-rgb:105,166,255}

.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame{
  --lt-terminal-chart-h:clamp(390px,36vw,490px);
  --lt-price-scale:1;
  --lt-price-scale-origin-y:49.2857%;
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  align-items:start;
  width:100%;
  min-width:0;
  overflow:hidden;
  background:#020304;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-hedge .lt-terminal-chart-frame,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-grid.is-multi .lt-terminal-chart-frame{
  --lt-terminal-chart-h:clamp(320px,29vw,385px);
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-scroll{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  overscroll-behavior-x:contain;
  scrollbar-gutter:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.18) transparent;
  background:#020304!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-scroll::-webkit-scrollbar{height:8px}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-scroll::-webkit-scrollbar-track{background:rgba(255,255,255,.018)}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-scroll::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);border:2px solid #020304;border-radius:0}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-scroll::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.26)}

.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-canvas{
  position:relative!important;
  isolation:isolate!important;
  display:block!important;
  width:100%!important;
  height:var(--lt-terminal-chart-h)!important;
  min-height:var(--lt-terminal-chart-h)!important;
  max-width:none!important;
  aspect-ratio:auto!important;
  flex:0 0 auto!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:
    linear-gradient(rgba(255,255,255,.055),rgba(255,255,255,.055)) 0 4.2857%/100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.055),rgba(255,255,255,.055)) 0 26.7857%/100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.055),rgba(255,255,255,.055)) 0 49.2857%/100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.055),rgba(255,255,255,.055)) 0 71.7857%/100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.055),rgba(255,255,255,.055)) 0 94.2857%/100% 1px no-repeat,
    #020304!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-price-svg,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-chart-canvas>.algoagent-price-svg{
  position:absolute!important;
  z-index:1!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  object-fit:fill!important;
  transform:scaleY(var(--lt-price-scale,1));
  transform-origin:100% var(--lt-price-scale-origin-y,49.2857%);
  will-change:transform;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame .lt-terminal-trade-overlay{
  position:absolute!important;
  z-index:3!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  object-fit:fill!important;
  pointer-events:none!important;
  transform:scaleY(var(--lt-price-scale,1));
  transform-origin:100% var(--lt-price-scale-origin-y,49.2857%);
  will-change:transform;
}

.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis{
  position:relative;
  z-index:8;
  width:48px;
  height:var(--lt-terminal-chart-h);
  overflow:hidden;
  border-left:1px solid rgba(255,255,255,.065);
  background:#020304;
  color:rgba(255,255,255,.43);
  pointer-events:auto!important;
  cursor:ns-resize!important;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis:hover,
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis.is-scaling{
  background:rgba(255,255,255,.018);
  border-left-color:rgba(255,255,255,.12);
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis-tick{
  position:absolute;
  left:5px;
  right:2px;
  transform:translateY(-50%);
  overflow:hidden;
  color:rgba(255,255,255,.39);
  font:500 7px/1 var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace);
  font-variant-numeric:tabular-nums;
  text-align:left;
  text-overflow:clip;
  white-space:nowrap;
  pointer-events:none!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis-live{
  position:absolute;
  z-index:2;
  left:0;
  right:0;
  display:flex;
  align-items:center;
  min-height:16px;
  padding:0 4px;
  transform:translateY(-50%);
  overflow:hidden;
  background:var(--lt-chart-accent);
  color:#070809;
  font:750 8px/1 var(--algo-mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace);
  font-variant-numeric:tabular-nums;
  text-overflow:clip;
  white-space:nowrap;
  pointer-events:none!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card .lt-terminal-live-ticker{
  background:rgba(var(--lt-chart-accent-rgb),.075)!important;
  color:var(--lt-chart-accent)!important;
}
.extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-market-card.is-live-chart .lt-terminal-chart-stat-value{
  color:var(--lt-chart-accent)!important;
}
@media(max-width:620px){
  .extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-chart-frame{--lt-terminal-chart-h:320px;grid-template-columns:minmax(0,1fr) 44px}
  .extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis{width:44px}
  .extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis-tick{font-size:6.5px}
  .extended-html-body [data-aa-algo-agent-dashboard="1"] .lt-terminal-price-axis-live{font-size:7.5px}
}
