/* Compact, readable Algorithms filters. */
#algorithmsWorkspace .algorithms-live-filter-inner { padding: 6px !important; }
#algorithmsWorkspace .algorithms-live-filters { overflow: visible !important; }
#algorithmsWorkspace .algorithms-live-filter-inner,
#algorithmsWorkspace .algorithms-live-filter-inner * { font-family: Arial, Helvetica, sans-serif !important; }
#algorithmsWorkspace .algorithms-filter-section {
  padding: 6px; margin: 0 0 6px; border: 1px solid #26354c; border-radius: 8px;
  background: #0b1522;
}
#algorithmsWorkspace .algorithms-filter-section h3 {
  margin: 0 0 6px; font-size: 11px; font-weight: 850; letter-spacing: .04em;
}
#algorithmsWorkspace .algorithms-filter-section h3 > b { font-size: 11px; }
#algorithmsWorkspace .algorithms-filter-section > small { display: none; }
#algorithmsWorkspace .algorithms-number { height: 34px; border-radius: 6px; overflow: hidden; }
#algorithmsWorkspace .algorithms-number input { padding-inline: 6px; font-size: 13px; font-weight: 800; }
#algorithmsWorkspace .algorithms-number span { padding-inline: 6px; font-size: 10px; font-weight: 800; }
#algorithmsWorkspace .algorithms-segment { gap: 6px; }
#algorithmsWorkspace .algorithms-segment button { height: 34px; font-size: 12px; font-weight: 850; border-radius: 6px; }
#algorithmsWorkspace .algorithms-reset { height: 36px; margin-top: 0; font-size: 12px; font-weight: 850; border-radius: 6px; }

/* Same gold edge control for closing and reopening the panel. */
#algorithmsWorkspace .algorithms-filter-toggle {
  position: absolute !important;
  z-index: 4;
  left: clamp(-44px,-1.7vw,-34px) !important;
  right: auto !important;
  top: 6px !important;
  width: clamp(34px,1.7vw,44px) !important;
  height: clamp(34px,1.5vw,44px) !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  transform: none !important;
  color: #ffd044 !important;
  border: 1px solid #e5a600 !important;
  border-radius: 7px 0 0 7px !important;
  background: linear-gradient(180deg,#3a2b06,#211907) !important;
  box-shadow: inset 0 0 0 1px rgba(255,194,38,.13),0 0 12px rgba(255,185,0,.08) !important;
  font-size: clamp(19px,.7vw,28px) !important;
  line-height: 1 !important;
  cursor: pointer;
}
#algorithmsWorkspace .algorithms-live-shell.filters-closed .algorithms-filter-toggle { transform: rotate(180deg) !important; }
#algorithmsWorkspace .algorithms-filter-toggle:hover,
#algorithmsWorkspace .algorithms-filter-toggle:focus-visible {
  outline: 0;
  border-color: #ffd044 !important;
  background: linear-gradient(180deg,#4a3607,#2b2008) !important;
  box-shadow: inset 0 0 0 1px rgba(255,211,84,.2),0 0 16px rgba(255,185,0,.18) !important;
}

/* Runtime-inserted exchange and listing controls follow the same spacing. */
#algorithmsWorkspace .algorithms-exchange-controls { padding: 0; border: 0; background: transparent; }
#algorithmsWorkspace .algorithms-exchange-controls > h3 { display: none; }
#algorithmsWorkspace .algorithms-exchange-grid { overflow: hidden; border-radius: 10px; }
#algorithmsWorkspace .algorithms-exchange-grid-head,
#algorithmsWorkspace .algorithms-exchange-control-row {
  grid-template-columns: minmax(0,1fr) 40px 26px 40px 26px; gap: 6px; padding-inline: 6px;
}
#algorithmsWorkspace .algorithms-exchange-grid-head { height: 28px; font-size: 9px; }
#algorithmsWorkspace .algorithms-exchange-control-row { height: 36px; }
#algorithmsWorkspace .algorithms-exchange-control-row > span { gap: 6px; }
#algorithmsWorkspace .algorithms-exchange-control-row b { font-size: 12px; font-weight: 850; }
#algorithmsWorkspace .algorithms-exchange-control-row small { font-size: 7px; }
#algorithmsWorkspace .algorithms-switch em { width: 40px; }
#algorithmsWorkspace .algorithms-switch input:checked + em:after { left: 20px; }
#algorithmsWorkspace .algorithms-switch input:checked + em { background: linear-gradient(180deg,#ffc235,#f29c00); }
#algorithmsWorkspace .algorithms-listing-filter { margin: 0 0 6px; padding: 6px; border-radius: 8px; }
#algorithmsWorkspace .algorithms-listing-filter > header { gap: 6px; }
#algorithmsWorkspace .algorithms-listing-filter header small,
#algorithmsWorkspace .algorithms-listing-help { display: none; }
#algorithmsWorkspace .algorithms-listing-filter strong { font-size: 11px; font-weight: 850; }
#algorithmsWorkspace .algorithms-listing-filter header button { padding-inline: 6px; font-size: 10px; border-radius: 6px; }
#algorithmsWorkspace .algorithms-market-chips { margin-top: 6px; }
#algorithmsWorkspace .algorithms-listings-status { margin-top: 6px; }

/* Keep the Algorithms drawer attached to the visible header edge. */
#algorithmsWorkspace { --algorithms-header-offset: 58px; }
.scalpy-header.is-panel-hidden ~ #algorithmsWorkspace {
  --algorithms-header-offset: 0px;
}
#algorithmsWorkspace .algorithms-live-filters {
  top: var(--algorithms-header-offset) !important;
  height: calc(100vh - var(--algorithms-header-offset)) !important;
  height: calc(100dvh - var(--algorithms-header-offset)) !important;
  transition: transform .25s ease, top .42s cubic-bezier(.22,.61,.36,1), height .42s cubic-bezier(.22,.61,.36,1) !important;
}
