@media (max-width: 800px) {
  body.workbench-mobile{overflow-x:hidden;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  #installWorkbenchApp{min-height:46px;border:1px solid #39d98a;background:#123b36;color:#eafff6;font-weight:800}
  body.workbench-mobile .shell{padding:6px!important;max-width:100vw;overflow-x:hidden}
  body.workbench-mobile .safety{position:static!important;top:auto!important;min-height:0!important;padding:8px 10px!important;font-size:13px!important;line-height:1.25!important;letter-spacing:.1px!important;z-index:auto!important}
  body.workbench-mobile header{margin-bottom:6px}
  body.workbench-mobile header h1{font-size:22px}
  body.workbench-mobile header p{display:none}
  body.workbench-mobile #freshness{font-size:11px;text-align:right}
  body.workbench-mobile #mobileFlowTitle{display:flex;flex-direction:column;gap:3px;margin:7px 0;padding:10px 12px;border:1px solid #315c7c;border-radius:11px;background:#10283b;color:#dff4ff}
  body.workbench-mobile #mobileFlowTitle b{font-size:17px}
  body.workbench-mobile #mobileFlowTitle span{font-size:12px;color:#9fc5dc}

  /* First screen: one clear decision, with large thumb-friendly timeframe buttons. */
  body.workbench-mobile.mobile-timeframe-step .metrics,
  body.workbench-mobile.mobile-timeframe-step .movement-tabs-panel,
  body.workbench-mobile.mobile-timeframe-step .workspace,
  body.workbench-mobile.mobile-timeframe-step .paper{display:none!important}
  body.workbench-mobile.mobile-timeframe-step .toolbar{display:block!important;padding:12px!important}
  body.workbench-mobile.mobile-timeframe-step .toolbar>:not(#timeframes){display:none!important}
  body.workbench-mobile.mobile-timeframe-step #timeframes{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px!important;overflow:visible!important}
  body.workbench-mobile.mobile-timeframe-step #timeframes button{width:100%;min-width:0!important;min-height:54px!important;font-size:17px!important;border-radius:11px!important}

  /* Mobile list screen: keep the summary cards visible while hiding chart/paper details. */
  body.workbench-mobile:not(.mobile-chart-mode) .paper{display:none!important}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .metrics{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0 10px}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .metric{min-height:64px;padding:8px 10px}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .metric b{font-size:18px}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-tabs-panel{margin-bottom:8px}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-controls-row{display:none}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-tab{min-height:68px;padding:9px}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-tab span{font-size:14px}
  body.workbench-mobile:not(.mobile-chart-mode) .movement-tab b{font-size:20px}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px;position:sticky;top:0;z-index:35;background:#071522}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .tf{grid-column:1/-1;display:flex;gap:7px;overflow-x:auto;padding-bottom:3px;scrollbar-width:none}
  body.workbench-mobile:not(.mobile-chart-mode):not(.mobile-timeframe-step) .tf button{flex:0 0 52px;min-width:52px;min-height:42px;font-size:15px;font-weight:700}
  body.workbench-mobile:not(.mobile-chart-mode) #search,
  body.workbench-mobile:not(.mobile-chart-mode) #view{width:100%;min-height:46px;font-size:16px}
  body.workbench-mobile:not(.mobile-chart-mode) #refresh{display:none}

  body.workbench-mobile:not(.mobile-chart-mode) .workspace{display:block}
  body.workbench-mobile:not(.mobile-chart-mode) .chart-panel{display:none!important}
  body.workbench-mobile:not(.mobile-chart-mode) #workbenchReadablePriceAxis,
  body.workbench-mobile:not(.mobile-chart-mode) #workbenchAreaSelection{display:none!important}
  body.workbench-mobile:not(.mobile-chart-mode) .scanner{padding:8px}
  body.workbench-mobile:not(.mobile-chart-mode) .scanner .section-head{flex-direction:row;align-items:center}
  body.workbench-mobile:not(.mobile-chart-mode) #scannerTitle{font-size:21px}
  body.workbench-mobile:not(.mobile-chart-mode) #scannerRange{font-size:12px}
  body.workbench-mobile:not(.mobile-chart-mode) #rowCount{font-size:13px}
  body.workbench-mobile:not(.mobile-chart-mode) .table-wrap{height:auto;max-height:none;min-height:360px;border:0;background:transparent;overflow:visible}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table{display:block;font-size:15px;background:transparent}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table thead{display:none}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table tbody{display:grid;gap:8px}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table tbody tr{display:grid;grid-template-columns:1fr auto;gap:5px 12px;padding:12px;border:1px solid #31506a;border-radius:12px;background:#10283b;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.16)}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td{display:none!important;padding:0!important;border:0!important}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(1),
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(2),
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(3),
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(4){display:block!important}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(1){grid-column:1;font-size:17px;font-weight:800;color:#50c8ff}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(2){grid-column:2;grid-row:1;font-size:17px;font-weight:800;text-align:right}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(3){grid-column:1;font-size:15px;font-weight:750}
  body.workbench-mobile:not(.mobile-chart-mode) .market-table td:nth-child(4){grid-column:2;grid-row:2;text-align:right;font-size:12px}

  /* Mobile chart screen: compact controls and give the chart the maximum usable width. */
  body.workbench-mobile.mobile-chart-mode header,
  body.workbench-mobile.mobile-chart-mode .toolbar,
  body.workbench-mobile.mobile-chart-mode .metrics,
  body.workbench-mobile.mobile-chart-mode .movement-tabs-panel,
  body.workbench-mobile.mobile-chart-mode .scanner,
  body.workbench-mobile.mobile-chart-mode .paper{display:none!important}
  body.workbench-mobile.mobile-chart-mode #mobileFlowTitle{display:none!important}
  body.workbench-mobile.mobile-chart-mode .workspace{display:block;width:100%;min-width:0;margin:0!important}
  body.workbench-mobile.mobile-chart-mode .chart-panel{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;padding:6px!important;margin:0!important;border-radius:10px;overflow:hidden}
  body.workbench-mobile.mobile-chart-mode .chart-panel .section-head{display:block!important;margin:0 0 6px!important;gap:4px}
  body.workbench-mobile.mobile-chart-mode #chartTitle{font-size:21px!important;line-height:1.15;margin:2px 0 3px!important;overflow-wrap:anywhere}
  body.workbench-mobile.mobile-chart-mode #chartMeta{display:none!important}

  body.workbench-mobile.mobile-chart-mode .chart-nav{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;width:100%;margin:0 0 5px!important}
  body.workbench-mobile.mobile-chart-mode .chart-nav .chart-live-state{min-height:34px!important;display:flex;align-items:center;justify-content:center;font-size:11px!important;padding:4px!important;white-space:nowrap}
  body.workbench-mobile.mobile-chart-mode .chart-nav button{width:100%!important;min-width:0!important;min-height:36px!important;padding:5px 4px!important;font-size:13px!important;line-height:1.1!important;border-radius:8px!important;white-space:nowrap}
  body.workbench-mobile.mobile-chart-mode #panLeft,
  body.workbench-mobile.mobile-chart-mode #panRight,
  body.workbench-mobile.mobile-chart-mode #areaZoom,
  body.workbench-mobile.mobile-chart-mode #zoomIn,
  body.workbench-mobile.mobile-chart-mode #zoomOut{display:none!important}
  #mobileCrosshairToggle{display:none}
  body.workbench-mobile.mobile-chart-mode #mobileCrosshairToggle{display:block!important;font-size:23px!important;line-height:1!important}
  body.workbench-mobile.mobile-chart-mode #mobileCrosshairToggle.active{background:#123b36!important;border-color:#39d98a!important;color:#eafff6!important;box-shadow:0 0 0 1px rgba(57,217,138,.35) inset}

  body.workbench-mobile.mobile-chart-mode .market-strip{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px!important;margin:0 0 5px!important;font-size:10px!important}
  body.workbench-mobile.mobile-chart-mode .market-strip>*{min-width:0!important;padding:4px!important;overflow:hidden}
  body.workbench-mobile.mobile-chart-mode .market-strip b,
  body.workbench-mobile.mobile-chart-mode .market-strip strong{font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary{grid-column:1/-1;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px!important;width:100%!important;height:auto!important;padding:0!important;overflow:visible!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary .candle-hover-time{grid-column:1/-1;display:block!important;min-height:28px;padding:5px 6px!important;white-space:normal!important;line-height:1.15}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary>span:not(.candle-hover-time){display:flex!important;flex-direction:column;align-items:flex-start;justify-content:center;min-width:0;min-height:38px;padding:4px!important;overflow:hidden}

  body.workbench-mobile.mobile-chart-mode #chart{display:block!important;width:100%!important;max-width:100%!important;height:68vh!important;min-height:520px!important;max-height:720px!important;margin:0!important;touch-action:none;border-radius:9px;box-sizing:border-box}
  #mobileChartDetails{display:none}
  body.workbench-mobile.mobile-chart-mode #mobileChartDetails{display:block;width:100%;min-height:40px;margin:6px 0 0;background:#123b36;border:1px solid #39d98a;color:#eafff6;border-radius:8px;font-weight:800}
  body.workbench-mobile.mobile-chart-mode .indicator-cards,
  body.workbench-mobile.mobile-chart-mode .data-health{display:none!important}
  body.workbench-mobile.mobile-chart-mode.mobile-details-open .indicator-cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:7px}
  body.workbench-mobile.mobile-chart-mode.mobile-details-open .data-health{display:block!important}
  body.workbench-mobile.mobile-chart-mode .icard{min-height:62px;padding:7px}
  body.workbench-mobile.mobile-chart-mode .icard span{font-size:11px}
  body.workbench-mobile.mobile-chart-mode .icard b{font-size:14px;overflow-wrap:anywhere}
  body.workbench-mobile.mobile-chart-mode .data-health{font-size:11px;line-height:1.3}

  /* Selected timeframe stays active without looking like a second yellow focus target. */
  body.workbench-mobile #timeframes button.active{
    border-color:#4aa7df!important;
    outline:none!important;
    box-shadow:0 0 0 1px rgba(74,167,223,.18) inset!important;
    background:#176fa8!important;
  }

  body.workbench-mobile #timeframes button.active:focus,
  body.workbench-mobile #timeframes button.active:focus-visible{
    border-color:#4aa7df!important;
    outline:none!important;
    box-shadow:0 0 0 1px rgba(74,167,223,.18) inset!important;
  }

  #mobileBackToStocks,#mobileChartInterval,#mobileTradeDock{display:none}

  /* Compact selected-stock header and controls. */
  body.workbench-mobile.mobile-chart-mode{padding-bottom:calc(74px + env(safe-area-inset-bottom))}
  body.workbench-mobile.mobile-chart-mode .safety{display:none!important}
  body.workbench-mobile.mobile-chart-mode .chart-panel .section-head{display:block!important;margin:0 0 3px!important}
  body.workbench-mobile.mobile-chart-mode .chart-title-stack{display:grid!important;grid-template-columns:34px minmax(0,1fr) 72px 18px;align-items:center;gap:5px;width:100%}
  body.workbench-mobile.mobile-chart-mode #mobileBackToStocks{display:flex;width:34px;height:34px;min-height:34px;margin:0;padding:0;align-items:center;justify-content:center;background:#10283b;border:1px solid #315c7c;border-radius:50%;font-size:22px;font-weight:900;position:static!important}
  body.workbench-mobile.mobile-chart-mode #chartTitle{font-size:18px!important;line-height:1!important;margin:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.workbench-mobile.mobile-chart-mode .chart-title-stack #chartLiveState{display:flex!important;width:14px!important;height:14px!important;min-height:14px!important;padding:0!important;border:0!important;border-radius:50%!important;font-size:0!important;background:#f59e0b!important;box-shadow:0 0 0 3px rgba(245,158,11,.16)}
  body.workbench-mobile.mobile-chart-mode .chart-title-stack #chartLiveState.live{background:#22c55e!important;box-shadow:0 0 0 3px rgba(34,197,94,.18)}
  body.workbench-mobile.mobile-chart-mode .chart-title-stack #chartLiveState.closed,
  body.workbench-mobile.mobile-chart-mode .chart-title-stack #chartLiveState.error{background:#ef4444!important;box-shadow:0 0 0 3px rgba(239,68,68,.18)}
  body.workbench-mobile.mobile-chart-mode .chart-title-stack #chartLiveState.stale{background:#f97316!important}
  body.workbench-mobile.mobile-chart-mode .chart-interval-row>span,
  body.workbench-mobile.mobile-chart-mode #chartIntervals{display:none!important}
  body.workbench-mobile.mobile-chart-mode .chart-interval-row{display:block!important;margin:0 0 3px!important}
  body.workbench-mobile.mobile-chart-mode .chart-nav{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;margin:0!important}
  body.workbench-mobile.mobile-chart-mode #mobileChartInterval{display:block!important;width:72px;min-width:0;min-height:34px;padding:4px 6px;font-size:14px;font-weight:800;background:#10283b;border-color:#4aa7df}

  /* OHLC is retained while duplicate summary cards are removed. */
  body.workbench-mobile.mobile-chart-mode .market-strip>span{display:none!important}
  body.workbench-mobile.mobile-chart-mode .market-strip{display:block!important;margin:0 0 3px!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px!important;padding:4px 6px!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary .candle-hover-time{display:none!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary>span:not(.candle-hover-time){display:flex!important;flex-direction:row!important;align-items:center!important;gap:4px;min-height:24px!important;padding:1px 3px!important;font-size:11px!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary small{display:inline!important;margin:0!important;font-size:10px!important}
  body.workbench-mobile.mobile-chart-mode .market-strip .candle-hover-summary b{display:inline!important;font-size:12px!important}

  body.workbench-mobile.mobile-chart-mode #chart{height:55vh!important;min-height:420px!important;max-height:580px!important}
  body.workbench-mobile.mobile-chart-mode #mobileChartDetails{display:none!important}

  /* Always-reachable mobile order controls; every action still opens confirmation. */
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock{display:grid;grid-template-columns:58px repeat(3,minmax(0,1fr));gap:5px;position:fixed;left:6px;right:6px;bottom:calc(5px + env(safe-area-inset-bottom));z-index:90;padding:6px;background:rgba(7,21,34,.97);border:1px solid #315c7c;border-radius:12px;box-shadow:0 -8px 24px rgba(0,0,0,.38)}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock input,
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock button{width:100%;min-width:0;min-height:48px;padding:5px 3px;font-size:12px;font-weight:850}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock .mobile-dock-lots{display:flex;flex-direction:column;justify-content:center;color:#9fc5dc;font-size:9px;text-align:center}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock .mobile-dock-lots input{min-height:31px;text-align:center;font-size:15px;padding:2px}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock .mobile-ce{background:#0d8a53}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock .mobile-pe{background:#a83b50}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock .mobile-unlock{background:#176fa8}
  body.workbench-mobile.mobile-chart-mode #mobileTradeDock button:disabled{background:#465260;color:#cbd5e1;opacity:.82}
}
