.chart-tools {
  flex-wrap: wrap;
  gap: 8px;
}

.symbol-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel2);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.symbol-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--panel);
}

.coin-mark:has(.symbol-avatar) {
  width: 30px;
  height: 30px;
  background: transparent;
}

.coin-mark .symbol-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.market-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-name > span:not(.symbol-avatar) {
  min-width: 0;
}

.order-direction-guide {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
}

.dual-order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dual-order-actions button {
  min-height: 48px;
  font-weight: 800;
}

.order-confirm-modal .box,
.execution-modal .box {
  width: min(430px, calc(100vw - 28px));
}

.order-message-summary {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.order-message-summary .summary-row {
  padding: 10px 12px;
  background: var(--panel);
}

.order-message-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.execution-modal .order-message-actions {
  grid-template-columns: 1fr;
}

.order-message-actions button {
  min-height: 46px;
}

.header-menu-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.trade-order-col > .account-card {
  display: none;
}

@media (max-width: 900px), (pointer: coarse) {
  body.mobile-chart-open .chart-stage {
    height: calc(100% - 76px);
    min-height: 0;
  }

  body.mobile-chart-open .chart-stage #chart {
    height: 100%;
  }

  .chart-tools {
    max-height: 74px;
    overflow-x: auto;
  }

  .chart-tools #chartSource {
    display: none;
  }

  .indicator-pane {
    height: 90px;
    min-height: 76px;
    flex-basis: 90px;
  }

  .indicator-settings-modal {
    align-items: flex-end;
    padding: 0;
  }

  .indicator-settings-modal .box {
    width: 100%;
    max-height: min(76dvh, 640px);
    margin: 0;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    overflow-y: auto;
  }

  .indicator-settings-grid {
    grid-template-columns: 1fr;
  }

  .indicator-settings-grid > label {
    min-height: 52px;
  }

  .indicator-settings-actions button,
  .indicator-settings-head button {
    min-height: 44px;
  }
}

.chart-intervals,
.chart-drawing-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-tools button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.chart-tools button.active {
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}

.chart-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 270px;
  overflow: hidden;
}

.chart-main-pane {
  position: relative;
  min-height: 180px;
  flex: 1 1 auto;
}

.chart-main-pane #chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.chart-indicator-legend {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 9px;
  display: flex;
  max-width: calc(100% - 70px);
  gap: 7px;
  flex-wrap: wrap;
  pointer-events: none;
  color: var(--muted);
  font-size: 9px;
}

.chart-indicator-legend span {
  padding: 2px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
}

.drawing-status {
  position: absolute;
  z-index: 4;
  right: 50%;
  bottom: 10px;
  max-width: calc(100% - 28px);
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #f2c94c 55%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  color: #f2c94c;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
  pointer-events: none;
  transform: translateX(50%);
}

.indicator-pane {
  position: relative;
  height: 108px;
  min-height: 88px;
  flex: 0 0 108px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.indicator-pane-head {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 8px;
  display: flex;
  gap: 8px;
  pointer-events: none;
  color: var(--muted);
  font-size: 9px;
}

.indicator-pane-head b {
  color: var(--text);
}

.indicator-chart {
  width: 100%;
  height: 100%;
}

.indicator-settings-modal {
  z-index: 10060;
}

.indicator-settings-modal .box {
  width: min(520px, calc(100vw - 28px));
}

.indicator-settings-head,
.indicator-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.indicator-settings-head h2 {
  margin: 0;
}

.indicator-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.indicator-settings-grid > label {
  display: grid;
  min-height: 50px;
  padding: 8px 10px;
  grid-template-columns: auto 1fr 72px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  font-weight: 700;
}

.indicator-settings-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.indicator-settings-grid input[type="number"] {
  height: 34px;
  padding: 5px 7px;
}

.indicator-fixed-period {
  grid-column: 3;
  color: var(--muted);
  font-size: 10px;
}

#chartDrawing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

#chartDrawing.drawing {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#chartDrawing line {
  stroke: #f2c94c;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

#chartDrawing g.selected line {
  stroke-width: 3;
  filter: drop-shadow(0 0 3px rgba(242,201,76,.65));
}

#chartDrawing .drawing-handle {
  fill: var(--panel);
  stroke: #f2c94c;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

#chartDrawing circle {
  fill: #f2c94c;
  stroke: var(--panel);
  stroke-width: 2;
}

.mobile-content-switch,
.mobile-bottom-nav {
  display: none;
}

.order-advanced {
  display: contents;
}

.order-advanced > summary {
  display: none;
}

