/* STEP81 / V95 - final safe DRAW top position, hover tooltips and Alerts fix. */

:root { --gp-step81-draw-col: 64px; }

html body.gp-step81-ready.terminal-active,
html body.gp-step81-ready.gp-terminal-active {
  --gp-step79-draw-col: var(--gp-step81-draw-col) !important;
  --gp-step04-side-width: var(--gp-step81-draw-col) !important;
  --gp-terminal-side-width: var(--gp-step81-draw-col) !important;
}

@media (min-width: 1181px) {
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode #app,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode #app,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-chart-active #app,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-chart-active #app,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-chart-visuals-only #app,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-chart-visuals-only #app,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-dom-restored #app,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-dom-restored #app {
    grid-template-columns: var(--gp-step81-draw-col) minmax(0, 1fr) var(--gp-step04-dom-width, var(--gp-step01-dom-width, 430px)) !important;
  }

  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-show-panel #app,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-show-panel #app {
    grid-template-columns: var(--gp-step81-draw-col) minmax(520px, 1fr) 238px 328px !important;
    grid-template-rows: 48px minmax(0, 1fr) !important;
  }

  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-show-panel .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-show-panel .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-chart-active .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-chart-active .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-chart-visuals-only .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-chart-visuals-only .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-chart-mode.gp-clean-dom-restored .gp-terminal-side,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-chart-mode.gp-clean-dom-restored .gp-terminal-side {
    grid-column: 1 !important;
    grid-row: 2 / 6 !important;
    width: var(--gp-step81-draw-col) !important;
    min-width: var(--gp-step81-draw-col) !important;
    max-width: var(--gp-step81-draw-col) !important;
    position: relative !important;
    display: block !important;
    padding: 5px 4px !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow: visible !important;
    background: linear-gradient(180deg, rgba(7,7,8,.98), rgba(0,0,0,.98)) !important;
    border-color: rgba(255,255,255,.10) !important;
  }

  html body.gp-step81-ready.gp-step79-ready.terminal-active.gp-dashboard-show-panel .gp-dashboard-tab-panels,
  html body.gp-step81-ready.gp-step79-ready.gp-terminal-active.gp-dashboard-show-panel .gp-dashboard-tab-panels {
    grid-column: 2 / 5 !important;
    grid-row: 2 !important;
  }
}

/* Put DRAW rail near the top of the compact left column. */
html body.gp-step81-ready.gp-step79-ready .gp-terminal-side > .gp-draw-tv-rail.gp-step79-docked {
  position: absolute !important;
  top: 5px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: 52px !important;
  max-width: 52px !important;
  max-height: calc(100dvh - 106px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 7px 5px !important;
  border-radius: 15px !important;
  z-index: 260 !important;
}

html body.gp-step81-ready.gp-step79-ready .gp-terminal-side > .gp-draw-tv-rail.gp-step79-docked .gp-draw-tv-btn {
  width: 39px !important;
  height: 37px !important;
  border-radius: 10px !important;
}

html body.gp-step81-ready.gp-step79-ready .gp-terminal-side > .gp-draw-tv-rail.gp-step79-docked .gp-draw-tv-rail__brand {
  height: 21px !important;
  font-size: 8px !important;
  letter-spacing: .10em !important;
}

html body.gp-step81-ready.gp-step79-ready .gp-terminal-side > .gp-draw-tv-rail.gp-step79-docked .gp-draw-tv-state {
  max-width: 42px !important;
  font-size: 8px !important;
}

/* Hide clipped Step77 pseudo tooltips. Step81 uses fixed tooltip. */
html body.gp-step81-ready .gp-draw-tv-btn::after {
  display: none !important;
}

.gp-step81-draw-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 12, 14, .98);
  border: 1px solid rgba(255,255,255,.13);
  color: #f5f9ff;
  font: 850 11px/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 14px 32px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.06);
  transform: translateY(-50%) translateX(8px);
  transition: opacity .12s ease, visibility .12s ease;
}

.gp-step81-draw-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.gp-step81-draw-tooltip small {
  display: block;
  margin-top: 3px;
  color: rgba(246,247,249,.58);
  font: 700 9px/1 Inter, system-ui, sans-serif;
}

html body.gp-dashboard-tab-alerts .gp-step79-header-nav__btn[data-gp-step79-top-nav="alerts"] {
  color: #03111d !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #0aa7ff, #00efbf) !important;
  box-shadow: 0 0 22px rgba(0,224,255,.20), inset 0 1px rgba(255,255,255,.22) !important;
}
