.mobile-nav,
.mob-quick-trade,
.mob-pos-actions,
.mob-only-row,
.mob-tabbar {
  display: none;
}

.mobile-nav { display: none !important; }
#mob-zoom-reset[hidden] { display: none !important; }

@media (max-width: 768px) {
  .top-bar-merged {
    height: auto !important;
    min-height: 44px;
    padding: 4px 6px !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .top-bar-merged .top-bar-left {
    flex: 1 1 100%;
    min-width: 0;
    overflow: hidden;
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .tib-inline {
    flex: 1 1 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tib-inline::-webkit-scrollbar { display: none; }
  .tib-sep { display: none; }
  .tib-item { padding: 0 6px; }
  .tib-label { font-size: 8px; }
  .tib-value { font-size: 10px; }

  .exchange-chip {
    height: 22px;
    padding: 0 3px 0 0;
  }
  .exchange-chip-mark {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
  .exchange-select {
    font-size: 10px;
    padding: 0 12px 0 4px;
  }
  .leverage-badge {
    font-size: 10px;
    padding: 0 4px;
  }

  .price-input-tif {
    flex: 0 0 78px;
    font-size: 12px;
  }

  .settings-action-btn {
    padding: 12px 12px;
    font-size: 14px;
  }
  .settings-action-icon { width: 18px; }
  .settings-action-status { font-size: 11px; }

  .pwa-install-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 10px;
  }
  .pwa-install-text strong { font-size: 12px; }
  .pwa-install-text span { font-size: 11px; }

  .ema-pop {
    width: calc(100vw - 16px);
    max-width: 320px;
    left: 8px !important;
    right: 8px;
  }

  #settings-modal { padding: 0 !important; }
  #settings-modal .modal-content,
  #settings-modal .settings-modal-v2 {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  #chart-display-modal .modal-box {
    width: calc(100vw - 16px) !important;
    max-width: 460px;
    max-height: 92vh;
  }
  .cds-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .cds-tabs::-webkit-scrollbar { display: none; }

  .drw-tpl-wrap > #drw-tpl-dropdown {
    left: 8px !important;
    right: 8px;
    width: auto !important;
  }

  .btn-krytes-back .kb-icon { display: none; }
  .btn-krytes-back { font-size: 10px; padding: 3px 7px; }
  .user-name { display: none; }
  html, body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .auth-box {
    width: 90%;
    max-width: 340px;
    padding: 20px;
  }

  .auth-title { font-size: 16px; }

  #auth-form input, #keys-form input {
    padding: 12px 10px;
    font-size: 14px;
  }

  .btn-primary {
    padding: 12px;
    font-size: 14px;
  }

  .top-bar {
    height: auto;
    min-height: 40px;
    flex-wrap: wrap;
    padding: 4px 6px;
    gap: 4px;
  }

  .top-bar-left {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .top-bar-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding: 2px 0 0;
  }

  .top-bar-right {
    order: 2;
    gap: 3px;
  }

  .pair-select {
    font-size: 13px;
    padding: 4px 6px;
    max-width: 110px;
  }

  .current-price {
    font-size: 15px;
  }

  .price-change {
    font-size: 12px;
  }

  .exchange-select {
    font-size: 11px;
    padding: 4px 18px 4px 8px;
  }

  .leverage-select {
    font-size: 12px;
    padding: 4px 6px;
  }

  .btn-sm {
    padding: 5px 8px;
    font-size: 11px;
    min-height: 28px;
  }

  .grid-toggle-wrap {
    display: none;
  }

  #btn-refresh { font-size: 0; padding: 5px 6px; }
  #btn-refresh::before { content: '↻'; font-size: 14px; }
  #btn-settings { font-size: 0; padding: 5px 6px; }
  #btn-settings::before { content: '⚙'; font-size: 14px; }
  #btn-theme { font-size: 0; padding: 5px 6px; }
  #btn-theme::before { content: '◐'; font-size: 14px; }

  .timeframe-bar {
    padding: 0 6px;
    height: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .timeframe-bar::-webkit-scrollbar { display: none; }

  .tf-btn {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    min-width: 36px;
  }

  .tf-label { display: none; }
  .tf-separator { display: none; }

  .top-bar-undo {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
  }
  body:not([data-mob-view="chart"]) .top-bar-undo { display: none; }
  .top-bar-undo .tf-undo {
    flex: 0 0 auto;
    width: 31px;
    height: 28px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-secondary);
  }
  .top-bar-undo .tf-undo .ico { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #top-bar-undo .top-bar-tool {
    flex: 0 0 auto;
    width: 31px;
    height: 28px;
    min-width: 0;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-secondary);
  }
  #top-bar-undo .tf-undo + .top-bar-tool { margin-left: 5px; }
  #top-bar-undo .top-bar-tool > span { display: none; }
  #top-bar-undo .top-bar-tool > svg { width: 15px; height: 15px; }
  #krytes-ta-panel {
    left: 8px !important;
    right: 8px !important;
    top: 96px !important;
    width: auto !important;
  }

  .main-layout {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  .left-toolbar {
    display: none !important;
  }

  #drawing-favorites-bar {
    display: none !important;
  }

  .chart-area {
    flex: 1;
    min-height: 0;
  }

  .chart-grid {
    grid-template-areas: "c1" !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  .chart-panel-wrap:not(#chart-wrap-1) {
    display: none !important;
  }

  .chart-panel-header {
    height: auto;
    min-height: 24px;
    padding: 2px 8px;
    font-size: 10px;
    align-items: flex-start;
  }
  .chart-panel-header > .chart-label { display: none !important; }
  #chart-grid .chart-panel-header > .chart-symbol {
    position: static;
    transform: none;
    max-width: none;
    overflow: visible;
    flex: 1 1 0%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-template-rows: 32px;
    grid-auto-rows: 26px;
    gap: 4px;
    align-items: stretch;
    padding: 2px 0;
  }
  .chart-symbol::after { content: none; }
  #chart-grid .chart-symbol > .chart-pick-sym,
  #chart-grid .chart-symbol > .chart-exch,
  #chart-grid .chart-symbol > .chart-pick-mt,
  #chart-grid .chart-symbol > .chart-pick-tf {
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 0 4px;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    border-radius: 5px;
  }
  #chart-grid .chart-symbol > .chart-exch { gap: 5px; }
  #chart-grid .chart-symbol > .chart-exch .chart-exch-name { font-size: 12px; }
  .chart-symbol > .chart-pick-sym { order: 1; grid-column: span 9; }
  .chart-symbol > .chart-exch { order: 2; grid-column: span 6; }
  .chart-symbol > .chart-pick-mt { order: 3; grid-column: span 6; }
  .chart-symbol > .chart-pick-tf { order: 4; grid-column: span 3; }
  #chart-grid .chart-symbol > .chart-tf-fav {
    order: 6;
    grid-column: span 3;
    height: auto;
    min-width: 0;
    margin: 0;
    padding: 0 2px;
    justify-content: center;
    font-size: 11px;
  }
  .chart-symbol > .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav ~ .chart-tf-fav { display: none; }
  #pane-menu.fav-edit .pane-menu-tf.is-na { opacity: .4; }

  #chart-wrap-1.chart-panel-wrap {
    margin: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-primary);
  }

  #chart-wrap-1.chart-panel-wrap.chart-fullscreen {
    margin: 0;
    border: none;
    border-radius: 0;
  }

  #chart-grid {
    gap: 0;
    background: transparent;
  }

  .positions-bar {
    height: 0;
    min-height: 0;
    overflow: hidden;
    border: none;
    transition: height 0.2s;
  }

  .right-panel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 56px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    z-index: 100 !important;
    transform: translateX(100%) !important;
    transition: transform 0.25s ease !important;
    border-left: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    flex: none !important;
    flex-shrink: 0 !important;
  }

  .right-panel.mob-visible {
    transform: translateX(0) !important;
  }

  .panel-header {
    padding: 10px 12px;
    font-size: 12px;
  }

  .sl-tp-section {
    padding: 10px 12px;
  }

  .price-input {
    padding: 10px 8px;
    font-size: 14px;
  }

  .btn-sl, .btn-tp {
    padding: 10px 14px;
    font-size: 12px;
  }

  .input-row {
    gap: 6px;
    margin-bottom: 6px;
  }

  .calculator {
    padding: 10px 12px;
  }

  .section-header { font-size: 11px; }

  .calc-row {
    padding: 3px 0;
    font-size: 13px;
  }

  .calc-row span:first-child { font-size: 12px; }
  .calc-value { font-size: 13px; }
  .volume-color { font-size: 16px; }

  .info-section { padding: 10px 12px; }
  .info-row { padding: 3px 0; font-size: 13px; }
  .info-row span:first-child { font-size: 12px; }
  .info-value { font-size: 13px; }

  .trade-buttons {
    padding: 10px 12px;
    gap: 8px;
  }

  .btn-long, .btn-short {
    padding: 14px 0;
    font-size: 15px;
    border-radius: 6px;
  }

  .action-buttons {
    padding: 6px 12px;
    gap: 6px;
  }

  .btn-action {
    padding: 10px 0;
    font-size: 12px;
    border-radius: 4px;
  }

  .watchlist-header {
    padding: 8px 12px;
    font-size: 12px;
  }

  .watchlist-table-header {
    padding: 4px 12px;
    font-size: 10px;
  }

  .wth-price { width: 80px; }
  .wth-change { width: 65px; }

  .wl-section-name {
    padding: 6px 12px;
    font-size: 10px;
  }

  .wl-item {
    padding: 10px 12px;
    font-size: 13px;
    gap: 8px;
    min-height: 40px;
  }

  .wl-symbol { font-size: 12px; }
  .wl-price { font-size: 12px; width: 80px; }
  .wl-change { font-size: 12px; width: 65px; }

  .status-bar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 52px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 200;
  }

  .mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 9px;
    font-family: var(--font);
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-tab svg {
    width: 20px;
    height: 20px;
  }

  .mob-tab.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-weight: 700;
  }

  .mob-tab:active {
    color: var(--text-primary);
  }

  .mob-quick-trade {
    display: none !important;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    gap: 8px;
  }

  .mqt-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    min-width: 0;
    overflow: hidden;
  }

  .mqt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
  }

  .mqt-dot.connected {
    background: var(--green);
  }

  .mqt-pair {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .mqt-price {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
  }

  .mqt-balance {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
  }

  .mqt-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }

  .mqt-long, .mqt-short {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent;
  }

  .mqt-long {
    background: var(--green);
    color: white;
  }

  .mqt-short {
    background: var(--red);
    color: white;
  }

  .mqt-long:active, .mqt-short:active {
    opacity: 0.8;
  }

  .mob-pos-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  .mob-pos-actions .btn-action {
    padding: 12px 0;
    font-size: 13px;
    border-radius: 4px;
  }

  .pos-close-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    margin-left: 6px;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .order-cancel-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 4px 8px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .pos-close-btn:active {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
  }

  .modal-content {
    width: 92%;
    max-width: 360px;
    max-height: 85vh;
  }

  .modal-body input {
    padding: 10px;
    font-size: 14px;
  }

  .modal-body label {
    font-size: 12px;
    margin-top: 10px;
  }

  .grid-selector {
    width: 95vw;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  .positions-bar.mob-visible {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    z-index: 100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: none;
  }

  .positions-bar.mob-visible .positions-header {
    padding: 8px 12px;
    font-size: 13px;
  }

  .positions-bar.mob-visible .pos-tabs {
    gap: 0;
    flex-wrap: wrap;
  }

  .positions-bar.mob-visible .pos-tab {
    font-size: 12px;
    padding: 6px 10px;
  }

  .positions-bar.mob-visible .position-item {
    padding: 10px 12px;
    font-size: 12px;
    gap: 6px;
    min-height: 44px;
  }

  .positions-bar.mob-visible .pos-main-row {
    gap: 8px;
  }

  .positions-bar.mob-visible .pos-detail-row {
    font-size: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .positions-bar.mob-visible .pos-symbol { font-size: 12px; }
  .positions-bar.mob-visible .pos-side { font-size: 11px; padding: 2px 6px; }
  .positions-bar.mob-visible .pos-pnl { font-size: 13px; }

  .positions-bar.mob-visible .order-item {
    padding: 10px 12px;
    font-size: 12px;
    gap: 8px;
    min-height: 40px;
    flex-wrap: wrap;
  }

  .positions-bar.mob-visible .income-item {
    padding: 10px 12px;
    font-size: 12px;
    gap: 8px;
  }

  .positions-bar.mob-visible .no-positions {
    font-size: 13px;
    padding: 20px;
  }

  .right-panel.mob-watchlist-only > *:not(.watchlist):not(.panel-header) {
    display: none;
  }

  .right-panel.mob-watchlist-only .panel-header {
    display: none;
  }

  .right-panel.mob-watchlist-only .watchlist {
    flex: 1;
  }

  .right-panel.mob-visible {
    padding-bottom: 10px;
  }

  .sl-tp-actions {
    gap: 6px;
    margin-top: 6px;
  }

  .btn-click-set {
    padding: 10px 8px;
    font-size: 12px;
  }

  .btn-click-clear {
    padding: 10px 12px;
    font-size: 12px;
  }

  .gsl-row {
    margin-top: 8px;
    padding-top: 6px;
  }

  .gsl-toggle {
    width: 36px;
    height: 18px;
  }

  .gsl-toggle .gs-toggle-slider:before {
    width: 14px;
    height: 14px;
  }

  .gsl-toggle input:checked + .gs-toggle-slider:before {
    transform: translateX(18px);
  }

  .gsl-label {
    font-size: 12px;
  }

  .gsl-hint {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .click-mode-badge {
    top: 8px;
    font-size: 13px;
    padding: 8px 20px;
  }

  input:focus {
    scroll-margin-bottom: 200px;
  }

  .right-panel.mob-visible input:focus {
    position: relative;
    z-index: 200;
  }

  .positions-bar.mob-visible::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

@media (min-width: 520px) and (max-width: 768px) {
  #chart-grid .chart-panel-header > .chart-symbol {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr) repeat(4, minmax(0, .58fr));
    grid-template-rows: 26px 26px;
    grid-auto-rows: 26px;
  }
  .chart-symbol > .chart-pick-sym,
  .chart-symbol > .chart-exch,
  .chart-symbol > .chart-pick-mt,
  .chart-symbol > .chart-pick-tf { grid-column: auto; grid-row: span 2; }
  #chart-grid .chart-symbol > .chart-tf-fav { grid-column: auto; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .right-panel {
    width: 280px;
  }

  #pair-search-wrap,
  #exchange-chip,
  #tf-select,
  #tf-select + .tf-separator { display: none; }
  #btn-idea { display: inline-flex; }
  .user-menu .um-idea { display: none; }

  .top-bar {
    padding: 4px 8px;
  }

  .pair-select {
    font-size: 13px;
  }

  .current-price {
    font-size: 16px;
  }

  .price-change {
    font-size: 12px;
  }

  .btn-sm {
    padding: 5px 8px;
    font-size: 11px;
  }

  .tf-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .panel-header {
    padding: 8px 10px;
    font-size: 11px;
  }

  .price-input {
    padding: 8px 6px;
    font-size: 13px;
  }

  .btn-long, .btn-short {
    padding: 10px 0;
    font-size: 13px;
  }

  .calc-row {
    font-size: 12px;
  }

  .info-row {
    font-size: 12px;
  }

  .position-item {
    font-size: 10px;
  }

  .pos-detail-row {
    font-size: 9px;
  }

  .wl-item {
    padding: 6px 10px;
    font-size: 12px;
  }

  .wl-symbol {
    font-size: 11px;
  }

  .wl-price, .wl-change {
    font-size: 11px;
  }
}

@media (min-width: 769px) {
  html[data-tablet-ui] .right-panel:not(.collapsed):not(.compact) { width: 280px; }
  html[data-tablet-ui] #chart-grid .chart-symbol > .chart-pick-sym { order: 1; }
  html[data-tablet-ui] #chart-grid .chart-symbol > .chart-exch { order: 2; }
  html[data-tablet-ui] #chart-grid .chart-symbol > .chart-pick-mt { order: 3; }
  html[data-tablet-ui] #chart-grid .chart-symbol > .chart-pick-tf { order: 4; }
  html[data-tablet-ui] #chart-grid .chart-symbol > .chart-tf-fav { order: 5; }
  html[data-tablet-ui] #btn-idea { display: inline-flex; }
  html[data-tablet-ui] .user-menu .um-idea { display: none; }
  html[data-tablet-ui] .calc-row > span:first-child,
  html[data-tablet-ui] .info-row > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-tablet-ui] .calc-value,
  html[data-tablet-ui] .info-value { flex: 0 0 auto; white-space: nowrap; }

  html[data-tablet-ui] .positions-list,
  html[data-tablet-ui] #open-orders-list,
  html[data-tablet-ui] #fills-list,
  html[data-tablet-ui] #trader-journal-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    grid-template-columns: minmax(max-content, 1fr);
    align-content: start;
  }
  html[data-tablet-ui] .positions-list > *,
  html[data-tablet-ui] #open-orders-list > *,
  html[data-tablet-ui] #fills-list > *,
  html[data-tablet-ui] #trader-journal-list > * {
    width: auto;
    min-width: 100%;
  }
}
@media (min-width: 1025px) {
  html[data-tablet-ui] .top-bar-merged { display: flex; }
  html[data-tablet-ui] #pair-search-wrap,
  html[data-tablet-ui] #exchange-chip { display: none; }
}

