/* Chamada no celular (08h-chamada-celular.js): topo próprio, barra de 5 botões com alça e gaveta que sobe ao arrastar.
   No computador o painel é transparente (display: contents) e o topo/gaveta/cartão ficam escondidos. */
.cv-panel { display: contents; }
.cv-top, .cv-handle, .cv-sheet, .cv-alone { display: none; }

/* filtros da grade (valem em qualquer tela) */
.callgrid.only-video .tile:not(:has(video)) { display: none; }
.callgrid.hide-self .tile[data-key="me"] { display: none; }

@media (max-width: 700px) {
  .sv-main.callmode .callview { position: fixed; inset: 0; z-index: 45; flex-direction: column; background: #000; padding-top: env(safe-area-inset-top); }
  .sv-main.callmode .callgrid { flex: 1; min-height: 0; padding: 8px 12px 200px; align-content: center; }

  body:has(.sv-main.callmode) .topbar, body:has(.sv-main.callmode) .sbtoggle { display: none; }   /* a chamada ocupa a tela toda */
  .callbar #cbCam { order: 1; } .callbar #cbMic { order: 2; } .callbar #cbScreen { order: 3; } .callbar #cbSound { order: 4; } .callbar #cbLeave { order: 9; } .callbar .ptt { order: 5; }
  /* topo */
  .cv-top { display: flex; align-items: center; gap: 6px; flex: none; padding: 10px 12px 6px; position: relative; z-index: 4; }
  .cv-sp { flex: 1; }
  .cv-tb { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; background: none; color: #fff; cursor: pointer; }
  .cv-tb svg, .cv-title svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .cv-tb.on { background: #fff; color: #000; }
  .cv-tb[hidden] { display: none; }
  .cv-title { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 4px; border: 0; background: none; color: #fff; font: 700 16px 'Montserrat', sans-serif; cursor: pointer; }
  .cv-title .cv-tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cv-title .cv-tic { display: flex; opacity: .85; }
  .cv-title .cv-tic svg { width: 20px; height: 20px; }
  .cv-title .cv-tgo { display: flex; opacity: .7; }
  .cv-title .cv-tgo svg { width: 18px; height: 18px; }

  /* cartão "adicionar pessoas" */
  .cv-alone { display: flex; align-items: center; gap: 14px; position: absolute; left: 16px; right: 16px; bottom: calc(118px + env(safe-area-inset-bottom)); z-index: 3; padding: 16px 18px; border: 0; border-radius: 20px; background: #161616; color: #fff; text-align: left; cursor: pointer; font: inherit; }
  .cv-alone[hidden] { display: none; }
  .cv-alone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .cv-alone-ic, .cv-alone-go { display: flex; flex: none; }
  .cv-alone-go { opacity: .6; }
  .cv-alone-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cv-alone-tx b { font-size: 15px; font-weight: 600; }
  .cv-alone-tx small { font-size: 13px; color: rgba(255, 255, 255, .6); }

  /* painel de baixo: alça + barra + gaveta */
  .cv-panel { display: flex; flex-direction: column; position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5;
    border: 1px solid rgba(255, 255, 255, .1); border-radius: 26px; background: #121212; box-shadow: 0 -8px 40px rgba(0, 0, 0, .6);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), left .25s, right .25s, bottom .25s, border-radius .25s; touch-action: none; }
  .cv-panel.open { left: 0; right: 0; bottom: 0; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .cv-handle { display: block; align-self: center; width: 64px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
  .cv-handle::before { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .35); transform: translateX(-50%); }

  .sv-main.callmode .callbar { justify-content: space-between; gap: 6px; padding: 2px 16px 16px; }
  .callbar #cbSpk, .callbar #cbDeaf, .callbar #cbFlip, .callbar #cbBlur, .callbar #cbInvite, .callbar #cbChat { display: none; }   /* moram no topo e na gaveta */
  .callbar .cb:not(.ptt) { width: 60px; height: 60px; border-radius: 20px; border: 0; background: transparent; }
  .callbar .cb.off { background: rgba(255, 90, 90, .14); box-shadow: inset 0 0 0 1px rgba(255, 90, 90, .35); }
  .callbar .cb.on { background: #fff; color: #000; }
  .callbar .cb.leave { background: #d83a3a; color: #fff; }
  .callbar .cb svg { width: 26px; height: 26px; }

  .cv-sheet { display: block; max-height: 0; overflow: hidden; padding: 0 16px; transition: max-height .3s cubic-bezier(.22, 1, .36, 1); }
  .cv-panel.open .cv-sheet { max-height: 64vh; overflow-y: auto; padding-bottom: 18px; touch-action: pan-y; overscroll-behavior: contain; }
  .cv-gt { margin: 20px 4px 10px; font-size: 15px; color: rgba(255, 255, 255, .6); }
  .cv-group { border-radius: 18px; background: #0a0a0a; border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; }
  .cv-group + .cv-group { margin-top: 14px; }
  .cv-row { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 60px; padding: 12px 18px; border: 0; background: none; color: #fff; text-align: left; font: inherit; cursor: pointer; }
  .cv-row + .cv-row { border-top: 1px solid rgba(255, 255, 255, .08); }
  .cv-row:active { background: rgba(255, 255, 255, .05); }
  .cv-ic { display: flex; flex: none; }
  .cv-ic svg, .cv-go svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .cv-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cv-tx b { font-size: 16px; font-weight: 500; }
  .cv-tx small { font-size: 13px; color: rgba(255, 255, 255, .55); }
  .cv-go { display: flex; opacity: .6; }
  .cv-sw { flex: none; width: 52px; height: 30px; border-radius: 15px; background: rgba(255, 255, 255, .15); position: relative; transition: background .2s; }
  .cv-sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
  .cv-sw.on { background: #fff; }
  .cv-sw.on::after { transform: translateX(22px); background: #000; }
  .cv-radio { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); box-sizing: border-box; }
  .cv-radio.on { border: 8px solid #fff; }
  .sv-main.callmode .callstate { top: calc(64px + env(safe-area-inset-top)); }
  .sv-main.callmode ~ .calldock, body .sv-main.callmode .focus-exit { z-index: 46; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) { html:not(.motion-on) .cv-panel, html:not(.motion-on) .cv-sheet { transition: none; } }
