/* ================= finder, Pujo Metro: the line badges, the diagram, the station pins, the route =================
   Every thana is a line in one of 5 route colours (--lc, set per element by the JS), every pandal a station.
   The Bangla line number rides on every badge so colour is never the only cue. Motion has one job: show the route order. */

/* ---------- the line badge: a radius 8 tag in the line colour with the number in dark ink ---------- */
.fbadge{flex:0 0 auto;display:inline-grid;place-items:center;min-width:26px;height:26px;padding:0 5px;border-radius:8px;background:var(--lc,var(--gold));
  color:var(--deep);font-size:.92rem;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}

/* ---------- the line selector: outlined in the line colour, the chosen one filled ---------- */
.fchips{display:flex;gap:8px;margin:14px -16px 0;padding:0 16px 4px;overflow-x:auto;scroll-snap-type:x proximity;scroll-padding-inline:16px;
  scrollbar-width:none;overscroll-behavior-x:contain}
.fchips::-webkit-scrollbar{display:none}
.fchip{flex:0 0 auto;scroll-snap-align:start;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 12px 0 8px;border-radius:8px;
  border:2px solid var(--lc,var(--fr));background:var(--deep);color:var(--ink);font:inherit;font-size:.92rem;font-weight:600;white-space:nowrap;cursor:pointer}
.fchip>.ph{margin-left:4px;color:var(--gold)}
.fchip b{font-weight:500;color:var(--fm)}   /* no tabular-nums: Bangla digits overlap in some fallback fonts */
.fchip[aria-pressed="true"]{background:var(--lc,var(--gold));border-color:var(--lc,var(--gold));color:var(--deep)}
.fchip[aria-pressed="true"] b,.fchip[aria-pressed="true"]>.ph{color:var(--deep)}
.fchip[aria-pressed="true"] .fbadge{background:var(--deep);color:var(--lc)}

