/* 手机版 panel: single-window, touch-friendly layout for phone screens. */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Red machine label after 云窗账号管理: shrink on a phone so it doesn't overflow */
.machine-label-header {
  font-size: 1.15rem !important;
  line-height: 1.2 !important;
  margin-left: 0.35em !important;
}
.machine-label-login {
  font-size: 1.25rem !important;
  line-height: 1.4 !important;
}

/* Larger tap targets, single column on narrow screens */
@media (max-width: 720px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Account / window grids collapse to one column */
  .mt-6.grid.gap-3.sm\:grid-cols-3,
  .mt-5.grid.grid-cols-2,
  .mt-4.grid.gap-3.sm\:grid-cols-2,
  .mt-3.grid.grid-cols-2,
  .mt-4.grid.grid-cols-2,
  .mt-3.grid.grid-cols-3,
  .mt-2.grid.grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Seat / account cards: bigger, easier to tap */
  button, a, [role="button"] {
    min-height: 44px;
  }

  /* Last-opened floating card: don't cover the bottom actions */
  aside[aria-label="上次打开窗口"] {
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    max-width: none !important;
  }

  /* Header title row can wrap */
  h1, .font-semibold {
    overflow: visible !important;
    word-break: break-word;
  }
}

/* Always prefer a single-column account list on very narrow phones */
@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr !important;
  }
}

/* Keep the last-opened card from covering the account list */
@media (max-width: 720px) {
  main, #app, body > div {
    padding-bottom: 6.5rem;
  }
  article {
    min-height: 44px;
  }
}
