/* Additive mobile styles; desktop report and PDF print layouts stay intact. */
.demo-banner{position:fixed;bottom:0;left:0;right:0;z-index:10000;background:#b58b39;color:#111;padding:5px 12px calc(5px + env(safe-area-inset-bottom));text-align:center;font:600 12px Arial;pointer-events:none}
body{padding-bottom:calc(34px + env(safe-area-inset-bottom))}
.pwa-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:6px 12px;background:#f6f7f9}
.pwa-tools button{background:#162c40;color:white;border:0;border-radius:7px;padding:10px 14px;font:600 12px system-ui;min-height:44px}
.pwa-tools [hidden]{display:none!important}
#connectionStatus{color:#775000;font:600 13px system-ui;margin-right:auto}
.pwa-install-help{max-width:420px;width:calc(100% - 32px);padding:24px;border-radius:14px;line-height:1.6}
.pwa-install-help h2{font-size:22px}.pwa-install-help p{font-size:14px}
.mobile-ledger-nav{display:none}
@media screen and (max-width:760px){
  body{margin:0;min-width:0}
  .login-view{min-height:calc(100dvh - 96px);padding:24px 16px}
  .login-panel{width:100%;max-width:420px;padding:24px;box-sizing:border-box}
  input,select,textarea{font-size:16px!important;max-width:100%;box-sizing:border-box}
  button,.button-link{min-height:44px;touch-action:manipulation}
  .topbar{flex-direction:column;padding:12px;gap:12px}
  .brand{min-width:0}.brand h1{font-size:18px}.brand img{width:140px;height:auto}.brand p{font-size:11px}
  .topnav{width:100%;display:flex;overflow-x:auto;flex-wrap:nowrap;gap:6px}
  .topnav button{flex-shrink:0;font-size:12px;padding:10px}
  .layout{padding:10px;display:block;height:auto;min-width:0}
  .mobile-ledger-nav{display:flex;gap:6px;margin-bottom:10px;position:sticky;top:0;background:#f6f7f9;padding:6px 0;z-index:5}
  .mobile-ledger-nav button{flex:1;border:1px solid #d9dee7;background:white;color:#162c40;border-radius:8px;padding:9px 6px;font-size:12px}
  .mobile-ledger-nav button[aria-pressed=true]{background:#162c40;color:white;border-color:#162c40}
  .mobile-ledger-nav button[hidden]{display:none}
  #accountingView[data-mobile-panel=companies]>.documents-panel,#accountingView[data-mobile-panel=companies]>.detail-panel,
  #accountingView[data-mobile-panel=documents]>.clients-panel,#accountingView[data-mobile-panel=documents]>.detail-panel,
  #accountingView[data-mobile-panel=detail]>.clients-panel,#accountingView[data-mobile-panel=detail]>.documents-panel{display:none}
  .layout>.panel{min-width:0;min-height:calc(100dvh - 260px);height:auto}
  .panel-header{flex-wrap:wrap;gap:8px}.panel-header h2{font-size:15px;overflow-wrap:anywhere}
  .panel-header>div{display:flex;gap:6px;flex-wrap:wrap}
  .document-filter-row{flex-wrap:wrap}.document-filter-row>*{min-width:0;width:100%}
  .list{height:auto;max-height:none}.detail-panel .detail-body{height:auto;max-height:none;overflow:auto}
  .detail-body>*,.admin-layout>*{min-width:0;max-width:100%;box-sizing:border-box}
  .detail-body table{min-width:600px}.detail-body .summary{grid-template-columns:minmax(0,1fr)}
  .item{padding:14px 12px}.item strong,.item span{overflow-wrap:anywhere}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics .metric-wide{grid-column:1/-1}
  .invoice-pdf-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px}
  .invoice-pdf-toolbar-group{min-width:0;gap:5px}.invoice-pdf-toolbar-group:nth-child(2){justify-self:end}
  .invoice-pdf-toolbar-group:last-child{grid-column:1/-1;justify-self:stretch;justify-content:flex-end}
  .pdf-tool-button,.pdf-tool-link{min-height:44px;box-sizing:border-box}
  .invoice-pdf-stage{height:calc(100dvh - 300px);min-height:380px;padding:10px}
  .statement-toolbar{align-items:stretch;flex-direction:column}.statement-filters{justify-content:flex-start}
  .gold-toolbar>label,.gold-toolbar input{min-width:0;width:100%}
  .report-workspace .gold-toolbar .report-actions{flex-wrap:wrap}
  .report-workspace .gold-toolbar .report-actions button{min-height:44px}
  .gold-sidebar nav button{min-height:44px}
  .report-workspace .reports-body{padding-bottom:24px}
  .reports-table{font-size:12px}.report-detail-scroll{max-width:100%;overflow:auto}
  dialog.pdf-modal,dialog.support-upload-modal{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);box-sizing:border-box;margin:auto}
  dialog.pdf-modal{height:calc(100dvh - 24px)}
  .pdf-modal-header{gap:8px}.pdf-modal-header h2{font-size:16px;overflow-wrap:anywhere;min-width:0}.pdf-modal-header form{flex-shrink:0}
  .pdf-modal iframe{height:calc(100dvh - 156px);max-height:none}
  .pdf-modal-actions{flex-wrap:wrap;justify-content:stretch}.pdf-modal-actions .button-link{flex:1;text-align:center;box-sizing:border-box;font-size:12px}
  .support-upload-dialog-body{max-height:calc(100dvh - 200px);overflow:auto}
  .pwa-tools{flex-wrap:wrap;padding:8px 12px}#connectionStatus{flex-basis:100%}
}
@media print{.demo-banner,.pwa-tools,.mobile-ledger-nav{display:none!important}body{padding-bottom:0}}
