/* ==========================================================================
   AXIONMESK — TRADE mobile: BOOK refinado (v2)
   - barras de profundidade sutis (12% de opacidade)
   - cabeçalho de colunas alinhado
   - preço médio destacado no centro
   - tipografia tabular consistente
   ========================================================================== */

@media (max-width: 900px) {

  /* ------------------------------------------------------------------------
     CABEÇALHO DA SHEET
     ------------------------------------------------------------------------ */
  .cm-book-head {
    padding: 4px 2px 10px !important;
    gap: 10px;
  }

  .cm-book-title {
    font-size: 15.5px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  /* pontinho dourado ao lado do título */
  .cm-book-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #386BFF;
    box-shadow: 0 0 8px rgba(56,107,255, .8);
    flex: 0 0 6px;
  }

  /* ------------------------------------------------------------------------
     CABEÇALHO DE COLUNAS (Preço | Qtd | Total)
     ------------------------------------------------------------------------ */
  .cm-book-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 4px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .035);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8996AA;
    flex: 0 0 auto;
  }
  .cm-book-cols span:nth-child(2) { text-align: center; }
  .cm-book-cols span:nth-child(3) { text-align: right; }

  /* ------------------------------------------------------------------------
     LINHAS DO BOOK — discretas e legíveis
     ------------------------------------------------------------------------ */
  .cm-book-body .book-row,
  .cm-book-body .brow,
  .cm-book-body > div > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    align-items: center;
    gap: 8px;
    padding: 5px 10px !important;
    border-radius: 6px;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    transition: background .12s ease;
  }

  /* Barras de profundidade MUITO sutis (antes eram 38%) */
  .cm-book-body .book-row::before,
  .cm-book-body .brow::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--depth, 0%);
    opacity: .12;
    pointer-events: none;
    border-radius: 4px;
  }

  /* Zebra quase imperceptível */
  .cm-book-body .book-row:nth-child(odd),
  .cm-book-body .brow:nth-child(odd) {
    background: rgba(255, 255, 255, .018) !important;
  }

  /* Colunas alinhadas */
  .cm-book-body .book-row > *:nth-child(1),
  .cm-book-body .brow > *:nth-child(1) {
    text-align: left;
    font-weight: 700;
  }
  .cm-book-body .book-row > *:nth-child(2),
  .cm-book-body .brow > *:nth-child(2) {
    text-align: center;
    color: #B4BAC5;
  }
  .cm-book-body .book-row > *:nth-child(3),
  .cm-book-body .brow > *:nth-child(3) {
    text-align: right;
    color: #8996AA;
  }

  /* Cores por lado (asks vermelho / bids verde) */
  .cm-book-body .book-row.is-ask > *:nth-child(1),
  .cm-book-body .brow.is-ask > *:nth-child(1) { color: #F6465D; }

  .cm-book-body .book-row.is-bid > *:nth-child(1),
  .cm-book-body .brow.is-bid > *:nth-child(1) { color: #16C784; }

  /* ------------------------------------------------------------------------
     PREÇO CENTRAL (spread)
     ------------------------------------------------------------------------ */
  .cm-book-mid,
  .cm-book-body .book-mid {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 10px !important;
    margin: 6px 0 !important;
    border-radius: 10px;
    background: rgba(56,107,255, .06);
    border-top: 1px solid rgba(56,107,255, .16);
    border-bottom: 1px solid rgba(56,107,255, .16);
  }

  .cm-book-mid__price,
  .cm-book-body #bookMid {
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: -.02em;
  }

  .cm-book-mid__arrow,
  .cm-book-body #bookArrow {
    font-size: 11px !important;
    opacity: .8;
  }

  /* ------------------------------------------------------------------------
     RODAPÉ
     ------------------------------------------------------------------------ */
  .cm-book-foot {
    padding: 10px 4px 0 !important;
    font-size: 10.5px !important;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 700;
  }

  /* ------------------------------------------------------------------------
     SHEET — altura e respiro
     ------------------------------------------------------------------------ */
  .cm-book-sheet {
    max-height: 72dvh !important;
  }

  .cm-book-body {
    padding: 2px 0 6px !important;
    min-height: 100px !important;
  }

  /* ------------------------------------------------------------------------
     BOTÃO "LIVRO" — mais discreto
     ------------------------------------------------------------------------ */
  .cm-book-btn {
    height: 27px !important;
    padding: 0 9px !important;
    font-size: 10.5px !important;
    gap: 4px !important;
    border-radius: 8px !important;
    border-color: rgba(56,107,255, .2) !important;
    background: rgba(56,107,255, .08) !important;
    opacity: .9;
  }

  .cm-book-btn:active {
    opacity: 1;
    background: rgba(56,107,255, .2) !important;
  }

  .cm-book-btn svg { width: 14px !important; height: 14px !important; }
}

/* --------------------------------------------------------------------------
   ACESSIBILIDADE
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cm-book-body .book-row,
  .cm-book-body .brow { transition: none !important; }
}
