*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --oortu-navy: #0D1B2A;
  --oortu-navy-2: #162D4A;
  --oortu-blue: #1B3A5C;
  --oortu-accent: #2B6FBF;
  --oortu-green: #2EAF7D;
  --oortu-text: #0D1B2A;
  --oortu-muted: #5A6577;
  --oortu-soft: #F2F4F7;
  --oortu-panel: #FFFFFF;
  --oortu-subtle: #F6F8FB;
  --oortu-line: #E6EAF0;
  --oortu-radius-lg: 20px;
  --oortu-radius-md: 16px;
  --oortu-radius-sm: 12px;
  --oortu-shadow: 0 2px 24px rgba(13, 27, 42, 0.06), 0 0 0 1px rgba(13, 27, 42, 0.04);
  --oortu-shadow-hover: 0 10px 26px rgba(13, 27, 42, 0.09), 0 0 0 1px rgba(27, 58, 92, 0.12);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--oortu-soft);
  color: var(--oortu-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.header {
  padding: 12px 1.25rem;
  min-height: 48px;
  background: var(--oortu-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 0.5rem;
}

.logo img {
  height: 24px;
  width: auto;
}

.header-store-links {
  display: none;
  align-items: center;
  margin-left: auto;
}

.header-store-link {
  display: none;
  align-items: center;
  height: 31px;
  border-radius: 7px;
  background: #000;
  overflow: hidden;
  text-decoration: none;
}

.header-store-link img {
  display: block;
  width: auto;
  height: 31px;
  border-radius: 0;
  clip-path: inset(1px round 7px);
  transform: scale(1.025);
  transform-origin: center;
}

/* ─── Page ─── */
.station-page {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 2rem;
  flex: 1;
}

/* ─── Map ─── */
.map-container {
  width: 100%;
  height: 300px;
  background: #DCE1E8;
  overflow: hidden;
  position: relative;
}

.map-container img.map-static {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.osm-map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  transform: scale(1.08);
}

.osm-map-tile {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.osm-map-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -88%);
  filter: drop-shadow(0 10px 14px rgba(13, 27, 42, 0.28));
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── Station Card ─── */
.station-card {
  background: var(--oortu-panel);
  border-radius: var(--oortu-radius-lg);
  margin: -48px 16px 0;
  padding: 24px;
  position: relative;
  min-width: 0;
  box-shadow: var(--oortu-shadow);
}

.station-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--oortu-text);
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--oortu-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.breadcrumbs a {
  color: var(--oortu-blue);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #B0B7C3;
}

/* ─── Info rows ─── */
.station-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--oortu-muted);
  font-size: 0.875rem;
}

.info-row svg {
  margin-top: 2px;
  flex-shrink: 0;
  color: #8892A0;
}

.info-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.info-row .operator-name {
  color: var(--oortu-blue);
  font-weight: 500;
}

.operator-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.city-context-link {
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.operator-link:hover,
.city-context-link:hover {
  color: var(--oortu-text);
}

/* ─── Stats ─── */
.station-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  min-width: 0;
}

.stat-card {
  background: #F6F8FB;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.connectors {
  background: #E8F4FD;
  color: #1B3A5C;
}

.stat-icon.power {
  background: #FFF3E0;
  color: #E65100;
}

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0D1B2A;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--oortu-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Connectors ─── */
.connectors-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.connector-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F2F4F7;
}

.connector-row:last-child {
  border-bottom: none;
}

.connector-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.connector-icon {
  width: 36px;
  height: 36px;
  background: #F0F2F5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1B3A5C;
}

.connector-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--oortu-text);
}

.connector-right {
  text-align: right;
  flex-shrink: 0;
}

.connector-power {
  font-weight: 600;
  color: var(--oortu-blue);
  font-size: 0.9375rem;
}

.connector-count {
  font-size: 0.75rem;
  color: var(--oortu-muted);
}

/* ─── Rating ─── */
.rating-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #FFFBF0;
  border-radius: 12px;
}

.rating-stars {
  color: #F9A825;
  font-size: 1rem;
}

.rating-score {
  font-weight: 700;
  color: #0D1B2A;
  font-size: 0.9375rem;
}

.rating-label {
  color: #6B7280;
  font-size: 0.8125rem;
}

