body.portal-body.portal-ui-v2 .portal-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 14px calc(108px + env(safe-area-inset-bottom));
}

body.portal-body.portal-ui-v2 .portal-main--full {
  padding-bottom: 24px;
}

body.portal-body.portal-ui-v2 .portal-screen {
  gap: var(--portal-v2-space-lg);
}

body.portal-body.portal-ui-v2 .portal-section {
  display: grid;
  gap: 12px;
}

body.portal-body.portal-ui-v2 .portal-section h2 {
  font-size: clamp(23px, 3.4vw, 28px);
  margin: 0;
}

body.portal-body.portal-ui-v2 .portal-page-header {
  display: grid;
  gap: 8px;
  padding: 2px;
}

body.portal-body.portal-ui-v2 .portal-page-header h1 {
  margin: 0;
  font-size: clamp(31px, 7vw, 42px);
  line-height: 1.02;
}

body.portal-body.portal-ui-v2 .portal-page-header p {
  margin: 0;
  color: #573f49;
  line-height: 1.55;
  max-width: 72ch;
}

body.portal-body.portal-ui-v2 .portal-main .portal-back-link {
  margin-top: 0;
  font-size: 12px;
  color: #6f4f5a;
  text-decoration: none;
}

body.portal-body.portal-ui-v2 .portal-main .portal-back-link:hover {
  text-decoration: underline;
}

body.portal-body.portal-ui-v2 .portal-alert {
  border-radius: 14px;
  border-color: #e8b6bc;
  background: #fff4f6;
  color: #972f3d;
}

body.portal-body.portal-ui-v2 .portal-field span {
  font-size: 12px;
  color: #674c57;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.portal-body.portal-ui-v2 .portal-field input,
body.portal-body.portal-ui-v2 .portal-field textarea,
body.portal-body.portal-ui-v2 .portal-field select {
  border: 1px solid var(--portal-v2-border);
  border-radius: 14px;
  min-height: 46px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--portal-v2-text);
}

body.portal-body.portal-ui-v2 .portal-field input:focus,
body.portal-body.portal-ui-v2 .portal-field textarea:focus,
body.portal-body.portal-ui-v2 .portal-field select:focus {
  border-color: #ab7d89;
  box-shadow: 0 0 0 3px rgba(171, 125, 137, 0.2);
  outline: none;
}

body.portal-body.portal-ui-v2 .portal-auth-main {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 22px 16px 48px;
}

body.portal-body.portal-ui-v2 .portal-auth-card {
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(8px);
}

body.portal-body.portal-ui-v2 .portal-auth-card--narrow {
  max-width: 560px;
}

body.portal-body.portal-ui-v2 .portal-auth-footnote {
  color: var(--portal-v2-muted);
}

body.portal-body.portal-ui-v2 .portal-login-options {
  gap: 10px;
}

body.portal-body.portal-ui-v2 .portal-login-option {
  border-radius: 16px;
  border-color: var(--portal-v2-border);
}

body.portal-body.portal-ui-v2 .portal-login-option.is-primary {
  border-color: rgba(140, 91, 102, 0.42);
  background: rgba(249, 234, 239, 0.85);
}

@media (min-width: 768px) {
  body.portal-body.portal-ui-v2 .portal-main {
    padding: 26px 24px calc(104px + env(safe-area-inset-bottom));
  }

  body.portal-body.portal-ui-v2 .portal-screen {
    gap: 24px;
  }
}

