.portal-page {
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--portal-primary) 10%, var(--portal-card-bg)) 0, var(--portal-page-bg) 360px);
  color: var(--portal-text);
  min-height: 100vh;
  padding-bottom: 48px;
  --portal-panel-gap: 24px;
  --portal-panel-padding: 24px;
  --portal-card-radius: var(--radius-card);
  --portal-control-radius: var(--radius-control);
  --portal-pill-radius: var(--radius-pill);
  --portal-card-shadow: none;
  --portal-card-border-width: 1px;
  --portal-primary-soft: color-mix(in oklch, var(--portal-primary) 10%, var(--portal-card-bg));
  --portal-secondary-soft: color-mix(in oklch, var(--portal-secondary) 8%, var(--portal-card-bg));
  --portal-tertiary-soft: color-mix(in oklch, var(--portal-tertiary) 10%, var(--portal-card-bg));
  --portal-focus: 0 0 0 3px color-mix(in oklch, var(--portal-tertiary) 34%, transparent);
}

.portal-density--comfortable {
  --portal-panel-gap: 24px;
  --portal-panel-padding: 24px;
}

.portal-card-style--bordered {
  --portal-card-border-width: 1px;
  --portal-card-shadow: none;
}

.portal-radius--none {
  --portal-card-radius: 0;
  --portal-control-radius: 0;
  --portal-pill-radius: 0;
}

.portal-radius--small {
  --portal-card-radius: 6px;
  --portal-control-radius: 4px;
  --portal-pill-radius: 999px;
}

.portal-radius--large {
  --portal-card-radius: 18px;
  --portal-control-radius: 12px;
  --portal-pill-radius: 999px;
}

.portal-density--compact {
  --portal-panel-gap: 16px;
  --portal-panel-padding: 18px;
}

.portal-card-style--elevated {
  --portal-card-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.portal-card-style--flat {
  --portal-card-border-width: 0;
  --portal-card-shadow: none;
}

.portal-header {
  position: relative;
  border-bottom: 1px solid var(--portal-border);
  background:
    linear-gradient(135deg, var(--portal-primary-soft), var(--portal-card-bg) 58%, var(--portal-secondary-soft));
}

.portal-header::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--portal-primary), var(--portal-tertiary), var(--portal-secondary));
}

.portal-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: end;
  padding-top: 40px;
  padding-bottom: 32px;
}

.portal-header--compact .portal-header__inner,
.portal-header--logo_only .portal-header__inner {
  grid-template-columns: 1fr;
  padding-top: 24px;
  padding-bottom: 22px;
}

.portal-header--compact .portal-description,
.portal-header--logo_only .portal-description {
  display: none;
}

