/* BLOWER_HISTORY_MOBILE_DIALOG_CLOSE_V1
   Keep the asset-history dialog inside the iOS visual viewport so the
   header X and footer Close controls always remain reachable. */
@media (max-width: 700px),
  (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  #historyDialog.history-dialog[open] {
    position: fixed !important;
    top: max(6px, env(safe-area-inset-top)) !important;
    right: 6px !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    left: 6px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  #historyDialog .history-dialog-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }

  #historyDialog .dialog-header {
    position: sticky;
    top: 0;
    z-index: 5;
    flex: 0 0 auto;
    align-items: flex-start;
    padding: 12px 13px 10px;
    background: #ffffff;
  }

  #historyDialog .dialog-header > div {
    min-width: 0;
  }

  #historyDialog .dialog-header .icon-button[data-close-dialog="historyDialog"] {
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 6;
    cursor: pointer;
    touch-action: manipulation;
  }

  #historyDialog .dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 14px;
  }

  #historyDialog .history-dialog-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #d9e0e7;
    background: #ffffff;
  }

  #historyDialog .history-dialog-footer [data-close-dialog="historyDialog"] {
    display: block !important;
    width: 100%;
    min-height: 42px;
  }
}
