/* Shared browser, touch and viewport compatibility layer. */
html{
  max-width:100%;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{max-width:100%}

.login-screen{
  align-items:flex-start!important;
  -webkit-overflow-scrolling:touch;
}
#loginForm.login-card,
#passwordChangeForm.login-card{margin:auto}

.startup-screen,
.dashboard-page,
.aircraft-access-page,
.flight-registry-page,
.planning-page,
.settings-page,
.crew-portal-page,
.contracts-page,
.safety-page,
.instruction-page,
.maintenance-page,
.availability-records-page,
.login-screen,
.password-modal{
  min-height:100vh;
  min-height:100dvh;
}

.planning-modal,
.password-recovery-modal{
  box-sizing:border-box;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.planning-modal-box,
.password-recovery-card{
  max-width:100%;
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
  box-sizing:border-box;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.op02-ifr-grid{display:grid;grid-template-columns:minmax(130px,.35fr) auto minmax(280px,1fr);align-items:end;gap:10px}
.op02-ifr-action{display:flex;align-items:end}.op02-ifr-action button{white-space:nowrap}
.op02-ifr-description input[readonly],.op02-ifr-grid input[readonly]{background:#eef4fb;color:#0B2545;font-weight:700}
.op02-ifr-modal-box{width:min(760px,96vw)}
.op02-ifr-entry{display:grid;grid-template-columns:minmax(140px,1fr) minmax(130px,1fr) minmax(110px,150px) auto;gap:10px;align-items:end;margin:12px 0}
.op02-ifr-entry>div{min-width:0}.op02-ifr-entry select,.op02-ifr-entry input{width:100%;box-sizing:border-box}.op02-ifr-entry button{align-self:end}
.op02-ifr-tags{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.op02-ifr-tag{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:7px 8px;border:1px solid #b9c9dd;border-radius:6px;background:#f7faff;color:#0B2545}
.op02-ifr-tag button{min-height:32px;padding:4px 7px;font-size:12px}.op02-ifr-tag button[data-ifr-remove]{background:#b42318}
.date-range-popover,
.flight-registry-filter-popover,
.crew-civ-filter-popover,
.stat-filter-popover{
  max-width:calc(100vw - 24px);
  max-height:calc(100vh - 24px);
  max-height:calc(100dvh - 24px);
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.dashboard-expandable-panel.is-expanded .dashboard-map{
  min-height:calc(100vh - 92px);
  min-height:calc(100dvh - 92px);
}
.dashboard-expandable-panel.is-expanded .dashboard-map svg{
  height:calc(100vh - 92px);
  height:calc(100dvh - 92px);
}
.dashboard-kpi-detail{
  max-height:calc(100vh - 32px);
  max-height:calc(100dvh - 32px);
}

:where(button,a[href],input,select,textarea,[tabindex]:not([tabindex="-1"])):focus-visible{
  outline:3px solid rgba(22,131,58,.32);
  outline-offset:2px;
}

@supports(padding:max(0px)){
  .startup-screen,
  .login-screen,
  .password-modal{
    padding-top:max(10px,env(safe-area-inset-top));
    padding-right:max(10px,env(safe-area-inset-right));
    padding-bottom:max(10px,env(safe-area-inset-bottom));
    padding-left:max(10px,env(safe-area-inset-left));
  }
  .planning-modal,
  .password-recovery-modal{
    padding-top:max(12px,env(safe-area-inset-top));
    padding-right:max(12px,env(safe-area-inset-right));
    padding-bottom:max(12px,env(safe-area-inset-bottom));
    padding-left:max(12px,env(safe-area-inset-left));
  }
  .internal-footer{
    padding-bottom:max(8px,env(safe-area-inset-bottom));
  }
}

@media(max-width:900px), (hover:none), (pointer:coarse){
  /* Prevent Safari iOS from zooming the viewport when a compact form field receives focus. */
  input:not([type="checkbox"]):not([type="radio"]),
  select{
    font-size:16px!important;
    height:44px!important;
    min-height:44px!important;
  }
  textarea{
    font-size:16px!important;
    min-height:44px!important;
  }
  body button:not(.menu-hotspot):not(.startup-instruction-link):not(.startup-instruction-hotspot):not(.startup-aircraft-link):not(.aircraft-access-hotspot){
    min-height:44px!important;
  }
  .planning-modal,
  .password-recovery-modal{align-items:flex-start}
  .planning-modal-box,
  .password-recovery-card{
    max-height:calc(100vh - 24px);
    max-height:calc(100dvh - 24px);
  }
  .dashboard-expandable-panel.is-expanded .dashboard-map{
    min-height:calc(100vh - 76px);
    min-height:calc(100dvh - 76px);
  }
  .dashboard-expandable-panel.is-expanded .dashboard-map svg{
    height:calc(100vh - 76px);
    height:calc(100dvh - 76px);
  }
}

@media(max-width:640px){
  .op02-ifr-grid,.op02-ifr-entry{grid-template-columns:minmax(0,1fr)}
  .op02-ifr-action,.op02-ifr-description,.op02-ifr-entry button{grid-column:auto;grid-row:auto}
  .op02-ifr-action button,.op02-ifr-entry button{width:100%}
  .op02-ifr-tag{width:100%;justify-content:space-between;flex-wrap:wrap}
}

@media(hover:none), (pointer:coarse){
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  [role="button"]{
    min-height:44px!important;
    touch-action:manipulation;
  }
  .menu-hotspot,
  .startup-instruction-link,
  .startup-instruction-hotspot,
  .startup-aircraft-link,
  .aircraft-access-hotspot{
    min-height:0!important;
  }
  .settings-option-row button,
  .settings-option-add button,
  .settings-record-actions button,
  .cargo-row-actions button,
  .stat-filter-actions button{
    min-height:44px!important;
  }
  .planning-toolbar button,
  .settings-record-toolbar button,
  .password-recovery-actions button,
  .contracts-actions button,
  .internal-footer button{
    min-height:44px;
  }
  .menu-hotspot,
  .startup-instruction-link,
  .startup-instruction-hotspot,
  .startup-aircraft-link,
  .aircraft-access-hotspot{
    -webkit-tap-highlight-color:rgba(22,131,58,.18);
  }
}

@media print{
  html,body{max-width:none}
}
/* Registro de Voo: retorno discreto do cálculo solar automático. */
.op02-solar-status {
  display: flex;
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  align-items: center;
  gap: 0.5rem;
  color: #52657a;
  font-size: 0.78rem;
  line-height: 1.35;
}

.op02-solar-status:empty { min-height: 0; margin: 0; }
.op02-solar-status.is-loading { color: #785a00; }
.op02-solar-status.is-error { color: #9f1d20; }
.op02-solar-status.is-success { color: #24613b; }
.op02-solar-status button {
  width: auto;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .op02-solar-status { align-items: flex-start; flex-direction: column; }
}
