:root {
  --br-tech-glow: 0 0 0 1px rgba(36, 80, 111, 0.08), 0 22px 58px rgba(16, 24, 32, 0.1);
  --city-map-height: 580px;
}

.city-body {
  min-height: 100vh;
  padding-bottom: 124px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 249, 0.98)),
    var(--br-bg);
  color: var(--br-ink);
}

.city-app-shell {
  min-height: 100vh;
}

.city-main {
  padding-bottom: 36px;
}

.city-hero {
  padding: 42px 0 20px;
}

.city-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
}

.city-hero-copy,
.city-signal-panel,
.map-section,
.radio-panel {
  border: 1px solid rgba(17, 63, 103, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--br-tech-glow);
  backdrop-filter: blur(16px);
}

.city-hero-copy {
  display: grid;
  align-content: center;
  min-height: 290px;
  padding: clamp(26px, 4vw, 46px);
}

.city-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--br-blue-deep);
  font-size: clamp(2.05rem, 4vw, 3.8rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.city-hero-copy p {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--br-ink-soft);
  font-size: 1.02rem;
  line-height: 1.72;
}

.city-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.city-signal-panel {
  display: grid;
  align-content: center;
  min-height: 290px;
  padding: 28px;
  overflow: hidden;
}

.city-signal-panel span,
.city-signal-panel small {
  color: var(--br-muted);
  font-weight: 800;
}

.city-signal-panel > span {
  color: var(--br-green);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.city-signal-panel strong {
  margin-top: 10px;
  color: var(--br-ink);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1;
  font-weight: 950;
}

.city-signal-panel small {
  margin-top: 10px;
}

.signal-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 92px;
  margin-top: 34px;
}

.signal-bars span {
  display: block;
  min-height: 18px;
  border-radius: 999px;
  background: var(--br-green);
  box-shadow: 0 0 22px rgba(22, 128, 90, 0.18);
  animation: citySignal 1.35s ease-in-out infinite;
}

.signal-bars span:nth-child(2n) {
  background: var(--br-blue);
  animation-delay: 120ms;
}

.signal-bars span:nth-child(3n) {
  background: var(--br-yellow);
  animation-delay: 220ms;
}

.signal-bars span:nth-child(1) { height: 24px; }
.signal-bars span:nth-child(2) { height: 48px; }
.signal-bars span:nth-child(3) { height: 72px; }
.signal-bars span:nth-child(4) { height: 36px; }
.signal-bars span:nth-child(5) { height: 58px; }
.signal-bars span:nth-child(6) { height: 86px; }
.signal-bars span:nth-child(7) { height: 42px; }
.signal-bars span:nth-child(8) { height: 66px; }
.signal-bars span:nth-child(9) { height: 30px; }
.signal-bars span:nth-child(10) { height: 76px; }
.signal-bars span:nth-child(11) { height: 54px; }
.signal-bars span:nth-child(12) { height: 38px; }

@keyframes citySignal {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.92;
  }

  50% {
    transform: scaleY(0.68);
    opacity: 1;
  }
}

.city-layout-section {
  padding: 20px 0 58px;
}

.city-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.map-section {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 470px);
  gap: 18px;
  align-items: end;
}

.map-toolbar h2,
.selected-city h2 {
  margin: 0;
  color: var(--br-blue-deep);
  font-weight: 950;
  line-height: 1.04;
}

.map-toolbar h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.map-toolbar p {
  margin: 8px 0 0;
  color: var(--br-muted);
  line-height: 1.55;
}

.toolbar-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 178px;
  gap: 10px;
}

.field-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(17, 63, 103, 0.13);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--br-green);
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.field-shell:focus-within,
.field:focus {
  border-color: rgba(28, 140, 85, 0.46);
  box-shadow: 0 0 0 4px rgba(28, 140, 85, 0.1), var(--shadow-xs);
  transform: translateY(-1px);
}

.field {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--br-ink);
  outline: 0;
}

.select-field {
  padding: 0 12px;
  border: 1px solid rgba(17, 63, 103, 0.13);
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 850;
  box-shadow: var(--shadow-xs);
}

.osm-frame {
  position: relative;
  min-height: var(--city-map-height);
  overflow: hidden;
  border: 1px solid rgba(17, 63, 103, 0.12);
  border-radius: var(--radius);
  background: #dfe8e2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

.city-map {
  width: 100%;
  height: 100%;
  min-height: var(--city-map-height);
}

.leaflet-container {
  background: #dfe8e2;
  font: inherit;
}

.leaflet-control-zoom a {
  color: var(--br-blue-deep);
}

.city-marker-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--br-blue);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(16, 24, 32, 0.24);
  font-size: 12px;
  font-weight: 950;
}

