/*
 LGFT v4.51.27.6 — Mobile Tooltip / Checkbox / Button Text / Device Time UI Repair
 Scope: screen-only. No print CSS, no login/auth, no price sync, no QR, no permission enforcement.
*/

@media screen {
  /* Tooltips must be touchable on mobile and not rely on hover-only pseudo elements. */
  .lgft-tip,
  .lgft-tip.auto-help {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  .lgft-tooltip-portal {
    position: fixed !important;
    z-index: 2147483647 !important;
    max-width: min(420px, calc(100vw - 24px)) !important;
    pointer-events: auto !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  /* Desktop + mobile button text containment. Long labels must wrap instead of spilling out. */
  .btn,
  a.btn,
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .action-btn,
  .pill-action,
  .nav-logout,
  .density-toggle {
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.15 !important;
    text-align: center !important;
  }

  .btn,
  a.btn,
  button,
  [role="button"],
  .action-btn,
  .pill-action,
  .nav-logout,
  .density-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .35rem !important;
    min-height: 36px !important;
    height: auto !important;
  }

  .toolbar-actions,
  .document-actions,
  .form-actions,
  .portal-actions,
  .workflow-actions,
  .customer-quick-actions,
  .action-row,
  .button-row,
  .btn-row,
  .actions,
  .card-actions,
  .table-actions {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .toolbar-actions > *,
  .document-actions > *,
  .form-actions > *,
  .portal-actions > *,
  .workflow-actions > *,
  .customer-quick-actions > *,
  .action-row > *,
  .button-row > *,
  .btn-row > *,
  .actions > *,
  .card-actions > *,
  .table-actions > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Undo earlier global mobile input min-height rules for checkboxes/radios only. */
  input[type="checkbox"],
  input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    margin: 0 7px 0 0 !important;
    transform: none !important;
    flex: 0 0 16px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
  }

  label > input[type="checkbox"],
  label > input[type="radio"] {
    position: relative !important;
    top: 2px !important;
  }

  .alert-document label,
  .settings-document label,
  .portal-document label,
  .management-document label,
  .notification-document label,
  .permission-document label,
  .customer-document label {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  .lgft-device-clock {
    margin-top: 8px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    color: rgba(183,196,222,.78) !important;
    text-align: center !important;
  }

  .lgft-device-clock strong { color: rgba(245,210,110,.95) !important; }
}

@media screen and (max-width: 768px) {
  input[type="checkbox"],
  input[type="radio"] {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
    flex-basis: 15px !important;
  }

  .btn,
  a.btn,
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .action-btn,
  .pill-action,
  .nav-logout,
  .density-toggle {
    min-height: 38px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: clamp(12px, 3.55vw, 15px) !important;
  }

  .customer-quick-actions,
  .portal-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .customer-quick-actions > *,
  .portal-actions > * {
    width: 100% !important;
    flex: 1 1 auto !important;
  }
}

@media screen and (max-width: 420px) {
  .customer-quick-actions,
  .portal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .btn,
  a.btn,
  button,
  [role="button"] {
    font-size: clamp(11.5px, 3.35vw, 14px) !important;
  }
}

@media print {
  /* Screen-only repair. Do not alter portrait printing. */
}
