body:has(#terminal:not([hidden])){background:#000;font-family:"Segoe UI",Arial,sans-serif}
body:has(#terminal:not([hidden])) .topbar{height:30px;min-height:30px;padding:0 8px;background:#f3f3f3;color:#424242;border:0;justify-content:flex-start;gap:5px}
body:has(#terminal:not([hidden])) .brand{font-size:11px;letter-spacing:0;font-weight:500;gap:4px}
body:has(#terminal:not([hidden])) .brand svg{width:13px;height:13px;color:#178f6e}
body:has(#terminal:not([hidden])) .product{font-size:11px;border:0;padding:0;color:#555}
body:has(#terminal:not([hidden])) .account-tools{position:absolute;right:9px;top:31px;height:38px;z-index:3;font-size:11px;gap:6px}
body:has(#terminal:not([hidden])) .account-tools button,.account-chip{font-size:11px;padding:2px 5px}
#terminal{--base:var(--win-NeutralTertiaryToggleButton);--soft:var(--win-TertiaryBackground);--box:var(--win-SecondaryBackground);--deep:var(--win-QuaternaryBackground);--accent:var(--win-AccentPositiveButton);--fg:var(--win-PrimaryOneTextIcons);--dim:var(--win-SecondaryTextIcons);display:block;max-width:none;min-height:0;margin:0;padding:0 7px 7px;background:var(--base);color:var(--fg);font:12px "Segoe UI",Arial,sans-serif}
#terminal button,#terminal input,#terminal select,#terminal summary{font:inherit;color:inherit}
#terminal button{background:var(--soft);border:0;border-radius:2px;padding:3px 6px}
#terminal button:disabled{opacity:.57}
#terminal button:focus-visible,#terminal input:focus-visible,#terminal select:focus-visible,#terminal summary:focus-visible{outline:1px solid #94c4a7;outline-offset:-1px}
#terminal button:not(:disabled):hover{background:var(--win-NeutralPrimaryButton)}
#terminal button[aria-pressed=true],#terminal button[aria-selected=true]{background:var(--box);box-shadow:inset 0 -1px var(--accent)}
#terminal .win-shell{height:calc(100dvh - 37px);min-height:550px;display:grid;grid-template-columns:22.25% minmax(0,1fr) 17.5%;grid-template-rows:39px minmax(0,1fr) 23px;gap:0 6px}
#terminal .win-shell.hide-watch{grid-template-columns:36px minmax(0,1fr) 17.5%}
#terminal .win-shell.hide-ticket{grid-template-columns:22.25% minmax(0,1fr) 0}
#terminal .win-shell.hide-watch.hide-ticket{grid-template-columns:36px minmax(0,1fr) 0}
#terminal .left-native{grid-column:1;grid-row:1/4;min-width:0;display:flex;flex-direction:column;background:var(--base)}
#terminal .nav-top{height:39px;flex:none;background:var(--soft)}
#terminal .nav-top button,#terminal .left-native>button,#terminal .nav-lower button{width:100%;display:flex;align-items:center;gap:12px;height:39px;border-radius:0;text-align:left}
#terminal .nav-top button span:last-child,#terminal .hide-watch .left-native button span:not(.win-icon),#terminal .hide-watch .nav-foot{display:none}
#terminal .left-native>button[data-win=TradeTab_AId]{background:var(--accent)}
#terminal .nav-lower{margin-top:auto}
#terminal .nav-lower button{border-bottom:1px solid var(--base);background:linear-gradient(90deg,var(--accent) 37px,var(--soft) 37px);opacity:1}
#terminal .nav-lower .win-icon,#terminal .left-native>button .win-icon{margin-left:4px}
#terminal .nav-foot{height:40px;display:flex;align-items:center;gap:2px;background:var(--soft)}
#terminal .nav-foot button span:last-child{display:none}
#terminal .nav-foot button{padding:5px}
#terminal .workspace-tools{grid-column:2/4;grid-row:1;display:flex;align-items:center;gap:2px;padding-right:175px;min-width:0;overflow-x:auto;scrollbar-width:none;white-space:nowrap}
#terminal .workspace-tools button{background:transparent;flex:none;border-radius:2px;height:25px;display:grid;place-items:center;padding:2px 4px}
#terminal .workspace-tools button[aria-pressed=true]{background:var(--box)}
#terminal #focus-order{border:1px solid #888;margin-right:3px;font-size:11px;height:21px;padding:0 7px}
#terminal .native-tabs{display:flex;gap:1px}
#terminal .order-types{display:grid;grid-template-columns:repeat(4,minmax(max-content,1fr))}
#terminal .native-tabs button{flex:1;white-space:nowrap;min-width:0;padding:3px 2px;font-size:11px}
#terminal #watch-dock{padding-top:4px;min-width:0}
#terminal .watch-search{display:flex;align-items:center;gap:5px;padding:4px 3px}
#terminal .watch-search input{min-width:0;width:62%;padding:2px 4px;background:var(--deep);border:0;font-size:11px}
#terminal .watch-search>span{margin-left:auto;font-size:10px;color:var(--dim)}
#terminal #watch-group{width:100%;text-align:left;background:var(--box);margin:2px 0}
#terminal .watch{width:100%;border:0}
#terminal .watch td{padding:3px 5px;text-align:right;white-space:nowrap;font-size:11px}
#terminal .watch td:first-child{text-align:left}
#terminal .watch tbody tr{background:var(--base);box-shadow:none}
#terminal .watch button{background:transparent;padding:0}
#terminal .center-dock{grid-column:2;grid-row:2;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(160px,1fr) 34px minmax(130px,34.25vh) 46px}
#terminal .chart-deck{display:grid;grid-template-columns:minmax(0,1fr) 30px;gap:5px;min-height:0}
#terminal .chart-tiles{min-height:0;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:5px}
#terminal .chart-tile{min-width:0;min-height:0;display:flex;flex-direction:column;background:#000;border:3px solid var(--soft);border-radius:3px;overflow:hidden;position:relative}
#terminal .chart-tile[data-primary=true]{grid-column:1/-1;border-color:var(--box)}
#terminal .chart-tile header{background:var(--soft);height:23px;flex:none;display:flex;align-items:center;font-size:11px;gap:4px}
#terminal .chart-tile[data-active=true] header{background:var(--box)}
#terminal .chart-name{font-weight:600;background:transparent}
#terminal .chart-tile img{display:block;min-height:0;flex:1;width:100%;height:0;object-fit:fill;border:0;background:#000}
#terminal .chart-tile .load{font-size:10px;color:var(--dim);margin-left:auto;margin-right:5px}
#terminal .chart-tiles.single{display:flex}
#terminal .chart-tiles.single .chart-tile{flex:1}
#terminal .chart-tiles.crosshair img{cursor:crosshair}
#terminal .draw-tools{display:flex;flex-direction:column;align-items:center;overflow:hidden;border-radius:3px;background:var(--box);padding-top:4px}
#terminal .draw-tools button{background:none;width:26px;height:25px;padding:3px}
#terminal .ranges{display:flex;align-items:center;gap:5px;padding:3px 0;overflow:hidden}
#terminal #bar-detail{color:var(--dim);font-size:11px;white-space:nowrap}
#terminal .trade-watch{display:flex;min-width:0;min-height:0;flex-direction:column;background:var(--box);padding:0 5px 5px}
#terminal .watch-tabs{display:flex;gap:2px;align-items:center;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;background:var(--base);margin:0 -5px;padding-top:1px}
#terminal .watch-tabs button{font-size:11px;flex:none;height:24px}
#terminal .count{font-size:10px;padding:0 4px;margin-left:2px;background:var(--box)}
#terminal .trade-watch-body{margin-top:5px;min-height:0;flex:1;background:var(--base);overflow:auto;border-radius:2px}
#terminal .positions-panel{min-height:0}
#terminal table th,#terminal table td{padding:4px 7px;font-size:11px;font-weight:400}
#terminal table th{color:var(--dim);background:var(--base);border-right:1px solid var(--soft)}
#terminal .empty{font-size:11px;color:var(--dim)}
#terminal #orders-panel:not([hidden]) + #no-orders{display:none}
#terminal .account-summary{grid-template-columns:repeat(4,minmax(0,1fr));border:0;border-radius:0;background:var(--box);padding:3px 0;align-items:center}
#terminal .account-summary>div{text-align:center;padding:0 3px;border-color:var(--soft)}
#terminal .account-summary span,#terminal .account-summary strong{font-size:11px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}
#terminal .account-summary span{color:var(--dim);margin:0}
#terminal .symbol-dock{grid-column:3;grid-row:2;display:flex;flex-direction:column;min-width:0;overflow:auto;scrollbar-width:thin;background:var(--base);border-left:4px solid var(--box);padding:0 4px}
#terminal .symbol-dock>header,#terminal details>summary{background:var(--soft);padding:5px 7px}
#terminal .symbol-dock>select{background:var(--deep);border:1px solid var(--box);margin:3px;padding:2px}
#terminal .symbol-dock details{border:4px solid var(--box);border-radius:2px;margin:3px 0;min-width:0}
#terminal details>summary{cursor:pointer}
#terminal .ticket{padding:8px 7px}
#terminal .ticket>strong{display:block;font-size:12px;margin:0 0 7px}
#terminal .trade-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin:8px 0}
#terminal .trade-actions button{background:var(--deep);min-height:42px;border-radius:2px;padding:4px;display:flex;flex-direction:column;align-items:center}
#terminal .trade-actions .sell{color:var(--win-AccentNegativeButton)}
#terminal .trade-actions .buy{color:var(--win-AccentPositiveTextIcons)}
#terminal .trade-actions button[aria-pressed=true]{border:1px solid currentColor;box-shadow:none}
#terminal .trade-actions strong{font-size:16px}
#terminal .spread{font-size:11px;padding:5px 0}
#terminal .ticket-entry,#terminal .ticket-quantity{display:contents}
#terminal:is([data-ticket-kind="LIMIT"],[data-ticket-kind="STOP"]) .ticket-entry{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px;margin-top:10px
}
#terminal:is([data-ticket-kind="LIMIT"],[data-ticket-kind="STOP"]) .ticket-quantity{display:block;min-width:0}
#terminal:is([data-ticket-kind="LIMIT"],[data-ticket-kind="STOP"]) .ticket .spread{display:none}
#terminal:is([data-ticket-kind="LIMIT"],[data-ticket-kind="STOP"]) .trade-actions button{min-height:24px;justify-content:center}
#terminal #trigger-price{height:19px;margin-top:3px;color:var(--win-PrimaryOneTextIcons)}
#terminal #trigger-hint{display:block;text-align:start;padding:0;margin:0 0 5px}
#terminal #trigger-hint[hidden],#terminal #trigger-field[hidden]{display:none}
#terminal .lot-control{margin:3px 0 12px;border:0;background:var(--deep);border-radius:0}
#terminal .lot-control input{padding:4px;width:100%;min-width:0}
#terminal #submit-order{width:100%;background:var(--accent);color:#fff;font-weight:600}
#terminal .depth{min-height:90px;flex:1}
#terminal .depth>div{display:flex;gap:7px;justify-content:center;color:var(--dim);font-size:11px;padding:10px 2px}
#terminal .aux p{font-size:11px;padding:10px;color:var(--dim)}
#terminal .status-native{grid-column:2/4;grid-row:3;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--dim)}
#terminal .status-native #quote-status:before{content:"";display:inline-block;border-radius:50%;width:6px;height:6px;background:#f49c24;margin-right:4px}
#terminal .status-native #quote-status.fresh:before{background:var(--accent)}
@media(max-width:1000px){#terminal .win-shell{grid-template-columns:19% minmax(0,1fr) 23%}#terminal .workspace-tools{padding-right:160px}#terminal .draw-tools{display:none}#terminal .chart-deck{grid-template-columns:1fr}}
@media(max-width:730px){#terminal{padding:0 3px 3px}#terminal .win-shell,#terminal .win-shell.hide-watch,#terminal .win-shell.hide-ticket,#terminal .win-shell.hide-watch.hide-ticket{display:flex;flex-direction:column;height:auto;min-height:0;gap:3px}#terminal .left-native>button,#terminal .nav-lower,#terminal .nav-foot{display:none}#terminal .nav-top{height:26px}#terminal .nav-top button{width:35px;height:25px}#terminal .workspace-tools{min-height:31px;padding:0}#terminal .center-dock{grid-template-rows:450px 25px 140px 40px}#terminal .symbol-dock{min-height:200px}#terminal .status-native{min-height:22px}body:has(#terminal:not([hidden])) .account-tools{top:31px;height:25px}#terminal .account-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:0}#terminal .account-summary span,#terminal .account-summary strong{font-size:9px}}

body:has(#terminal:not([hidden])) .brand span{color:#424242}
#terminal .margin-pip,#terminal .protection-flags{display:grid;grid-template-columns:1fr 1fr;gap:5px;font-size:11px}
#terminal .margin-pip b{display:block;font-weight:400}
#terminal .protection-flags{margin:7px 0;color:var(--dim)}
#terminal .protection-flags input{vertical-align:middle;margin:0}
#terminal .note-native{display:block;font-size:11px;color:var(--dim)}
#terminal .note-native input{display:block;width:100%;height:21px;margin-bottom:5px;background:var(--deep);border:1px solid var(--soft)}
#terminal .depth{min-height:70px;flex:1}
#terminal .ticket .spread{display:flex;justify-content:center;gap:4px;color:var(--win-PrimaryOneTextIcons)}
#terminal .ticket .lot-control{max-width:145px}
#terminal .ticket .protection-flags{row-gap:12px;margin:12px 0;line-height:20px}
#terminal .ticket .protection-flags label{white-space:nowrap}
#terminal #order-protections>div{min-width:0}
#terminal #order-protections input[inputmode]{display:block;width:100%;max-width:145px;background:var(--deep);border:1px solid var(--soft);margin-top:3px;padding:3px}
#terminal #order-protections input[hidden],#terminal #entry-protection-hint[hidden]{display:none}
#terminal #entry-protection-hint{display:block;margin-bottom:5px;color:var(--dim)}
#terminal .ticket-comment{display:block;position:relative;margin:5px 0}
#terminal .ticket-comment textarea{display:block;width:100%;min-height:45px;padding:5px 6px 16px;resize:vertical;border:1px solid var(--soft);border-radius:3px;background:var(--deep);color:var(--win-PrimaryOneTextIcons);font:inherit}
#terminal .ticket-comment span{position:absolute;bottom:3px;right:7px;font-size:10px;color:var(--dim);pointer-events:none}
#terminal .ticket .order-types{grid-template-columns:1fr .85fr .85fr 1.4fr}
#terminal .ticket .order-types button{min-width:0}
#terminal .symbol-dock .aux{min-height:30px}
#terminal .symbol-dock .aux:nth-last-child(2),#terminal .symbol-dock .aux:nth-last-child(3){height:11.7vh;min-height:45px}

#terminal .win-chart-options, #terminal .win-chart-options-sub {
  position: fixed; z-index: 501; padding: 3px; min-width: 168px;
  border: 1px solid var(--win-SecondaryBackground); background: var(--base); color: var(--fg);
}
#terminal .win-chart-options-sub {
  position: absolute; top: 0; min-width: 184px; max-height: 95vh; overflow-y: auto;
}
#terminal .win-chart-options[hidden], #terminal .win-chart-options-sub[hidden] { display: none; }
#terminal .win-chart-options button {
  width: 100%; min-height: 25px; display: flex; gap: 8px; align-items: center;
  padding: 3px 6px; border: none; font: inherit; color: inherit; background: transparent; text-align: left;
}
#terminal .win-chart-options button:is(:hover,:focus-visible) { background: var(--soft); }
#terminal .win-chart-options kbd { margin-left: auto; color: var(--dim); font: inherit; }
#terminal .win-chart-options button[aria-checked]::before { content: ''; min-width: 12px; }
#terminal .win-chart-options button[aria-checked=true]::before { content: '✓'; }

#terminal .win-chart-zoomer { display:flex; flex:none; gap:0; align-items:center; }
#terminal .win-chart-zoomer button { width:25px; height:25px; padding:0; }
#terminal .win-chart-zoomer button:is(:hover,:active) { background:transparent; }
#terminal .win-chart-zoomer svg {
  display:block; width:19px; height:19px; fill:var(--win-PrimaryOneTextIcons);
  opacity:.7; border-radius:2px;
}
#terminal .win-chart-zoomer button:not(:disabled):hover svg { opacity:1; background:var(--win-TertiaryBackground); }
#terminal .win-chart-zoomer button:not(:disabled):active svg { background:var(--win-NeutralPrimaryButton); }
#terminal #win-zoom-popup {
  position:fixed; z-index:502; padding:5px; border-radius:3px; color:var(--fg);
  background:var(--win-QuaternaryBackground); box-shadow:0 2px 7px #0009;
}
#terminal #win-zoom-popup[hidden] { display:none; }
#terminal .win-zoom-panel { display:flex; align-items:center; width:200px; min-height:25px; }
#terminal .win-zoom-panel output { margin-left:10px; color:inherit; font:inherit; line-height:1; }
#terminal .win-zoom-panel input {
  appearance:none; box-sizing:border-box; width:150px; height:25px; min-width:0;
  padding:0; margin:0; border:0; border-radius:0; cursor:pointer;
  background:linear-gradient(to right,var(--win-AccentPositiveTextIcons) var(--zoom-fill),
    var(--win-SecondaryBackground) var(--zoom-fill)) center / calc(100% - 11px) 1px no-repeat;
}
#terminal .win-zoom-panel input::-webkit-slider-runnable-track { height:11px; background:transparent; }
#terminal .win-zoom-panel input::-webkit-slider-thumb {
  appearance:none; width:11px; height:11px; border:0; border-radius:50%; background:#bdbdbd;
  box-shadow:0 1px 3px #0005;
}
#terminal .win-zoom-panel input::-moz-range-track { background:transparent; }
#terminal .win-zoom-panel input::-moz-range-thumb {
  width:11px; height:11px; border:0; border-radius:50%; background:#bdbdbd; box-shadow:0 1px 3px #0005;
}
#terminal .win-chart-zoomer button:disabled { opacity:1; }
#terminal .win-chart-zoomer button:disabled svg { opacity:.35; }
#terminal .win-zoom-panel input:is(:hover,:active)::-webkit-slider-thumb { background:#e0e0e0; }
#terminal .win-zoom-panel input:is(:hover,:active)::-moz-range-thumb { background:#e0e0e0; }

#terminal[data-empty-market=true] .chart-deck{display:grid;grid-template-columns:1fr;place-items:center}
#terminal[data-empty-market=true] .chart-deck > :not(#empty-markets),
#terminal[data-empty-market=true] #ticket-dock > :not(header){display:none}
#terminal[data-empty-market=true] .workspace-tools,#terminal[data-empty-market=true] #positions-new-order{opacity:.45}
#empty-markets{margin:1rem;color:var(--PrimaryOneTextIcons);text-align:center}