.city-marker-icon[data-region="north"],
.city-marker-icon[data-region="southeast"] {
  background: var(--br-green);
}

.city-marker-icon[data-region="northeast"] {
  background: var(--br-coral);
}

.city-marker-icon[data-region="center-west"] {
  background: var(--br-blue);
}

.city-marker-icon[data-region="south"] {
  background: var(--br-blue-deep);
}

.city-marker-icon.is-active {
  background: var(--br-yellow);
  color: var(--br-blue-deep);
  transform: scale(1.12);
}

.city-popup strong {
  display: block;
  margin-bottom: 4px;
  color: var(--br-ink);
}

.city-popup span {
  display: block;
  color: var(--br-muted);
  font-size: 12px;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--br-danger);
  text-align: center;
}

.city-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 184px;
  overflow: auto;
  padding-right: 2px;
}

.city-card {
  display: grid;
  gap: 5px;
  min-height: 66px;
  padding: 11px 12px;
  border: 1px solid rgba(17, 63, 103, 0.1);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--br-ink);
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.city-card:hover,
.city-card[aria-current="true"] {
  border-color: rgba(255, 216, 77, 0.72);
  background: var(--br-yellow);
  color: var(--br-blue-deep);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.city-card strong {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-card span {
  overflow: hidden;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0.76;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radio-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  max-height: calc(100vh - 104px);
  overflow: hidden;
}

.selected-city,
.radio-panel .station-tools {
  border-bottom: 1px solid var(--br-line);
  background: rgba(255, 255, 255, 0.72);
}

.selected-city {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.selected-city h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.selected-city p:last-child,
.summary {
  margin: 8px 0 0;
  color: var(--br-muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.radio-panel .station-tools {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
}

.station-list {
  min-height: 340px;
  overflow: auto;
  padding: 14px;
}

.station-card {
  margin-bottom: 10px;
  border: 1px solid rgba(17, 63, 103, 0.1);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.station-card:hover,
.station-card.is-playing {
  border-color: rgba(28, 140, 85, 0.44);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.station-card.is-playing {
  box-shadow: inset 4px 0 0 var(--br-green), var(--shadow-sm);
}

.station-main {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
}

.city-station-logo {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--br-yellow);
  color: var(--br-blue-deep);
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: inset 0 -4px 0 rgba(16, 24, 32, 0.08);
}

.city-station-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.station-copy {
  display: block;
  min-width: 0;
}

.station-name {
  display: block;
  overflow: hidden;
  color: var(--br-ink);
  font-size: 0.96rem;
  line-height: 1.2;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.station-meta span {
  max-width: 150px;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--br-surface-soft);
  color: var(--br-muted);
  font-size: 0.73rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-copy small {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  color: var(--br-muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--br-surface-soft);
  color: var(--br-blue);
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.station-card.is-playing .station-live {
  background: var(--br-green);
  color: #ffffff;
}

.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 24px;
  color: var(--br-muted);
  text-align: center;
  line-height: 1.45;
}

.error-state {
  color: var(--br-danger);
}

.spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border: 3px solid rgba(28, 140, 85, 0.16);
  border-top-color: var(--br-green);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.city-player {
  display: grid;
  grid-template-rows: auto auto;
}

.city-player .player-logo {
  width: 52px;
  height: 52px;
}

.city-player-panel {
  padding: 0 12px 12px;
  border-top: 1px solid var(--br-line);
}

.city-player-panel .player-volume {
  margin-top: 12px;
}

.city-card:focus-visible,
.station-main:focus-visible,
.field:focus-visible,
.select-field:focus-visible,
.leaflet-marker-icon:focus-visible {
  outline: 3px solid rgba(36, 80, 111, 0.24);
  outline-offset: 2px;
}

@media (max-width: 1120px) {
  .city-hero-grid,
  .city-layout {
    grid-template-columns: 1fr;
  }

  .radio-panel {
    max-height: none;
  }

  .station-list {
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  :root {
    --city-map-height: 460px;
  }

  .city-body {
    padding-bottom: 156px;
  }

  .city-hero {
    padding-top: 28px;
  }

  .city-hero-copy,
  .city-signal-panel,
  .map-section {
    padding: 18px;
  }

  .city-signal-panel {
    min-height: 210px;
  }

  .map-toolbar,
  .toolbar-fields {
    grid-template-columns: 1fr;
  }

  .selected-city {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-city .btn {
    width: 100%;
  }

  .station-main {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .station-live {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  .city-player {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
}

@media (max-width: 480px) {
  :root {
    --city-map-height: 380px;
  }

  .city-hero-actions,
  .city-hero-actions .btn {
    width: 100%;
  }

  .city-list {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .city-marker-icon {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .city-player .mini-player-bar {
    grid-template-columns: 1fr auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal-bars span {
    animation: none;
  }
}
