/* Final Stage 11 phone polish. Loaded after stage11.css so these rules intentionally win. */

/* Keep the stable app-page scroll behavior without showing browser scrollbars. */
.app-main {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-main::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Date/time controls: compact, paired, and truly contained on iOS. */
.compact-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.compact-date-row > .field-label {
  display: block;
  min-width: 0;
  max-width: 100%;
}
.compact-date-row input[type="date"],
.compact-date-row input[type="time"] {
  display: block;
  width: 100% !important;
  inline-size: 100% !important;
  min-width: 0 !important;
  min-inline-size: 0 !important;
  max-width: 100% !important;
  max-inline-size: 100% !important;
  box-sizing: border-box !important;
  font-size: 16px;
}

.plan-editor form,
.trip-planner form,
.trip-form-grid,
.trip-days-editor,
.trip-day-editor,
.trip-day-when {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.plan-date-row { margin: 0; }
.trip-form-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 16px !important;
}
.trip-name-field,
.trip-range-row { width: 100%; min-width: 0; }

/* Each hiking day: Trail, paired Date/Expected start, Notes, then a quiet removal control. */
.trip-day-editor {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 16px !important;
  overflow: hidden !important;
}
.trip-day-editor > *,
.trip-day-trail,
.trip-day-when,
.trip-day-note {
  grid-column: 1 !important;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.trip-day-editor > span { margin-bottom: -2px; }
.trip-day-remove,
.trip-day-delete {
  appearance: none;
  justify-self: end;
  width: auto !important;
  min-height: 34px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--stone);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.trip-day-remove:focus-visible,
.trip-day-delete:focus-visible { color: var(--clay); outline: 2px solid var(--clay); outline-offset: 3px; }

/* Swipe-to-delete cards. Swipe left to reveal the deliberate red Delete action. */
.swipe-delete-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  min-width: 0;
  max-width: 100%;
  background: var(--clay);
  touch-action: pan-y;
}
.swipe-delete-content {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  transform: translateX(0);
  transition: transform .18s ease;
  will-change: transform;
  background: var(--card);
}
.swipe-delete-shell.is-swiping .swipe-delete-content { transition: none; }
.swipe-delete-shell.is-revealed .swipe-delete-content { transform: translateX(-86px); }
.swipe-delete-action {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86px;
  border: 0;
  background: var(--clay);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.swipe-delete-action:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }

/* The planned Adventure retains its card appearance inside the swipe shell. */
.swipe-delete-shell > .planned-card { margin: 0; border-radius: inherit; }
.planned-card__body > .eyebrow { padding-right: 0 !important; }
.planned-card__dismiss,
.latent-trip-dismiss { display: none !important; }

/* Multi-day saved Trip rows should not let removal overlap the date/name. */
.latent-trip-item.swipe-delete-shell {
  display: block !important;
  background: var(--clay);
}
.latent-trip-item .latent-trip-open {
  width: 100%;
  min-width: 0;
  padding: 13px 14px !important;
  padding-right: 14px !important;
  background: var(--card);
}
.latent-trip-open strong,
.latent-trip-open small {
  overflow-wrap: anywhere;
}
.trip-detail-swipe { margin: 4px 0 18px; }
.trip-detail-swipe .trip-detail-identity { padding: 4px 2px 8px; }

/* Profile photo removal lives on the avatar itself. */
.family-profile-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}
.profile-photo-corner-remove {
  appearance: none;
  position: absolute;
  z-index: 3;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--card);
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font: 700 18px/1 var(--sans);
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  cursor: pointer;
}
.profile-photo-corner-remove:focus-visible { outline: 3px solid var(--alpine); outline-offset: 2px; }
.profile-photo-actions,
.profile-photo-remove { display: none !important; }

@media (max-width: 470px) {
  .compact-date-row { gap: 8px; }
  .compact-date-row .text-control {
    padding-left: 10px !important;
    padding-right: 10px !important;
    font-size: 16px !important;
  }
  .plan-editor form { padding: 16px !important; }
  .trip-day-editor { padding: 14px !important; }
  .trip-range-row,
  .trip-day-when { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
}
