/* CasinoLab v25.30.4 – mobile-only visual refinement. Desktop layout untouched. */
.cl-mobile-sheet{display:none}
@media(max-width:760px){
  html.cl-sheet-mobile,html.cl-sheet-mobile body{height:100%;overflow:hidden!important;overscroll-behavior:none}
  html.cl-sheet-mobile body.authenticated .app{
    height:100dvh!important;min-height:0!important;max-height:100dvh!important;
    overflow:hidden!important;display:flex!important;flex-direction:column!important;
  }
  html.cl-sheet-mobile .workspace,
  html.cl-sheet-mobile .workspace.markets-hidden,
  html.cl-sheet-mobile .workspace.markets-visible{
    display:flex!important;flex:1 1 auto!important;flex-direction:column!important;
    min-height:0!important;height:auto!important;overflow:hidden!important;
  }
  html.cl-sheet-mobile .workspace .chart-panel{
    order:0!important;flex:1 1 auto!important;height:auto!important;min-height:0!important;
    max-height:none!important;overflow:hidden!important;
  }
  html.cl-sheet-mobile .workspace .chart-stage,
  html.cl-sheet-mobile .workspace .chart-area,
  html.cl-sheet-mobile .workspace #chart{
    flex:1 1 auto!important;min-height:0!important;height:100%!important;
  }
  html.cl-sheet-mobile .workspace .chart-stage{height:auto!important;overflow:hidden!important}
  html.cl-sheet-mobile .workspace .chart-area{height:auto!important}
  html.cl-sheet-mobile .workspace .ticket-reopen{display:none!important}
  /* The existing scrolling ticker remains alive, but must not cover the sheet. */
  html.cl-sheet-mobile .market-ticker-footer{display:none!important}
  html.cl-sheet-mobile #mobile-trade-sheet.cl-mobile-sheet{
    display:flex;flex-direction:column;position:fixed;left:0;right:0;bottom:0;
    z-index:78;width:100%;min-width:0;max-width:100vw;
    height:calc(88px + env(safe-area-inset-bottom,0px));max-height:100dvh;padding-bottom:env(safe-area-inset-bottom,0px);
    background:#111416;color:#eeeff1;border:1px solid #323b3b;border-bottom:0;
    border-radius:23px 23px 0 0;box-shadow:0 -12px 28px rgba(0,0,0,.28),0 -2px 8px rgba(0,0,0,.09);
    overflow:hidden;isolation:isolate;transition:height 245ms cubic-bezier(.22,.8,.22,1);
    box-sizing:border-box;transform:translateZ(0);
  }
  html.cl-sheet-mobile #mobile-trade-sheet.cl-sheet-dragging{transition:none!important}
  /* The pull affordance is understated; dragging still uses a full-width hit target. */
  #mobile-trade-sheet .cl-sheet-grip{
    display:flex;flex:0 0 21px;min-height:21px;width:100%;align-items:center;
    justify-content:center;cursor:grab;touch-action:none;user-select:none;
    -webkit-user-select:none;-webkit-tap-highlight-color:transparent;outline-offset:-2px;
  }
  #mobile-trade-sheet .cl-sheet-grip span{
    display:block;width:30px;height:4px;border-radius:100px;background:#58646a;
    transition:background .15s,width .15s;
  }
  #mobile-trade-sheet .cl-sheet-grip:active span,
  #mobile-trade-sheet.cl-sheet-touching .cl-sheet-grip span{background:#48ba8a;width:41px}
  #mobile-trade-sheet.cl-sheet-touching .cl-sheet-grip{cursor:grabbing}
  /* Rounded inset segmented tabs: the active state is a real pill, not a hard-edged block. */
  #mobile-trade-sheet .cl-sheet-tabs{
    flex:0 0 49px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    margin:0 10px 7px;padding:4px;gap:4px;min-width:0;
    border:1px solid #293333;border-radius:14px;background:#1c2424;
  }
  #mobile-trade-sheet .cl-sheet-tab{
    background:transparent;border:1px solid transparent;border-radius:10px;
    color:#a4b2b6;font-size:12px;font-weight:650;text-align:center;white-space:nowrap;
    padding:0 5px;min-width:0;min-height:39px;touch-action:manipulation;
    transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease;
  }
  #mobile-trade-sheet .cl-sheet-tab.active{
    color:#84e7b2;border-color:#37644e;background:#294038;
    box-shadow:0 1px 5px rgba(0,0,0,.22);
  }
  #mobile-trade-sheet .cl-sheet-tab:focus-visible{outline:2px solid #35c58e;outline-offset:-2px}
  #mobile-trade-sheet .cl-sheet-viewport{
    flex:1 1 auto;min-height:0;min-width:0;display:flex;flex-direction:column;
    overflow:hidden;overscroll-behavior:contain;background:#0f1013;
  }
  #mobile-trade-sheet .cl-sheet-pane{
    display:none;flex-direction:column;flex:1 1 auto;min-height:0;min-width:0;
    overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;scrollbar-width:thin;
    scrollbar-color:#3d4148 transparent;
    touch-action:pan-y;
  }
  #mobile-trade-sheet .cl-sheet-pane.active{display:flex!important}
  /* At 88px expose only the pull handle and 3-tab navigation (no clipped ticket). */
  #mobile-trade-sheet[data-position="collapsed"] .cl-sheet-viewport{
    visibility:hidden;pointer-events:none;
  }
  /* Existing New Order element, including its original form and attached event listeners. */
  #mobile-trade-sheet #order-ticket{
    order:initial;display:flex!important;position:relative!important;flex:0 0 auto!important;
    width:100%;min-width:0!important;height:auto!important;max-height:none!important;
    min-height:0!important;overflow:visible!important;border:0!important;padding:0!important;
  }
  #mobile-trade-sheet #order-ticket .ticket-heading{
    flex:0 0 40px;height:40px;min-height:40px;padding:0 14px;
  }
  #mobile-trade-sheet #order-ticket .ticket-scroll{
    flex:0 0 auto!important;max-height:none!important;height:auto!important;overflow:visible!important;
    padding:11px 14px 23px!important;
  }
  #mobile-trade-sheet #order-ticket .ticket-edge-toggle,
  #mobile-trade-sheet #order-ticket #order-hide{display:none!important}
  #mobile-trade-sheet #order-ticket .ticket-price-cards{max-width:none}
  /* Existing account tables: vertically scroll the sheet, horizontally scroll each table. */
  #mobile-trade-sheet .blotter{
    order:initial;display:flex!important;position:relative!important;flex:0 0 auto!important;
    width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
    overflow:visible!important;border:0!important;padding:0 0 14px!important;
  }
  #mobile-trade-sheet .blotter-resize{display:none!important}
  /* The sheet's Positions tab already gives this section its heading. Hide the
     entire redundant ACCOUNT / My trades row, not the nested trade tabs. */
  #mobile-trade-sheet .blotter-top{display:none!important}
  #mobile-trade-sheet .blotter-top{
    flex:0 0 42px!important;height:42px!important;min-height:42px!important;
    padding:0 13px!important;
  }
  #mobile-trade-sheet .blotter-top-left{width:auto!important}
  #mobile-trade-sheet .blotter .tabs{
    flex:0 0 43px!important;min-height:43px!important;max-width:100%;
    gap:9px!important;padding:0 10px!important;overflow-x:auto!important;
    overflow-y:hidden!important;scrollbar-width:none;white-space:nowrap;
  }
  #mobile-trade-sheet .blotter .tabs::-webkit-scrollbar{display:none}
  #mobile-trade-sheet .blotter .tabs .tab{
    flex:0 0 auto!important;white-space:nowrap!important;padding:0 5px!important;
    font-size:11px!important;
  }
  #mobile-trade-sheet .blotter .tab-panel:not(.hidden){
    display:flex!important;flex:0 0 auto!important;min-height:0!important;
    height:auto!important;overflow:visible!important;
  }
  #mobile-trade-sheet .blotter .table-scroll{
    display:block!important;overflow-x:auto!important;overflow-y:auto!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    min-height:0!important;max-height:none!important;flex:0 0 auto!important;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;scrollbar-width:thin;
  }
  #mobile-trade-sheet .blotter table{
    width:max-content!important;min-width:100%!important;max-width:none!important;
    border-collapse:collapse!important;white-space:nowrap!important;
  }
  #mobile-trade-sheet .blotter td,#mobile-trade-sheet .blotter th{white-space:nowrap}
  #mobile-trade-sheet .blotter .history-pages{flex:0 0 auto!important}
  #mobile-trade-sheet .blotter .empty-state{min-height:86px;margin:0!important;display:grid;place-content:center}
  #mobile-trade-sheet .blotter .empty-state.hidden{display:none!important}
  #mobile-trade-sheet .blotter .market-ticker-footer{display:none!important}
  /* Single original markets panel, now located inside the Watchlist tab. */
  #mobile-trade-sheet #markets-panel{
    order:initial;position:relative!important;display:flex!important;flex:0 0 auto!important;
    flex-direction:column!important;left:auto!important;right:auto!important;
    top:auto!important;bottom:auto!important;transform:none!important;
    visibility:visible!important;pointer-events:auto!important;
    width:100%!important;max-width:none!important;height:auto!important;
    min-height:0!important;max-height:none!important;overflow:visible!important;
    border:0!important;box-shadow:none!important;transition:none!important;
  }
  #mobile-trade-sheet #markets-panel .markets-drawer-header,
  #mobile-trade-sheet #markets-panel .markets-tabs{display:none!important}
  #mobile-trade-sheet #markets-panel .markets-search{flex:0 0 48px!important}
  #mobile-trade-sheet #markets-panel .markets-table-head{flex:0 0 32px!important}
  #mobile-trade-sheet #markets-panel #markets-list{
    flex:0 0 auto!important;min-height:0!important;max-height:none!important;
    height:auto!important;overflow:visible!important;touch-action:pan-y;
  }
  #mobile-trade-sheet #markets-panel .markets-footer{flex:0 0 34px!important;margin-top:0!important}
  #mobile-trade-sheet .cl-market-group{
    display:flex;align-items:center;gap:7px;margin:0;padding:10px 13px 7px;
    color:#a6acb3;font-size:10px;font-weight:800;letter-spacing:.09em;
    text-transform:uppercase;background:#15181b;border-bottom:1px solid #2b2e33;
  }
  #mobile-trade-sheet .cl-market-group .cl-market-star{color:#eab308;font-size:14px}
  #mobile-trade-sheet .cl-market-group small{margin-left:auto;font-size:10px;letter-spacing:0;color:#929ba1}
  #mobile-trade-sheet #markets-panel .market-row{padding:8px 11px;min-height:54px}
  #mobile-trade-sheet #markets-panel .market-fav{
    width:32px;flex:0 0 32px;height:36px;font-size:21px;line-height:1;
    border-radius:9px;touch-action:manipulation;color:#818e94;
  }
  #mobile-trade-sheet #markets-panel .market-fav.is-fav{
    color:#f3b423!important;text-shadow:0 0 9px rgba(243,180,35,.18);
  }
  #mobile-trade-sheet #markets-panel .market-fav:focus-visible{outline:2px solid #eab308;outline-offset:0}
  #mobile-trade-sheet .markets-empty{padding:17px 14px}
  html[data-theme="light"] #mobile-trade-sheet.cl-mobile-sheet,
  html[data-theme="light"] #mobile-trade-sheet .cl-sheet-viewport{
    background:#fff!important;color:#203247!important;border-color:#dbe4ec!important;
  }
  html[data-theme="light"] #mobile-trade-sheet .cl-market-group{
    background:#f3f7fa!important;border-color:#dbe4ec!important;color:#50677c!important;
  }
  html[data-theme="light"] #mobile-trade-sheet.cl-mobile-sheet{
    border-color:#dde6eb!important;border-bottom:0!important;
    box-shadow:0 -12px 30px rgba(27,44,62,.10),0 -1px 6px rgba(27,44,62,.07)!important;
  }
  html[data-theme="light"] #mobile-trade-sheet .cl-sheet-tabs{
    background:#eff3f5!important;border-color:#e6ecef!important;
  }
  html[data-theme="light"] #mobile-trade-sheet .cl-sheet-grip span{background:#a0acb4}
  html[data-theme="light"] #mobile-trade-sheet .cl-sheet-tab{color:#506477}
  html[data-theme="light"] #mobile-trade-sheet .cl-sheet-tab.active{
    color:#087a55;background:#fff!important;border-color:#cde9dc;
    box-shadow:0 1px 5px rgba(26,77,56,.10);
  }
  html[data-theme="light"] #mobile-trade-sheet #markets-panel .market-fav{color:#8b98a7}
  html[data-theme="light"] #mobile-trade-sheet #markets-panel .market-fav.is-fav{color:#d99b0b!important}
  html[data-theme="light"] #mobile-trade-sheet .cl-market-group small{color:#75869a}
}
@media (max-width:350px){
  #mobile-trade-sheet .cl-sheet-tabs{margin-left:7px;margin-right:7px;padding:3px;gap:2px}
  #mobile-trade-sheet .cl-sheet-tab{font-size:11px}
  #mobile-trade-sheet .blotter .tabs{gap:5px!important;padding:0 6px!important}
  #mobile-trade-sheet .blotter .tabs .tab{font-size:10px!important}
}
@media (prefers-reduced-motion:reduce){#mobile-trade-sheet.cl-mobile-sheet{transition:none!important}}

/* v25.30.7: Mobile input sizing; do not use CSS zoom on editable fields.
   Safari will zoom the ENTIRE page on focus when an input is rendered at <16px.
   Android keeps the requested 13px; iOS/WebKit uses an actual, unscaled 16px
   input so the sheet/chart and page scale stay stable when the keyboard opens.
   This intentionally preserves user pinch-to-zoom accessibility. */
@media (max-width:760px) {
  #market-search,
  #pair-dropdown .pair-dropdown-search input,
  #mobile-trade-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
  #mobile-trade-sheet textarea,
  #mobile-trade-sheet select,
  .risk-inline-row input:not([type="checkbox"]):not([type="radio"]),
  .risk-inline-row textarea,
  .risk-inline-row select {
    font-size:13px!important;
  }
}
@supports (-webkit-touch-callout: none) {
  @media (max-width:760px) {
    #market-search,
    #pair-dropdown .pair-dropdown-search input,
    #mobile-trade-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
    #mobile-trade-sheet textarea,
    #mobile-trade-sheet select,
    .risk-inline-row input:not([type="checkbox"]):not([type="radio"]),
    .risk-inline-row textarea,
    .risk-inline-row select {
      font-size:16px!important;
      zoom:1!important;
      -webkit-text-size-adjust:100%;
    }
  }
}
