/* ══ RESPONSIVO GERAL — Tocador e Músico novo (03/12/2026) ══════════════════════════════════════════════════════
   Sandro: "o app tem MENU e ÁREA DE TRABALHO. No tablet e no celular o menu sai do caminho e a área de trabalho
   fica de um tamanho bom para trabalhar, com o dedo". Arquivo IGUAL nos dois apps, carregado por último
   (vence pelo html.mu-html na frente, sem !important). Medido por varredura em 8 tamanhos (scratchpad varredura_resp.py).
   Tamanhos: celular pequeno 360 · celular 390 · celular DEITADO (altura ≤ 500) · tablet em pé 768–834 ·
   tablet deitado 1024–1194 · PC ≥ 1280 (menu do lado, não muda aqui). */

/* ── 1. TOQUE: campo com letra < 16px faz o iPhone dar zoom sozinho ao tocar ── */
@media (pointer: coarse) {
  html.mu-html :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select) { font-size: 16px; }
  html.mu-html .m-ed-titulo input { font-size: 18px; }
  html.mu-html .m-ed-titulo input + input { font-size: 16px; }
}

/* ── 2. TOQUE: alvo pequeno vira alvo de dedo (mín. ~40px), sem mudar o desenho onde não precisa ── */
@media (pointer: coarse) {
  html.mu-html :is(.mu-voltar, .mg-seg button, .mg-barra__aula, .mu-acvista__b, .mu-etq-mais, .rd-segm__b, .es-chip, .mp-voz, .mp-modo-vozes, .mup-chip) { min-height: 40px; }
  html.mu-html :is(.mup-ilha__x, .mp-tr, .mua__bt, .es-icobtn, .mu-redondo) { min-width: 40px; min-height: 40px; }
  html.mu-html .mg-barra__aula { display: inline-flex; align-items: center; padding-inline: 8px; }
  html.mu-html .mu-voltar { display: inline-flex; align-items: center; }
  html.mu-html :is(input[type="checkbox"], input[type="radio"]) { width: 22px; height: 22px; }
  /* 2ª rodada (varredura depois): hino (Cifra 1 · Cifra 2 · Arranjo, História), cifra (⋯ da estrofe), estúdio (nome da pista, M/S),
     roda (sequência), conta, partitura (A− A+ Auto, lápis, ícones) */
  html.mu-html :is(.mu-hcab-seg button, .mu-hhist, .es-voz__nome, .rd-seq__ac, .mu-perfil-cartao__pagina, .mu-fmt__bt) { min-height: 40px; }
  html.mu-html :is(.m-sec__menu, .es-ms) { min-width: 40px; min-height: 40px; }
  html.mu-html .mp :is(.mp-ico, .mp-ativo, [data-acao="zoom-"], [data-acao="zoom+"], [data-porlinha]) { min-height: 40px; min-width: 40px; }
}

/* ── 3. CELULAR PEQUENO: menos borda, mais área ── */
@media (max-width: 479.98px) {
  html.mu-html .mu-tela { padding-left: max(1.6rem, env(safe-area-inset-left, 0px)); padding-right: max(1.6rem, env(safe-area-inset-right, 0px)); padding-top: calc(env(safe-area-inset-top, 0px) + 1.6rem); gap: 1.6rem; }
}

/* ── 4. MENU DE BAIXO (celular e tablet): some quando a pessoa rola para baixo (está trabalhando), volta ao subir
      ou ao chegar no fim. Classe posta pelo responsivo.js. `translate` soma com o transform/animação do menu. ── */
@media (max-width: 1279.98px) {
  html.mu-html .mu-abas { transition: translate .32s cubic-bezier(.4, 0, .2, 1), opacity .32s; }
  html.mu-html .mu-raiz.mu-raiz--rolando .mu-abas { translate: 0 calc(100% + 2.4rem + env(safe-area-inset-bottom, 0px)); opacity: 0; pointer-events: none; }
  /* a sombra atrás do menu: só a altura do menu (antes 11rem cobriam a última linha de trabalho) e some junto com ele */
  html.mu-html .mu-raiz:not(.mu-raiz--cheia)::after { height: calc(env(safe-area-inset-bottom, 0px) + 7.6rem); transition: opacity .32s; }
  html.mu-html .mu-raiz.mu-raiz--rolando::after { opacity: 0; }
  /* digitando (teclado do celular aberto): o menu não fica boiando em cima do campo */
  html.mu-html .mu-raiz.mu-raiz--digitando .mu-abas, html.mu-html .mu-raiz.mu-raiz--digitando::after { display: none; }
}