/* ---------- the line card: a header, then the stations on a 6 px spine (finder-deck.css holds the deck around it) ---------- */
.fln{--sp:17px;margin-top:12px;padding:14px 14px 6px;background:var(--fs);border-top:2px solid var(--lc)}
.fln:first-child{margin-top:0}
.flh{display:flex;flex-direction:column;gap:6px;margin-bottom:6px}
.flhb{display:flex;align-items:center;gap:10px;min-height:44px;width:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.flhb .fbadge{min-width:34px;height:34px;font-size:1.1rem}
.flhn{flex:1;min-width:0;font-size:1.12rem;font-weight:700;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flhc{flex:0 0 auto;font-size:.86rem;font-weight:600;color:var(--lc)}
.flhw{padding-left:44px;font-size:.86rem;line-height:1.45;color:var(--fm)}
.flhact{display:flex;flex-wrap:wrap;gap:8px;padding:6px 0 4px}
.flhact .fpill{flex:1 1 auto}
.flhact .fpill-on:has(~ .flhleg){flex-basis:100%}                          /* a long line: শুরু করুন on its own row, the legs below it */
.flhleg{flex-basis:100%;margin:0;font-size:.78rem;line-height:1.4;color:var(--fm)}

.fsts{position:relative;list-style:none;margin:0;padding:0}
.fsts::before{content:"";position:absolute;left:calc(var(--sp) - 3px);top:0;bottom:0;width:6px;background:var(--lc);transform-origin:50% 0}   /* the spine */
.fst{position:relative;z-index:1;display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;column-gap:10px;padding:10px 6px 12px 0;cursor:pointer;scroll-margin-top:96px}
.fst:last-child::after{content:"";position:absolute;z-index:-1;left:calc(var(--sp) - 3px);top:22px;bottom:0;width:6px;background:var(--fs)}   /* the line ends at the last station */
.fdot{grid-row:1/3;justify-self:center;width:22px;height:22px;margin-top:1px;border-radius:50%;border:4px solid var(--lc);background:#fff;transition:transform .15s ease}
.fsb{min-width:0}
.fsn{font-size:1rem;font-weight:600;line-height:1.45}
.fsm{margin-top:2px;font-size:.84rem;line-height:1.45;color:var(--fm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fsa{grid-column:3;display:flex;gap:8px}
.fsa .fpill{width:44px;padding:0;font-size:0}                              /* compact: icon only, the label lives in aria-label */
#finder .fsa .fpill .ph{font-size:1.15rem;color:var(--gold)}
.fsa:has(.gmadd){grid-column:2/4;flex-wrap:wrap;margin-top:8px}           /* an own puja keeps its labelled actions on their own line */
.fsa:has(.gmadd) .fpill{width:auto;padding:0 16px;font-size:.92rem}
.fsa:has(.gmadd) .fpill{min-width:96px}
.fsa .gmadd{flex:1 1 100%}
.fst:hover .fsn{color:var(--gold)}
.fst.active::before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:calc(var(--sp) + 8px);right:-14px;background:var(--fs2)}   /* a flat tonal step right of the spine */
.fst.active .fsn{color:var(--gold)}
.fst.active .fdot{transform:scale(1.4)}
.fwait .fdot{background:var(--fs);border-style:dashed}                    /* a pending own puja: a hollow station */
.fwaitb{display:inline-block;margin:4px 0 2px;padding:1px 8px;border-radius:8px;border:2px solid var(--fm);font-size:.74rem;font-weight:600;color:var(--fm)}

/* ---------- empty: a search miss or an empty line ---------- */
.fempty{padding:22px 14px;background:var(--fs);border-top:2px solid var(--gold);text-align:center;line-height:1.7}
.fempty .fpill{margin-top:12px}

/* ---------- the station pins on the map: white dots ringed in the line colour; the active one grows and shows its name ---------- */
.pin{position:relative}
.pin span{display:block;width:22px;height:22px;border-radius:50%;border:4px solid var(--lc,var(--gold));background:#fff;box-shadow:0 0 0 2px var(--ground,#1f0309);
  transition:transform .15s ease}
.pin.apwait span{background:var(--ground,#1f0309);border-style:dashed}
.pin b{position:absolute;top:-10px;right:-12px;min-width:18px;height:18px;padding:0 4px;border-radius:8px;background:var(--deep);border:2px solid var(--lc,var(--gold));
  color:var(--ink);font-size:.68rem;font-weight:700;line-height:14px;text-align:center}
.pin em{position:absolute;left:30px;top:50%;display:block;max-width:180px;padding:4px 8px;background:var(--deep);border-left:4px solid var(--lc,var(--gold));color:var(--ink);
  font-size:.8rem;font-style:normal;font-weight:600;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;
  opacity:0;transform:translate(-4px,-50%);transition:opacity .15s ease,transform .15s ease}
.pin.active span{transform:scale(1.4)}
.pin.active em{opacity:1;transform:translate(0,-50%)}
.fstage .leaflet-marker-icon{transition:opacity .3s ease}
.fstage.fhas .leaflet-marker-icon:not(.active){opacity:.7}
.leaflet-marker-icon.active{z-index:1000!important}

/* clusters: a solid disc in the line colour with the Bangla count */
.fcluster span{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--lc);border:2px solid var(--ground,#1f0309);
  color:var(--deep);font-size:1rem;font-weight:700;line-height:1;cursor:pointer;transition:transform .15s ease}
.fcluster.active span{transform:scale(1.15)}

/* the zoom control, flat */
.fstage .leaflet-bar{border:2px solid var(--fr);border-radius:0;box-shadow:none}
.fstage .leaflet-bar a{background:var(--fs);color:var(--ink);border-color:var(--fr)}

/* ---------- motion: the spine draws down, the stations pop in 30 ms apart (first view and every line change) ---------- */
.fdview.anim .fsts::before{animation:fspine .5s ease-out both}
.fdview.anim .fdot{animation:fpop .25s cubic-bezier(.2,1.4,.4,1) both;animation-delay:calc(var(--k,0) * 30ms + 80ms)}
@keyframes fspine{from{transform:scaleY(0)}}
@keyframes fpop{from{opacity:0;transform:scale(.3)}}
@media (prefers-reduced-motion:reduce){
  .fdview.anim .fsts::before,.fdview.anim .fdot{animation:none}
  .fdot,.pin span,.pin em,.fcluster span,.fpill,.fgo{transition:none}
}

@media (min-width:900px){
  .fchips{flex-wrap:wrap;margin:14px 0 0;padding:0;overflow:visible}
}
