/* ---------- Narrow screens ---------- */

@media (max-width: 960px) {
  .booking {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    position: static;
    max-height: none;
  }

  /* A picked room opens as a bottom sheet, like a seat picker on a phone. */
  .panel:not([data-showing='empty']) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 20;
    max-height: 66dvh;
    border-radius: 18px 18px 0 0;
    border: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    padding: 22px 16px 0;
    animation: sheet-up 0.22s ease-out;
  }

  /* Keep the main button in reach while the sheet's details scroll. */
  .panel:not([data-showing='empty']) .btn-wide {
    position: sticky;
    bottom: 0;
    margin-bottom: 0;
    box-shadow: 0 0 0 12px var(--white), 0 12px 0 12px var(--white);
  }

  .panel:not([data-showing='empty'])::after {
    content: '';
    display: block;
    height: calc(16px + env(safe-area-inset-bottom));
  }

  body.sheet-open .page {
    padding-bottom: 50dvh;
  }

  @keyframes sheet-up {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 14px;
    padding: 10px 16px;
  }

  .where {
    padding-left: 14px;
    font-size: 14px;
  }

  .where span {
    display: none;
  }

  .requests-btn {
    padding: 8px 12px;
  }

  .page {
    padding: 24px 16px 48px;
  }

  .lede {
    font-size: 16px;
  }

  .mode {
    width: 100%;
  }

  .mode button {
    flex: 1;
    min-width: 0;
  }

  select {
    min-width: 0;
    width: 100%;
  }

  h1 {
    font-size: 38px;
  }

  .lede {
    display: none;
  }

  .map-card {
    padding: 12px;
  }

  .map-toolbar {
    flex-wrap: nowrap;
  }

  .floors {
    flex: 1;
    min-width: 0;
  }

  .floors button {
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 5px 8px;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .switch-view {
    padding: 8px 12px;
  }

  .switch-view span {
    display: none;
  }

  .plan {
    max-height: none;
  }

  /* The first floor fits the screen. The ground floor is too dense, so it pans sideways. */
  .plan[data-floor='first'] .room-sub,
  .plan[data-floor='first'] .room-note {
    display: none;
  }

  .plan[data-floor='ground'] {
    min-width: 640px;
  }

  .pan-hint {
    display: block;
  }

  .list-row {
    grid-template-columns: 18px 1fr auto;
  }

  .list-row span {
    display: none;
  }

  .panel h2 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
