/* GUARDEER PRIME r363 — narrow-phone terminal layout containment.
 * Keeps the two mobile command rows independent and horizontally scrollable.
 */
@media (max-width: 720px) {
  body.terminal-active .gp-mobile-quick-rail,
  body.gp-terminal-active .gp-mobile-quick-rail,
  body.terminal-active .gp-mobile-action-dock,
  body.gp-terminal-active .gp-mobile-action-dock {
    position: relative !important;
    inset: auto !important;
    z-index: 40 !important;
    display: flex !important;
    flex: 0 0 48px !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 4px 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none !important;
    touch-action: pan-x;
  }

  body.terminal-active .gp-mobile-quick-rail::-webkit-scrollbar,
  body.gp-terminal-active .gp-mobile-quick-rail::-webkit-scrollbar,
  body.terminal-active .gp-mobile-action-dock::-webkit-scrollbar,
  body.gp-terminal-active .gp-mobile-action-dock::-webkit-scrollbar {
    display: none !important;
  }

  body.terminal-active .gp-mobile-quick-rail > button,
  body.terminal-active .gp-mobile-quick-rail > a,
  body.gp-terminal-active .gp-mobile-quick-rail > button,
  body.gp-terminal-active .gp-mobile-quick-rail > a,
  body.terminal-active .gp-mobile-action-dock > button,
  body.terminal-active .gp-mobile-action-dock > a,
  body.gp-terminal-active .gp-mobile-action-dock > button,
  body.gp-terminal-active .gp-mobile-action-dock > a {
    position: relative !important;
    inset: auto !important;
    z-index: 0 !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transform: none !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    font-size: 11px !important;
    line-height: 1 !important;
    scroll-snap-align: start;
  }

  body.terminal-active .gp-mobile-quick-rail > .gp-mobile-prime-tools-trigger,
  body.gp-terminal-active .gp-mobile-quick-rail > .gp-mobile-prime-tools-trigger,
  body.terminal-active .gp-mobile-action-dock > .gp-mobile-prime-tools-trigger,
  body.gp-terminal-active .gp-mobile-action-dock > .gp-mobile-prime-tools-trigger,
  body.terminal-active .gp-mobile-quick-rail > .gp-kairi-route-link,
  body.gp-terminal-active .gp-mobile-quick-rail > .gp-kairi-route-link {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }

  body.terminal-active .gp-mobile-quick-rail > * > span,
  body.gp-terminal-active .gp-mobile-quick-rail > * > span,
  body.terminal-active .gp-mobile-action-dock > * > span,
  body.gp-terminal-active .gp-mobile-action-dock > * > span {
    position: static !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    transform: none !important;
    line-height: 1 !important;
  }

  body.terminal-active .chart-container > .timeframes,
  body.gp-terminal-active .chart-container > .timeframes {
    position: relative !important;
    z-index: 30 !important;
    display: flex !important;
    flex: 0 0 48px !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 5px 6px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body.terminal-active .timeframes__scroll,
  body.gp-terminal-active .timeframes__scroll {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  body.terminal-active .timeframes__scroll > .timeframe-btn,
  body.gp-terminal-active .timeframes__scroll > .timeframe-btn,
  body.terminal-active .timeframes__scroll > .timeframes__divider,
  body.gp-terminal-active .timeframes__scroll > .timeframes__divider {
    display: none !important;
  }

  body.terminal-active #timeframes-tools.gp-minimal-chart-toolbar,
  body.gp-terminal-active #timeframes-tools.gp-minimal-chart-toolbar,
  body.terminal-active #timeframes .timeframes__tools,
  body.gp-terminal-active #timeframes .timeframes__tools {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
  }

  body.terminal-active #timeframes-tools::-webkit-scrollbar,
  body.gp-terminal-active #timeframes-tools::-webkit-scrollbar {
    display: none !important;
  }

  body.terminal-active #timeframes-tools .tv-top-tool,
  body.gp-terminal-active #timeframes-tools .tv-top-tool {
    position: static !important;
    flex: 0 0 auto !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
    white-space: nowrap !important;
  }

  body.terminal-active #timeframes-tools [data-tv-action="toggleFullscreenChart"],
  body.gp-terminal-active #timeframes-tools [data-tv-action="toggleFullscreenChart"] {
    position: static !important;
    inset: auto !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    margin-left: auto !important;
  }

  body.terminal-active #timeframe-select,
  body.gp-terminal-active #timeframe-select {
    position: static !important;
    display: block !important;
    flex: 0 0 78px !important;
    order: 2 !important;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 360px) {
  body.terminal-active .gp-mobile-quick-rail > button,
  body.terminal-active .gp-mobile-quick-rail > a,
  body.gp-terminal-active .gp-mobile-quick-rail > button,
  body.gp-terminal-active .gp-mobile-quick-rail > a,
  body.terminal-active .gp-mobile-action-dock > button,
  body.terminal-active .gp-mobile-action-dock > a,
  body.gp-terminal-active .gp-mobile-action-dock > button,
  body.gp-terminal-active .gp-mobile-action-dock > a {
    padding-inline: 9px !important;
    font-size: 10px !important;
  }

  body.terminal-active #timeframe-select,
  body.gp-terminal-active #timeframe-select {
    flex-basis: 70px !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
  }
}
