/* Non-active scenes only. Requires the matching full-raster SVG viewBox
   -5 491 934 339.636364 in ChargingScene AND the login effects SVG.
   The registered image/path coordinates and animation timing stay unchanged.
   Load after the existing scene styles; active charging is owned separately. */
.ev-login .ev-scene {
  width: 100%;
  height: auto;
  aspect-ratio: 934 / 339.636364;
  overflow: visible;
}
.ev-login .ev-scene-art {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  clip-path: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.ev-login .ev-scene-effects {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ev-auth-photo-hero .ev-auth-photo-scene {
  width: 100%;
  height: auto;
  aspect-ratio: 934 / 339.636364;
  overflow: visible;
}
.ev-auth-photo-hero .ev-auth-photo-art {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  clip-path: none;
}
/* Existing wrapper widths and responsive negative margins already reach the
   page edge. Retain those margins rather than guessing a different gutter. */
.ev-start-screen .ev-start-scene,
.ev-completed-page .ev-completed-scene {
  flex: 0 0 auto;
  height: auto;
  aspect-ratio: 934 / 339.636364;
  overflow: visible;
}
.ev-start-screen .ev-start-scene .ev-charge-art,
.ev-completed-page .ev-completed-scene .ev-charge-art {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 934 / 339.636364;
  margin: 0;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
.ev-start-screen .ev-start-scene .ev-charge-scene,
.ev-completed-page .ev-completed-scene .ev-charge-scene {
  display: block;
  width: 100%;
  height: 100%;
}
/* Preserve the existing error helper's real flow space as well as the normal
   full-frame image. Error copy must not overflow into a form or session data. */
.ev-start-screen .ev-start-scene .ev-charge-art.ev-asset-recovery-active,
.ev-completed-page .ev-completed-scene .ev-charge-art.ev-asset-recovery-active {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
  min-height: 136px;
  max-height: none;
  aspect-ratio: auto;
}
.ev-start-screen .ev-start-scene .ev-charge-art.ev-asset-recovery-active > .ev-charge-scene,
.ev-completed-page .ev-completed-scene .ev-charge-art.ev-asset-recovery-active > .ev-charge-scene {
  flex: 0 0 56px;
  height: 56px;
  min-height: 56px;
}
.ev-login .ev-scene.ev-asset-recovery-active,
.ev-auth-photo-hero .ev-auth-photo-scene.ev-asset-recovery-active {
  height: auto;
  min-height: 136px;
  aspect-ratio: auto;
}
.ev-login .ev-scene.ev-asset-recovery-active > .ev-asset-recovery-notice,
.ev-auth-photo-hero .ev-auth-photo-scene.ev-asset-recovery-active > .ev-asset-recovery-notice {
  position: relative;
  inset: auto;
  transform: none;
  margin: 12px 14px;
}

@media (max-width: 520px) and (min-height: 480px) and (max-height: 760px) {
  .ev-map-proposal #station-sheet { bottom: 4px; }
  .station-sheet.ev-station-reference-surface { max-height: calc(100dvh - var(--nav) - 8px); }
  .station-detail.ev-station-reference-surface {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - var(--nav) - 16px);
  }
  body.station-screen #screen:has(> .station-detail) { padding-block: 8px calc(var(--nav) + 8px); }
  body.station-screen #screen:has(> .station-detail) > .updated { display: none; }
  .station-detail.ev-station-reference-surface > .page-title { flex: 0 0 auto; margin-bottom: 3px; }
  .station-detail.ev-station-reference-surface > .page-title .evcar-logo { width: 115px; }
  .ev-station-reference-surface .sheet-handle { margin-block: 5px 2px; }
  .ev-station-reference-surface .ev-station-reference-header .sheet-heading { min-height: 24px; padding-top: 0; }
  .ev-station-reference-surface .ev-station-reference-header .sheet-heading :is(h1,h2) { font-size: 18px; }
  .ev-station-reference-surface .ev-station-reference-header .sheet-info :is(span,p) { font-size: 12px; line-height: 1.25; }
  .ev-station-reference-surface > .sheet-ports-heading { min-height: 26px; padding-block: 3px; font-size: 13px; }
  .ev-station-reference-surface :is(.sheet-ports, .detail-connectors) { min-height: 52px; max-height: none; gap: 4px; }
  .ev-station-reference-surface .sheet-port.connector-row.ev-port-row {
    --ev-port-photo-size: 42px;
    --ev-port-price-width: 56px;
    --ev-port-badge-width: 65px;
    min-height: 44px;
    padding: 3px 7px;
    column-gap: 5px;
    row-gap: 2px;
    border-radius: 12px;
  }
  .ev-station-reference-surface .ev-port-row .connector-visual { width: var(--ev-port-photo-size); height: 36px; }
  .ev-station-reference-surface .ev-port-row .connector-content > .connector-primary,
  .ev-station-reference-surface .sheet-port.connector-row.ev-port-row .connector-number { font-size: 14px; }
  .ev-station-reference-surface .ev-port-row .ev-port-meta { font-size: 12px; margin-top: 2px; }
  .ev-station-reference-surface .ev-port-row .connector-price .connector-tariff { font-size: 11px; }
  .ev-station-reference-surface .ev-port-row .connector-tariff-unit { font-size: 9px; }
  .ev-station-reference-surface :is(.detail-action, .sheet-action) { flex: 0 0 auto; padding-block: 5px; }
  .ev-station-reference-surface .ev-start-select-prompt { margin-top: 0; }
  .ev-station-reference-surface .ev-start-swipe .ev-start-swipe-selected { font-size: 12px; }
  .ev-station-reference-surface .booking-entry { min-height: 44px; padding-block: 8px; margin-top: 5px; }
  .ev-station-reference-surface .connector-instruction { flex: 0 0 auto; margin-block: 3px 0; font-size: 11px; }
}

@media (max-height: 740px) {
  .ev-start-screen:not(.ev-connect-screen) { gap: 9px; padding-block: 10px; }
  .ev-start-screen .ev-start-help { padding-top: 3px; }
  .ev-start-screen .ev-start-help p { margin-bottom: 6px; }
  .ev-start-screen .ev-start-support-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ev-start-screen .ev-start-support-options > button {
    height: auto;
    min-height: 60px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
  }
  .ev-start-screen .ev-start-support-copy { text-align: center; align-items: center; }
  .ev-start-screen .ev-start-support-copy small { font-size: 10px; overflow-wrap: anywhere; }
  .ev-start-screen .ev-start-support-arrow { display: none; }

  .ev-connect-screen { gap: 6px; padding-block: 8px; }
  .ev-connect-screen .ev-start-station { padding-block: 5px; }
  .ev-connect-screen .ev-connect-message h2 { font-size: clamp(18px, 5vw, 22px); }
  .ev-connect-screen .ev-connect-message p { font-size: 13px; line-height: 1.3; }
  .ev-connect-screen .ev-connect-scene:not(:has(.ev-asset-recovery-active)) { aspect-ratio: auto; height: clamp(76px, 14dvh, 104px); }
  .ev-connect-screen .ev-connect-scene .ev-charge-art:not(.ev-asset-recovery-active) { height: 100%; aspect-ratio: auto; }
  .ev-connect-screen .ev-connect-guide { padding: 7px; }
  .ev-connect-screen .ev-connect-guide-heading h3 { font-size: 14px; }
  .ev-connect-screen .ev-connect-demo { margin-block: 0 2px; }
  .ev-connect-screen .ev-connect-steps { gap: 2px; }
  .ev-connect-screen .ev-connect-step { min-height: 29px; padding: 3px 5px; }
  .ev-connect-screen .ev-connect-step p { font-size: 13px; line-height: 1.25; }
  .ev-connect-screen .ev-connect-actions > button { padding: 6px 7px; font-size: 14px; }
  .ev-connect-screen .ev-connect-support h3 { font-size: 14px; }
  .ev-connect-screen .ev-connect-support-options > button { font-size: 12px; }

  .ev-completed-page { gap: 6px; padding-block: 10px; }
  .ev-completed-page .ev-completed-hero { padding-top: 0; }
  .ev-completed-page .ev-completed-hero h1 { font-size: clamp(20px, 5.7vw, 24px); }
  .ev-completed-page .ev-completed-hero p { margin-top: 4px; }
  .ev-completed-page .ev-completed-summary { gap: 5px; }
  .ev-completed-page .ev-completed-metric { min-height: 52px; padding: 5px; border-radius: 11px; }
  .ev-completed-page .ev-completed-metric dt { margin-bottom: 2px; }
  .ev-completed-page .ev-completed-metric dd { font-size: 17px; }
  .ev-completed-page .ev-completed-text dd { font-size: 12px; }
  .ev-completed-page .ev-completed-map { min-height: 44px; }
}
