/* Station cards */
:root{
  --txt: var(--text, #e2e8f0);
  --mut: var(--muted, #94a3b8);
  --bd:  rgba(148,163,184,.16);
  --card: rgba(30,41,59,.50);
  --cardHover: rgba(30,41,59,.62);
  --chip: rgba(2,6,23,.35);
}

.fp-section{
  margin: 14px 0 10px;
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.fp-section h3{
  margin: 0;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: -.02em;
  color: var(--txt);
}
.fp-section .meta{
  font-size: .86rem;
  font-weight: 800;
  color: var(--mut);
}

.fp-card{
  display:grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items:center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--bd);
  background: var(--card);
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  margin-bottom: 10px;
}
.fp-card:hover{
  transform: translateY(-1px);
  background: var(--cardHover);
  border-color: rgba(148,163,184,.24);
}
.fp-card.active{
  border-color: rgba(59,130,246,.5);
  box-shadow: 0 18px 44px rgba(37,99,235,.18);
}

/* Logo */
.fp-logo{
  width: 48px; height: 48px;
  border-radius: 16px;
  overflow:hidden;
  display:grid;
  place-items:center;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.95);
}
.fp-logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  display:block;
  filter:none !important;
  mix-blend-mode: normal !important;
}

/* Fallback */
.fp-fallback{
  width: 48px; height: 48px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-weight: 950;
  color: #2563eb;
  background: rgba(2,6,23,.30);
  border: 1px solid rgba(148,163,184,.14);
}

body[data-theme="light"] .fp-logo{ background: #fff; }

/* Text */
.fp-main{ min-width: 0; }
.fp-brand{
  font-weight: 950;
  letter-spacing: -.02em;
  color: var(--txt);
  line-height: 1.1;
}
.fp-addr{
  margin-top: 4px;
  font-size: .88rem;
  color: var(--mut);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.fp-sub{
  margin-top: 6px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fp-pill{
  font-size: .78rem;
  font-weight: 850;
  color: var(--txt);
  background: var(--chip);
  border: 1px solid rgba(148,163,184,.14);
  padding: 6px 8px;
  border-radius: 999px;
}

/* Price */
.fp-price{
  font-weight: 950;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.30);
  text-align:right;
  min-width: 92px;
}
.fp-price.best{ border-color: rgba(34,197,94,.35); }
.fp-price.ok  { border-color: rgba(34,197,94,.22); }
.fp-price.mid { border-color: rgba(245,158,11,.22); }
.fp-price.bad { border-color: rgba(239,68,68,.22); }

@media (max-width: 520px){
  .fp-card{
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto auto;
    align-items:start;
  }
  .fp-price{
    grid-column: 1 / -1;
    width: 100%;
    text-align:center;
  }
  .fp-addr{ white-space: normal; }
}
/* =========================
   Logo fit fixes (results + chips)
   ========================= */

.resultLogo { display:flex; align-items:center; justify-content:center; }

.logoBox{
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.25);
  box-shadow: 0 10px 20px rgba(0,0,0,0.20);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;          /* key: stops logos touching edges */
  flex: 0 0 56px;
}

.logoImg{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;   /* key: no stretching */
  object-position: center;
}

.logoFallback.brandfallback{
  width: 100%;
  height: 100%;
  display: grid;         /* JS hides this when image loads */
  place-items: center;
  font-weight: 950;
  font-size: 18px;
  color: #0b1220;
  letter-spacing: -0.02em;
}

/* Brand chip logos */
.chipLogo{
  width: 20px;
  height: 20px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(148,163,184,0.22);
}

.chipImg{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  padding: 2px;
}

.chipFallback{
  width: 100%;
  height: 100%;
  display: grid;         /* JS hides this when image loads */
  place-items: center;
  font-weight: 950;
  font-size: 11px;
  color: #0b1220;
}
