body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.shadow-xs {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

img, video, iframe, embed, object {
  max-width: 100%;
}

img, video {
  height: auto;
}

/* ===== 手機直屏優化（僅 < 768px 生效，橫屏與桌面版自動展開為雙欄/寬屏） ===== */
@media (max-width: 767px) {
  html, body { overflow-x: clip; }
  main { min-width: 0; }

  .text-xs, .text-sm, .text-\[10px\], .text-\[11px\] {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
  }
  input, select, textarea { font-size: 1rem !important; }

  main button, header button, main select, main input[type="date"] { min-height: 44px; }
  main button, header button { min-width: 44px; }
  main button.w-8.h-8 { width: 44px !important; height: 44px !important; }
  main label:has(input[type="checkbox"]) { min-height: 44px; }
  main input[type="checkbox"] { width: 1.25rem; height: 1.25rem; }

  main .flex.justify-between:not(.mob-nowrap) { flex-wrap: wrap; row-gap: 0.25rem; }
  main .inline-flex.p-1 { flex-wrap: wrap; max-width: 100%; }
  .mob-wrap { flex-wrap: wrap; row-gap: 0.25rem; }

  .mob-datenav { flex-wrap: wrap; gap: 0.5rem; }
  .mob-datenav > * { margin: 0 !important; flex: 1 1 auto; justify-content: center; }
  .mob-datenav > select { order: -1; flex-basis: 100%; }

  .mob-cal { padding: 0.75rem !important; }
  .mob-cal .grid-cols-7 { column-gap: 0 !important; }
  #calendarGrid > div { padding: 0.25rem !important; }
  #calendarGrid .text-\[11px\] {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    padding-left: 0.125rem;
    padding-right: 0.125rem;
  }

  #navMenu { display: none !important; }
  #navMenu.is-open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
  }
  #navMenu > button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    margin: 0 !important;
    font-size: 1rem !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  header > div {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}