.portal-header--compact .portal-title,
.portal-header--logo_only .portal-title {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.portal-header--logo_only .portal-brand {
  justify-content: center;
}

.portal-brand {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.portal-logo {
  width: auto;
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}

.portal-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--portal-card-radius);
  background: linear-gradient(135deg, var(--portal-primary), var(--portal-secondary));
  color: var(--portal-on-primary);
  font-size: 1.65rem;
  font-weight: 800;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.portal-kicker {
  color: var(--portal-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.portal-title {
  color: var(--portal-primary);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0;
}

.portal-description,
.portal-section-header p,
.portal-empty-state span,
.portal-rec-main small,
.portal-rec-meta small,
.portal-unit-details p,
.portal-footer-note {
  color: var(--portal-muted);
}

.portal-description {
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.portal-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.76fr);
  gap: var(--portal-panel-gap);
  align-items: start;
  padding-top: 32px;
}

.portal-layout--single_column .portal-shell,
.portal-layout--compact .portal-shell {
  grid-template-columns: 1fr;
}

.portal-layout--single_column .portal-shell {
  max-width: 920px;
}

.portal-layout--compact .portal-shell {
  max-width: 760px;
  padding-top: 20px;
}

.portal-layout--single_column .portal-results-panel,
.portal-layout--compact .portal-results-panel {
  position: static;
}

.portal-card {
  border: var(--portal-card-border-width) solid var(--portal-border);
  border-radius: var(--portal-card-radius);
  background: var(--portal-card-bg);
  box-shadow: var(--portal-card-shadow);
  overflow: hidden;
}

.portal-card-style--flat .portal-card {
  background: color-mix(in oklch, var(--portal-card-bg) 78%, transparent);
}

.portal-card-style--elevated .portal-card {
  border-color: color-mix(in oklch, var(--portal-border) 58%, transparent);
}

.portal-form-panel,
.portal-results-card,
.portal-map-card {
  padding: var(--portal-panel-padding);
}

.portal-form-panel,
.portal-results-card {
  border-top: 4px solid var(--portal-primary);
}

.portal-results-card {
  border-top-color: var(--portal-tertiary);
}

.portal-form-panel,
.portal-results-panel {
  min-width: 0;
}

.portal-results-panel {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 88px;
  align-self: start;
}

.portal-results-panel:focus {
  outline: 0;
}

.portal-results-panel:focus-visible {
  box-shadow: var(--portal-focus);
  border-radius: var(--portal-card-radius);
}

.portal-section-header {
  margin-bottom: 20px;
}

.portal-section-header h2 {
  color: var(--portal-text);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
}

.portal-section-header p {
  margin: 0;
}

.portal-feedback {
  display: grid;
  gap: 4px;
  border: 1px solid var(--portal-border);
  border-left: 4px solid var(--portal-secondary);
  border-radius: var(--portal-control-radius);
  background: var(--portal-card-bg);
  color: var(--portal-text);
  line-height: 1.45;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.portal-feedback strong {
  color: var(--portal-text);
  font-size: 0.95rem;
  line-height: 1.3;
}

.portal-feedback span {
  color: color-mix(in oklch, var(--portal-text) 78%, var(--portal-muted));
  font-size: 0.92rem;
}

.portal-feedback--success {
  border-left-color: var(--portal-tertiary);
  background: var(--portal-tertiary-soft);
}

.portal-feedback--warning {
  border-left-color: #b45309;
  background: #fffbeb;
}

.portal-feedback--error {
  border-left-color: var(--color-danger);
  background: #fef2f2;
}

.portal-results-warning {
  margin-bottom: 14px;
}

.portal-form {
  display: grid;
  gap: 20px;
}

.portal-density--compact .portal-form {
  gap: 16px;
}

.portal-density--compact .portal-form-section {
  gap: 12px;
}

.portal-density--compact .portal-section-header {
  margin-bottom: 14px;
}

.portal-density--compact .portal-header__inner {
  padding-top: 28px;
  padding-bottom: 24px;
}

.portal-density--compact .portal-form-heading {
  padding-top: 0;
}

.portal-density--compact .portal-recommendation-list {
  gap: 8px;
}

.portal-density--compact .portal-rec-item {
  padding: 10px;
}

.portal-form-section {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.portal-form-section + .portal-form-section {
  border-top: 1px solid color-mix(in oklch, var(--portal-border) 82%, transparent);
  margin-top: 2px;
  padding-top: 20px;
}

.portal-form-heading {
  color: var(--portal-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
  padding-top: 0;
}

.portal-form-heading::before {
  content: "";
  display: block;
  width: 4px;
  height: 1.2em;
  border-radius: var(--portal-pill-radius);
  background: var(--portal-tertiary);
  flex: 0 0 auto;
}

.portal-form-heading:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.portal-form-help {
  color: var(--portal-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: -4px 0 0;
}

.portal-field {
  margin: 0;
}

.portal-field label {
  color: color-mix(in oklch, var(--portal-text) 76%, var(--portal-muted));
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
  background-color: var(--portal-card-bg);
  border-color: var(--portal-border);
  border-radius: var(--portal-control-radius);
  color: var(--portal-text);
  min-height: 44px;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
  border-color: var(--portal-tertiary);
  box-shadow: var(--portal-focus);
}

.portal-field textarea {
  min-height: 96px;
}

.portal-field--requester_email,
.portal-field--requester_phone,
.portal-field--main_criterion,
.portal-field--urgency_level,
.portal-field--latitude,
.portal-field--longitude,
.portal-field--address_zip_code,
.portal-field--address_number,
.portal-field--address_state {
  max-width: 100%;
}

.portal-form-section[aria-labelledby="portal-requester-section"],
.portal-form-section[aria-labelledby="portal-need-section"],
.portal-form-section[aria-labelledby="portal-advanced-location-section"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-form-section[aria-labelledby="portal-address-section"] {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.portal-form-section[aria-labelledby="portal-criteria-section"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-form-heading,
.portal-field--requester_name,
.portal-field--notes {
  grid-column: 1 / -1;
}

.portal-field--address_zip_code {
  grid-column: span 2;
}

.portal-field--address_street {
  grid-column: span 6;
}

.portal-field--address_number {
  grid-column: span 2;
}

.portal-field--address_neighborhood {
  grid-column: span 6;
}

.portal-field--address_city {
  grid-column: span 6;
}

.portal-field--address_state {
  grid-column: span 2;
}

.portal-field--main_criterion,
.portal-field--request_type {
  grid-column: 1 / -1;
}

.portal-field--latitude,
.portal-field--longitude,
.portal-form-section[aria-labelledby="portal-criteria-section"] .portal-field {
  grid-column: span 1;
}

.portal-preferences {
  grid-template-columns: 1fr;
}

.portal-preference-picker,
.portal-preference-list {
  grid-column: 1 / -1;
}

.portal-preference-picker {
  border: 1px solid color-mix(in oklch, var(--portal-border) 82%, transparent);
  border-radius: var(--portal-control-radius);
  background: var(--portal-secondary-soft);
  padding: 14px;
}

.portal-preference-picker .form-label {
  color: color-mix(in oklch, var(--portal-text) 76%, var(--portal-muted));
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.portal-preference-picker__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.portal-secondary-btn {
  border-color: color-mix(in oklch, var(--portal-tertiary) 42%, var(--portal-border));
  background: var(--portal-card-bg);
  color: var(--portal-tertiary);
  font-weight: 800;
  min-height: 44px;
  padding-left: 16px;
  padding-right: 16px;
}

.portal-secondary-btn:hover,
.portal-secondary-btn:focus-visible {
  border-color: var(--portal-tertiary);
  background: var(--portal-tertiary-soft);
  color: var(--portal-tertiary);
}

.portal-preference-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--portal-border);
  border-radius: var(--portal-control-radius);
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 12px 14px;
}

.portal-preference-list {
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .portal-preference-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-preference-card {
  border: 1px solid color-mix(in oklch, var(--portal-border) 88%, transparent);
  border-radius: var(--portal-control-radius);
  background: var(--portal-card-bg);
  padding: 14px;
}

.portal-preference-card--active {
  border-color: color-mix(in oklch, var(--portal-tertiary) 42%, var(--portal-border));
  background:
    linear-gradient(135deg, var(--portal-tertiary-soft), var(--portal-card-bg) 74%);
}

.portal-preferences--enhanced .portal-preference-card:not(.portal-preference-card--active) {
  display: none;
}

.portal-preference-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.portal-preference-card__header span {
  color: var(--portal-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-preference-remove {
  border: 0;
  border-radius: var(--portal-pill-radius);
  background: transparent;
  color: var(--portal-muted);
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 32px;
  padding: 4px 10px;
}

.portal-preference-remove:hover,
.portal-preference-remove:focus-visible {
  background: var(--portal-card-bg);
  color: var(--portal-text);
  outline: 0;
  box-shadow: var(--portal-focus);
}

.portal-btn {
  width: 100%;
  background-color: var(--portal-tertiary);
  border-color: var(--portal-tertiary);
  color: var(--portal-on-tertiary);
  font-weight: 700;
  min-height: 48px;
}

.portal-btn:hover,
.portal-btn:focus-visible {
  background-color: var(--portal-tertiary);
  border-color: var(--portal-tertiary);
  color: var(--portal-on-tertiary);
  opacity: 0.9;
}

.portal-btn[disabled],
.portal-btn--loading {
  cursor: wait;
  opacity: 0.82;
}

.portal-submit-status {
  border: 1px solid color-mix(in oklch, var(--portal-tertiary) 35%, var(--portal-border));
  border-radius: var(--portal-control-radius);
  background: var(--portal-tertiary-soft);
  color: var(--portal-text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  padding: 12px 14px;
}

.portal-primary-recommendation {
  border: 1px solid color-mix(in oklch, var(--portal-tertiary) 42%, var(--portal-border));
  border-left: 4px solid var(--portal-tertiary);
  border-radius: var(--portal-card-radius);
  background:
    linear-gradient(135deg, var(--portal-tertiary-soft), var(--portal-card-bg) 70%);
  margin: 0 0 16px;
  padding: 16px;
}

.portal-primary-recommendation__header {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.portal-primary-recommendation__eyebrow {
  align-self: start;
  border-radius: var(--portal-pill-radius);
  background: var(--portal-tertiary);
  color: var(--portal-on-tertiary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.3;
  padding: 3px 9px;
  text-transform: uppercase;
  width: fit-content;
}

.portal-results-subheader {
  display: grid;
  gap: 2px;
  margin: 2px 0 10px;
}

.portal-results-subheader strong {
  color: var(--portal-text);
  font-size: 0.95rem;
  line-height: 1.3;
}

.portal-results-subheader span {
  color: var(--portal-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.portal-recommendation-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-gutter: stable;
}

.portal-rec-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-control-radius);
  background: var(--portal-card-bg);
  color: var(--portal-text);
  padding: 12px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  will-change: transform;
}

.portal-rec-item:hover {
  border-color: color-mix(in oklch, var(--portal-tertiary) 55%, var(--portal-border));
  transform: translateY(-1px);
}

button.portal-rec-item {
  cursor: pointer;
  touch-action: manipulation;
}

button.portal-rec-item:focus-visible {
  outline: 0;
  box-shadow: var(--portal-focus);
}

.portal-rec-item.active {
  border-color: var(--portal-tertiary);
  background: var(--portal-tertiary-soft);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--portal-tertiary) 40%, transparent),
    0 10px 24px color-mix(in oklch, var(--portal-tertiary) 12%, transparent);
}

.portal-rec-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--portal-primary);
  color: var(--portal-on-primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.portal-rec-item.active .portal-rec-rank {
  background: var(--portal-tertiary);
  color: var(--portal-on-tertiary);
}

.portal-rec-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-rec-main em {
  align-self: start;
  color: var(--portal-on-tertiary);
  background: var(--portal-tertiary);
  border-radius: var(--portal-pill-radius);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  text-transform: uppercase;
  width: fit-content;
}

.portal-rec-main strong,
.portal-rec-main small {
  overflow-wrap: anywhere;
}

.portal-rec-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  white-space: nowrap;
}

.portal-rec-meta small {
  display: grid;
  gap: 1px;
  line-height: 1.2;
  min-width: max-content;
}

.portal-rec-meta small span {
  color: color-mix(in oklch, var(--portal-muted) 80%, var(--portal-card-bg));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-rec-action {
  align-items: center;
  border: 1px solid color-mix(in oklch, var(--portal-tertiary) 42%, var(--portal-border));
  border-radius: var(--portal-pill-radius);
  color: var(--portal-tertiary);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  justify-content: center;
  min-height: 32px;
  padding: 4px 10px;
}

.portal-rec-item.active .portal-rec-action {
  background: var(--portal-tertiary);
  color: var(--portal-on-tertiary);
}

.portal-unit-details {
  min-width: 0;
}

.portal-unit-details h3 {
  color: var(--portal-text);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.portal-unit-details p {
  font-size: 0.92rem;
  margin: 0;
}

.portal-unit-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.portal-unit-metrics span,
.portal-attribute-list li {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-pill-radius);
  background: var(--portal-primary-soft);
  color: var(--portal-text);
  font-size: 0.85rem;
  line-height: 1.35;
  padding: 6px 10px;
}

.portal-unit-metrics span {
  display: grid;
  gap: 1px;
  border-radius: var(--portal-control-radius);
  min-width: 128px;
}

.portal-unit-metrics small {
  color: var(--portal-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-unit-metrics strong {
  color: var(--portal-text);
  font-size: 0.95rem;
  font-weight: 800;
}

.portal-unit-extra {
  margin-top: 12px;
}

.portal-attribute-list {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
}

.portal-attribute-list span {
  color: var(--portal-muted);
  font-weight: 700;
}

.portal-attribute-list strong {
  color: var(--portal-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.portal-empty-state {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--portal-border);
  border-radius: var(--portal-card-radius);
  background: var(--portal-secondary-soft);
  padding: 18px;
}

.portal-map-card {
  padding: 0;
  overflow: hidden;
}

.portal-map-header {
  align-items: center;
  border-bottom: 1px solid var(--portal-border);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 16px 18px;
}

.portal-map-header .portal-kicker {
  margin-bottom: 4px;
}

.portal-map-header h3 {
  color: var(--portal-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.portal-map-header span {
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-pill-radius);
  color: var(--portal-muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: 48%;
  overflow-wrap: anywhere;
  padding: 6px 10px;
  text-align: right;
}

.portal-map-wrap {
  min-height: 320px;
  aspect-ratio: 16 / 11;
  background:
    repeating-linear-gradient(
      0deg,
      var(--portal-border) 0,
      var(--portal-border) 1px,
      transparent 1px,
      transparent 40px
    ),
    repeating-linear-gradient(
      90deg,
      var(--portal-border) 0,
      var(--portal-border) 1px,
      transparent 1px,
      transparent 40px
    );
  color: var(--portal-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-map-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

.portal-map-placeholder {
  padding: 24px;
  text-align: center;
}

.portal-footer-note {
  font-size: 0.9rem;
  margin: 0;
}

.portal-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.portal-loading-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--portal-border);
  border-top: 4px solid var(--portal-tertiary);
  border-radius: var(--portal-card-radius);
  background: var(--portal-card-bg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 16px;
  max-width: min(420px, 100%);
}

.portal-loading-card strong {
  display: block;
  color: var(--portal-text);
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.portal-loading-card p {
  color: var(--portal-muted);
  line-height: 1.45;
  margin: 0;
}

.portal-powered-by {
  color: var(--portal-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

@media (min-width: 1200px) {
  .portal-layout--split .portal-shell {
    max-width: min(1320px, calc(100% - 48px));
  }
}

@media (max-width: 991.98px) {
  .portal-header__inner,
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-results-panel {
    position: static;
  }

  .portal-recommendation-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .portal-page {
    padding-bottom: 32px;
    --portal-panel-gap: 16px;
  }

  .portal-header__inner {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .portal-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-form-panel,
  .portal-results-card {
    padding: 18px;
  }

  .portal-form-section,
  .portal-form-section[aria-labelledby="portal-requester-section"],
  .portal-form-section[aria-labelledby="portal-address-section"],
  .portal-form-section[aria-labelledby="portal-need-section"],
  .portal-form-section[aria-labelledby="portal-advanced-location-section"],
  .portal-form-section[aria-labelledby="portal-criteria-section"] {
    grid-template-columns: 1fr;
  }

  .portal-form-section + .portal-form-section {
    padding-top: 18px;
  }

  .portal-form-section .portal-field {
    grid-column: 1 / -1;
  }

  .portal-preference-picker__controls {
    grid-template-columns: 1fr;
  }

  .portal-secondary-btn {
    width: 100%;
  }

  .portal-page--has-results .portal-results-panel {
    order: -1;
  }

  .portal-rec-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .portal-rec-meta {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-items: start;
    white-space: normal;
  }

  .portal-rec-action {
    grid-column: 2;
    justify-self: start;
  }

  .portal-unit-metrics span {
    min-width: min(100%, 150px);
  }

  .portal-map-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-map-header span {
    max-width: 100%;
    text-align: left;
  }

  .portal-map-wrap,
  .portal-map-wrap iframe {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-rec-item {
    transition: none;
    will-change: auto;
  }

  .portal-rec-item:hover {
    transform: none;
  }
}
