/* V2.4: each strategy owns its controls; the action follows the user. */
html { scroll-padding-bottom: 112px; }
main { padding-bottom: 132px; }
.workspace { grid-template-columns: 350px minmax(0,1fr); }
.setup-intro { margin: 0; padding: 15px 20px; font-size: 12px; line-height: 1.8; color: var(--muted); border-bottom: 1px solid var(--line); }
.setup-intro span { font-weight: 650; color: var(--ink); }
.strategy-card { margin: 0 0 13px; border: 1px solid #d8e2f0; border-radius: 12px; overflow: hidden; background: #fafcff; transition: border-color .18s,background .18s; }
.strategy-card.is-selected { border-color: #8ca9df; background: #f4f7ff; box-shadow: 0 0 0 1px rgba(81,119,190,.05); }
.strategy-card .strategy-option { margin: 0; padding: 14px 12px; border: 0; border-radius: 0; gap: 8px; min-height: 70px; }
.strategy-card .strategy-option:has(input:checked) { background: transparent; }
.strategy-card .strategy-option:hover { background: rgba(99,143,211,.08); }
.strategy-card .strategy-option input { width: 17px; height: 17px; margin-top: 2px; }
.strategy-card .strategy-option strong { font-size: 13px; line-height: 1.55; font-weight: 650; }
.strategy-card .strategy-option small { font-size: 11px; line-height: 1.7; }
.strategy-card .strategy-option>span:last-child { min-width: 0; overflow-wrap: anywhere; }
.strategy-card .strategy-color { margin-top: 7px; }
.strategy-settings { margin: 0 12px; padding: 0 0 14px; border-top: 1px solid #dbe4f2; }
.strategy-settings.dca-controls { margin: 0 12px; padding: 13px 0 14px; border: 0; border-top: 1px solid #dbe4f2; border-radius: 0; background: transparent; }
.strategy-settings[hidden] { display: none !important; }
.settings-caption { font-size: 11px; font-weight: 600; color: #486b9d; margin: 0 0 12px; }
.strategy-settings .field-label { margin-top: 13px; }
.strategy-settings .dca-fields { gap: 10px; }
.strategy-settings select,.strategy-settings input { height: 40px; }
.dca-presets button { min-height: 34px; }
.dca-presets button[aria-pressed="true"] { background: #e0eaff; border-color: #8ca9df; color: #274fa7; }
.strategy-help { font-size: 11px; line-height: 1.8; margin-top: 12px; color: var(--muted); }
.strategy-help summary { cursor: pointer; color: var(--ink); }
.strategy-help p { margin-bottom: 0; }
.strategy-card .strategy-definition { border: 0; border-top: 1px solid #dbe4f2; padding: 11px 0 13px; margin: 0 12px; border-radius: 0; }
.strategy-card .strategy-definition summary { font-size: 11px; }
.custom-settings { padding-top: 12px; }
.custom-settings .import-orders { padding: 0; gap: 10px; }
.custom-settings .upload-button { font-size: 12px; padding: 11px; }
.model-entry { display: block; margin-top: 13px; text-align: left; line-height: 1.7; }
.custom-settings .field-note { margin-top: 7px; }
.run-area { padding: 20px; }
.run-button { min-height: 50px; font-size: 15px; letter-spacing: .2px; }
.run-button:focus-visible { outline-width: 3px; outline-offset: 4px; }
.execution-dock { display: none; position: fixed; z-index: 40; bottom: 16px; left: 244px; right: 24px; gap: 18px; align-items: center; padding: 14px 16px 14px 20px; background: rgba(248,252,255,.97); border: 1px solid #b6cbe6; border-radius: 16px; box-shadow: 0 12px 34px rgba(25,58,102,.2),inset 0 1px 0 #fff; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
body:has(#view-backtest:not([hidden])) .execution-dock { display: flex; }
.dock-copy { flex: 1; min-width: 0; }
.dock-copy strong { display: block; font-size: 13px; color: #294c7a; line-height: 1.6; }
.dock-copy span { display: block; font-size: 11px; color: #5b7192; margin-top: 3px; line-height: 1.5; }
.dock-results { flex: 0 0 auto; color: #416796; font-size: 12px; min-height: 44px; padding: 6px 9px; border: 1px solid transparent; border-radius: 8px; }
.dock-results:hover:not(:disabled) { background: #e6effb; border-color: #bad0ed; }
.dock-run { width: 190px; flex: 0 0 190px; }
.execution-dock[data-state="dirty"] { border-color: #ccad62; }
.execution-dock[data-state="dirty"] .dock-copy strong { color: #806019; }
.execution-dock[data-state="busy"] .dock-copy strong { color: #345ac0; }
.toast { bottom: 118px; }
.focus-row { flex-wrap: wrap; }
.focus-row>span:first-child { font-size: 12px; font-weight: 600; color: var(--ink); }
.focus-row select { min-height: 40px; max-width: 100%; font-size: 12px; padding: 5px 9px; border: 1px solid var(--line); }
.focus-tip { display: block; flex-basis: 100%; margin: -2px 0 3px; line-height: 1.6; font-size: 11px; }
#resultContent,.results { scroll-margin-top: 20px; }
.results:has(#dirtyNote:not([hidden])) #resultContent { opacity: .63; }
.table-downloads { display: flex; gap: 13px; flex-wrap: wrap; align-items: center; }
.table-downloads .link-button { min-height: 36px; }
.trade-tools { align-items: flex-start; flex-wrap: wrap; }
.trade-tools>div:first-child { flex: 1 1 100%; }
.trade-tools select { max-width: 55%; flex: 1; }
.trade-tools input { max-width: 45%; flex: 1; }
/* Dark colors are centralized in quant.css. */
@media (max-width:1080px) {
  .execution-dock { left:22px; right:22px; }
  .workspace { grid-template-columns:330px minmax(0,1fr); }
}
@media (max-width:820px) {
  .workspace { display:block; }
  .execution-dock { left:12px; right:12px; bottom:10px; gap:10px; padding:11px 12px; }
  .dock-run { flex-basis:165px; width:165px; }
  .dock-summary { font-size:10px; }
  .dock-results { display:none; }
  .setup input[type=date],.setup input[type=number],.setup select { font-size:16px; min-height:44px; }
  .strategy-card .strategy-option strong { font-size:14px; }
  .strategy-card .strategy-option small,.strategy-settings .field-note { font-size:12px; }
  .strategy-settings { margin-left:14px; margin-right:14px; }
  .strategy-settings.dca-controls { margin-left:14px; margin-right:14px; }
  .focus-row select { width:100%; }
}
@media (max-width:480px) {
  main { padding-bottom:154px; }
  .execution-dock { flex-wrap:wrap; gap:8px; padding:11px 12px; }
  .dock-copy { flex:1 1 100%; }
  .dock-copy strong { font-size:12px; }
  .dock-copy span { font-size:10px; margin-top:0; }
  .dock-run { flex:1 1 auto; min-height:46px; }
  .dock-results { display:block; order:2; font-size:11px; }
  .dock-copy span { white-space:normal; }
  .toast { bottom:160px; }
  .table-downloads { gap:9px; }
}
@media print { .execution-dock { display:none!important; } main { padding-bottom:0; } }

/* Confirmed audit fixes: readable full-value entry, recovery actions and visible mobile navigation. */
.metric-details { display: block; min-height: 32px; margin-top: 3px; font-size: 11px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.market-load-notice { margin: -7px 0 18px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.market-load-notice p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.market-load-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.market-load-actions .link-button { min-height: 36px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width:820px) {
  .sidebar nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: visible; gap: 6px; padding-bottom: 0; }
  .sidebar .nav-item { width: 100%; min-width: 0; min-height: 44px; padding: 8px 6px; gap: 4px; justify-content: center; text-align: center; font-size: 12px; }
  .sidebar .nav-item svg { width: 15px; height: 15px; flex-basis: 15px; }
}
@media (max-width:380px) {
  .sidebar .nav-item { font-size: 11px; }
  .sidebar .nav-item svg { width: 14px; height: 14px; flex-basis: 14px; }
}

/* Start with a choice, then reveal the settings for that strategy. */
.strategy-selection-hint { margin: -3px 0 14px; }
#selectStrategiesButton { margin-top: 22px; }
