/* Phone installation and quick navigation. Records still use the live server. */
[hidden] { display: none !important; }
.app-install-button { border: 1px solid #bed6fb; color: #0757c7; background: #eaf3ff; }
.app-install-button:hover { background: #dceaff; }
.app-mobile-nav, .app-close-menu, .app-menu-backdrop, .app-mobile-password { display: none; }
.app-offline-status { position: fixed; z-index: 110; top: 0; left: 0; right: 0; margin: 0; padding: .65rem 1rem; padding-top: calc(.65rem + env(safe-area-inset-top)); background: #fff7d8; color: #6b4b00; text-align: center; font-size: 1rem; }
.app-install-dialog { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; box-sizing: border-box; padding: 1.5rem; border: 1px solid #dce5f0; border-radius: 1rem; background: white; color: #162033; font-family: Calibri, Arial, sans-serif; box-shadow: 0 20px 65px #16203333; }
.app-install-dialog::backdrop { background: #16203388; }
.app-install-dialog:not([open]) { display: none; }
.app-install-heading { display: flex; align-items: start; gap: 1rem; justify-content: space-between; }
.app-install-heading h2 { margin: 0; font-size: 1.55rem; }
.app-install-heading .icon-btn { flex: none; }
.app-install-dialog p, .app-install-dialog li { font-size: 1.05rem; line-height: 1.55; }
.app-install-dialog h3 { margin-bottom: .4rem; }
.app-install-dialog ol { padding-left: 1.4rem; }
.app-install-dialog li { margin: .6rem 0; }
.app-install-note { color: #5f6d82; }
.app-dialog-fallback { position: fixed; z-index: 120; inset: 4vh 0 auto; margin: auto; }

@media (max-width: 900px) {
  .app-shell { min-height: 100vh; min-height: 100dvh; }
  .sidebar { height: 100vh; height: 100dvh; max-width: calc(100vw - 2.5rem); z-index: 72; padding-top: calc(1.05rem + env(safe-area-inset-top)); padding-bottom: calc(1.05rem + env(safe-area-inset-bottom)); }
  .side-brand { gap: .55rem; }
  .app-close-menu { display: grid; width: 44px; min-width: 44px; margin-left: auto; }
  .app-mobile-password { display: flex; flex: none; color: #0757c7; }
  .app-menu-backdrop:not([hidden]) { display: block; position: fixed; z-index: 71; inset: 0; width: 100%; height: 100%; border: 0; background: #16203380; border-radius: 0; }
  body.app-menu-is-open { overflow: hidden; }
  .app-mobile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; padding: .35rem max(.3rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.3rem, env(safe-area-inset-left)); border-top: 1px solid #dce5f0; background: #fffffffa; box-shadow: 0 -4px 20px #1620330d; }
  .app-mobile-nav button { border: 0; border-radius: .65rem; background: transparent; color: #5f6d82; min-height: 54px; padding: .3rem .15rem; display: grid; place-items: center; gap: .1rem; font-size: .78rem; font-weight: 700; }
  .app-mobile-nav button > span:first-child { font-size: 1.35rem; line-height: 1.2; }
  .app-mobile-nav button[aria-current="page"] { background: #eaf3ff; color: #0757c7; }
  .page-content { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
  .topbar { padding-top: calc(.85rem + env(safe-area-inset-top)); padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); gap: .55rem; }
  .topbar > div { min-width: 0; }
  .topbar h1 { overflow-wrap: anywhere; }
  .topbar .app-install-button { padding: .55rem .65rem; font-size: .85rem; white-space: nowrap; }
  .menu-btn, .icon-btn, .btn, .nav-btn { min-height: 44px; }
  .menu-btn, .icon-btn { min-width: 44px; }
  .login-card input, .scope-bar input, .scope-bar select, .form-grid input:not([type="checkbox"]):not([type="radio"]), .form-grid select, .form-grid textarea, .toolbar input, .toolbar select, .task-status, .email-status, .desk-filter-row input, .desk-filter-row select { font-size: 16px; min-height: 44px; }
  input[type="file"] { max-width: 100%; }
  .modal { padding-top: calc(1rem + env(safe-area-inset-top)); padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .modal-card { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  .login-brand { padding: calc(1.5rem + env(safe-area-inset-top)) 1.5rem 4.5rem; }
  .login-brand .brand-mark { width: 52px; height: 52px; margin-bottom: .85rem; border-radius: 14px; }
  .login-brand h1 { font-size: 2.5rem; }
  .login-brand > p:not(.eyebrow) { margin: .7rem 0 0; font-size: 1rem; line-height: 1.45; }
  .login-points { display: none; }
  .login-card { padding: 1.5rem; margin-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .topbar .eyebrow { font-size: .6rem; letter-spacing: .08em; }
  .topbar h1 { font-size: 1.35rem; }
  .top-actions { gap: .3rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media print { .app-mobile-nav, .app-menu-backdrop, .app-close-menu, .app-install-button, .app-offline-status, .app-install-dialog { display: none !important; } }