@media (min-width: 900px) {
  body.portal-body.portal-ui-v2 .portal-home {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  body.portal-body.portal-ui-v2 .portal-home > * {
    grid-column: span 2;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-next,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-shortcuts,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-retention,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-news,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-utility,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-points {
    grid-column: span 1;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-retention,
  body.portal-body.portal-ui-v2 .portal-home .portal-home-points {
    align-self: start;
  }
}

@media (min-width: 1200px) {
  body.portal-body.portal-ui-v2 .portal-main {
    padding: 28px 34px 48px;
  }

  body.portal-body.portal-ui-v2 .portal-home {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
  }

  body.portal-body.portal-ui-v2 .portal-home > * {
    grid-column: span 12;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-next {
    grid-column: span 7;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-shortcuts {
    grid-column: span 5;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-retention {
    grid-column: span 7;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-news {
    grid-column: span 5;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-utility {
    grid-column: span 5;
  }

  body.portal-body.portal-ui-v2 .portal-home .portal-home-points {
    grid-column: span 7;
  }
}

/* =====================================================
   Unit Selection Page (v2)
   ===================================================== */

body.portal-body.portal-ui-v2 .portal-unit-list {
  gap: 10px;
  padding-bottom: 96px; /* space for sticky CTA on mobile */
}

body.portal-body.portal-ui-v2 .portal-unit-card {
  border-radius: 18px;
  border: 1.5px solid rgba(134, 87, 98, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.72) 100%);
  box-shadow: var(--portal-v2-shadow-soft);
  padding: 14px;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform var(--portal-v2-motion) ease,
    border-color var(--portal-v2-motion) ease,
    box-shadow var(--portal-v2-motion) ease,
    background var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-unit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--portal-v2-shadow-md);
}

body.portal-body.portal-ui-v2 .portal-unit-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

body.portal-body.portal-ui-v2 .portal-unit-card:has(input:checked) {
  border-color: rgba(17, 115, 82, 0.5);
  background: linear-gradient(160deg, rgba(236, 251, 244, 0.96) 0%, rgba(218, 244, 232, 0.88) 100%);
  box-shadow: 0 12px 28px rgba(17, 88, 64, 0.16);
}

body.portal-body.portal-ui-v2 .portal-unit-pin {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(236, 114, 98, 0.96) 0%, rgba(216, 66, 87, 0.94) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(208, 74, 90, 0.3);
  transition:
    background var(--portal-v2-motion) ease,
    box-shadow var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-unit-pin svg {
  width: 18px;
  height: 18px;
}

body.portal-body.portal-ui-v2 .portal-unit-card:has(input:checked) .portal-unit-pin {
  background: linear-gradient(160deg, #22a06b 0%, #0f7a4f 100%);
  box-shadow: 0 10px 20px rgba(15, 122, 79, 0.3);
}

body.portal-body.portal-ui-v2 .portal-unit-info {
  flex: 1;
  min-width: 0;
  gap: 3px;
}

body.portal-body.portal-ui-v2 .portal-unit-name {
  font-size: 15px;
  color: #3a252c;
}

body.portal-body.portal-ui-v2 .portal-unit-address {
  font-size: 12px;
  color: #65484e;
  line-height: 1.4;
}

body.portal-body.portal-ui-v2 .portal-unit-distance {
  font-size: 11px;
  color: #8f7a84;
}

body.portal-body.portal-ui-v2 .portal-unit-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid rgba(134, 87, 98, 0.28);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition:
    background var(--portal-v2-motion) ease,
    border-color var(--portal-v2-motion) ease,
    color var(--portal-v2-motion) ease,
    box-shadow var(--portal-v2-motion) ease;
}

body.portal-body.portal-ui-v2 .portal-unit-check svg {
  width: 13px;
  height: 13px;
}

body.portal-body.portal-ui-v2 .portal-unit-card:has(input:checked) .portal-unit-check {
  border-color: #0f7a4f;
  background: linear-gradient(135deg, #22a06b 0%, #0f7a4f 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 122, 79, 0.28);
}

/* Sticky confirm CTA */
body.portal-body.portal-ui-v2 .portal-unit-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(134, 87, 98, 0.22);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 22px 36px rgba(90, 53, 67, 0.22);
  backdrop-filter: blur(14px);
  z-index: 95;
}

body.portal-body.portal-ui-v2 .portal-unit-cta .portal-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 15px;
}

@media (min-width: 1024px) {
  body.portal-body.portal-ui-v2 .portal-unit-list {
    padding-bottom: 0;
  }

  body.portal-body.portal-ui-v2 .portal-unit-cta {
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    border-radius: 0;
    margin-top: 8px;
  }

  body.portal-body.portal-ui-v2 .portal-unit-cta .portal-btn {
    max-width: 340px;
  }
}

/* ── Unit selection hero ── */
body.portal-body.portal-ui-v2 .portal-unit-select-hero {
  display: grid;
  gap: 4px;
  padding-bottom: 4px;
}

body.portal-body.portal-ui-v2 .portal-unit-select-title {
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-size: clamp(28px, 6vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--portal-v2-text);
  margin: 0;
}

body.portal-body.portal-ui-v2 .portal-unit-select-sub {
  font-size: 14px;
  color: var(--portal-v2-muted);
  margin: 0;
}

body.portal-body.portal-ui-v2 .portal-unit-card:hover {
  transform: translateY(-4px);
  transition: transform 200ms var(--portal-v2-ease-spring), box-shadow 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body.portal-body.portal-ui-v2 .portal-unit-card:hover {
    transform: none;
    transition: none;
  }
}
