@media (max-width: 850px) {
  #assistant {
    grid-template-columns: minmax(0, 1fr);
  }

  #add .form-line label,
  #guest-dialog #request-form .form-line label {
    min-width: 0;
  }

  #add input {
    width: 100%;
  }
}

/* Comfortable controls for touch, keyboard and large displays. */
header > nav { flex-wrap: wrap; gap: 8px 18px; min-width: 0; }
header > nav a { display: inline-flex; align-items: center; min-height: 44px; }
button {
  min-height: 44px;
  min-width: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
input:not([type="checkbox"]):not([type="radio"]), select {
  min-height: 44px;
}
input, select, textarea {
  font-size: 16px;
  max-width: 100%;
  box-sizing: border-box;
}
dialog {
  max-inline-size: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 16px;
  box-sizing: border-box;
}
img { max-width: 100%; }
:focus-visible { outline-offset: 3px; }

@media (max-width: 480px) {
  #service-navigation {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-radius: 16px;
  }
  #service-navigation a {
    padding: 6px 2px;
    font-size: 12px;
    line-height: 1.3;
  }
  main { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .event-card button { width: 100%; margin: 6px 0; }
  .event-form button { width: 100%; }
}
@media (max-height: 500px) and (max-width: 850px) {
  dialog { max-height: calc(100dvh - 12px); margin-block: 6px; padding: 16px; }
  main { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
