/* Phone-only menu simplification + scrollable modal tables.
   Modal backdrops are Vue Teleports under <body>; .workspace selectors do not reach them. */
.ui-swipe-hint {display:none}
@media screen and (max-width:650px) {
  /* Mobile Menu: show only the actual navigation tiles, without repeated greetings/heading/footer. */
  #app .phone-app-home { padding-top:12px; padding-bottom:20px; }
  #app .phone-app-home .phone-app-grid { margin:0; gap:10px; }
  #app .phone-app-home .phone-app-tile {
    min-height:104px;
    padding:12px 5px;
    gap:9px;
    font-size:11px;
    line-height:1.35;
  }
  #app .phone-app-home .phone-app-icon {width:48px; height:48px; flex:none;}
  #app .phone-app-home .phone-app-icon i {font-size:22px;}
  #app .phone-app-home .phone-app-tile:focus-visible {
    outline:3px solid #65b995;
    outline-offset:2px;
  }

  /* Crucial: the dashboard detail dialog is teleported directly to body. */
  body > .db85-modal-backdrop .db85-detail-modal {
    display:flex!important;
    flex-direction:column!important;
    width:calc(100vw - 20px)!important;
    max-width:100%!important;
    max-height:calc(100dvh - 24px)!important;
    padding:15px!important;
    overflow:hidden!important;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-head,
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-tools {
    flex-shrink:0!important;
    min-width:0;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-head {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:9px;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-head > div {min-width:0;}
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-tools {margin:12px 0 8px!important;}
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-tools > input {
    flex:1 1 100%;
    min-width:0!important;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-tools > button {
    width:100%;
    justify-content:center;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-detail-tools > span {width:100%;}
  body > .db85-modal-backdrop .db85-detail-modal .ui-swipe-hint {
    display:flex;
    align-items:center;
    gap:7px;
    font-size:11px;
    line-height:1.4;
    color:#50735f;
    margin:0 0 8px;
    flex:0 0 auto;
  }
  body > .db85-modal-backdrop .db85-detail-modal .ui-swipe-hint i {color:#16835a;}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table.table-wrap {
    box-sizing:border-box!important;
    display:block!important;
    position:relative!important;
    flex:1 1 auto!important;
    min-height:150px!important;
    max-height:none!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x pan-y!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin;
    scrollbar-color:#8ec5a5 #eff7f1;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-table.table-wrap::-webkit-scrollbar {
    width:6px;height:7px;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-table.table-wrap::-webkit-scrollbar-thumb {
    background:#8ec5a5;border-radius:99px;
  }
  /* Fixed, legible column sizes, rather than shrinking all columns into 360px. */
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table {
    display:table!important;
    width:1080px!important;
    min-width:1080px!important;
    max-width:none!important;
    table-layout:fixed!important;
    border-collapse:separate!important;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td) {
    display:table-cell!important;
    box-sizing:border-box!important;
    vertical-align:middle!important;
    padding:11px 12px!important;
    overflow:visible!important;
    text-overflow:clip!important;
    min-width:0!important;
    max-width:none!important;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(1){width:135px!important;white-space:nowrap!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(2){width:205px!important;white-space:normal!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(3){width:260px!important;white-space:normal!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(4){width:112px!important;white-space:nowrap!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(5){width:112px!important;white-space:nowrap!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(6){width:112px!important;white-space:nowrap!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table :is(th,td):nth-child(7){width:144px!important;white-space:normal!important}
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table .ui-identity-cell,
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table .ui-identity-cell strong {
    display:block!important;
    min-width:0!important;
    max-width:none!important;
    overflow:visible!important;
    text-overflow:clip!important;
    white-space:nowrap!important;
  }
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table .hris-org-cell,
  body > .db85-modal-backdrop .db85-detail-modal .db74-table .fm62-late-detail-table .hris-org-cell :is(strong,small) {
    min-width:0!important;
    max-width:none!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere!important;
    -webkit-line-clamp:unset!important;
  }
  /* Same principle for other table-based dialogs, without changing form layouts. */
  body .modal-card :is(.table-wrap,.ui-leaving-table-scroll,.hris-evaluation-table-wrap),
  body .db85-kpi-modal :is(.table-wrap,.db71-table-scroll),
  body .db88-alert-modal .table-wrap {
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-x pan-y!important;
    overscroll-behavior-x:contain!important;
  }
  body .modal-card :is(.table-wrap,.ui-leaving-table-scroll,.hris-evaluation-table-wrap) > table.data-table,
  body .db85-kpi-modal :is(.table-wrap,.db71-table-scroll) > table.data-table,
  body .db88-alert-modal .table-wrap > table.data-table {
    display:table!important;
    width:max-content!important;
    min-width:max(700px,100%)!important;
    max-width:none!important;
    table-layout:auto!important;
  }
  body .modal-card :is(.table-wrap,.ui-leaving-table-scroll,.hris-evaluation-table-wrap) > table.data-table :is(th,td),
  body .db85-kpi-modal :is(.table-wrap,.db71-table-scroll) > table.data-table :is(th,td),
  body .db88-alert-modal .table-wrap > table.data-table :is(th,td) {
    text-overflow:clip!important;
    max-width:none!important;
  }
}
