/* Targeted layout corrections. Keep the application theme and printed pages. */
@media screen {
  .shell > *, .content, .card, .cardbody, .contact-link-grid,
  .visit-layout, .calendar-shell, .calendar-shell > *,
  .wf-card, .wf-cardbody, .wf-auth-layout > *, .mail-pane {
    min-width: 0;
  }
  .content { width: 100%; }
  .pagehead > div { min-width: 0; max-width: 100%; }
  .pagehead h1, .pagehead .subtitle { overflow-wrap: anywhere; }
  .tablewrap {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .wf-table-scroll, .document-paper-wrap, .calendar-main {
    min-width: 0;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .cardbody:has(> table) { overflow-x: auto; }
  .toolbar > button, .document-toolbar button,
  .wealth-subnav button, .wf-request-actions button {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .modalhead h2, .wf-dialoghead h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .modalhead > button, .wf-dialoghead > button { flex: 0 0 auto; }

  /* The body scrolls while the actions stay available on short viewports. */
  #dialog, #wfDialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
  }
  #dialog > form, #wfDialog > form {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    min-width: 0;
  }
  #dialog .modalbody, #wfDialog .wf-dialogbody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
  }
  #dialog .modalhead, #dialog .modalfoot,
  #wfDialog .wf-dialoghead, #wfDialog .wf-dialogfoot {
    flex: 0 0 auto;
  }
  .modalfoot, .wf-dialogfoot { flex-wrap: wrap; }
  .modalfoot > button, .wf-dialogfoot > button {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #modalBody .fields > .field.full { grid-column: 1 / -1; }
  .assistant-panel {
    max-height: calc(100vh - 110px);
    max-height: calc(100dvh - 110px);
    overscroll-behavior: contain;
  }
  .profile #zeregoAccount { max-width: 100%; white-space: normal; }
}

@media screen and (max-width: 1024px) {
  .history-row { flex-wrap: wrap; }
  .history-row > .text { flex: 1 1 220px; }
  .mail-reader-actions > button { min-width: 0; }
}

@media screen and (max-width: 760px) {
  #sidebar {
    max-width: calc(100vw - 44px);
    overscroll-behavior-y: contain;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 100;
  }
  /* An open navigation drawer takes precedence over the assistant drawer. */
  body:not(.sidebar-collapsed) #assistantHost { visibility: hidden; }
  .topbar { gap: 8px; }
  .topbar .searchbox { min-width: 0; padding-inline: 8px; }
  .topbar .searchbox input { padding-inline: 6px; }
  .tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .tabs > button { flex: 0 0 auto; }
  #view:has(.kb-view-toggle) .filterbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  #view:has(.kb-view-toggle) .filterbar > label { grid-column: 1 / -1; }
  #view:has(.kb-view-toggle) .filterbar > select,
  #view:has(.kb-view-toggle) .filterbar > button { width: 100%; min-width: 0; }
  .kb-view-toggle > button { min-height: 40px; }
  .kb-drag-handle { width: 40px; height: 40px; flex-basis: 40px; }
  .toolbar > button, .tabs > button, .modalfoot > button,
  .wf-dialogfoot > button, .mail-reader-actions > button,
  .task-actions > button, .wf-inline-actions > button {
    min-height: 40px;
  }
  .mail-account-toggle { flex-basis: 36px; width: 36px; min-height: 40px; }
  .mail-account-folders .mail-folder { min-height: 40px; }
  .panel-toggle { width: 36px; height: 36px; flex-basis: 36px; }
  .document-toolbar { padding: 14px; }
  .history-row { padding: 15px; }
  .assistant-panel {
    left: 12px;
    right: 12px;
    width: auto;
    padding: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom));
  }
  .assistant-launch { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .mail-reading-pane { scroll-margin-top: 78px; }
  .pagehead .toolbar { align-items: stretch; }

  /* Avoid browser zoom when focusing a field on iPhone/iPad. */
  .topbar input, .filterbar input, .filterbar select,
  .wf-module input:not([type=checkbox]):not([type=radio]), .wf-module select, .wf-module textarea,
  .report-section textarea, .value-input,
  .controlgroup input:not([type=checkbox]):not([type=radio]),
  .controlgroup select, .controlgroup textarea,
  dialog input:not([type=checkbox]):not([type=radio]), dialog select, dialog textarea,
  .mail-client input:not([type=checkbox]), .mail-client select, .mail-client textarea,
  .assistant-panel input:not([type=checkbox]), .assistant-panel select, .assistant-panel textarea {
    font-size: 16px;
    min-width: 0;
    max-width: 100%;
  }
}

.deadline-table{min-width:970px}.deadline-table td:nth-child(6){min-width:125px}.deadline-table td:last-child{min-width:118px}.deadline-table .badge{white-space:normal;word-break:normal;overflow-wrap:normal}

