/* Keep content usable with narrow widths, short viewports and enlarged text. */
.profile-location { margin: 24px 0; }
.profile-map { width: 100%; height: clamp(280px,45vw,420px); margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbff; z-index: 0; }
.profile-map .leaflet-top.leaflet-right { top: 10px; right: 10px; }
.profile-map .leaflet-bottom.leaflet-right { bottom: 0; right: 0; }
.profile-location-marker span { display: block; width: 24px; height: 24px; border: 3px solid white; border-radius: 50%; background: #006bd6; box-shadow: 0 0 0 2px #002653; }
main, .form-card, .form-layout > *, .profile-grid > *, .fields-grid > *,
.form-grid > *, .result-card > div, .request-card > div { min-width: 0; }
.form-card, .article-body, .profile-grid, .review-card, .request-card { overflow-wrap: anywhere; }
fieldset { min-inline-size: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.mobile-nav { max-height: calc(100dvh - 76px); overflow-y: auto; }
.mobile-nav a { min-height: 44px; }
.map-heading--directory { max-width: min(560px, calc(100% - 105px)); }
.map-heading--directory h1 { font-size: clamp(26px, 2.6vw, 40px); line-height: 1.12; letter-spacing: -1px; text-wrap: balance; }
@media (max-width: 820px) {
  .map-heading--directory { max-width: min(520px, calc(100% - 48px)); }
  .map-heading--directory h1 { font-size: clamp(24px, 5vw, 32px); }
}
@media (min-width: 481px) and (max-width: 820px) {
  .map-heading--directory h1 { margin-top: 26px; }
}

/* A short desktop/landscape window must not collapse the results to zero. */
@media (min-width: 821px) {
  .explorer--immersive .explorer-shell { min-height: 720px; }
  .explorer--immersive.map-expanded .explorer-shell { grid-template-columns: 1fr; }
}
@media (min-width: 1001px) { .mobile-nav { display: none; } }
@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .mobile-toggle { display: flex; min-width: 44px; min-height: 44px; }
}
@media (max-width: 820px) {
  input:not([type=checkbox],[type=radio],[type=hidden]), select, textarea,
  .explorer--immersive .filter-bar input, .explorer--immersive .filter-bar select,
  .sort-label select, .input-button input { font-size: 16px; }
  .button, .icon-button, .near-button, .billing-toggle button,
  .explorer--immersive .filter-actions .button { min-height: 44px; }
  .checkbox { min-height: 44px; align-items: flex-start; font-size: 13px; }
  .checkbox input { flex-shrink: 0; margin-top: 3px; }
  .field-hint, .small-text, .form-card label { font-size: 13px; }
  .explorer--immersive .chip { min-height: 44px; font-size: 12px; }
  .explorer--immersive .results-panel { height: auto; min-height: 0; }
  .explorer--immersive .result-list { flex: none; max-height: 540px; min-height: 160px; }
  .results-heading, .sort-label { flex-wrap: wrap; }
  .sort-label select { max-width: 100%; }
  .input-button { flex-wrap: wrap; }
  .input-button input { min-width: 0; flex: 1 1 150px; }
}
@media (max-width: 480px) {
  /* Move map actions below the map, rather than over the Canary inset. */
  .explorer--immersive .map-panel { height: auto; min-height: 0; }
  .explorer--immersive #spain-map { height: 520px; }
  .map-tools { position: relative; inset: auto; padding: 12px 18px 0; }
  .mobile-filters { min-height: 44px; font-size: 13px; }
  .explorer--immersive .map-territories { position: relative; inset: auto; margin: 12px 18px; max-width: none; }
  .explorer--immersive .map-territories button { min-height: 44px; font-size: 11px !important; padding: 8px !important; }
  .map-territories button[data-territory=peninsula] { display: block; }
  .canary-inset { top: 390px; bottom: auto; width: 150px; height: 115px; }
  .explorer--immersive .map-key { position: relative; inset: auto; margin: 0 18px 12px; font-size: 10px; }
  .explorer--immersive .map-caption { position: relative; inset: auto; margin: 0 18px 14px; max-width: none; font-size: 10px; }
  .map-test { display: none; }
  .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
  .leaflet-bottom.leaflet-right { bottom: 4px; }
  .quick-form-heading { flex-wrap: wrap; }
  .form-card .fields-grid, .review-completion .form-grid { grid-template-columns: minmax(0,1fr); }
}
