:root {
  --ink: #0e2233;
  --paper: #f3efe6;
  --line-blue: #1c4b82;
  --line-blue-dark: #0f3a5c;
  --stop-yellow: #f2b705;
  --muted: #5c6b78;
  --card: #ffffff;
  --radius: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
header {
  background: var(--line-blue);
  color: #fff;
  padding: 22px 20px 26px;
  position: relative;
  overflow: hidden;
}
header::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: var(--stop-yellow);
  border-radius: 50%;
  opacity: 0.15;
}
header h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}
header p {
  margin: 0;
  color: #cfe0f2;
  font-size: 0.95rem;
}
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}
.layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.panel {
  min-width: 0;
}
.favorites-panel {
  flex: 0 0 260px;
}
.map-panel {
  flex: 1 1 656px;
}
.arrivals-panel {
  flex: 0 0 280px;
  position: sticky;
  top: 20px;
}

.center {
        text-align: center;
    }
    
h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--line-blue);
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(14, 34, 51, 0.08);
}
.map-wrap {
  position: relative;
}
#map {
  width: 100%;
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
}
.locate-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--muted);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(14, 34, 51, 0.3);
  font-weight: 400;
}
.locate-btn:hover {
  color: var(--line-blue);
  filter: none;
}
.locate-btn.locating {
  color: var(--line-blue);
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}
.favorite-card {
  margin-bottom: 14px;
}
.favorite-pick-btn {
  width: 100%;
  background: var(--stop-yellow);
  color: var(--ink);
  border: 2px solid transparent;
}
.favorite-pick-btn.picking {
  background: #fff;
  border-color: var(--line-blue);
  color: var(--line-blue);
  animation: favorite-pulse 1.1s ease-in-out infinite;
}
@keyframes favorite-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.favorite-stop-name {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 0;
}
.favorite-arrivals {
  max-height: 190px;
  overflow-y: auto;
  margin-top: 6px;
}
.favorite-arrivals .arrival-row {
  padding: 7px 0;
}
button {
  background: var(--stop-yellow);
  color: var(--ink);
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.96);
}
/* Buszérkezés-panel — korábban lecsúszó felugró kártya volt, most a térkép
   melletti állandó oldalsávban jelenik meg, hogy sose lógjon ki a képernyőről. */
.arrivals-panel .card {
  position: relative;
  min-height: 180px;
}
.arrivals-panel.open .card {
  border: 1.5px solid var(--line-blue);
}
.arrivals-panel .stop-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 22px 2px 0;
  color: var(--ink);
}
.arrivals-panel .stop-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 14px;
}
#popup-body {
  max-height: 340px;
  overflow-y: auto;
}
.arrival-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #e6e2d6;
}
.arrival-row .line-badge {
  background: var(--stop-yellow);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 3px 9px;
  border-radius: 6px;
  min-width: 34px;
  text-align: center;
}
.arrival-row .dest {
  flex: 1;
  margin: 0 10px;
  font-size: 0.88rem;
  color: var(--ink);
}
.arrival-row .eta {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--line-blue);
}
.arrivals-panel .close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 2px 6px;
}
.empty-note {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 14px 0 2px;
}
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 20px 16px 40px;
}
.setup-note {
  background: #fff7e0;
  border: 1px solid #f0d98a;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #6b5615;
  margin-bottom: 16px;
}
code {
  background: #eee;
  padding: 1px 5px;
  border-radius: 4px;
}

@media (max-width: 980px) {
  .layout {
    flex-direction: column;
  }
  .favorites-panel,
  .map-panel,
  .arrivals-panel {
    flex: 1 1 auto;
    width: 100%;
    position: static;
  }
}
