/* Touch-first adjustments shared by the VPS app and the public website. */
html { -webkit-text-size-adjust: 100%; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body:has(dialog[open]) { overflow: hidden; }
button, a, input, select, textarea { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: rgba(255,192,75,.15); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
@media (max-width: 800px) {
  .nav { padding-top: env(safe-area-inset-top); }
  .nav-inner { min-height: 72px; height: auto; padding-block: 12px; }
  .nav-links { top: 100%; padding: 12px 18px; box-shadow: 0 20px 30px #0006; }
  .nav-links a { min-height: 44px; display: flex; align-items: center; padding: 8px 14px; }
  .button, .chip, .side-link, .doc-nav a { min-height: 44px; }
  .mobile-menu { min-width: 44px; min-height: 44px; }
  input, select, textarea, .field input, .field select, .field textarea, .search input { font-size: 16px; }
  input:not([type=checkbox]), select { min-height: 46px; }
  .sidebar { gap: 4px; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .server-select { min-width: 145px; }
  .sidebar .side-link { font-size: 13px; padding-inline: 13px; }
  .dashboard-main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .toolbar { min-width: 0; }
  .chips { flex-wrap: wrap; gap: 8px; }
  .chip { padding: 10px 14px; font-size: 13px; }
  .notice { gap: 12px; flex-wrap: wrap; }
  .table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .dialog-header { position: sticky; top: 0; z-index: 2; background: var(--panel); }
  .dialog-header button { min-width: 44px; min-height: 44px; }
  .dialog-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .footer-links a { display: flex; align-items: center; min-height: 44px; }
  .site-footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); font-size: 14px; }
}
@media (max-width: 500px) {
  .nav-inner { gap: 8px; }
  .nav-actions { gap: 6px; }
  .nav-actions .button { font-size: 12px; padding: 10px; }
  .nav-actions .mobile-menu { padding: 10px; }
  .brand { gap: 6px; font-size: 18px; }
  .brand-period { display: none; }
  .hero h1 { font-size: clamp(38px, 11.7vw, 50px); overflow-wrap: normal; }
  .hero-note { flex-wrap: wrap; font-size: 12px !important; gap: 10px; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-actions .button { justify-content: center; min-height: 48px; }
  .preview-wrap { width: 100%; }
  .preview-float { position: static; margin: 16px 0 0; font-size: 12px; }
  .preview-caption { margin-top: 18px; line-height: 1.8; font-size: 10px; }
  .promise-strip { grid-template-columns: 1fr; gap: 16px; }
  .promise-strip span { font-size: 13px; }
  .page-header h1 { font-size: clamp(30px, 9vw, 38px); overflow-wrap: anywhere; }
  .stat small { font-size: 12px; line-height: 1.5; }
  .stat { min-width: 0; }
  .stat strong { font-size: 30px; }
  .dash-heading { flex-wrap: wrap; gap: 14px; }
  .dash-heading .button { font-size: 13px; }
  .notice { font-size: 13px; }
  .notice .button { font-size: 13px; }
  .command-card h3 { overflow-wrap: anywhere; }
  .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; }
  .footer-links a { font-size: 13px; }
  .dialog-footer { gap: 12px; }
  .dialog-footer .actions { width: 100%; display: flex; }
  .dialog-footer .actions .button { flex: 1; justify-content: center; }
}
@media (max-width: 360px) {
  .nav-actions > .button:not(.mobile-menu) { max-width: 105px; text-align: center; line-height: 1.3; }
  .brand { font-size: 16px; }
  .brand img { width: 27px; height: 27px; }
}