@media (max-width: 380px) {
  .top-bar-center {
    gap: 4px;
  }

  .current-price { font-size: 13px; }

  .tf-btn {
    padding: 5px 8px;
    font-size: 11px;
    min-width: 30px;
  }

  .btn-long, .btn-short {
    padding: 12px 0;
    font-size: 14px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .top-bar,
  .top-bar-merged {
    min-height: 32px !important;
    height: 32px !important;
    flex-wrap: nowrap !important;
    row-gap: 0 !important;
    padding: 2px 6px !important;
    overflow: hidden;
  }
  .top-bar-merged .top-bar-left {
    flex: 1 1 auto !important;
    min-width: 0;
    flex-wrap: nowrap !important;
    overflow: hidden;
  }
  .tib-inline { display: none !important; }

  .top-bar-center {
    display: flex !important;
    order: 2 !important;
    width: auto !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    margin-left: 6px;
  }
  .exchange-chip {
    height: 22px !important;
    padding: 0 4px 0 0 !important;
  }
  .exchange-chip-mark {
    width: 16px !important;
    height: 16px !important;
    margin-left: 2px !important;
    font-size: 9px !important;
  }
  .exchange-selector-wrap { margin: 0 2px !important; }
  .exchange-select {
    font-size: 10px !important;
    padding: 0 10px 0 3px !important;
    max-width: 56px;
  }
  .exchange-chip-divider { margin: 0 3px !important; }
  .leverage-badge {
    font-size: 10px !important;
    padding: 0 3px !important;
  }

  .top-bar-right {
    order: 3 !important;
    flex: 0 0 auto !important;
    gap: 2px !important;
  }

  .timeframe-bar {
    height: 28px !important;
    padding-top: 0;
    padding-bottom: 0;
  }
  .tf-btn {
    padding: 4px 9px !important;
    font-size: 11px !important;
    min-width: 32px !important;
  }

  .mob-tabbar {
    height: 40px !important;
  }
  .mob-tab {
    flex-direction: row !important;
    gap: 5px !important;
    font-size: 10px !important;
    padding: 4px 0 !important;
  }
  .mob-tab svg {
    width: 16px !important;
    height: 16px !important;
  }
  body { padding-bottom: 40px !important; }
  .right-panel { bottom: 40px !important; }

  .mobile-nav { height: 40px; padding-bottom: 0; }

  .wth-price  { width: 96px !important; }
  .wth-change { width: 72px !important; }
  .wl-item {
    padding: 7px 14px !important;
    min-height: 34px !important;
    font-size: 12px !important;
  }
  .wl-symbol { font-size: 12px !important; }
  .wl-price  { width: 96px !important; font-size: 12px !important; }
  .wl-change { width: 72px !important; font-size: 12px !important; }

  body[data-mob-view="trade"] .right-panel {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
    gap: 8px !important;
    padding: 10px 10px 60px !important;
  }
  body[data-mob-view="trade"] .right-panel > .panel-section {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 220px;
  }
  body[data-mob-view="trade"] .right-panel > [data-panel-section="watchlist"] {
    flex: 1 1 100% !important;
  }
}

@media (max-width: 768px) {
  body.chart-light .mobile-nav {
    background: #ffffff;
    border-top-color: #d5d8de;
  }

  body.chart-light .mob-tab.active {
    color: #2563eb;
  }
}

@supports (padding: env(safe-area-inset-top)) {
  @media (display-mode: standalone) {
    .top-section, .top-bar, .top-bar-merged {
      padding-top: env(safe-area-inset-top);
    }
    .timeframe-bar {
      padding-left: calc(8px + env(safe-area-inset-left));
      padding-right: calc(8px + env(safe-area-inset-right));
    }
    .positions-bar, .right-panel {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

@media (display-mode: standalone) {
  .pwa-install-banner { display: none !important; }
}

@media (max-width: 768px) {
  .mob-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.35);
  }
  .mob-tab {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--text-muted, #8b8f9a);
    font-size: 10px;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: color 0.12s;
  }
  .mob-tab svg {
    width: 22px;
    height: 22px;
  }
  .mob-tab.is-active {
    color: var(--accent, #2962ff);
  }
  .mob-tab:active {
    background: var(--film-040);
  }

  body { padding-bottom: 56px; }
  .main-layout { padding-bottom: 0; }

  body[data-mob-view="chart"] .right-panel {
    transform: translateX(100%) !important;
    pointer-events: none !important;
  }
  body[data-mob-view="chart"] .positions-bar {
    display: none !important;
  }
  body[data-mob-view="chart"] .chart-area {
    display: flex !important;
    flex: 1 1 auto;
  }

  body[data-mob-view="trade"] .chart-area {
    display: none !important;
  }
  body[data-mob-view="trade"] .positions-bar {
    display: none !important;
  }
  body[data-mob-view="trade"] .right-panel {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 56px !important;
    width: 100% !important;
    max-width: 100vw !important;
    transform: translateX(0) !important;
    z-index: 90 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-left: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body[data-mob-view="trade"] .right-panel [data-panel-section="order-form"],
  body[data-mob-view="trade"] .right-panel [data-panel-section="calculator"],
  body[data-mob-view="trade"] .right-panel [data-panel-section="trade-buttons"],
  body[data-mob-view="trade"] .right-panel [data-panel-section="trade-buttons-all"],
  body[data-mob-view="trade"] .right-panel [data-panel-section="actions"],
  body[data-mob-view="trade"] .right-panel #gsl-row {
    display: none !important;
  }
  body[data-mob-view="trade"]:not([data-mob-sub]) .right-panel #alerts-section,
  body[data-mob-view="trade"]:not([data-mob-sub]) .right-panel #watchlist,
  body[data-mob-sub="alerts"] .right-panel .panel-section:not(#alerts-section),
  body[data-mob-sub="quotes"] .right-panel .panel-section:not(#watchlist) {
    display: none !important;
  }
  body[data-mob-sub="alerts"] #alerts-list { max-height: none !important; }

  body[data-mob-view="positions"] .chart-grid,
  body[data-mob-view="positions"] .top-section {
    display: none !important;
  }
  body[data-mob-view="positions"] .right-panel {
    transform: translateX(100%) !important;
    pointer-events: none !important;
  }
  body[data-mob-view="positions"] .positions-bar {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 56px !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: var(--bg-primary, #0a0e14) !important;
    z-index: 90;
    padding-top: env(safe-area-inset-top, 0);
  }
  body[data-mob-view="positions"] .positions-bar .pos-tabs {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
  }
  body[data-mob-view="positions"] .positions-bar .mob-pos-actions {
    display: flex !important;
  }

  body[data-mob-view="menu"] .chart-area,
  body[data-mob-view="menu"] .right-panel,
  body[data-mob-view="menu"] .positions-bar {
    display: none !important;
  }

  #settings-modal { bottom: 56px !important; }
}

@media (max-width: 768px) {

  :root {
    --m-green:    #16c784;
    --m-green-2:  #00b897;
    --m-red:      #ea3943;
    --m-red-2:    #f6465d;
    --m-card-bg:  #131722;
    --m-card-bd:  #1f2433;
  }

  body[data-mob-view="chart"] .top-bar-merged {
    padding: 8px 8px !important;
    height: auto !important;
    min-height: 48px;
  }
  body[data-mob-view="chart"] .current-price {
    font-size: 18px !important;
    font-weight: 700;
  }
  body[data-mob-view="chart"] .price-change {
    font-size: 13px !important;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(22, 199, 132, 0.12);
  }
  body[data-mob-view="chart"] .price-change.down {
    background: rgba(234, 57, 67, 0.12);
  }

  body[data-mob-view="chart"] .grid-toggle-wrap,
  body[data-mob-view="chart"] #btn-refresh,
  body[data-mob-view="chart"] #btn-settings,
  body[data-mob-view="chart"] .tib-inline,
  body[data-mob-view="chart"] .ticker-bar-wrap {
    display: none !important;
  }
  #btn-support .bts-label { display: none; }
  #btn-support { padding: 0 8px; }
  #btn-tutorial .btk-label { display: none; }
  #btn-tutorial { padding: 0 8px; }
  #btn-tutorial .btk-icon { display: inline-flex; }

  body[data-mob-view="chart"] .user-info-wrap {
    gap: 2px !important;
    border-left: 0 !important;
    padding-left: 0 !important;
  }
  body[data-mob-view="chart"] .user-crown { left: calc(1px + 3px + 11px); }
  body[data-mob-view="chart"] .user-name { display: none !important; }
  body[data-mob-view="chart"] .top-bar-left,
  body[data-mob-view="chart"] .top-bar-center,
  body[data-mob-view="chart"] #tf-select { display: none !important; }
  body[data-mob-view="chart"] .btn-krytes-back {
    width: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
    font-size: 11px !important;
    border-radius: 3px !important;
  }
  body[data-mob-view="chart"] .user-menu .um-refresh,
  body[data-mob-view="chart"] .user-menu .um-settings { display: flex; }
  body[data-mob-view="chart"] .btn-krytes-back .kb-label { display: none !important; }
  body[data-mob-view="chart"] .btn-krytes-back .kb-icon {
    display: inline-flex !important;
    width: 17px; height: 17px;
  }
  body[data-mob-view="chart"] .btn-krytes-back .kb-arrow,
  body[data-mob-view="chart"] .btn-krytes-back .kb-labels { display: none !important; }

  body[data-mob-view="chart"] .top-bar-right {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    padding: 0 !important;
  }

  body[data-mob-view="chart"] .timeframe-bar {
    height: auto !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  body[data-mob-view="chart"] .tf-btn {
    flex: 0 0 auto !important;
    min-width: 38px;
    text-align: center;
  }
  body[data-mob-view="chart"] .timeframe-bar > #chart-type-select,
  body[data-mob-view="chart"] .timeframe-bar > #btn-add-ema,
  body[data-mob-view="chart"] .timeframe-bar > #tz-select {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    background-color: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    color: var(--text-secondary) !important;
  }
  body[data-mob-view="chart"] .timeframe-bar > #btn-add-ema { justify-content: center; }
  body[data-mob-view="chart"] .tf-separator { display: none !important; }

  body[data-mob-view="chart"] .chart-area {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  body[data-mob-view="trade"] .right-panel {
    background: var(--bg-primary) !important;
    padding: 12px 12px 80px !important;
  }
  body[data-mob-view="trade"] .panel-header,
  body[data-mob-view="trade"] .panel-config-bar,
  body[data-mob-view="trade"] .resize-handle-v {
    display: none !important;
  }
  body[data-mob-view="trade"] .panel-section {
    background: var(--m-card-bg) !important;
    border: 1px solid var(--m-card-bd) !important;
    border-radius: 12px !important;
    margin: 0 0 10px 0 !important;
    padding: 14px !important;
  }

  body[data-mob-view="trade"] .order-type-tabs {
    margin: -14px -14px 14px !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--m-card-bd);
    display: flex;
  }
  body[data-mob-view="trade"] .ot-tab {
    flex: 1 1 50%;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    padding: 14px 0 !important;
    font-size: 14px !important;
    font-weight: 600;
    color: var(--text-muted) !important;
    border-radius: 0 !important;
  }
  body[data-mob-view="trade"] .ot-tab.active {
    color: var(--text-primary) !important;
    border-bottom-color: var(--accent) !important;
  }

  body[data-mob-view="trade"] .price-input,
  body[data-mob-view="trade"] #limit-price-input,
  body[data-mob-view="trade"] #sl-input,
  body[data-mob-view="trade"] #tp-input,
  body[data-mob-view="trade"] .calc-input {
    height: 44px !important;
    padding: 10px 12px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }
  body[data-mob-view="trade"] .price-input-tif {
    flex: 0 0 90px;
  }

  body[data-mob-view="trade"] .input-label {
    width: 44px !important;
    height: 44px !important;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body[data-mob-view="trade"] .sl-label {
    background: rgba(234, 57, 67, 0.14) !important;
    color: var(--m-red) !important;
    border: 1px solid rgba(234, 57, 67, 0.3) !important;
  }
  body[data-mob-view="trade"] .tp-label {
    background: rgba(22, 199, 132, 0.14) !important;
    color: var(--m-green) !important;
    border: 1px solid rgba(22, 199, 132, 0.3) !important;
  }

  body[data-mob-view="trade"] .section-header {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    color: var(--text-muted) !important;
    margin-bottom: 10px !important;
  }
  body[data-mob-view="trade"] .section-icon { display: none; }

  body[data-mob-view="trade"] .calc-row {
    padding: 8px 0 !important;
    font-size: 13px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  body[data-mob-view="trade"] .calc-row span:first-child {
    color: var(--text-muted) !important;
    font-size: 12px !important;
  }
  body[data-mob-view="trade"] .calc-value {
    font-size: 14px !important;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  body[data-mob-view="trade"] .calc-volume {
    border-top: 1px solid var(--m-card-bd);
    padding-top: 12px !important;
    margin-top: 4px;
  }
  body[data-mob-view="trade"] .calc-volume span:first-child {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
  }
  body[data-mob-view="trade"] .volume-color {
    font-size: 18px !important;
    color: var(--m-green) !important;
  }

  body[data-mob-view="trade"] .info-row {
    padding: 7px 0 !important;
    font-size: 13px !important;
    display: flex;
    justify-content: space-between;
  }
  body[data-mob-view="trade"] .info-row span:first-child {
    color: var(--text-muted) !important;
    font-size: 12px !important;
  }
  body[data-mob-view="trade"] .info-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600 !important;
    font-size: 13px !important;
  }
  body[data-mob-view="trade"] .info-row-primary .info-value {
    font-size: 16px !important;
    color: var(--text-primary) !important;
  }

  body[data-mob-view="chart"] .gsl-row { margin-bottom: 7px !important; }

  body[data-mob-view="trade"] .trade-buttons:not(.all-trade-buttons) {
    position: fixed !important;
    bottom: 56px !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    background: linear-gradient(to top, var(--bg-primary) 78%, transparent) !important;
    border: 0 !important;
    border-radius: 0 !important;
    z-index: 95;
    display: flex !important;
    gap: 8px;
  }
  body[data-mob-view="trade"] .all-trade-buttons {
    display: flex !important;
    gap: 8px;
    opacity: 0.92;
  }
  body[data-mob-view="trade"] .all-trade-buttons .btn-long,
  body[data-mob-view="trade"] .all-trade-buttons .btn-short {
    height: 44px !important;
    font-size: 14px !important;
    box-shadow: none !important;
  }
  body[data-mob-view="trade"] .btn-long,
  body[data-mob-view="trade"] .btn-short {
    flex: 1;
    height: 52px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.6px !important;
    border-radius: 12px !important;
    text-transform: uppercase;
  }
  body[data-mob-view="trade"] .btn-long {
    background: var(--m-green) !important;
    color: #002818 !important;
    box-shadow: 0 4px 14px rgba(22, 199, 132, 0.35);
  }
  body[data-mob-view="trade"] .btn-short {
    background: var(--m-red) !important;
    color: #2b0007 !important;
    box-shadow: 0 4px 14px rgba(234, 57, 67, 0.35);
  }

  body[data-mob-view="trade"] .partial-close-section .pc-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px !important;
  }
  body[data-mob-view="trade"] .pc-btn {
    height: 36px !important;
    border-radius: 8px !important;
    font-size: 12px;
    font-weight: 600;
  }
  body[data-mob-view="trade"] .action-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  body[data-mob-view="trade"] .action-buttons .btn-action {
    height: 40px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
  body[data-mob-view="trade"] .action-buttons .btn-action:first-child {
    grid-column: 1 / -1;
  }

  body[data-mob-view="trade"] .right-panel,
  body[data-mob-view="trade"] .panel-section {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  body[data-mob-view="trade"] .panel-section { overflow-x: hidden !important; }
  body[data-mob-view="trade"] .alerts-add-form .input-row,
  body[data-mob-view="trade"] .limit-fields .input-row,
  body[data-mob-view="trade"] .sl-tp-section .input-row {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  body[data-mob-view="trade"] .ob-container,
  body[data-mob-view="trade"] .rt-container {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body[data-mob-view="trade"] .watchlist-body .wl-item {
    font-size: 12px !important;
  }

  body[data-mob-view="positions"] .pos-tabs {
    padding: 0 12px !important;
    display: flex;
    gap: 0 !important;
    border-bottom: 1px solid var(--m-card-bd);
    background: var(--bg-secondary);
  }
  body[data-mob-view="positions"] .pos-tab {
    padding: 14px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    color: var(--text-muted) !important;
    background: none !important;
  }
  body[data-mob-view="positions"] .pos-tab.active {
    color: var(--text-primary) !important;
    border-bottom-color: var(--accent) !important;
  }
  body[data-mob-view="positions"] .pos-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  body[data-mob-view="positions"] .positions-header {
    flex-wrap: wrap !important;
  }
  body[data-mob-view="positions"] .positions-header .pos-header-right {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    padding: 4px 12px 6px !important;
  }
  body[data-mob-view="positions"] .pos-tabs::-webkit-scrollbar { display: none !important; }
  body[data-mob-view="positions"] .pos-tab {
    white-space: nowrap !important;
    flex: 1 1 auto !important;
    padding: 14px clamp(3px, 1.2vw, 8px) !important;
    font-size: clamp(10px, 3vw, 13px) !important;
    letter-spacing: 0 !important;
  }
  body[data-mob-view="positions"] .positions-bar .pos-tabs { padding: 0 6px !important; }
  body[data-mob-view="positions"] .positions-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body[data-mob-view="positions"] #open-orders-list,
  body[data-mob-view="positions"] #fills-list,
  body[data-mob-view="positions"] #trader-journal-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body[data-mob-view="positions"] .positions-list,
  body[data-mob-view="positions"] #open-orders-list,
  body[data-mob-view="positions"] #fills-list,
  body[data-mob-view="positions"] #trader-journal-list {
    display: grid;
    grid-template-columns: minmax(max-content, 1fr);
    align-content: start;
  }
  body[data-mob-view="positions"] .positions-list > *,
  body[data-mob-view="positions"] #open-orders-list > *,
  body[data-mob-view="positions"] #fills-list > *,
  body[data-mob-view="positions"] #trader-journal-list > * {
    width: auto;
    min-width: 100%;
  }
  body[data-mob-view="positions"] .no-positions {
    padding: 48px 16px !important;
    text-align: center;
    color: var(--text-muted) !important;
    font-size: 14px !important;
    min-width: 100vw;
  }
  body[data-mob-view="positions"] .positions-header {
    background: var(--bg-secondary);
  }
}

@media (max-width: 768px) {
  body[data-mob-view="chart"] { --mob-chart-h: 50%; }

  body[data-mob-view="chart"] .chart-area {
    display: flex !important;
    flex: 1 1 var(--mob-chart-h, 53%) !important;
    min-height: 0 !important;
    width: 100% !important;
    position: relative !important;
  }

  body[data-mob-view="chart"] .right-panel {
    display: block !important;
    position: static !important;
    transform: none !important;
    pointer-events: auto !important;
    flex: 1 1 calc(100% - var(--mob-chart-h, 50%)) !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: var(--bg-primary) !important;
    padding: 8px 8px 12px !important;
    border-left: none !important;
    z-index: 1 !important;
  }
  body[data-mob-view="chart"] .right-panel::-webkit-scrollbar { width: 0; }
  @supports not selector(::-webkit-scrollbar) {
    body[data-mob-view="chart"] .right-panel { scrollbar-width: none; }
  }

  body[data-mob-view="chart"] .right-panel .panel-header,
  body[data-mob-view="chart"] .right-panel .panel-config-bar,
  body[data-mob-view="chart"] .right-panel .resize-handle-v,
  body[data-mob-view="chart"] .info-section,
  body[data-mob-view="chart"] #orderbook-section,
  body[data-mob-view="chart"] #watchlist,
  body[data-mob-view="chart"] #alerts-section {
    display: none !important;
  }

  body[data-mob-view="chart"] .panel-section {
    background: var(--m-card-bg) !important;
    border: 1px solid var(--m-card-bd) !important;
    border-radius: 10px !important;
    margin: 0 0 8px 0 !important;
    padding: 10px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  body[data-mob-view="chart"] .section-header { font-size: 11px !important; }
  body[data-mob-view="chart"] .section-icon { display: none !important; }

  body[data-mob-view="chart"] .price-input,
  body[data-mob-view="chart"] #limit-price-input,
  body[data-mob-view="chart"] #sl-input,
  body[data-mob-view="chart"] #tp-input,
  body[data-mob-view="chart"] .calc-input {
    height: 38px !important;
    font-size: 14px !important;
  }
  body[data-mob-view="chart"] .order-type-tabs {
    display: flex !important;
    gap: 6px !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  body[data-mob-view="chart"] .ot-tab {
    flex: 1 !important;
    border: 1px solid var(--border) !important;
    border-radius: 3px !important;
  }
  body[data-mob-view="chart"] .order-type-tabs { margin-bottom: 0 !important; }
  body[data-mob-view="chart"] .order-type-section .scale-fields { margin-top: 8px; }
  body[data-mob-view="chart"] .limit-fields.in-levels { margin-bottom: 6px; }

  body[data-mob-view="chart"] .sl-tp-section .input-row,
  body[data-mob-view="chart"] .limit-fields .input-row { gap: 6px !important; }
  body[data-mob-view="chart"] .sl-tp-section .input-label,
  body[data-mob-view="chart"] .limit-fields .input-label {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 38px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  body[data-mob-view="chart"] .sl-tp-section .input-row > .input-label,
  body[data-mob-view="chart"] .limit-fields .input-row > .input-label,
  body[data-mob-view="chart"] .limit-fields #limit-price-input,
  body[data-mob-view="chart"] .sl-tp-section #sl-input,
  body[data-mob-view="chart"] .sl-tp-section #tp-input { height: 44px !important; }
  body[data-mob-view="chart"] .limit-fields .entry-label { font-size: 18px !important; }
  body[data-mob-view="chart"] .sl-tp-section .input-label:active,
  body[data-mob-view="chart"] .limit-fields .input-label:active { filter: brightness(1.35) !important; }

  body[data-mob-view="chart"] .trade-buttons {
    position: static !important;
    gap: 8px !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 0 8px 0 !important;
    z-index: auto !important;
  }
  body[data-mob-view="chart"] .trade-buttons:not(.all-trade-buttons) { display: flex !important; }
  body[data-mob-view="chart"] .right-panel .trade-buttons {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  body[data-mob-view="chart"] .btn-long,
  body[data-mob-view="chart"] .btn-short {
    flex: 1 !important;
    height: 46px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
  }
  body[data-mob-view="chart"] .partial-close-section .pc-buttons {
    display: flex !important;
    gap: 6px !important;
  }
  body[data-mob-view="chart"] .pc-btn { flex: 1 !important; }
  body[data-mob-view="chart"] .action-buttons {
    display: flex !important;
    gap: 6px !important;
  }
  body[data-mob-view="chart"] .action-buttons .btn-action { flex: 1 !important; }

  body[data-mob-view="chart"] .left-toolbar {
    display: none !important;
    flex-direction: column !important;
    align-items: center !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: calc(100% - var(--mob-chart-h, 53%)) !important;
    width: 44px !important;
    margin: 0 !important;
    padding: 5px 0 !important;
    gap: 3px !important;
    z-index: 45 !important;
    border: 0 !important;
    border-right: 1px solid var(--border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  body[data-mob-view="chart"] .left-toolbar::-webkit-scrollbar { width: 0; }
  @supports not selector(::-webkit-scrollbar) {
    body[data-mob-view="chart"] .left-toolbar { scrollbar-width: none; }
  }
  body[data-mob-view="chart"] .left-toolbar .tb-btn {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 auto;
  }
  body[data-mob-view="chart"] .left-toolbar .tb-div { width: 22px !important; }
  body[data-mob-view="chart"] .left-toolbar .tb-flyout {
    flex-wrap: wrap !important;
    max-width: calc(100vw - 70px) !important;
    z-index: 60 !important;
  }

  body[data-mob-view="chart"] .mob-chart-resizer {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute !important;
    left: 0;
    right: 0;
    top: var(--mob-chart-h, 50%);
    transform: translateY(-50%);
    height: 28px;
    z-index: 47 !important;
    cursor: row-resize;
    touch-action: none;
    background: transparent;
  }

  body[data-mob-view] .resize-handle-v,
  body[data-mob-view] #resize-right-panel,
  body[data-mob-view] .resize-handle-h,
  body[data-mob-view] #resize-positions {
    display: none !important;
  }
  body[data-mob-view="chart"] .mob-chart-resizer .mob-resizer-grip {
    width: 46px;
    height: 5px;
    border-radius: 3px;
    background: var(--border, #2a2e38);
    box-shadow: 0 0 0 1px var(--film-100);
    transition: background 0.12s, width 0.12s;
  }
  body[data-mob-view="chart"] .mob-chart-resizer.dragging .mob-resizer-grip,
  body[data-mob-view="chart"] .mob-chart-resizer:active .mob-resizer-grip {
    background: var(--accent, #3b82f6);
    width: 64px;
  }
}

@media (max-width: 768px) {
  :root {
    --m-fs-2xs: 9px;
    --m-fs-xs:  11px;
    --m-fs-sm:  12px;
    --m-fs-md:  13px;
    --m-fs-lg:  15px;
    --m-fs-xl:  18px;
    --m-fs-2xl: 22px;

    --m-sp-1: 4px;  --m-sp-2: 6px;  --m-sp-3: 8px;
    --m-sp-4: 10px; --m-sp-5: 12px; --m-sp-6: 16px;
    --m-gutter: 12px;

    --m-radius-sm: 6px;  --m-radius: 10px;
    --m-radius-lg: 14px; --m-radius-pill: 999px;

    --m-surface-1: var(--bg-secondary);
    --m-surface-2: var(--bg-tertiary, var(--bg-secondary));
    --m-hairline: var(--border);
    --m-elev-1: 0 1px 2px rgba(0,0,0,0.20);
    --m-elev-2: 0 4px 16px rgba(0,0,0,0.28);
    --m-tabbar-elev: 0 -1px 0 var(--border), 0 -8px 24px rgba(0,0,0,0.30);

    --m-accent: #3b82f6;
    --m-accent-soft: rgba(59,130,246,0.16);
    --m-tab-active-bg: rgba(59,130,246,0.14);

    --m-tabbar-h: 58px;
  }
  body.chart-light {
    --m-card-bg: #ffffff;
    --m-card-bd: #e3e7ee;
    --m-accent: #2563eb;
    --m-accent-soft: rgba(37,99,235,0.12);
    --m-tab-active-bg: rgba(37,99,235,0.10);
    --m-elev-1: 0 1px 2px rgba(16,24,40,0.06);
    --m-elev-2: 0 6px 18px rgba(16,24,40,0.10);
    --m-tabbar-elev: 0 -1px 0 var(--border), 0 -8px 24px rgba(16,24,40,0.08);
  }
  body.chart-light[data-mob-view="chart"] .right-panel,
  body.chart-light[data-mob-view="trade"] .right-panel {
    background: #eef1f5 !important;
  }
}

@media (max-width: 768px) {
  .mob-tabbar {
    background: var(--bg-secondary) !important;
    box-shadow: var(--m-tabbar-elev) !important;
    border-top: 0 !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  .mob-tab {
    gap: 3px !important;
    padding: 7px 0 5px !important;
    font-size: var(--m-fs-2xs) !important;
    letter-spacing: 0.2px;
    color: var(--text-muted) !important;
    border-radius: 0 !important;
    transition: color 0.14s ease, transform 0.08s ease !important;
  }
  .mob-tab svg { width: 22px !important; height: 22px !important; transition: transform 0.14s ease; }
  .mob-tab.is-active,
  .mob-tab.active {
    color: var(--m-accent) !important;
    border-bottom: 0 !important;
    font-weight: 600 !important;
  }
  .mob-tab.is-active svg,
  .mob-tab.active svg { transform: translateY(-1px) scale(1.04); }
  .mob-tab:active { transform: scale(0.94); background: transparent !important; }

}

@media (max-width: 768px) and (orientation: portrait) {
  .mob-tabbar { height: var(--m-tabbar-h) !important; }
  .mob-tab svg { width: 22px !important; height: 22px !important; }
  body { padding-bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px)) !important; }
  body[data-mob-view="trade"] .right-panel,
  body[data-mob-view="positions"] .positions-bar { bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px)) !important; }
  body[data-mob-view="trade"] .trade-buttons:not(.all-trade-buttons) { bottom: var(--m-tabbar-h) !important; }
  #settings-modal { bottom: var(--m-tabbar-h) !important; }
}

@media (max-width: 768px) {
  .top-bar-merged {
    padding: var(--m-sp-3) var(--m-gutter) !important;
    gap: var(--m-sp-2) !important;
    box-shadow: inset 0 -1px 0 var(--m-hairline);
    background: var(--bg-primary);
  }
  .current-price {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
  }
  .price-change {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
    border-radius: var(--m-radius-sm) !important;
  }
  .exchange-chip {
    background: var(--m-surface-1);
    border: 1px solid var(--m-hairline);
    border-radius: var(--m-radius-pill);
    height: 24px;
  }
  .leverage-badge { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .tib-label { color: var(--text-muted); letter-spacing: 0.2px; }
  .tib-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-secondary); }

  .timeframe-bar { box-shadow: inset 0 -1px 0 var(--m-hairline); }
  .tf-btn { border-radius: var(--m-radius-sm); transition: color 0.12s ease, background 0.12s ease; }
  .tf-btn.active {
    color: var(--m-accent) !important;
    background: var(--m-tab-active-bg) !important;
    font-weight: 600;
  }
}

@media (max-width: 768px) {
  body[data-mob-view="trade"] .panel-section,
  body[data-mob-view="chart"] .panel-section {
    border-radius: var(--m-radius) !important;
    border: 1px solid var(--m-hairline) !important;
    box-shadow: var(--m-elev-1);
    margin-bottom: var(--m-sp-4) !important;
  }
  body[data-mob-view="trade"] .section-header,
  body[data-mob-view="chart"] .section-header {
    font-size: var(--m-fs-xs) !important;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-muted) !important;
  }
  body[data-mob-view="trade"] .calc-value,
  body[data-mob-view="trade"] .info-value,
  body[data-mob-view="chart"] .calc-value,
  body[data-mob-view="chart"] .info-value {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
  }
  body[data-mob-view="trade"] .ot-tab.active,
  body[data-mob-view="trade"] .pos-tab.active,
  body[data-mob-view="positions"] .pos-tab.active {
    border-bottom-color: var(--m-accent) !important;
    color: var(--text-primary) !important;
  }

  body[data-mob-view="trade"] .right-panel {
    padding-left: var(--m-gutter) !important;
    padding-right: var(--m-gutter) !important;
    scrollbar-width: none;
  }
  body[data-mob-view="trade"] .right-panel::-webkit-scrollbar { width: 0; }

  body[data-mob-view="trade"] .price-input,
  body[data-mob-view="trade"] .calc-input,
  body[data-mob-view="chart"] .price-input,
  body[data-mob-view="chart"] .calc-input {
    border-radius: var(--m-radius-sm) !important;
    border: 1px solid var(--m-hairline) !important;
    background: var(--bg-input) !important;
  }
}

@media (max-width: 768px) {
  .right-panel input:focus-visible,
  .right-panel button:focus-visible,
  .right-panel select:focus-visible,
  .top-bar input:focus-visible,
  .top-bar button:focus-visible,
  .mob-tabbar .mob-tab:focus-visible,
  .pair-search:focus-visible {
    outline: 2px solid var(--accent, #2962ff) !important;
    outline-offset: 1px !important;
    border-radius: 6px;
  }

  .right-panel {
    will-change: transform !important;
    backface-visibility: hidden;
  }

  .pair-dropdown {
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    min-width: min(220px, calc(100vw - 16px)) !important;
    left: 8px !important;
    right: 8px !important;
    box-sizing: border-box !important;
  }

  .mob-tabbar .mob-tab,
  .right-panel button,
  .top-bar button,
  .pos-close-btn,
  .pair-search {
    transition: transform 0.06s ease, filter 0.06s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-tabbar .mob-tab:active,
  .right-panel button:active,
  .top-bar button:active,
  .pos-close-btn:active,
  .pair-search:active {
    transform: scale(0.94);
    filter: brightness(1.12);
  }
}

@media (max-width: 768px) {
  body[data-mob-view="chart"] .right-panel .btn-click-clear,
  body[data-mob-view="trade"] .right-panel .btn-click-clear {
    opacity: 1 !important;
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    font-size: 14px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    border-radius: 6px !important;
  }
  body[data-mob-view="chart"] .order-type-tabs .ot-tab,
  body[data-mob-view="trade"] .order-type-tabs .ot-tab {
    min-height: 44px !important;
  }
  body[data-mob-view="chart"] .partial-close-section .pc-btn,
  body[data-mob-view="trade"] .partial-close-section .pc-btn {
    min-height: 44px !important;
  }
}

@media (max-width: 380px) {
  .right-panel .sl-tp-section .input-row,
  .right-panel .limit-fields .input-row,
  .right-panel .alerts-add-form .input-row {
    gap: 4px !important;
    margin-bottom: 6px !important;
    align-items: stretch !important;
  }
  body[data-mob-view="chart"] .right-panel .price-input,
  body[data-mob-view="chart"] .right-panel #limit-price-input,
  body[data-mob-view="chart"] .right-panel #sl-input,
  body[data-mob-view="chart"] .right-panel #tp-input,
  body[data-mob-view="chart"] .right-panel .calc-input,
  body[data-mob-view="trade"] .right-panel .price-input,
  body[data-mob-view="trade"] .right-panel #limit-price-input,
  body[data-mob-view="trade"] .right-panel #sl-input,
  body[data-mob-view="trade"] .right-panel #tp-input,
  body[data-mob-view="trade"] .right-panel .calc-input {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }
  body[data-mob-view="chart"] .right-panel .sl-tp-section .input-label,
  body[data-mob-view="chart"] .right-panel .limit-fields .input-label,
  body[data-mob-view="trade"] .right-panel .sl-tp-section .input-label,
  body[data-mob-view="trade"] .right-panel .limit-fields .input-label {
    height: 44px !important;
    min-height: 44px !important;
  }
  body[data-mob-view="chart"] .right-panel .calc-row .calc-input,
  body[data-mob-view="trade"] .right-panel .calc-row .calc-input {
    width: 120px !important;
    max-width: 45vw !important;
  }
  body[data-mob-view="chart"] .btn-long,
  body[data-mob-view="chart"] .btn-short,
  body[data-mob-view="trade"] .btn-long,
  body[data-mob-view="trade"] .btn-short {
    white-space: nowrap !important;
  }
}

@media (max-width: 380px) {
  .timeframe-bar {
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  }
  .timeframe-bar .tf-btn {
    min-height: 44px !important;
    min-width: 40px !important;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root { --mob-modal-gap: calc(var(--m-tabbar-h, 58px) + env(safe-area-inset-bottom, 0px) + 8px); }

  #alerts-modal .modal-box,
  #orders-modal .modal-box,
  #positions-modal .modal-box,
  #watchlist-modal .modal-box,
  #telegram-modal .modal-box {
    width: calc(100vw - 16px) !important;
    max-width: 460px !important;
    max-height: calc(100vh - var(--mob-modal-gap)) !important;
    max-height: calc(100dvh - var(--mob-modal-gap)) !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: var(--mob-modal-gap) !important;
  }
  #alerts-modal .modal-box .modal-body,
  #orders-modal .modal-box .modal-body,
  #positions-modal .modal-box .modal-body,
  #watchlist-modal .modal-box .modal-body,
  #telegram-modal .modal-box .modal-body,
  #settings-modal .settings-modal-v2 .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  #settings-modal .settings-modal-v2 {
    max-height: 100vh !important;
    max-height: 100dvh !important;
  }
  #alerts-modal.modal-overlay,
  #orders-modal.modal-overlay,
  #positions-modal.modal-overlay,
  #watchlist-modal.modal-overlay,
  #telegram-modal.modal-overlay {
    align-items: flex-start !important;
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
  }
}

@media (max-width: 768px) {
  body[data-mob-view="trade"] .right-panel .trade-buttons,
  body[data-mob-view="trade"] .right-panel [data-panel-section="trade-buttons"],
  body[data-mob-view="trade"] .right-panel [data-panel-section="trade-buttons-all"] {
    display: none !important;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  body[data-mob-view="chart"] .right-panel {
    scroll-padding-bottom: calc(var(--m-tabbar-h, 58px) + env(safe-area-inset-bottom, 0px) + 8px);
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  body[data-mob-view="chart"] .right-panel {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px) + 8px) !important;
    scroll-padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px) + 8px);
  }
}

@media (orientation: landscape) and (pointer: coarse) {
  .resize-handle-v { touch-action: none; }
  .resize-handle-v::before { left: -14px; width: 30px; }
  .resize-handle-h { touch-action: none; }
  .resize-handle-h::before { top: -14px; height: 30px; }
}

@media (pointer: coarse) {
  #chart-area,
  .chart-panel-wrap,
  .chart-panel,
  #chart-area canvas {
    -webkit-touch-callout: none;
  }
}

@media (max-width: 768px) {
  #terminal {
    height: 100% !important;
    zoom: var(--m-ui-zoom, 1);
  }
  #chart-area {
    zoom: calc(1 / var(--m-ui-zoom, 1));
  }
  .mob-only-row {
    display: flex !important;
  }
  #mob-zoom-reset {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10050;
    transform-origin: 100% 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px 0 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  }
  #mob-zoom-reset svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }
  .uizoom-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--border-color, #232a36);
    border-radius: 8px;
    overflow: hidden;
  }
  .uz-btn {
    min-width: 34px;
    height: 30px;
    border: none;
    background: none;
    color: var(--text-primary, #e6eaf0);
    font: 600 15px/1 var(--font, system-ui);
    cursor: pointer;
  }
  .uz-btn:active {
    background: var(--film-040);
  }
  .uz-btn:disabled {
    opacity: 0.35;
  }
  .uz-val {
    min-width: 46px;
    text-align: center;
    font: 500 12px/1 var(--font-mono);
    color: var(--text-secondary, #8b95a4);
    font-variant-numeric: tabular-nums;
  }
}
