/* MyEFB v1.0.4 — Button design layer.
   Visual styling only. Intentionally does not set widths, heights, display,
   positions or layout grid properties; existing aviation controls retain their handlers. */
:root{
  --efb-button-accent:#087e91;
  --efb-button-positive:#14754b;
  --efb-button-warning:#9e610e;
  --efb-button-danger:#b32d40;
  --efb-button-frost:rgba(255,255,255,.84);
  --efb-button-frost-tinted:rgba(231,245,246,.89);
  --efb-button-shadow:0 3px 7px rgba(18,43,56,.11),0 11px 25px rgba(18,43,56,.12),inset 0 1px 0 rgba(255,255,255,.5);
  --efb-button-shadow-raised:0 4px 9px rgba(12,58,66,.15),0 15px 28px rgba(12,58,66,.17),inset 0 1px 0 rgba(255,255,255,.24);
}
body[data-theme="dark"]{
  --efb-button-accent:#51c0cc;
  --efb-button-positive:#78d4a4;
  --efb-button-warning:#eac17b;
  --efb-button-danger:#ff8993;
  --efb-button-frost:rgba(36,40,46,.82);
  --efb-button-frost-tinted:rgba(30,63,68,.78);
  --efb-button-shadow:0 3px 9px rgba(0,0,0,.24),0 14px 30px rgba(0,0,0,.36),inset 0 1px 0 rgba(255,255,255,.09);
  --efb-button-shadow-raised:0 5px 12px rgba(0,0,0,.33),0 17px 30px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.13);
}

/* Ordinary controls, including shortcuts, without affecting home app tiles,
   checklist rows, segmented-control geometry, or the fixed nav positions. */
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton,
  .checklistAddRow,.checklistTopComplete,.checklistTopReset,
  .flightDashboardRefresh,.eobtNow,.accountButton,.settingsButton
){
  box-sizing:border-box!important;
  border:0!important;
  border-radius:999px!important;
  font-weight:500!important;
  letter-spacing:-.01em;
  text-transform:none!important;
  white-space:nowrap;
  box-shadow:var(--efb-button-shadow)!important;
  transition:transform 170ms cubic-bezier(.2,.75,.2,1),
             box-shadow 170ms cubic-bezier(.2,.75,.2,1),
             background-color 170ms ease,
             color 170ms ease,
             filter 170ms ease!important;
  -webkit-tap-highlight-color:transparent;
}
/* Keep labels on one line without spilling into adjacent compact controls. */
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton
){overflow:hidden;text-overflow:ellipsis}

/* Set icon-to-label spacing only on controls already laid out as flex/grid.
   Do not change their display types or override responsive sizing. */
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton,.accountButton
){gap:10px!important}
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton,.accountButton
) :is(svg,.uiIcon){
  width:20px!important;height:20px!important;flex:0 0 20px!important;
}
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton,.accountButton
) svg[fill="none"]{stroke-width:2!important}

/* Frosted secondary surface; stronger float than the earlier flat buttons. */
body.menuHeaderInstalled :is(
  .secondaryButton,.settingsSecondary,.checklistNavAction,.checklistBackButton,
  .checklistAddRow,.checklistTopReset,.flightDashboardRefresh,.accountButton,.settingsButton
){
  background:var(--efb-button-frost)!important;
  color:var(--efb-text)!important;
  backdrop-filter:saturate(150%) blur(18px)!important;
  -webkit-backdrop-filter:saturate(150%) blur(18px)!important;
}
body.menuHeaderInstalled :is(.primaryButton,.settingsPrimary,.checklistSaveAction,.calculateButton){
  background:#087e91!important;
  color:#fff!important;
  box-shadow:var(--efb-button-shadow-raised)!important;
}
body.menuHeaderInstalled .efbHomeButton{
  background:#087e91!important;
  color:#fff!important;
  box-shadow:var(--efb-button-shadow-raised)!important;
  backdrop-filter:saturate(150%) blur(18px)!important;
  -webkit-backdrop-filter:saturate(150%) blur(18px)!important;
}
body.menuHeaderInstalled :is(.backButton,.checklistBackButton){
  background:var(--efb-button-frost-tinted)!important;
  color:var(--efb-button-accent)!important;
}

/* Graduated operational hierarchy: green start, amber abnormal,
   red emergency, softer red End Flight until the confirmation dialog. */
