/* Two independent lower drawers share the bottom edge with chart readouts. */
.workspace #bottomDrawerRail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  flex: 0 0 auto;
  min-height: 27px;
  padding: 0 10px;
  color: var(--soft);
  background: var(--surface2);
  border-top: 1px solid var(--line);
}
#bottomDrawerRail .chart-footer { display: contents; }
#bottomDrawerRail .chart-footer > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  grid-row: 1;
  font-size: 9px;
}
#bottomDrawerRail .chart-footer > span:first-child { grid-column: 1; }
#bottomDrawerRail #dotsDetail { grid-column: 3; text-align: right; }
#bottomDrawerRail #barCount { grid-column: 4; text-align: right; }
.bottom-drawer-handles {
  grid-area: 1 / 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: stretch;
  gap: 4px;
}
.workspace #bottomDrawerRail .lower-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid var(--control-line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: var(--surface);
  color: var(--soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.workspace #bottomDrawerRail .lower-handle[aria-expanded="true"] {
  color: var(--blue);
  border-color: var(--active-line);
  background: var(--active);
}
.workspace #bottomDrawerRail .lower-handle:hover { border-color: var(--blue); color: var(--blue); }
.workspace #bottomDrawerRail .lower-handle:focus-visible { outline-offset: -2px; }
.lower-handle i {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.lower-handle[aria-expanded="true"] i { transform: rotate(135deg); margin-top: -3px; }
.workspace .lower-drawer {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(26dvh, 235px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--control-line) var(--surface);
  background: var(--surface);
}
#volumeDrawer[hidden], #regimeDrawer[hidden] { display: none !important; }
@supports (transition-behavior: allow-discrete) {
  @media (prefers-reduced-motion: no-preference) {
    .workspace .lower-drawer {
      transition: max-height 160ms ease, opacity 160ms ease, display 160ms allow-discrete;
    }
    .workspace .lower-drawer[hidden] {
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      pointer-events: none;
    }
    @starting-style {
      .workspace .lower-drawer:not([hidden]) { max-height: 0; opacity: 0; }
    }
  }
}
.lower-drawer :is(#volumePane,#deltaPane,#regimePane) {
  height: auto;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
}
.lower-drawer :is(#volumePane,#deltaPane,#regimePane) > header {
  position: relative;
  inset: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 27px;
  padding: 3px 9px;
  gap: 3px 7px;
  pointer-events: auto;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
}
.lower-drawer #drawerDeltaToggle {
  min-height: 22px;
  padding: 2px 7px;
  border-color: var(--control-line);
  color: var(--soft);
  background: var(--surface);
  font-size: 10px;
}
.lower-drawer #drawerDeltaToggle[aria-pressed="true"] {
  border-color: var(--active-line);
  color: var(--blue);
  background: var(--active);
}
.lower-drawer .indicator-pane:has(canvas[hidden]) .pane-style-controls { display: none; }
.lower-drawer #regimePane .regime-line-controls {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin: 0;
  min-width: 0;
}
.lower-drawer #regimeLineValue { color: var(--ink); white-space: normal; }
.lower-drawer :is(#volumeCanvas,#deltaCanvas,#regimeCanvas) {
  display: block;
  position: relative;
  width: 100%;
  height: clamp(48px, 9dvh, 98px);
  min-height: 0;
  flex: 0 0 auto;
  touch-action: none;
}
.lower-drawer :is(#volumeCanvas,#deltaCanvas,#regimeCanvas)[hidden] { display: none !important; }
@media (max-width: 760px) {
  .workspace #bottomDrawerRail {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 3px;
    padding: 0 6px;
  }
  #bottomDrawerRail #barCount { grid-column: 3; }
  #bottomDrawerRail #dotsDetail { display: none; }
  .workspace #bottomDrawerRail .lower-handle { padding-inline: 6px; }
}
@media (pointer: coarse) {
  .workspace #bottomDrawerRail .lower-handle { min-height: 34px; }
  .lower-drawer #drawerDeltaToggle, .lower-drawer #regimeLineTf { min-height: 30px; }
}
