/* Phone document reader. Desktop layout and document actions stay in portal.css. */
@media (max-width: 760px) {
  #app_view .bn-phone-invoice-backdrop {
    padding: 0 !important;
    top: var(--bn-phone-top, 0px) !important;
    bottom: auto !important;
    height: var(--bn-phone-height, 100dvh) !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }
  #app_view .bn-phone-invoice-screen {
    position: relative;
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f2f5fa;
    overflow: hidden;
  }
  #app_view .bn-phone-invoice-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    background: #fff;
  }
  #app_view .bn-phone-invoice-head > div { min-width: 0; }
  #app_view .bn-phone-invoice-head h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
  #app_view .bn-phone-invoice-head p { margin: 3px 0 0; color: #52657b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #app_view .bn-phone-invoice-summary { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 10px; background: #fff; }
  #app_view .bn-phone-invoice-summary strong { color: #102944; font-size: 18px; }
  #app_view .bn-phone-invoice-tabs { display: grid; flex: 0 0 auto; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 12px 8px; background: #fff; border-bottom: 1px solid #dfe6ef; }
  #app_view .bn-phone-invoice-tabs button { min-height: 44px; border: 0; border-radius: 9px; background: #eef3f9; color: #53627a; font: inherit; font-size: 13px; font-weight: 750; }
  #app_view .bn-phone-invoice-tabs button[aria-pressed="true"] { background: #123f68; color: #fff; }
  #app_view .bn-phone-invoice-content { flex: 1 1 auto; min-height: 0; min-width: 0; position: relative; display: flex; overflow: hidden; }
  #app_view .bn-phone-invoice-content > section { width: 100%; min-width: 0; min-height: 0; }
  #app_view .bn-phone-invoice-screen [hidden] { display: none !important; }
  #app_view .bn-phone-invoice-document { display: flex; flex-direction: column; overflow: hidden; }
  #app_view .bn-phone-invoice-document > .facturier-pdf-document { height: 100%; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
  #app_view .bn-phone-invoice-document .facturier-pdf-document-actions { flex: 0 0 auto; background: #fff; padding: 6px 12px; justify-content: flex-end; }
  #app_view .bn-phone-invoice-document .facturier-pdf-document-actions [data-facturier-pdf-print] { display: none; }
  #app_view .bn-phone-invoice-document .facturier-clean-pdf-viewer { flex: 1 1 auto; height: auto; min-height: 0; }
  #app_view .bn-phone-invoice-details { overflow: auto; padding: 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #app_view .bn-phone-invoice-details .facturier-detail-actions { display: none; }
  #app_view .bn-phone-invoice-details .facturier-detail { margin: 0; width: 100%; min-width: 0; }
  #app_view .bn-phone-individual-lifecycle { padding: 12px; background: #eef6ec; border: 1px solid #d5e5cf; border-radius: 10px; color: #245b23; }
  #app_view .bn-phone-individual-lifecycle p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; }
  #app_view .bn-phone-invoice-details :is(.facturier-document-meta, .facturier-related-grid) { grid-template-columns: minmax(0, 1fr); }
  #app_view .bn-phone-invoice-footer { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #dfe6ef; box-shadow: 0 -6px 20px #123f6810; }
  #app_view .bn-phone-invoice-footer .fv-action-primary { flex: 1 1 auto; }
  #app_view .bn-phone-invoice-screen :is(.fv-action-btn, .fv-action-link) { min-height: 44px; font-size: 13px; white-space: normal; }
  #app_view .bn-phone-invoice-actions { position: absolute; inset: auto 0 0; max-height: 75%; overflow-y: auto; z-index: 3; background: #fff; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); border: 1px solid #dfe6ef; border-radius: 18px 18px 0 0; box-shadow: 0 0 0 100vmax #10294488; overscroll-behavior: contain; }
  #app_view .bn-phone-invoice-actions header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
  #app_view .bn-phone-invoice-action-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #app_view .bn-phone-invoice-action-list button { justify-content: flex-start; padding: 12px; }
  #app_view .facturier-pdf-viewer-toolbar { gap: 4px; padding: 4px 6px; flex-wrap: nowrap; }
  #app_view .facturier-pdf-viewer-toolbar button { min-width: 44px; min-height: 44px; padding: 6px; flex-shrink: 0; font-size: 18px; }
  #app_view .facturier-pdf-viewer-toolbar span { font-size: 12px; }
  #app_view .facturier-pdf-viewer-toolbar [data-pdf-zoom] { display: none; }
  #app_view .facturier-pdf-canvas-wrap { padding: 8px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  #app_view .facturier-pdf-canvas-wrap canvas { flex: 0 0 auto; margin-inline: auto; }
  #app_view .facturier-pdf-viewer-fallback:not(.has-iframe) { min-height: 0; padding: 20px; text-align: center; align-content: center; }
}
