/* Camada para celular. Só acrescenta regras: não altera style.css, portal.css nem playback.css. */

/* Acesso rápido da Central: o botão herdava texto claro sobre fundo claro no tema claro. */
.ops-panel .quick-links .btn { background: #1a2029; color: #dbe5f2; }

/* Folha "Mais": criada pelo mobile-ui.js apenas em tela estreita. */
.m-sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: #0008; display: flex; align-items: flex-end; }
.m-sheet { inline-size: 100%; max-block-size: 78dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--panel); color: var(--fg); border-radius: 18px 18px 0 0; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px #0006; }
.m-sheet::before { content: ''; display: block; inline-size: 40px; block-size: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 12px; }
.m-sheet h2 { font-size: 15px; margin: 0 0 10px; }
.m-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.m-sheet-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-block-size: 76px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--fg); font: inherit; font-size: 12px; line-height: 1.2; text-align: center; cursor: pointer; }
.m-sheet-item svg { inline-size: 24px; block-size: 24px; }
.m-sheet-item[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.m-sheet-item:active { background: var(--line); }

@media (max-width: 700px) {
  /* Barra inferior: quatro destinos com rótulo + "Mais", no lugar de 15 ícones sem nome. */
  .portal-shell { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .portal-rail.m-ready { block-size: auto; min-block-size: 60px; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .portal-rail.m-ready > :not(.m-primary):not(.m-more) { display: none; }
  .portal-rail.m-ready .rail-link.m-primary,
  .portal-rail.m-ready .rail-link.m-more { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; inline-size: auto; min-inline-size: 0; min-block-size: 52px; margin: 0; border: 0; background: none; font: inherit; color: #e0ecff; }
  .portal-rail.m-ready .rail-link.selected { background: #ffffff26; color: #fff; }
  .portal-rail.m-ready .rail-link svg { inline-size: 23px; block-size: 23px; }
  .portal-rail.m-ready .rail-link .m-label { display: block; font-size: 10.5px; line-height: 1.1; white-space: nowrap; }

  /* Abas da câmera em uma linha rolável. */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: none; }

  /* Gravações: vídeo fixo no topo, linha do tempo logo abaixo, controles em faixas roláveis. */
  :has(> .playback-grid) { display: flex; flex-direction: column; }
  :has(> .playback-grid) > * { order: 5; }
  :has(> .playback-grid) > .playback-grid { order: 0; position: sticky; top: 64px; z-index: 6; background: var(--bg); padding-block: 4px; }
  :has(> .playback-grid) > .playback-timeline { order: 1; padding: 6px 0 0; }
  :has(> .playback-grid) > .playback-controls { order: 2; margin: 8px 0; gap: 8px; }
  :has(> .playback-grid) > .playback-zoom { order: 3; margin: 0 0 8px; }
  :has(> .playback-grid) > p.hint { display: none; }
  .playback-track { block-size: 84px; }
  .playback-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 6px 0 0; }
  .playback-legend span { flex: none; }
  :has(> .playback-grid) > .actions,
  .playback-controls .actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; inline-size: 100%; padding-block-end: 2px; }
  :has(> .playback-grid) > .actions::-webkit-scrollbar,
  .playback-controls .actions::-webkit-scrollbar,
  .playback-legend::-webkit-scrollbar { display: none; }
  :has(> .playback-grid) > .actions > *,
  .playback-controls .actions > * { flex: none; }
  .playback-controls .actions:first-child > button:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
  .playback-grid:fullscreen { position: static; }
}

/* Alvos de toque de pelo menos 44 px em tela de toque. */
@media (max-width: 700px) and (pointer: coarse) {
  .btn, .actions button, .tabs > *, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-block-size: 44px; }
}
.m-label { display: none; }
.portal-rail:not(.m-ready) .m-more { display: none; }
