/*
 * Bucket: phone-base (shared compact)
 * Media: max-width 720px
 * Shared chrome for phone-narrow / standard / large
 * Source of truth: /assets/layout-map.json
 */

@media (max-width: 720px) {
  .wrap {
    width: 100%;
    max-width: none;
    padding: 0 18px 3rem;
    overflow-x: clip;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -18px 14px;
    padding: 12px 18px;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 0;
  }

  .brand-lockup {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.55rem;
  }

  /* Portrait mark stays readable without eating the wordmark */
  .brand-logo {
    height: 56px;
    width: 56px;
    max-width: 56px;
  }

  .brand-lockup .brand {
    font-size: 1.2rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.15;
  }

  .brand-lockup .slogan {
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-lockup .brand-role {
    font-size: 0.75rem;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
    height: 44px;
  }

  .user-chip-name {
    display: none;
  }

  .user-chip {
    gap: 0;
    height: 44px;
  }

  /* Keep phone storefront topbar to order + logout; Kitchen lives in the footer. */
  body:not(.page-admin) .admin-link {
    display: none !important;
  }

  .btn-logout,
  .topbar-link,
  .admin-topbar .topbar-actions .btn {
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
  }

  .order-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .order-icon {
    width: 19px;
    height: 19px;
  }

  .page-admin .day-panel {
    padding: 20px 18px 18px;
    margin-inline: 0;
  }

  .page-admin .panel {
    padding: 1rem 1rem;
  }

  .page-admin .pack-summary {
    padding: 0.85rem 1rem;
  }

  .page-admin .field input[type="datetime-local"] {
    min-height: 48px;
    font-size: 16px;
    padding-inline: 0.7rem;
  }

  .page-admin .admin-actions {
    width: 100%;
  }

  .page-admin .admin-actions .btn {
    flex: 1 1 auto;
  }

  /* Account - full-bleed card, comfortable tap targets */
  .account-card {
    width: 100%;
    margin: 0.25rem 0 0;
    padding: 20px 16px 18px;
    border-radius: var(--radius-lg);
  }

  .account-tabs button {
    min-height: 44px;
  }

  .field input[type="text"],
  .field input[type="email"],
  .field input[type="password"],
  .field input[type="tel"] {
    min-height: 48px;
    font-size: 16px; /* avoid iOS zoom */
  }

  .account-actions .btn-primary {
    min-height: 48px;
  }

  .check {
    gap: 0.75rem;
  }

  .check input {
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-top: 0.15rem;
  }

  /* Admin day form + meal foot peers */
  .page-admin .release-form,
  .page-admin .meal-edit-meta,
  .page-admin .product-add-grid {
    grid-template-columns: 1fr;
  }

  /* Keep From/To as peer times on one row; clamp WebKit time min-width */
  .page-admin .field-row-times {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
  }

  .page-admin .field-row-times .field,
  .page-admin .field-row-times input[type="time"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .page-admin .field input[type="time"] {
    min-height: 48px;
    font-size: 16px;
    padding-inline: 0.55rem;
  }

  .page-admin .field input[type="time"]::-webkit-calendar-picker-indicator {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    padding: 0;
  }

  .page-admin .pickup-defaults {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .page-admin .pickup-defaults .check {
    white-space: normal;
    max-width: 100%;
  }

  .page-admin .admin-actions .btn {
    min-height: 44px;
  }

  .page-admin .meal-photo-actions {
    justify-content: flex-start;
  }

  /* Menu */
  .menu-intro {
    padding: 18px 16px;
    margin-bottom: 18px;
    border-radius: 14px;
  }

  .menu-intro-day {
    font-size: 1.05rem;
    line-height: 1.3;
  }

  .menu-intro #menu-intro-lede {
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .menu-intro h1 {
    font-size: 1.65rem;
  }

  .menu-heading {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }

  .product {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: var(--radius-lg);
  }

  .product-photo,
  .product-photo img {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: none;
  }

  .product-photo::after {
    background: linear-gradient(180deg, transparent 78%, rgba(42, 28, 22, 0.12));
  }

  .product-body {
    padding: 18px 16px 16px;
  }

  .product-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
  }

  .dish-name {
    font-size: 1.45rem;
    overflow-wrap: anywhere;
  }

  .unit-price {
    min-width: 72px;
    padding: 8px 9px 7px;
    font-size: 1.35rem;
  }

  .product-desc {
    font-size: 0.92rem;
  }

  .product-actions {
    padding-top: 16px;
    flex-wrap: wrap;
  }

  .qty {
    height: 48px;
  }

  .qty button {
    min-width: 44px;
  }

  .product-actions .btn-primary {
    flex: 1 1 140px;
    min-height: 48px;
    height: 48px;
  }

  /* Order bottom sheet */
  .order-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(78vh, 640px);
    border-radius: 20px 20px 0 0;
    transform: translateY(105%);
    box-shadow: 0 -16px 48px rgba(42, 28, 22, 0.18);
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  body.order-open .order-drawer {
    transform: translateY(0);
  }

  .drawer-close {
    width: 44px;
    height: 44px;
  }

  .drawer-checkout {
    min-height: 48px;
  }

  .site-legal {
    margin-top: 2rem;
    gap: 12px;
  }
}