/* ── 5. CELULAR DEITADO (altura ≤ 500): o menu vira um TRILHO fino na esquerda (só ícones) e a área de trabalho
      ganha a altura toda. Antes: menu + sombra comiam ~45% da altura (390 px). ── */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1279.98px) {
  html.mu-html .mu-raiz:not(.mu-raiz--cheia) { padding-left: calc(7.2rem + env(safe-area-inset-left, 0px)); }
  html.mu-html .mu-raiz:not(.mu-raiz--cheia)::after { display: none; }
  html.mu-html .mu-abas { left: 0; top: 0; bottom: 0; right: auto; transform: none; translate: none; opacity: 1; pointer-events: auto; animation: none;
    width: calc(7.2rem + env(safe-area-inset-left, 0px)); max-width: none; flex-direction: column; justify-content: center; align-items: stretch; gap: .4rem;
    padding: .8rem .8rem .8rem calc(.8rem + env(safe-area-inset-left, 0px)); border-radius: 0; box-shadow: 1px 0 0 var(--m-borda); background: var(--m-superficie); }
  html.mu-html .mu-abas .mu-aba { justify-content: center; min-height: 4.4rem; padding: 0; flex: 0 0 auto; }
  html.mu-html .mu-abas .mu-aba__nome { display: none; }
  html.mu-html .mu-abas .mu-abas__luz { display: none; }
  html.mu-html .mu-abas .mu-aba--on { background: var(--m-ouro-brilho); color: #2a1d00; }
  html.mu-html .mu-tela { padding-top: calc(env(safe-area-inset-top, 0px) + 1.4rem); padding-bottom: 3.2rem; gap: 1.4rem; }
  html.mu-html .mu-raiz { --mu-menu-alto: 0px; }
  html.mu-html .mu-topo-btn { bottom: 1.2rem; }
}

/* ── 6. EDITOR DE CIFRA (área de trabalho nº 1) no celular: as ferramentas viram UMA linha que corre de lado
      e fica presa em cima junto com o título. Antes: 4 linhas de botões = 60% da tela antes da 1ª estrofe. ── */
@media (max-width: 760px) {
  html.mu-html .m-editor { padding-inline: 12px; }
  html.mu-html .m-ed-topo { gap: 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) 0 4px; background: var(--m-fundo); }
  html.mu-html .m-ed-topo .m-ico[data-acao="sair"] { min-width: 40px; min-height: 40px; }
  html.mu-html .m-ed-titulo input { font-size: 18px; padding: 0; }
  html.mu-html .m-ed-titulo input + input { font-size: 16px; }   /* < 16px = zoom do iPhone ao tocar */
  html.mu-html .m-ed-topo .m-btn--ouro { padding-inline: 12px; min-height: 40px; }
  html.mu-html .m-ed-barra { position: sticky; top: var(--m-ed-topo-alto, 56px); z-index: 19; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; scroll-snap-type: x proximity; margin-inline: -12px; padding: 4px 12px 8px; gap: 6px; background: var(--m-fundo);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  html.mu-html .m-ed-barra > * { scroll-snap-align: start; }
  html.mu-html .m-ed-barra .m-btn { min-height: 40px; padding-inline: 12px; white-space: nowrap; }
  html.mu-html .m-ed-barra [data-acao="desfazer"] { margin-left: 0; }
  html.mu-html .m-ed-dica { font-size: 12px; margin-bottom: 8px; }
  /* "Ver Cifra · Graus · Cifra + grau": uma linha só */
  html.mu-html .mg-barra { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  html.mu-html .mg-barra > * { flex: none; }
}
/* celular deitado: título e ferramentas lado a lado não cabem; o título rola embora e só a linha de ferramentas fica presa */
@media (orientation: landscape) and (max-height: 500px) {
  html.mu-html .m-ed-topo { position: relative; }
  html.mu-html .m-ed-barra { top: 0; }
}

/* ── 7. PARTITURA: no celular as linhas de ferramenta correm de lado (não empilham) e, deitado, o teclado da
      partitura encolhe para a pauta aparecer. (O detalhe fino da partitura vem na etapa "só partituras".) ── */
@media (max-width: 640px) {
  html.mu-html .mp-barra { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  html.mu-html .mp-barra > * { flex: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  html.mu-html .mp-aviso { display: none; }
  html.mu-html .mp-topo { padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 2px; }
  html.mu-html .mp-vozes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
  html.mu-html .mt--partitura { --mt-altura: 84px; }
  html.mu-html .mp-doca { gap: 4px; padding-top: 4px; }
}

/* ── 8. TABLET (em pé e deitado): a área de trabalho usa a largura toda que tem, com borda confortável ── */
@media (min-width: 600px) and (max-width: 1279.98px) {
  html.mu-html .mu-tela { padding-left: max(3.2rem, env(safe-area-inset-left, 0px)); padding-right: max(3.2rem, env(safe-area-inset-right, 0px)); }
  html.mu-html .m-editor { padding-inline: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html.mu-html .mu-abas, html.mu-html .mu-raiz::after { transition: none; }
}
