/* Trade inspector: presentation only; chart coordinates and data stay intact. */
#tradeDetail{width:min(1240px,calc(100vw - 40px));max-width:1240px;max-height:calc(100dvh - 36px);padding:18px 22px 20px;scrollbar-gutter:stable;border-radius:12px;background:var(--panel,#171b23);color:var(--text);font-size:13px;line-height:1.45}
#tradeDetail .dialoghead{position:sticky;top:-18px;z-index:3;background:var(--panel,#171b23);padding:10px 0 12px;margin:-8px 0 8px;gap:12px}
#tradeDetail .trade-heading{display:flex;align-items:center;gap:14px;min-width:0}
#tradeDetail .trade-heading h2{margin:0;min-width:0}
#tradeDetail .trade-heading .eyebrow{margin:0;padding:3px 7px;border:1px solid var(--line);border-radius:4px;font-size:10px;white-space:nowrap;letter-spacing:.06em;color:var(--muted)}
#tradeDetail .identity-detail .coin-icon{width:32px;height:32px;flex:0 0 32px}
#tradeDetail .identity-detail .history-identity-text>b{font-size:17px;letter-spacing:-.3px}
#tradeDetail .history-identity-text{gap:1px}
#tradeDetail .history-venue{font-size:10px}
#tradeDetail button,#tradeDetail select{min-height:32px;padding:6px 10px;font-size:12px;border-radius:6px;transition:border-color .12s,background-color .12s}
#tradeDetail #tradeSubtitle{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#tradeDetail .trade-stats{grid-template-columns:repeat(7,minmax(0,1fr));gap:0;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
#tradeDetail .trade-stat{padding:2px 12px;min-width:0}
#tradeDetail .trade-stat:first-child{padding-left:0}
#tradeDetail .trade-stat:last-child{padding-right:0}
#tradeDetail .trade-stat span{font-size:11px;margin-bottom:5px;line-height:1.4}
#tradeDetail .trade-stat b{font-family:var(--font-data);font-size:15px;line-height:1.45;font-weight:650;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#tradeDetail .trade-recheck{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:10px 0}
#tradeDetail .trade-recheck>p{flex:1;margin:0;font-size:11px}
#tradeDetail p:empty{display:none}
#tradeDetail details{padding:10px 12px;margin-top:10px;border:1px solid var(--line);border-radius:6px}
#tradeDetail details summary{font-size:12px;font-weight:550;cursor:pointer;color:var(--muted);transition:color .12s}
#tradeDetail details summary:hover,#tradeDetail details[open]>summary{color:var(--text)}
#tradeDetail details summary:focus-visible{outline:2px solid var(--accent,#aa93f5);outline-offset:4px}
#tradeDetail .trade-audit{margin:0 0 0 auto;padding:0;border:0;max-width:100%}
#tradeDetail .trade-audit[open]{flex:1 1 100%;margin:0;padding:10px 12px;background:var(--bg,#101319);border:1px solid var(--line)}
#tradeDetail .trade-audit-content p{margin:8px 0 0;font-size:11px;overflow-wrap:anywhere}
#tradeDetail #tradeCoverage{margin:8px 0 12px;padding:8px 10px;font-size:11px;line-height:1.5;border-left-width:2px;background:rgba(160,137,230,.055)}
#tradeDetail .chart-toolbar{margin-top:0;gap:8px;min-height:32px}
#tradeDetail .chart-toolbar h3{font-size:13px;margin:0 auto 0 0}
#tradeDetail .chart-toolbar label{font-size:11px}
#tradeDetail .candle-controls{gap:8px;padding:6px 0;margin:0;align-items:end}
#tradeDetail .candle-controls label{font-size:10px;gap:3px}
#tradeDetail .candle-controls select{min-width:105px;max-width:100%}
#tradeDetail #candleStatus{font-size:11px;line-height:1.45;margin:6px 0}
#tradeDetail .chart-legend{font-size:10px;color:var(--muted);margin:6px 0}
#tradeDetail .chart-readout{font-size:11px;line-height:1.5;padding:7px 10px;min-height:32px;margin:8px 0;border-radius:5px;overflow-wrap:anywhere}
#tradeDetail .trade-chart{min-height:0}
#tradeDetail .trade-chart svg{min-height:0}
#tradeDetail #tpTimeline{font-family:var(--font-ui);font-size:11px;line-height:1.65;margin-top:8px;color:var(--muted)}
#tradeDetail #tpTimeline b{color:var(--text);font-weight:600}
#tradeDetail #chartNote{font-size:11px;line-height:1.5;margin:8px 0 14px}
#tradeDetail>h3{font-size:13px;margin:14px 0 6px}
#tradeDetail #executionAuditStatus{margin:0 0 8px;font-size:11px}
#tradeDetail .history-table th{padding:9px 10px;font-size:10px}
#tradeDetail .history-table td{padding:9px 10px;font-size:12px}
#tradeDetail .history-table small{font-size:10px;line-height:1.4;margin-top:3px}
#tradeDetail .trade-logs{font-size:11px;max-height:280px}
@media(min-width:761px) and (max-width:1080px){#tradeDetail .trade-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 0}#tradeDetail .trade-stat:nth-child(3n+1){padding-left:0;border-left:0}}
@media(max-width:760px){#tradeDetail{width:calc(100vw - 16px);max-width:calc(100vw - 16px);padding:12px;max-height:calc(100dvh - 16px);border-radius:9px}#tradeDetail .dialoghead{top:-12px;margin-top:-4px;padding-top:6px}#tradeDetail .trade-heading{gap:8px;flex-wrap:wrap}#tradeDetail .identity-detail .history-identity-text>b{font-size:16px}#tradeDetail .trade-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 0}#tradeDetail .trade-stat:nth-child(odd){padding-left:0;border-left:0}#tradeDetail .trade-stat b{font-size:14px}#tradeDetail .chart-toolbar h3{flex-basis:100%}#tradeDetail .chart-toolbar label{flex:1}#tradeDetail .candle-controls{gap:6px}#tradeDetail .candle-controls label{flex:1 1 40%}#tradeDetail .candle-controls button{flex:1 1 auto}#tradeDetail .trade-chart{overflow:auto}#tradeDetail .trade-chart svg{min-width:600px}#tradeDetail #tradeSubtitle{font-size:11px}#tradeDetail .trade-recheck{gap:8px}#tradeDetail .trade-settings{grid-template-columns:1fr 1fr;gap:8px}}
@media(prefers-reduced-motion:reduce){#tradeDetail button,#tradeDetail select,#tradeDetail summary{transition:none}}

/* Confirmed entry fill, separate from PNL and configured notional. */
.history-runs .entry-fill{white-space:normal;overflow-wrap:anywhere;font-size:11px;line-height:1.5;margin-top:7px;color:var(--muted)}
.entry-fill b{font-variant-numeric:tabular-nums;font-weight:600}
.entry-fill-partial b{color:#e8ba75}
.entry-fill-detail{display:flex;flex-wrap:wrap;gap:6px 20px;padding:10px 12px;margin:0 0 12px;border-left:2px solid var(--accent,#a99af2);background:rgba(169,154,242,.055);font-size:12px;line-height:1.6}
.entry-fill-note{flex-basis:100%;font-size:11px;color:var(--muted)}
/* Period PNL: a compact summary, separate from reconciliation controls. */
.bots-lab .history-pnl{padding:20px;border:1px solid var(--line);border-radius:10px;background:var(--panel);margin:20px 0}
.bots-lab .pnl-panel-top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.bots-lab .history-pnl-heading{display:block;margin:0}
.bots-lab .history-pnl-heading h2{margin:0 0 5px;font-size:16px}
.bots-lab .history-pnl-heading p{margin:0;font-size:12px;color:var(--muted)}
.bots-lab .history-recheck{display:flex;align-items:flex-end;gap:8px;margin:0}
.bots-lab .history-recheck label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--muted)}
.bots-lab .history-recheck select,.bots-lab .history-recheck button{min-height:34px;padding:6px 10px;font-size:12px}
.bots-lab #recheckMessage:empty{display:none}
.bots-lab .history-pnl .pnl-periods{gap:0;margin:20px 0 0;padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.bots-lab .history-pnl .pnl-period{border-left:1px solid var(--line);padding:0 18px;gap:10px;min-width:0}
.bots-lab .history-pnl .pnl-period:first-child{padding-left:0;border-left:0}
.bots-lab .history-pnl .pnl-period:last-child{padding-right:0}
.bots-lab .pnl-period-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.bots-lab .pnl-period-state{font-size:10px;color:var(--muted)}
.bots-lab .pnl-period-state.is-pending,.bots-lab .pnl-excluded{color:#e2b77b}
.bots-lab .history-pnl .pnl-period>strong{font-size:clamp(19px,1.6vw,26px);letter-spacing:-.5px;line-height:1.3}
.bots-lab .pnl-currency{font-family:var(--font-ui);font-size:11px;font-weight:500;letter-spacing:0;color:var(--muted)}
.bots-lab .pnl-period-meta{display:flex;flex-direction:column;gap:4px;font-size:11px;line-height:1.5;color:var(--muted)}
.bots-lab .pnl-period-meta b{font-weight:600;font-variant-numeric:tabular-nums}
.bots-lab .pnl-method{margin-top:12px;font-size:12px;color:var(--muted)}
.bots-lab .pnl-method summary{cursor:pointer;width:fit-content}
.bots-lab .pnl-method summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.bots-lab .pnl-method p{max-width:1000px;font-size:12px;line-height:1.6;margin:10px 0 0}
@media(max-width:1050px){.bots-lab .history-pnl .pnl-periods{gap:20px 0}.bots-lab .history-pnl .pnl-period:nth-child(odd){border-left:0;padding-left:0}.bots-lab .history-pnl .pnl-period:nth-child(even){padding-right:0}}
@media(max-width:560px){.bots-lab .history-pnl{padding:14px}.bots-lab .history-pnl .pnl-periods{grid-template-columns:1fr}.bots-lab .history-pnl .pnl-period{padding:0 0 14px!important;border-left:0;border-bottom:1px solid var(--line)}.bots-lab .history-pnl .pnl-period:last-child{padding-bottom:0!important;border-bottom:0}.bots-lab .history-recheck{width:100%}.bots-lab .history-recheck label{flex:1}.bots-lab .history-recheck button{flex:1}}
.bots-lab .history-pnl details.pnl-method{padding:0;border:0;background:none;border-radius:0;margin:12px 0 0}
.bots-lab .history-pnl details.pnl-method summary{padding:0;margin:0}
.bots-lab .pnl-currency{margin-left:4px}

.bots-lab #pnlScope:empty{display:none}
.bots-lab .history-pnl .pnl-periods{grid-template-columns:repeat(2,minmax(0,1fr))}
.bots-lab .history-pnl details.pnl-daily{padding:0;border:0;background:none;margin:14px 0 0}
.bots-lab .pnl-daily summary{cursor:pointer;font-size:13px;font-weight:600}
.bots-lab #dailyTotal{margin-left:14px;font-variant-numeric:tabular-nums}
.bots-lab .pnl-daily-scroll{max-height:340px;overflow:auto;margin-top:10px;border:1px solid var(--line);border-radius:6px}
.bots-lab .pnl-daily-table{width:100%;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums}
.bots-lab .pnl-daily-table th,.bots-lab .pnl-daily-table td{padding:9px 12px;border-bottom:1px solid var(--line);text-align:right}
.bots-lab .pnl-daily-table th{position:sticky;top:0;background:var(--panel);color:var(--muted);font-weight:500}
.bots-lab .pnl-daily-table th:first-child,.bots-lab .pnl-daily-table td:first-child{text-align:left}
.bots-lab .pnl-daily-table tr:last-child td{border-bottom:0}
.bots-lab .pnl-daily-table tbody tr:hover{background:rgba(160,160,180,.04)}
.bots-lab .history-pnl .history-recheck{flex-wrap:wrap}
@media(max-width:560px){.bots-lab .history-pnl .pnl-periods{grid-template-columns:1fr}.bots-lab .history-pnl .history-recheck label{flex:1 1 40%}}
.bots-lab .history-dates{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin:16px 0 0;padding-top:14px;border-top:1px solid var(--line)}
.bots-lab .history-dates label{display:flex;flex-direction:column;gap:5px;font-size:11px;color:var(--muted)}
.bots-lab .history-dates input{min-height:34px;padding:6px 10px;font:500 12px var(--font-ui);font-variant-numeric:tabular-nums;color-scheme:dark;max-width:100%}
.bots-lab .history-dates button{min-height:34px;font-size:12px;padding:6px 12px}
.bots-lab .history-dates .foot{margin:0;padding-bottom:8px;font-size:11px}
.bots-lab .date-range-dash{padding-bottom:7px;color:var(--muted)}
@media(max-width:560px){.bots-lab .history-dates label{flex:1;min-width:120px}.bots-lab .date-range-dash{display:none}.bots-lab .history-dates button{width:100%}}
/* Range calendar — shared violet accents, native dialog focus handling. */
.bots-lab #rangeCalendar{width:min(680px,calc(100vw - 24px));max-width:680px;max-height:calc(100dvh - 24px);overflow:auto;padding:22px;border:1px solid #383342;border-radius:16px;background:#171820;color:#e8e9ef;box-shadow:0 24px 90px #0009;font-family:var(--font-ui);animation:calendar-enter .16s ease-out}
#rangeCalendar::backdrop{background:rgba(5,7,12,.65);backdrop-filter:blur(3px)}
.bots-lab #rangeCalendar button{min-height:34px;font:550 13px var(--font-ui);border-radius:7px;cursor:pointer;transition:background .12s,color .12s,box-shadow .12s,transform .12s}
.bots-lab #rangeCalendar button:focus-visible{outline:2px solid #b8a6ff;outline-offset:2px}
.calendar-header{display:flex;justify-content:space-between;align-items:center;gap:16px}
.calendar-eyebrow{font-size:10px;font-weight:600;letter-spacing:.12em;color:#9a8acb}
.bots-lab #rangeTitle{font-size:20px;letter-spacing:-.4px;margin:5px 0 0}
.bots-lab #rangeCalendar .calendar-icon{width:34px;padding:0;font-size:24px;color:#b7b3c7;border:0;background:transparent}
.bots-lab #rangeCalendar .calendar-icon:hover{background:#ffffff0c;color:white}
.calendar-selection{display:flex;align-items:center;gap:12px;margin:20px 0 14px;color:#80758e}
.bots-lab #rangeCalendar .calendar-selection button{flex:1;padding:10px;background:#111219;border:1px solid #34313e;color:#b9bbca;font-variant-numeric:tabular-nums}
.bots-lab #rangeCalendar .calendar-selection button.is-active{border-color:#a48aea;color:#ddd1ff;box-shadow:0 0 0 3px #a48aea12}
.calendar-navigation{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.bots-lab #rangeToday{background:transparent;border:0;color:#a9a1bd;font-size:12px}
#rangeMonths{display:grid;grid-template-columns:1fr 1fr;gap:26px}
.calendar-month h3{font-size:14px;font-weight:600;text-transform:capitalize;margin:0 0 14px;text-align:center}
.calendar-grid,.calendar-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.calendar-weekdays span{text-align:center;font-size:11px;color:#838598;padding:5px 0 9px}
.bots-lab #rangeCalendar .calendar-day{padding:0;aspect-ratio:1;min-height:30px;background:transparent;border:1px solid transparent;color:#d1d3df;font-variant-numeric:tabular-nums}
.bots-lab #rangeCalendar .calendar-day:hover{background:#a48aea20;transform:translateY(-1px)}
.bots-lab #rangeCalendar .calendar-day.is-today{border-color:#8f7fc2}
.bots-lab #rangeCalendar .calendar-day.is-between{background:#a48aea16;color:#cfc0f5;border-radius:4px}
.bots-lab #rangeCalendar .calendar-day.is-edge{background:#8970d3;color:#fff;box-shadow:0 2px 8px #0003}
.calendar-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:20px;padding-top:16px;border-top:1px solid #ffffff0c}
#rangeHint{font-size:12px;margin:0 0 5px;color:#d2ccde}.calendar-footer small{font-size:11px;color:#8d8b9e}
.bots-lab #rangeApply{background:#8065ce;border:1px solid #977de0;color:white;padding:9px 15px;white-space:nowrap}
.bots-lab #rangeApply:disabled{opacity:.4;cursor:default}
.bots-lab .history-dates .calendar-launch{display:flex;align-items:center;gap:8px;background:#a48aea12;border:1px solid #a48aea50;color:#c5b6ed}
.bots-lab .history-dates input::-webkit-calendar-picker-indicator{display:none}
@keyframes calendar-enter{from{opacity:0;transform:translateY(7px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:560px){.bots-lab #rangeCalendar{padding:16px}#rangeMonths{grid-template-columns:1fr;gap:22px}.calendar-footer{position:sticky;bottom:-16px;background:#171820;padding:12px 0;flex-wrap:wrap}.calendar-footer>div{flex:1}.bots-lab .history-dates .calendar-launch{width:100%}.bots-lab #rangeCalendar .calendar-day{aspect-ratio:auto;min-height:36px}}
@media(prefers-reduced-motion:reduce){.bots-lab #rangeCalendar{animation:none}.bots-lab #rangeCalendar button{transition:none}.bots-lab #rangeCalendar .calendar-day:hover{transform:none}}