body.menuHeaderInstalled :is(.flightDashboardAction.initialise,.flightDashboardEndNo){
  background:#14754b!important;color:#fff!important;
  box-shadow:var(--efb-button-shadow-raised)!important;
}
body.menuHeaderInstalled .flightDashboardBlockButton.primary{
  background:color-mix(in srgb,var(--efb-button-positive) 13%,var(--efb-button-frost))!important;
  color:var(--efb-button-positive)!important;
}
body.menuHeaderInstalled .flightDashboardBlockButton.end{
  background:color-mix(in srgb,var(--efb-button-danger) 12%,var(--efb-button-frost))!important;
  color:var(--efb-button-danger)!important;
}
body.menuHeaderInstalled :is(.flightDashboardAction.abnormal){
  background:color-mix(in srgb,var(--efb-button-warning) 15%,var(--efb-button-frost))!important;
  color:var(--efb-button-warning)!important;
}
body.menuHeaderInstalled .flightDashboardAction.checklist{
  background:var(--efb-button-frost-tinted)!important;
  color:var(--efb-button-accent)!important;
}
body.menuHeaderInstalled :is(.flightDashboardAction.emergency,.flightDashboardEndYes){
  background:#b32d40!important;color:#fff!important;
  box-shadow:var(--efb-button-shadow-raised)!important;
}
body.menuHeaderInstalled :is(
  .flightDashboardAction.preflight-reset,.flightDashboardEndFlight,
  .flightDashboardBlockButton.reset,.dangerButton,.flightHistoryDelete
){
  background:color-mix(in srgb,var(--efb-button-danger) 12%,var(--efb-button-frost))!important;
  color:var(--efb-button-danger)!important;
}

/* Clearly filled current choices; no changes to segmented-control padding. */
body.menuHeaderInstalled :is(
  .settingsNav button.active,.routeModeToggle button.active,
  .routeModeToggle button[aria-pressed="true"],
  .timeModeToggle button.active,.unitToggle button.active
){
  background:var(--efb-button-accent)!important;
  box-shadow:0 3px 9px rgba(8,90,102,.18),inset 0 1px 0 rgba(255,255,255,.18)!important;
}
body.menuHeaderInstalled :is(
  .settingsNav button.active,.routeModeToggle button.active,
  .routeModeToggle button[aria-pressed="true"],
  .timeModeToggle button.active,.unitToggle button.active
){color:#fff!important}
body[data-theme="dark"].menuHeaderInstalled :is(
  .settingsNav button.active,.routeModeToggle button.active,
  .routeModeToggle button[aria-pressed="true"],
  .timeModeToggle button.active,.unitToggle button.active
){color:#071b1e!important}

/* Disabled controls are neutral and visibly inactive, not pale critical colours. */
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton,.eobtNow
):disabled{
  background:var(--efb-surface-tonal)!important;
  color:var(--efb-muted)!important;
  box-shadow:none!important;
  filter:grayscale(1)!important;
  opacity:.8!important;
  cursor:not-allowed!important;
}
@media(hover:hover) and (pointer:fine){
  body.menuHeaderInstalled :is(
    .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
    .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
    .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
    .flightDashboardEndNo,.flightDashboardEndYes,.efbHomeButton
  ):hover:not(:disabled){filter:brightness(1.055);box-shadow:var(--efb-button-shadow-raised)!important}
}
body.menuHeaderInstalled :is(
  .primaryButton,.secondaryButton,.settingsPrimary,.settingsSecondary,
  .backButton,.checklistNavAction,.checklistBackButton,.checklistSaveAction,
  .flightDashboardBlockButton,.flightDashboardAction,.flightDashboardEndFlight,
  .flightDashboardEndNo,.flightDashboardEndYes
):active:not(:disabled){transform:scale(.985)!important;filter:brightness(.97)}
/* Persistent Home's position is controlled by translations elsewhere. */
body.menuHeaderInstalled .efbHomeButton:active:not(:disabled){filter:brightness(.92)!important}

/* A label acknowledgment, when an existing action explicitly supplies
   data-efb-confirmation, may be displayed for 1.5 seconds by the UI.
   This stylesheet does not fabricate success or change any flight state. */
body.menuHeaderInstalled button[data-efb-confirmation-active="true"]{
  filter:brightness(1.08);
}
@media(prefers-reduced-motion:reduce){
  body.menuHeaderInstalled :is(button,[role="button"]){transition-duration:.01ms!important;animation-duration:.01ms!important}
}
@media(prefers-reduced-transparency:reduce){
  body.menuHeaderInstalled :is(
    .secondaryButton,.settingsSecondary,.checklistNavAction,.checklistBackButton,
    .checklistAddRow,.checklistTopReset,.flightDashboardRefresh,.accountButton,
    .settingsButton,.efbHomeButton
  ){backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
    background:var(--efb-surface-raised)!important}
  body.menuHeaderInstalled .efbHomeButton{background:#087e91!important}
}

/* Ephemeral confirmation copy overlays only already-selected controls. */
body.menuHeaderInstalled button[data-efb-button-ack]{position:relative!important;overflow:hidden}
body.menuHeaderInstalled button[data-efb-button-ack]::after{
  content:attr(data-efb-button-ack);
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;border-radius:inherit;
  color:#fff;background:#087e91;
  font-size:inherit;font-weight:500;letter-spacing:inherit;
}
body[data-theme="dark"].menuHeaderInstalled button[data-efb-button-ack]::after{
  background:#51c0cc;color:#071b1e;
}
