/* 行動裝置版（Android / iOS WebView 與手機瀏覽器） */
:root { --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }

@media (max-width: 860px) {
  body { font-size: 15px; -webkit-text-size-adjust: 100%; }
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 30;
    background: var(--accent); color: #fff;
    padding: calc(10px + var(--safe-top)) 14px 10px;
    font-weight: 600; font-size: 15px;
  }
  .shell { display: block; min-height: auto; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; height: 100%;
    z-index: 40; transform: translateX(-102%);
    transition: transform .22s ease; padding-top: calc(20px + var(--safe-top));
    overflow-y: auto;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(15,27,46,.45); z-index: 35; }
  .main { padding: 16px 14px calc(40px + var(--safe-bottom)); max-width: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .page-head h2 { font-size: 19px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .v { font-size: 20px; }
  table.data { font-size: 13px; display: block; overflow-x: auto; white-space: nowrap; }
  .card { padding: 14px 14px; }
  button.btn { padding: 11px 18px; }
  input, select, textarea { font-size: 16px; } /* 避免 iOS 聚焦自動放大 */
  .row > button.btn { flex: 1 1 auto; }
}