/* ─── CTA ─── */
.cta-section {
  margin-top: 4px;
}

.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--oortu-navy);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}

.cta-button:hover {
  background: var(--oortu-navy-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 27, 42, 0.2);
}

.cta-button svg {
  flex-shrink: 0;
}

.store-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.store-badge {
  display: block;
  text-decoration: none;
  transition: opacity 0.2s;
}

.store-badge:hover {
  opacity: 0.85;
}

.store-badge img {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 8px;
}

/* ─── Directions link ─── */
.directions-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 10px;
  color: var(--oortu-blue);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s;
}

.directions-link:hover {
  background: #F6F8FB;
}

/* ─── Nearby stations ─── */
.nearby-section {
  background: var(--oortu-panel);
  border-radius: var(--oortu-radius-lg);
  margin: 16px;
  padding: 18px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--oortu-shadow);
}

.nearby-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.nearby-header h2 {
  color: var(--oortu-text);
  font-size: 1.0625rem;
  line-height: 1.25;
}

.nearby-header > span {
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid #E6EAF0;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--oortu-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.nearby-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.nearby-station {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--oortu-line);
  border-radius: var(--oortu-radius-md);
  background: var(--oortu-panel);
  text-decoration: none;
  box-shadow: 0 1px 10px rgba(13, 27, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.nearby-station:hover {
  border-color: #D8E0EA;
  box-shadow: var(--oortu-shadow-hover);
  transform: translateY(-1px);
}

.nearby-card-head,
.nearby-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.nearby-name {
  min-width: 0;
  color: var(--oortu-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.nearby-distance {
  flex-shrink: 0;
  border-radius: 999px;
  background: #E8F4FD;
  color: #1B3A5C;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 700;
}

.nearby-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: #5A6577;
  font-size: 0.875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nearby-address svg {
  margin-top: 2px;
  flex-shrink: 0;
  color: #8892A0;
}

.nearby-address-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nearby-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: #F6F8FB;
  color: #1B3A5C;
  padding: 6px 9px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ─── Responsive ─── */
@media (min-width: 641px) {
  .station-card {
    margin: -48px 0 0;
    border-radius: 20px 20px 20px 20px;
  }

  .nearby-section {
    margin: 16px 0 0;
  }

  .map-container {
    height: 380px;
    border-radius: 0;
  }

}

@media (max-width: 640px) {
  .header {
    padding: 8px 12px;
    min-height: 44px;
  }

  .header-store-links {
    display: flex;
  }

  html[data-store-platform="ios"] .header-store-ios,
  html[data-store-platform="android"] .header-store-android {
    display: flex;
  }
}

@media (max-width: 360px) {
  .header {
    gap: 10px;
    padding: 8px 10px;
  }

  .logo img {
    height: 19px;
  }

  .header-store-link {
    height: 28px;
  }

  .header-store-link img {
    height: 28px;
  }

  .map-container {
    height: 276px;
  }

  .station-card {
    margin: -42px 12px 0;
    padding: 20px;
    border-radius: 18px;
  }

  .station-name {
    font-size: 1.34rem;
    line-height: 1.16;
    letter-spacing: 0;
  }

  .station-info {
    gap: 7px;
    margin-bottom: 18px;
  }

  .info-row {
    font-size: 0.83rem;
  }

  .station-stats {
    gap: 10px;
    margin-bottom: 18px;
  }

  .stat-card {
    padding: 12px 10px;
    gap: 8px;
    border-radius: 13px;
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .stat-value {
    font-size: 1.05rem;
  }

  .stat-label {
    font-size: 0.62rem;
    line-height: 1.25;
  }

  .connector-row {
    gap: 12px;
  }

  .connector-name,
  .connector-power {
    font-size: 0.9rem;
  }

  .cta-button {
    padding: 14px 12px;
    font-size: 0.94rem;
  }

  .nearby-section {
    margin: 14px 12px;
    padding: 16px;
  }

  .nearby-header {
    gap: 10px;
  }

  .nearby-header h2 {
    font-size: 1rem;
  }

  .nearby-station {
    padding: 14px;
  }

  .nearby-card-head {
    display: grid;
    justify-items: start;
    gap: 8px;
  }

  .nearby-name {
    font-size: 0.96rem;
  }

  .nearby-distance {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
}
