.mobile-menu-button, .mobile-menu-backdrop { display: none; }
.dorna-portable-icon > svg { display: none; }
@media (max-width: 760px) {
  .dorna-portable-icon { display: inline-flex; width: 1em; height: 1em; vertical-align: -.12em; align-items: center; justify-content: center; flex-shrink: 0; }
  .dorna-portable-icon > .dorna-original-glyph { display: none; }
  .dorna-portable-icon > svg { display: block; width: 1em; height: 1em; }
  .desktop-shell, .desktop-shell.menu-expanded { grid-template-rows: 62px minmax(0, 1fr); }
  .desktop-topbar { gap: 8px; }
  .mobile-menu-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #78704b; border-radius: 4px; color: white; background: transparent; cursor: pointer; }
  .mobile-menu-button svg { width: 22px; height: 22px; }
  .desktop-brand { min-width: 0; flex: 1; gap: 7px; }
  .desktop-brand img { width: 34px; height: 34px; }
  .desktop-brand strong { font-size: 20px; }
  .desktop-brand small { display: none; }
  .desktop-top-actions { gap: 4px; }
  .desktop-top-actions .header-command { min-width: 38px; min-height: 40px; }
  .desktop-top-actions #logout, .desktop-top-actions #accountant-switch-company { display: inline-flex; }
  .desktop-top-actions .header-command.accent, .desktop-top-actions [data-header-route="help"] { display: none; }
  .desktop-top-actions #accountant-switch-company { max-width: 96px; white-space: normal; font-size: 11px; }
  .desktop-sidebar { display: none; }
  .mobile-menu-open .desktop-sidebar { display: flex; position: fixed; z-index: 31; top: 62px; bottom: 0; left: 0; width: min(300px, calc(100vw - 48px)); max-height: calc(100dvh - 62px); padding: 10px 6px; overflow: auto; gap: 3px; }
  .mobile-menu-open .desktop-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr); min-height: 44px; text-align: left; }
  .mobile-menu-open .desktop-nav .nav-label { display: block; opacity: 1; }
  .mobile-menu-open .desktop-nav-section { display: block; }
  .mobile-menu-open .desktop-nav.toggle { display: none; }
  .mobile-menu-open .mobile-menu-backdrop { display: block; position: fixed; z-index: 30; inset: 62px 0 0; border: 0; background: #0007; }
  .desktop-workspace { grid-column: 1; grid-row: 2; }
  .mobile-pdf-dialog { padding: 0; border-radius: 4px; }
  .mobile-pdf-shell { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); min-height: 0; height: 100%; }
  .mobile-pdf-shell > header { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #dedfd3; }
  .mobile-pdf-shell h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .mobile-pdf-shell button, .mobile-pdf-actions a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d6d7c9; border-radius: 4px; background: white; color: #70571c; cursor: pointer; text-decoration: none; }
  .mobile-pdf-shell button:disabled { opacity: .4; cursor: default; }
  .mobile-pdf-actions, .mobile-pdf-toolbar { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 10px; }
  .mobile-pdf-actions > * { flex: 1; font-size: 13px; }
  .mobile-pdf-actions [data-download] { background: #967014; color: white; }
  .mobile-pdf-toolbar [data-page] { min-width: 48px; text-align: center; font-size: 13px; }
  .mobile-pdf-shell [data-status] { margin: 0; padding: 0 12px 4px; font-size: 12px; }
  .mobile-pdf-shell [data-status]:empty { padding: 0; }
  .mobile-pdf-pages { min-width: 0; min-height: 0; overflow: auto; background: #eeefe8; overscroll-behavior: contain; }
  .mobile-pdf-pages canvas { display: block; margin: 12px auto; background: white; }
}

@media(max-width:760px){.desktop-brand > span{display:none}.desktop-top-actions #switch-company{display:inline-flex;max-width:88px;min-height:44px;white-space:normal;font-size:11px}.desktop-brand strong{font-size:17px}.mobile-pdf-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-width:100%;max-height:100%;margin:auto}.desktop-top-actions .header-pill{display:none}}

/* Keep the complete page proportional to the visible phone area. */
@media(max-width:760px){
 dialog.mobile-pdf-dialog{position:fixed;inset:0;width:100%;height:100dvh;max-width:100%;max-height:100dvh;margin:0;border:0;border-radius:0;box-sizing:border-box;overflow:hidden}
 .mobile-pdf-shell{min-width:0;overflow:hidden}
 .mobile-pdf-shell>header{gap:8px;padding:4px 8px}
 .mobile-pdf-actions{padding:4px 8px;gap:6px}
 .mobile-pdf-toolbar{display:grid;grid-template-columns:44px minmax(24px,1fr) 44px 44px 64px 44px;gap:4px;padding:4px 8px}
 .mobile-pdf-toolbar [data-page]{min-width:0;font-size:12px}
 .mobile-pdf-toolbar button{padding:0;min-width:0;font-size:13px}
 .mobile-pdf-pages{position:relative;overflow:auto;touch-action:pan-x pan-y pinch-zoom}
 .mobile-pdf-pages canvas{max-width:none;max-height:none;object-fit:contain;margin:8px auto}
}

/* Viewer styles must survive rotation beyond the navigation breakpoint. */
  dialog.mobile-pdf-dialog { padding: 0; border-radius: 4px; }
  .mobile-pdf-shell { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); min-height: 0; height: 100%; }
  .mobile-pdf-shell > header { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #dedfd3; }
  .mobile-pdf-shell h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .mobile-pdf-shell button, .mobile-pdf-actions a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d6d7c9; border-radius: 4px; background: white; color: #70571c; cursor: pointer; text-decoration: none; }
  .mobile-pdf-shell button:disabled { opacity: .4; cursor: default; }
  .mobile-pdf-actions, .mobile-pdf-toolbar { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 10px; }
  .mobile-pdf-actions > * { flex: 1; font-size: 13px; }
  .mobile-pdf-actions [data-download] { background: #967014; color: white; }
  .mobile-pdf-toolbar [data-page] { min-width: 48px; text-align: center; font-size: 13px; }
  .mobile-pdf-shell [data-status] { margin: 0; padding: 0 12px 4px; font-size: 12px; }
  .mobile-pdf-shell [data-status]:empty { padding: 0; }
  .mobile-pdf-pages { min-width: 0; min-height: 0; overflow: auto; background: #eeefe8; overscroll-behavior: contain; }
  .mobile-pdf-pages canvas { display: block; margin: 12px auto; background: white; }
 dialog.mobile-pdf-dialog{position:fixed;inset:0;width:100%;height:100dvh;max-width:100%;max-height:100dvh;margin:0;border:0;border-radius:0;box-sizing:border-box;overflow:hidden}
 .mobile-pdf-shell{min-width:0;overflow:hidden}
 .mobile-pdf-shell>header{gap:8px;padding:4px 8px}
 .mobile-pdf-actions{padding:4px 8px;gap:6px}
 .mobile-pdf-toolbar{display:grid;grid-template-columns:44px minmax(24px,1fr) 44px 44px 64px 44px;gap:4px;padding:4px 8px}
 .mobile-pdf-toolbar [data-page]{min-width:0;font-size:12px}
 .mobile-pdf-toolbar button{padding:0;min-width:0;font-size:13px}
 .mobile-pdf-pages{position:relative;overflow:auto;touch-action:pan-x pan-y pinch-zoom}
 .mobile-pdf-pages canvas{max-width:none;max-height:none;object-fit:contain;margin:8px auto}

/* Long document names must not enlarge implicit grid columns or scroll the shell on autofocus. */
dialog.mobile-pdf-dialog[open]{grid-template-columns:minmax(0,1fr)}
.mobile-pdf-shell{grid-template-columns:minmax(0,1fr);width:100%}
.mobile-pdf-shell>*{min-width:0;max-width:100%}
.mobile-pdf-shell>header{overflow:hidden}
.mobile-pdf-shell h2{flex:1 1 0%;width:0;min-width:0}