.protection-entry {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.protection-entry-head {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.protection-entry-head span {
  color: var(--muted);
  font-size: 9px;
}

.protection-prices {
  display: grid;
  gap: 2px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.position-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.protection-modal .box {
  width: min(480px, 94vw);
}

.protection-modal-close {
  float: right;
}

.protection-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 4px;
}

.protection-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.protection-modal-actions button {
  min-height: 44px;
}

:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}

.overview-price,
.mobile-market-stats,
.order-summary,
.portfolio-panel table {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px), (pointer: coarse) {
  :root {
    --mobile-head-height: calc(48px + env(safe-area-inset-top));
    --mobile-nav-height: calc(64px + env(safe-area-inset-bottom));
    --mobile-action-height: 68px;
    --mobile-page-gap: 1px;
  }

  html,
  body {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--bg);
  }

  body.trading-app-active {
    position: fixed;
    inset: 0;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  button:active,
  .symbol-card:active {
    transform: none;
  }

  #appHead {
    position: fixed;
    z-index: 140;
    inset: 0 0 auto;
    display: grid;
    height: var(--mobile-head-height);
    padding: env(safe-area-inset-top) 8px 0;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  #appHead header {
    display: contents;
  }

  #appHead header h1 {
    grid-column: 1;
    min-width: 0;
    font-size: 0;
  }

  #appHead .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .market-class-bar {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .market-class-switch {
    width: 100%;
    max-width: 360px;
    height: 38px;
    margin: 0 auto;
    padding: 3px;
  }

  .market-class-btn {
    min-height: 32px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .mobile-nav-menu {
    display: block;
    grid-column: 3;
    grid-row: 1;
  }

  .mobile-menu-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
  }

  .mobile-menu-panel {
    position: fixed;
    z-index: 220;
    top: calc(var(--mobile-head-height) + 6px);
    right: 8px;
    width: min(240px, calc(100vw - 16px));
    padding: 8px;
    border-radius: 12px;
  }

  .mobile-menu-panel a,
  .mobile-menu-panel button {
    min-height: 46px;
    padding: 12px;
    font-size: 14px;
  }

  .spacer,
  .market-picker,
  .top-balances,
  .symbol-card-section,
  .balance-dashboard {
    display: none !important;
  }

  .wrap {
    position: fixed;
    inset: var(--mobile-head-height) 0 calc(var(--mobile-nav-height) + var(--mobile-action-height)) 0;
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 94px 48px minmax(0, 1fr);
    grid-template-areas:
      "overview"
      "mobile-switch"
      "chart";
    gap: var(--mobile-page-gap);
    overflow: hidden;
    background: var(--line);
  }

  .market-overview {
    grid-area: overview;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 94px;
    padding: 12px 14px;
    grid-template-columns: minmax(108px, .9fr) minmax(112px, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 6px 12px;
    overflow: hidden;
    background: var(--panel);
  }

  .overview-symbol {
    min-width: 0;
  }

  .coin-mark {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .overview-name {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-sub {
    max-width: 120px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-price {
    min-width: 0;
    text-align: right;
  }

  .overview-price strong {
    display: block;
    overflow: hidden;
    font-size: clamp(18px, 5vw, 24px);
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-price .krw-price {
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-market-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-market-stats div {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 7px;
    background: var(--panel2);
  }

  .mobile-market-stats span {
    display: block;
    color: var(--muted);
    font-size: 9px;
  }

  .mobile-market-stats b {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-overview .cinfo,
  .market-overview > .badge,
  .market-group-status:not(.show) {
    display: none;
  }

  .market-group-status.show {
    grid-column: 1 / -1;
    padding: 5px 7px;
    font-size: 9px;
  }

  .mobile-content-switch {
    grid-area: mobile-switch;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px 10px;
    gap: 4px;
    background: var(--panel);
  }

  .mobile-content-switch button {
    min-height: 38px;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-content-switch button.active {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
    background: color-mix(in srgb, var(--accent) 12%, var(--panel2));
    color: var(--text);
  }

  .trade-chart-col,
  .trade-book-col,
  .portfolio-card {
    width: 100%;
    min-width: 0;
    min-height: 0;
  }

  .trade-chart-col {
    grid-area: chart;
    display: flex;
    height: auto;
    overflow: hidden;
  }

  .trade-chart-col .card {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0;
    flex-direction: column;
  }

  .trade-chart-col .terminal-tabs {
    display: none;
  }

  .trade-chart-col .chart-tools {
    display: flex;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0 12px;
  }

  .trade-chart-col #chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1;
  }

  .trade-book-col {
    display: none;
    grid-area: chart;
    height: auto;
    overflow: hidden;
  }

  .trade-book-col .card {
    width: 100%;
    height: 100%;
    padding: 10px;
    overflow: hidden;
  }

  .trade-book-col h3 {
    height: 36px;
    min-height: 36px;
    margin: -10px -10px 0;
    padding: 0 10px;
    font-size: 10px;
  }

  .trade-book-col .book-head {
    height: 30px;
    min-height: 30px;
    margin: 0 -10px;
    padding: 0 8px;
    font-size: 9px;
  }

  .trade-book-col .ob-row {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 11px;
  }

  .trade-book-col .ob-mid {
    padding: 6px;
    font-size: 14px;
  }

  body[data-mobile-view="book"] .trade-chart-col {
    display: none;
  }

  body[data-mobile-view="book"] .trade-book-col {
    display: flex;
  }

  .portfolio-card {
    display: none !important;
    grid-area: chart;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--panel);
  }

  body[data-mobile-view="trades"] .trade-chart-col,
  body[data-mobile-view="positions"] .trade-chart-col,
  body[data-mobile-view="assets"] .trade-chart-col {
    display: none;
  }

  body[data-mobile-view="trades"] .portfolio-card,
  body[data-mobile-view="positions"] .portfolio-card,
  body[data-mobile-view="assets"] .portfolio-card {
    display: block !important;
  }

  body[data-mobile-view="positions"] .mobile-content-switch,
  body[data-mobile-view="assets"] .mobile-content-switch {
    grid-template-columns: 1fr;
  }

  body[data-mobile-view="positions"] .mobile-content-switch::before,
  body[data-mobile-view="assets"] .mobile-content-switch::before {
    align-self: center;
    padding-left: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
  }

  body[data-mobile-view="positions"] .mobile-content-switch::before {
    content: "내 포지션";
  }

  body[data-mobile-view="assets"] .mobile-content-switch::before {
    content: "내 자산";
  }

  body[data-mobile-view="positions"] .mobile-content-switch button,
  body[data-mobile-view="assets"] .mobile-content-switch button {
    display: none;
  }

  .portfolio-tabs {
    height: 46px;
    margin: 0;
    padding: 4px 10px;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .portfolio-tabs::-webkit-scrollbar {
    display: none;
  }

  .portfolio-tab {
    min-height: 38px;
    padding: 7px 2px;
    font-size: 11px;
    white-space: nowrap;
  }

  .portfolio-panel {
    height: calc(100% - 46px);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .portfolio-panel table {
    min-width: 720px;
  }

  #portfolio-positions .position-table {
    display: block;
    min-width: 0;
    table-layout: fixed;
  }

  #portfolio-positions .position-table thead {
    display: none;
  }

  #portfolio-positions .position-table tbody {
    display: block;
  }

  #portfolio-positions .position-table tr.position-row,
  #portfolio-positions .position-table tr.position-summary-row {
    display: grid;
    grid-template-columns: 0.82fr 1.08fr 1.25fr;
    width: 100%;
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  #portfolio-positions .position-table tr.position-summary-row {
    background: rgba(255, 255, 255, 0.025);
  }

  #portfolio-positions .position-table tr.position-row > td,
  #portfolio-positions .position-table tr.position-summary-row > td {
    display: block;
    min-width: 0;
    padding: 5px 4px;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
    font-size: 10px;
    line-height: 1.35;
  }

  #portfolio-positions .position-table tr.position-row > td:nth-child(2),
  #portfolio-positions .position-table tr.position-row > td:nth-child(5),
  #portfolio-positions .position-table tr.position-summary-row > td:nth-child(2),
  #portfolio-positions .position-table tr.position-summary-row > td:nth-child(5) {
    text-align: right;
  }

  #portfolio-positions .position-table .position-management {
    display: grid;
    gap: 5px;
    justify-content: stretch;
  }

  #portfolio-positions .position-table .position-actions {
    justify-content: flex-start;
  }

  #portfolio-positions .position-table .close-btn {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 10px;
  }

  #portfolio-assets table {
    min-width: 620px;
  }

  .trade-order-col > .account-card {
    display: none;
  }

  .trade-order-col > .order-entry-card {
    display: block;
    height: auto;
    max-height: none;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .trade-order-col .margin-mode {
    margin-bottom: 10px;
    padding: 9px 10px;
  }

  .trade-order-col .margin-mode span {
    font-size: 11px;
  }

  .trade-order-col .margin-mode button,
  .trade-order-col .type-toggle button,
  .trade-order-col .quick-buttons button {
    min-height: 44px;
    font-size: 12px;
  }

  .trade-order-col .side-toggle {
    margin: 0 0 12px;
  }

  .trade-order-col .side-toggle button {
    min-height: 48px;
    padding: 10px 4px;
    font-size: 13px;
  }

  .trade-order-col .order-head {
    display: flex;
    margin-bottom: 10px;
  }

  .trade-order-col .order-head h3 {
    display: block;
    font-size: 12px;
  }

  .trade-order-col .order-available {
    display: inline;
    font-size: 11px;
  }

  .trade-order-col .type-toggle {
    height: auto;
    margin-bottom: 10px;
    padding: 3px;
  }

  .trade-order-col .field {
    margin-bottom: 10px;
  }

  .trade-order-col label {
    font-size: 11px;
  }

  .trade-order-col input {
    height: 46px;
    margin-top: 5px;
    padding: 10px 12px;
    font-size: 15px;
  }

  .trade-order-col input[type="range"] {
    height: 36px;
    padding: 0;
  }

  .trade-order-col .quick-buttons {
    gap: 6px;
    margin: 6px 0 12px;
  }

  .trade-order-col .leverage-presets {
    grid-template-columns: repeat(3, 1fr);
  }

  .protection-entry .sideby {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .order-advanced {
    display: block;
    margin: 8px 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel2) 58%, transparent);
  }

  .order-advanced summary {
    display: flex;
    min-height: 46px;
    padding: 10px 12px;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    font-size: 11px;
  }

  .order-advanced summary::-webkit-details-marker {
    display: none;
  }

  .order-advanced summary span {
    color: var(--text);
  }

  .order-advanced[open] {
    padding: 0 10px 10px;
  }

  .order-advanced[open] summary {
    margin: 0 -10px 8px;
    border-bottom: 1px solid var(--line);
  }

  .trade-order-col .order-summary {
    max-height: none;
    margin: 10px 0 12px;
    padding: 11px;
    overflow: visible;
    font-size: 11px;
  }

  .trade-order-col .single-action {
    position: sticky;
    bottom: 0;
    width: 100%;
    min-height: 52px;
    padding: 10px;
    font-size: 15px;
  }

  body[data-mobile-view="trades"] .wrap,
  body[data-mobile-view="positions"] .wrap,
  body[data-mobile-view="assets"] .wrap {
    bottom: var(--mobile-nav-height);
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 180;
    inset: auto 0 0;
    display: grid;
    height: var(--mobile-nav-height);
    padding: 5px 6px env(safe-area-inset-bottom);
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .24);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-bottom-nav button > span {
    height: 22px;
    font-size: 19px;
    line-height: 22px;
  }

  .mobile-bottom-nav button > b {
    overflow: hidden;
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-nav button[aria-current="page"] {
    color: var(--accent);
  }

  .mobile-bottom-nav .mobile-trade-nav > span {
    display: grid;
    width: 34px;
    height: 26px;
    place-items: center;
    border-radius: 9px;
    background: var(--accent);
    color: #032018;
    font-weight: 900;
  }

  .mobile-bottom-nav i {
    position: absolute;
    top: 4px;
    left: calc(50% + 10px);
    display: grid;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    place-items: center;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 8px;
    font-style: normal;
  }

  body.market-dialog-open .mobile-bottom-nav {
    visibility: hidden;
  }

  body > .market-panel {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    width: auto;
    max-width: none;
    padding:
      env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: var(--panel);
  }

  body > .market-panel .market-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }

  body > .market-panel .market-panel-head {
    min-height: 62px;
    padding: 10px 12px;
  }

  body > .market-panel .market-search {
    height: 44px;
    font-size: 15px;
  }

  body > .market-panel .market-close {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .market-filters {
    padding: 8px 12px;
    gap: 6px;
  }

  .market-filter {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .market-columns,
  .market-row {
    grid-template-columns: 34px minmax(110px, 1fr) minmax(92px, .8fr) 54px;
  }

  .market-row {
    min-height: 54px;
    padding: 8px;
  }

  .market-star {
    min-height: 36px;
    padding: 6px;
  }

  .toast {
    top: calc(var(--mobile-head-height) + 8px);
    right: 12px;
    bottom: auto;
    left: 12px;
    z-index: 170;
    max-width: none;
  }

  .protection-modal {
    z-index: 10040;
    align-items: flex-end;
  }

  .protection-modal .box {
    width: 100%;
    max-width: none;
    max-height: min(84dvh, 720px);
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .protection-form-grid {
    grid-template-columns: 1fr;
  }

  /* CoinEx-style chart-first mobile terminal */
  :root {
    --mobile-head-height: calc(58px + env(safe-area-inset-top));
    --mobile-nav-height: calc(66px + env(safe-area-inset-bottom));
    --mobile-action-height: 0px;
  }

  #appHead {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: env(safe-area-inset-top) 14px 0;
    background: var(--panel);
    backdrop-filter: none;
  }

  #appHead header h1 {
    grid-column: 1;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 18px;
    letter-spacing: -.04em;
  }

  #appHead .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: none;
  }

  .market-class-bar {
    display: none;
  }

  .mobile-header-actions {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .mobile-header-icon,
  .mobile-menu-button {
    display: grid;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: 22px;
  }

  .mobile-nav-menu {
    display: block;
    grid-column: auto;
  }

  .mobile-menu-panel {
    top: calc(var(--mobile-head-height) + 4px);
  }

  .mobile-menu-markets {
    display: grid;
    margin-bottom: 6px;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .mobile-menu-panel .mobile-menu-markets button {
    min-height: 40px;
    padding: 8px 3px;
    border: 1px solid var(--line);
    text-align: center;
    font-size: 10px;
  }

  .mobile-market-logo {
    display: block;
    height: 14px;
    margin: 0 auto 2px;
  }

  .mobile-market-logo svg {
    display: block;
    width: 38px;
    height: 14px;
    margin: auto;
  }

  .mobile-market-logo-coin svg,
  .mobile-market-logo-nasdaq svg {
    width: 16px;
  }

  .mobile-menu-panel .mobile-menu-markets button.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--panel));
    color: var(--accent);
  }

  .wrap {
    inset: var(--mobile-head-height) 0 var(--mobile-nav-height);
    grid-template-rows: 184px 46px minmax(0, 1fr);
    grid-template-areas:
      "overview"
      "mobile-switch"
      "chart";
    background: var(--panel);
  }

  .market-overview {
    min-height: 184px;
    padding: 10px 18px 12px;
    grid-template-columns: minmax(0, 1fr) 138px;
    grid-template-rows: 42px minmax(0, 1fr);
    align-items: start;
    gap: 4px 10px;
    background: var(--panel);
  }

  .market-symbol-button {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    width: fit-content;
    min-width: 0;
    min-height: 42px;
    padding: 0;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
  }

  .coin-mark {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .overview-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    font-weight: 800;
  }

  .overview-name #curSym {
    display: none;
  }

  .overview-name .mobile-contract-code {
    display: inline;
  }

  .market-symbol-chevron {
    display: inline;
    color: var(--muted);
    font-size: 14px;
  }

  .overview-sub {
    display: none;
  }

  .overview-price {
    grid-column: 1;
    grid-row: 2;
    padding-top: 4px;
    text-align: left;
  }

  .overview-price strong {
    width: max-content;
    max-width: 100%;
    overflow: visible;
    color: var(--green);
    font-size: clamp(23px, 6.6vw, 29px);
    line-height: 1.05;
    letter-spacing: -.05em;
    text-overflow: clip;
    white-space: nowrap;
  }

  .overview-price strong.price-up,
  .overview-price strong.price-down {
    animation: none;
    background: transparent;
  }

  .mobile-price-change {
    margin-top: 5px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
  }

  .overview-price > small {
    display: none;
  }

  .overview-price .krw-price {
    margin-top: 4px;
    max-width: 210px;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-funding-line {
    display: grid;
    margin-top: 17px;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 4px 18px;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-funding-line span {
    display: grid;
    gap: 3px;
  }

  .mobile-funding-line b {
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .mobile-market-stats {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    padding-top: 5px;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 8px;
  }

  .mobile-market-stats div {
    display: grid;
    min-width: 0;
    padding: 0;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-radius: 0;
    background: transparent;
  }

  .mobile-market-stats span {
    align-self: center;
    font-size: 10px;
    text-align: right;
    white-space: nowrap;
    word-break: keep-all;
  }

  .mobile-market-stats b {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    text-align: right;
  }

  .mobile-technical-values {
    display: none !important;
  }

  @media (max-width: 360px) {
    .market-overview {
      grid-template-columns: minmax(0, 1fr) 124px;
    }

    .mobile-market-stats span {
      white-space: normal;
    }
  }

  .mobile-content-switch {
    grid-template-columns: repeat(5, minmax(62px, 1fr));
    padding: 0 12px;
    gap: 0;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .mobile-content-switch::-webkit-scrollbar {
    display: none;
  }

  .mobile-content-switch button {
    min-height: 45px;
    padding: 10px 8px 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-content-switch button.active {
    border-color: var(--accent);
    background: transparent;
    color: var(--accent);
  }

  body[data-mobile-view="positions"] .mobile-content-switch,
  body[data-mobile-view="assets"] .mobile-content-switch {
    grid-template-columns: repeat(5, minmax(62px, 1fr));
  }

  body[data-mobile-view="positions"] .mobile-content-switch::before,
  body[data-mobile-view="assets"] .mobile-content-switch::before {
    display: none;
  }

  body[data-mobile-view="positions"] .mobile-content-switch button,
  body[data-mobile-view="assets"] .mobile-content-switch button {
    display: block;
  }

  .trade-chart-col .card {
    border: 0;
    border-radius: 0;
  }

  .trade-chart-col .chart-tools {
    height: 48px;
    min-height: 48px;
    padding: 0 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    scrollbar-width: none;
  }

  .trade-chart-col .chart-tools::-webkit-scrollbar {
    display: none;
  }

  .trade-chart-col .chart-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1;
  }

  .trade-chart-col .chart-stage #chart {
    width: 100%;
    height: 100%;
  }

  .chart-intervals,
  .chart-drawing-tools {
    flex: 0 0 auto;
  }

  .chart-intervals button,
  .chart-drawing-tools button {
    min-height: 44px;
    padding: 8px 9px;
    border: 0;
    background: transparent;
    font-size: 10px;
    white-space: nowrap;
  }

  .chart-intervals button.active {
    color: var(--accent);
  }

  .mobile-bottom-nav {
    display: grid !important;
    height: var(--mobile-nav-height);
    padding: 5px 6px env(safe-area-inset-bottom);
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 97%, transparent);
    box-shadow: 0 -8px 24px rgba(0,0,0,.1);
  }

  .mobile-bottom-nav .mobile-trade-nav > span {
    width: 38px;
    height: 28px;
    border-radius: 9px;
    background: #0fb39f;
    color: #fff;
    font-size: 19px;
  }

  .mobile-bottom-nav .mobile-trade-nav > b {
    color: var(--text);
    font-weight: 750;
  }

  .mobile-bottom-nav .mobile-trade-nav:disabled {
    opacity: .42;
  }

  .trade-order-col {
    inset: max(8px, env(safe-area-inset-top)) 0 0;
  }

  .mobile-order-side-tabs {
    display: grid;
    margin: -14px -16px 14px;
  }

  .trade-order-col .dual-order-actions {
    display: none;
  }

  .trade-order-col .mobile-order-submit {
    display: block;
    color: #fff;
  }

  .trade-order-col .mobile-order-submit.buy {
    background: #0fb39f;
  }

  .trade-order-col .mobile-order-submit.sell {
    background: #e6523f;
  }

  .order-direction-guide {
    display: none;
  }

  /* Default 7:3 order and order-book workspace */
  .wrap {
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    grid-template-areas:
      "overview overview"
      "mobile-switch mobile-switch"
      "order book";
  }

  .trade-order-col {
    position: static;
    z-index: auto;
    grid-area: order;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
    overflow: hidden;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .trade-order-col > .order-entry-card {
    height: 100%;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .trade-order-col .mobile-order-side-tabs {
    margin: -10px -10px 10px;
  }

  .trade-order-col .margin-mode {
    margin-bottom: 7px;
    padding: 6px 8px;
  }

  .trade-order-col .margin-mode button,
  .trade-order-col .type-toggle button,
  .trade-order-col .quick-buttons button {
    min-height: 44px;
  }

  .trade-order-col .order-head {
    margin-bottom: 7px;
  }

  .trade-order-col .order-head h3 {
    display: none;
  }

  .trade-order-col .type-toggle {
    margin-bottom: 7px;
  }

  .trade-order-col .field {
    margin-bottom: 7px;
  }

  .trade-order-col input {
    height: 44px;
    margin-top: 3px;
  }

  .trade-order-col .quick-buttons {
    gap: 4px;
    margin: 4px 0 8px;
  }

  .trade-order-col .primary-leverage-control {
    margin: 2px 0 4px;
  }

  .trade-order-col .primary-leverage-control input[type="range"] {
    height: 34px;
    margin-top: 0;
  }

  .trade-order-col .quick-buttons button {
    padding: 5px 1px;
    font-size: 10px;
  }

  .trade-order-col .order-advanced {
    margin: 6px 0 8px;
  }

  .trade-order-col .order-summary {
    margin: 7px 0 9px;
    padding: 8px;
  }

  .trade-order-col .mobile-order-submit {
    min-height: 46px;
  }

  .trade-book-col {
    grid-area: book;
    display: flex;
    height: 100%;
    border-left: 0;
  }

  .trade-book-col .card {
    padding: 5px 3px;
    border: 0;
    border-radius: 0;
  }

  .trade-book-col h3,
  .trade-book-col .depth-ratio,
  .trade-book-col .depth-ratio-meta {
    display: none;
  }

  .trade-book-col .book-head {
    height: 28px;
    min-height: 28px;
    margin: 0;
    padding: 0 3px;
    grid-template-columns: 1fr .7fr;
    font-size: 8px;
  }

  .trade-book-col .book-head span:last-child,
  .trade-book-col .ob-row .total {
    display: none;
  }

  .trade-book-col .ob-row {
    min-height: 21px;
    padding: 2px 3px;
    grid-template-columns: 1fr .7fr;
    gap: 2px;
    font-size: 9px;
  }

  .trade-book-col .ob-mid {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 34px;
    padding: 5px 3px;
    flex: 0 0 34px;
    align-items: center;
    background: var(--panel);
    font-size: 10px;
  }

  .trade-book-col #asks,
  .trade-book-col #bids {
    min-height: 0;
    flex: 1 1 0;
    overflow: hidden;
  }

  body[data-mobile-view="book"] .trade-order-col {
    display: none;
  }

  body[data-mobile-view="book"] .trade-book-col {
    grid-column: 1 / -1;
  }

  body[data-mobile-view="trades"] .trade-order-col,
  body[data-mobile-view="positions"] .trade-order-col,
  body[data-mobile-view="assets"] .trade-order-col,
  body[data-mobile-view="trades"] .trade-book-col,
  body[data-mobile-view="positions"] .trade-book-col,
  body[data-mobile-view="assets"] .trade-book-col {
    display: none;
  }

  body[data-mobile-view="trades"] .portfolio-card,
  body[data-mobile-view="positions"] .portfolio-card,
  body[data-mobile-view="assets"] .portfolio-card {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  /* Expandable chart bottom sheet */
  .trade-chart-col {
    position: fixed;
    z-index: 10020;
    right: 0;
    bottom: var(--mobile-nav-height);
    left: 0;
    display: flex;
    width: 100%;
    height: 72dvh;
    max-height: calc(100dvh - env(safe-area-inset-top) - var(--mobile-nav-height));
    border-radius: 20px 20px 0 0;
    background: var(--panel);
    box-shadow: 0 -20px 60px rgba(0,0,0,.34);
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(105%);
    transition: height .22s ease, transform .24s cubic-bezier(.22,.61,.36,1), visibility 0s linear .24s;
  }

  body.chart-sheet-open .trade-chart-col {
    display: flex !important;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  body.chart-sheet-expanded .trade-chart-col {
    top: env(safe-area-inset-top);
    bottom: var(--mobile-nav-height);
    height: auto;
    max-height: none;
    border-radius: 0;
  }

  body.chart-sheet-expanded #appHead {
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-chart-sheet-head {
    position: relative;
    display: flex;
    height: 48px;
    min-height: 48px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--line);
  }

  .mobile-chart-sheet-head > b {
    font-size: 13px;
  }

  .mobile-chart-sheet-handle {
    position: absolute;
    inset: 0 auto auto 50%;
    width: 92px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateX(-50%);
    touch-action: none;
  }

  .mobile-chart-sheet-handle span {
    display: block;
    width: 40px;
    height: 4px;
    margin: 7px auto 0;
    border-radius: 4px;
    background: color-mix(in srgb,var(--muted) 55%,transparent);
  }

  .mobile-chart-sheet-close {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    z-index: 3;
  }

  .chart-sheet-backdrop {
    position: fixed;
    z-index: 10010;
    inset: 0 0 var(--mobile-nav-height);
    display: block;
    background: rgba(0,0,0,.38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s, visibility 0s linear .2s;
  }

  body.chart-sheet-open .chart-sheet-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .toast {
    top: calc(var(--mobile-head-height) + 8px);
    bottom: auto;
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  :root {
    --mobile-nav-height: calc(60px + env(safe-area-inset-bottom));
  }

  .wrap {
    grid-template-rows: 152px 42px minmax(0, 1fr);
  }

  .market-overview {
    min-height: 152px;
    padding: 7px 14px 9px;
  }

  .mobile-funding-line {
    margin-top: 8px;
  }

  .mobile-content-switch {
    padding: 0 8px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .wrap {
    grid-template-rows: 108px 42px minmax(0, 1fr);
  }

  .market-overview {
    min-height: 108px;
    padding: 6px 16px;
    grid-template-columns: 170px minmax(170px, .9fr) minmax(180px, 1fr);
    grid-template-rows: 36px 1fr;
  }

  .market-symbol-button {
    grid-column: 1;
  }

  .overview-price {
    grid-column: 2;
    grid-row: 1 / -1;
  }

  .overview-price strong {
    font-size: 25px;
  }

  .mobile-funding-line {
    margin-top: 6px;
  }

  .mobile-market-stats {
    grid-column: 3;
    grid-row: 1 / -1;
  }

  .trade-order-col {
    left: auto;
    width: 100%;
    border-left: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trade-order-col,
  .trade-chart-col,
  .chart-sheet-backdrop,
  .mobile-bottom-nav *,
  .mobile-content-switch *,
  .market-class-switch::before {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Mobile fast-order page: market summary -> chart -> order and book */
@media (max-width: 900px), (pointer: coarse) {
  :root {
    --mobile-head-height: calc(44px + env(safe-area-inset-top));
    --mobile-nav-height: env(safe-area-inset-bottom);
    --mobile-action-height: 0px;
  }

  #appHead {
    padding-right: 4px;
    padding-left: 6px;
    grid-template-columns: minmax(72px, 1fr) auto;
    gap: 2px;
  }

  #appHead header h1 {
    font-size: 15px;
    gap: 5px;
  }

  #appHead .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  #appHead .mobile-header-actions {
    gap: 0;
  }

  #appHead .mobile-header-tool,
  #appHead .mobile-menu-button {
    width: 32px;
    height: 38px;
    min-height: 38px;
    padding: 2px 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
  }

  #appHead .mobile-header-tool {
    position: relative;
    display: grid;
    grid-template-rows: 20px 10px;
    place-items: center;
    line-height: 1;
  }

  #appHead .mobile-header-tool > span {
    font-size: 18px;
    font-weight: 700;
  }

  #appHead .mobile-header-tool > b {
    overflow: hidden;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: -.04em;
    white-space: nowrap;
  }

  #appHead .mobile-header-tool[aria-current="page"] {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
  }

  #appHead .mobile-header-tool > i {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 13px;
    height: 13px;
    padding: 0 3px;
    border-radius: 7px;
    background: var(--red);
    color: #fff;
    font-size: 8px;
    font-style: normal;
    line-height: 13px;
    text-align: center;
  }

  #appHead .mobile-menu-button {
    display: grid;
    place-items: center;
    font-size: 18px;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  .wrap {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
    grid-template-rows: 72px 220px minmax(0, 1fr);
    grid-template-areas:
      "overview overview"
      "chart chart"
      "book order";
    align-content: stretch;
    row-gap: 5px;
    column-gap: 1px;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior-y: contain;
    scroll-padding-bottom: env(safe-area-inset-bottom);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-content-switch,
  .mobile-chart-sheet-head,
  .chart-sheet-backdrop {
    display: none !important;
  }

  .market-overview {
    min-height: 72px;
    padding: 6px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 8px;
  }

  .market-symbol-button {
    grid-column: 1;
    grid-row: 1;
    min-height: 38px;
  }

  .market-overview .overview-price {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-items: end;
    text-align: right;
  }

  .market-overview .overview-price strong {
    max-width: 190px;
    font-size: clamp(19px, 5.6vw, 27px);
  }

  .market-overview .overview-price small,
  .market-overview .krw-price,
  .mobile-market-stats,
  .mobile-funding-line,
  .market-overview .cinfo,
  .market-overview > .badge {
    display: none !important;
  }

  .market-group-status.show {
    position: absolute;
    right: 8px;
    bottom: 2px;
    left: 8px;
    padding: 2px 6px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trade-chart-col {
    position: static !important;
    z-index: auto;
    grid-area: chart;
    display: flex !important;
    width: 100%;
    height: 220px !important;
    min-height: 0;
    max-height: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    transition: none;
    scroll-margin-top: 0;
  }

  .trade-chart-col .card,
  .trade-chart-col .chart-stage {
    min-height: 0;
  }

  .trade-chart-col .chart-main-pane {
    min-height: 0;
  }

  .trade-order-col {
    grid-area: order;
    height: auto;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    border-right: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    overflow: hidden;
    scroll-margin-top: 0;
  }

  .trade-order-col > .order-entry-card {
    display: flex;
    height: 100%;
    min-height: 0;
    max-height: none;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .trade-order-col .mobile-order-side-tabs,
  .trade-order-col .mobile-order-submit {
    display: none !important;
  }

  .trade-order-col .dual-order-actions {
    display: grid;
    position: sticky;
    z-index: 4;
    bottom: 0;
    margin-top: auto;
    padding-top: 5px;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--panel);
  }

  .trade-order-col .dual-order-actions button {
    min-width: 0;
    min-height: 46px;
    padding: 6px 2px;
    color: #fff;
    font-size: 13px;
  }

  .trade-book-col {
    grid-area: book;
    height: auto;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .trade-book-col .card {
    min-height: 100%;
  }

  .trade-order-col > .order-entry-card {
    padding: 6px 6px 0;
  }

  .trade-order-col .margin-mode {
    min-height: 30px;
    margin-bottom: 4px;
    padding: 3px 5px;
  }

  .trade-order-col .margin-mode button,
  .trade-order-col .type-toggle button,
  .trade-order-col .quick-buttons button {
    min-height: 32px;
  }

  .trade-order-col .order-head,
  .trade-order-col .type-toggle,
  .trade-order-col .field {
    margin-bottom: 4px;
  }

  .trade-order-col input {
    height: 38px;
    margin-top: 2px;
  }

  .trade-order-col .quick-buttons {
    margin: 2px 0 4px;
  }

  .trade-order-col .primary-leverage-control {
    margin: 0;
  }

  .trade-order-col .primary-leverage-control input[type="range"] {
    height: 26px;
  }

  .trade-order-col .order-advanced {
    margin: 3px 0 4px;
  }

  .trade-order-col .order-summary {
    display: none;
  }

  body[data-mobile-view="book"] .wrap {
    grid-template-areas:
      "overview overview"
      "chart chart"
      "book book";
  }

  body[data-mobile-view="book"] .trade-order-col {
    display: none;
  }

  body[data-mobile-view="book"] .trade-book-col {
    display: flex;
    grid-column: 1 / -1;
    min-height: 540px;
  }

  body[data-mobile-view="trades"] .wrap,
  body[data-mobile-view="positions"] .wrap,
  body[data-mobile-view="assets"] .wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "overview"
      "portfolio";
  }

  body[data-mobile-view="trades"] .trade-chart-col,
  body[data-mobile-view="positions"] .trade-chart-col,
  body[data-mobile-view="assets"] .trade-chart-col,
  body[data-mobile-view="trades"] .trade-order-col,
  body[data-mobile-view="positions"] .trade-order-col,
  body[data-mobile-view="assets"] .trade-order-col,
  body[data-mobile-view="trades"] .trade-book-col,
  body[data-mobile-view="positions"] .trade-book-col,
  body[data-mobile-view="assets"] .trade-book-col {
    display: none !important;
  }

  body[data-mobile-view="trades"] .portfolio-card,
  body[data-mobile-view="positions"] .portfolio-card,
  body[data-mobile-view="assets"] .portfolio-card {
    grid-area: portfolio;
    display: block !important;
    width: 100%;
    height: 100%;
  }

  body.chart-sheet-open .trade-chart-col {
    position: fixed !important;
    z-index: 10020;
    inset: auto 0 var(--mobile-nav-height);
    display: flex !important;
    width: 100%;
    height: 72dvh !important;
    min-height: 0;
    max-height: calc(100dvh - env(safe-area-inset-top) - var(--mobile-nav-height));
    border: 0;
    border-radius: 18px 18px 0 0;
    background: var(--panel);
    box-shadow: 0 -20px 60px rgba(0,0,0,.34);
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.chart-sheet-expanded .trade-chart-col {
    top: env(safe-area-inset-top);
    bottom: var(--mobile-nav-height);
    height: auto !important;
    max-height: none;
    border-radius: 0;
  }

  body.chart-sheet-open .mobile-chart-sheet-head {
    display: flex !important;
  }

  body.chart-sheet-open .chart-sheet-backdrop {
    position: fixed;
    z-index: 10010;
    inset: 0 0 var(--mobile-nav-height);
    display: block !important;
    background: rgba(0,0,0,.4);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
