/* =============================================================
 *  modals/pdf_viewer.css
 *  Extraído automaticamente de index.php.
 *  NÃO editar manualmente até remover o script de split.
 * ============================================================= */

    /* Visualizador de PDF (local, dentro do chat) */
    #pdf-viewer {
      position: fixed; inset: 0; z-index: 10055;
      background: rgba(0,0,0,.82);
      display: flex; flex-direction: column;
    }
    #pdf-viewer.d-none { display: none !important; }
    .pdfv-head {
      padding: max(12px, var(--zori-safe-top)) 12px 10px;
      display: flex; align-items: center; gap: 10px;
      color: #fff;
    }
    .pdfv-title {
      flex: 1; min-width: 0;
      font-weight: 900; font-size: 13px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      opacity: .95;
    }
    .pdfv-btn {
      height: 38px; padding: 0 12px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,.22);
      background: rgba(255,255,255,.10);
      color: #fff;
      font-weight: 900; font-size: 12px;
      cursor: pointer;
    }
    .pdfv-btn:active { transform: scale(.98); }
    .pdfv-stage {
      flex: 1; min-height: 0;
      padding: 0 10px max(10px, var(--zori-safe-bottom));
      display: flex;
    }
    .pdfv-frame {
      width: 100%; height: 100%;
      border: none;
      border-radius: 10px;
      background: #fff;
    }
    .pdfv-pages {
      width: 100%;
      height: 100%;
      border-radius: 10px;
      background: #fff;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      padding: 10px 10px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .pdfv-page {
      width: 100%;
      display: flex;
      justify-content: center;
    }
    .pdfv-page canvas {
      width: 100%;
      height: auto;
      max-width: 100%;
      background: #fff;
      border-radius: 8px;
      box-shadow: 0 1px 2px rgba(0,0,0,.08);
    }
    .pdfv-loading {
      color: #111827;
      font-weight: 900;
      font-size: 13px;
      padding: 12px;
      text-align: center;
      opacity: 0.8;
    }

    /* MOBILE (folha inferior) — comportamento antigo, via classe `.open` com transform. */
    #photo-sheet {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 10000;
      background: var(--panel); border-radius: 16px 16px 0 0;
      border: 1px solid var(--border); box-shadow: 0 -8px 32px rgba(0,0,0,.12);
      padding: 12px 16px max(16px, var(--zori-safe-bottom));
      transform: translateY(110%); transition: transform .22s ease;
    }
    #photo-sheet.open { transform: translateY(0); }

    /* DESKTOP (folha lateral, junto do clipe) — MESMO padrão do menu da setinha
       em `sidebar.css` (#lista-contatos-menu): `display: none ↔ block`, sem
       transição, sem `transform`. Isto elimina a hipótese de deslocamento ao fechar
       (não há duas transições a competir entre CSS base e inline JS). */
    #photo-sheet.folha-anexo-desktop {
      /* Desativa TUDO do mobile: transform, transition, padding inferior com safe-area. */
      display: none;
      position: fixed;
      left: auto;
      right: 12px;
      bottom: 80px;
      width: 320px;
      max-width: 320px;
      transform: none;
      transition: none;
      border-radius: 16px;
      padding: 10px;
      box-shadow: 0 10px 32px rgba(15, 18, 40, .16);
      z-index: 10000;
    }
    #photo-sheet.folha-anexo-desktop.visivel { display: block; }

    /* Backdrop: transparente e só captura clique quando aberto. */
    #photo-sheet-backdrop {
      position: fixed; inset: 0; z-index: 9999; background: transparent;
      opacity: 1; pointer-events: none; transition: none;
    }
    #photo-sheet-backdrop.open { pointer-events: auto; }
    .photo-sheet-actions { display: flex; flex-direction: column; gap: 10px; }
    .photo-sheet-actions button {
      width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--border);
      background: var(--surface); font-weight: 800; font-size: 15px; cursor: pointer; color: var(--text);
    }
    .photo-sheet-actions button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
    #chat-crop-overlay {
      display: none; position: fixed; inset: 0; z-index: 10001;
      background: rgba(15, 18, 40, .94);
      flex-direction: column;
      padding: max(10px, var(--zori-safe-top)) 12px max(12px, var(--zori-safe-bottom));
    }
    #chat-crop-overlay.open { display: flex; }
    .chat-crop-top {
      display: flex; justify-content: space-between; align-items: center; color: #fff;
      font-weight: 800; font-size: 15px; margin-bottom: 8px;
    }
    .chat-crop-top button {
      background: transparent; border: none; color: #a5b4fc; font-weight: 800; font-size: 15px; cursor: pointer; padding: 8px;
    }
    .chat-crop-top button.send { color: #fff; }
    .chat-crop-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
    #chat-crop-image { display: block; max-width: 100%; max-height: 72dvh; }
    .chat-crop-caption {
      margin-top: 10px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 14px;
      padding: 10px 12px;
    }
    #chat-crop-caption {
      width: 100%;
      resize: none;
      border: none;
      outline: none;
      background: transparent;
      color: #fff;
      font-family: inherit;
      font-size: 14px;
      line-height: 1.35;
      font-weight: 600;
      min-height: 44px;
    }
    #chat-crop-caption::placeholder { color: rgba(255,255,255,.6); }

    #attach-caption-overlay {
      position: fixed; inset: 0; z-index: 10020;
      background: rgba(15, 18, 40, .70);
      display: flex; align-items: center; justify-content: center;
      padding: max(10px, var(--zori-safe-top)) 12px max(12px, var(--zori-safe-bottom));
    }
    #attach-caption-overlay.d-none { display: none !important; }
    .attach-cap-box {
      width: min(520px, 96vw);
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 18px;
      box-shadow: 0 18px 45px rgba(0,0,0,.28);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      max-height: min(86vh, 620px);
    }
    .attach-cap-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
      gap: 10px;
    }
    .attach-cap-title { font-weight: 900; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .attach-cap-cancel, .attach-cap-send {
      border: none; background: transparent; cursor: pointer;
      font-weight: 900; font-size: 14px; padding: 8px 10px; border-radius: 12px;
      color: var(--accent);
    }
    .attach-cap-send { background: var(--accent); color: #fff; }
    .attach-cap-preview { padding: 14px; overflow: auto; }
    .attach-cap-preview .file-line { display: flex; align-items: center; gap: 10px; }
    .attach-cap-preview .file-ico { font-size: 20px; }
    .attach-cap-preview .file-name { font-weight: 900; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .attach-cap-preview .file-sub { margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--text-2); }
    .attach-cap-foot {
      border-top: 1px solid var(--border);
      padding: 12px 14px;
    }
    #attach-cap-caption {
      width: 100%;
      resize: none;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 10px 12px;
      outline: none;
      background: var(--surface);
      color: var(--text);
      font-family: inherit;
      font-size: 14px;
      line-height: 1.35;
      font-weight: 650;
      min-height: 44px;
    }

