/* RideRoster — Live Ride Map */
.map-view { padding: 0 !important; }
.map-shell { position: absolute; inset: 0; overflow: hidden; background: #e8edf3; }
.rmap { position: absolute; inset: 0; z-index: 1; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 10.5px; background: rgba(255, 255, 255, .85) !important; border-radius: 6px 0 0 0; }
.leaflet-bar { border: 0 !important; box-shadow: var(--sh) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; font-size: 20px !important; color: var(--ink) !important; }

/* floating event card */
.map-ev { position: absolute; z-index: 600; top: 16px; left: 16px; width: 380px; max-width: calc(100% - 460px); min-width: 280px; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-radius: 16px; box-shadow: 0 8px 28px rgba(13, 21, 48, .16); cursor: pointer; }
.map-ev select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; }
.me-sport { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 12px rgba(13, 21, 48, .2); }
.me-sport .ico { width: 26px; height: 26px; }
.me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-txt small { color: var(--muted); font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt b { font-size: 15.5px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt span { font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chev { transform: rotate(90deg); color: var(--muted); }
.map-legend { position: absolute; z-index: 600; top: 96px; left: 16px; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 460px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 12px; font-weight: 700; color: var(--ink2); box-shadow: 0 2px 8px rgba(13, 21, 48, .1); }
.map-legend i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.map-legend i .ico { width: 11px; height: 11px; fill: #fff; }
.lg-red { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); }
.lg-asg { background: conic-gradient(#2563eb 0 33%, #059669 0 66%, #d97706 0); }
.lg-car { background: #334155; border-radius: 5px !important; }
.lg-fac { background: var(--tc); }
.map-ctrls { position: absolute; z-index: 600; top: 16px; right: 422px; display: grid; gap: 8px; }
.map-btn { width: 44px; height: 44px; border-radius: 13px; background: #fff; border: 0; box-shadow: var(--sh); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.map-btn:hover { color: var(--brand); }

/* side panel */
.map-panel { position: absolute; z-index: 700; top: 16px; right: 16px; bottom: 16px; width: 392px; background: #fff; border-radius: 20px; box-shadow: 0 16px 50px rgba(13, 21, 48, .22); display: flex; flex-direction: column; overflow: hidden; }
.sheet-grab { display: none; }
.mp-cov { padding: 16px 18px 12px; background: linear-gradient(180deg, #f7f9ff, #fff); cursor: default; }
.cov-meter .cm-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.cm-num { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cm-num b { font-size: 38px; font-weight: 860; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.cm-num span { font-weight: 700; color: var(--ink2); font-size: 14px; }
.cm-num i { font-style: normal; }
.cm-pct { font-size: 15px; font-weight: 850; color: var(--danger); background: var(--danger-l); padding: 3px 9px; border-radius: 999px; }
.cov-meter.done .cm-pct { color: var(--ok); background: var(--ok-l); }
.cm-bar { height: 12px; border-radius: 99px; background: #fde4e4; margin: 12px 0 8px; overflow: hidden; position: relative; }
.cm-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #12a464, #34d399); transition: width 1s cubic-bezier(.2, .8, .2, 1); position: relative; overflow: hidden; }
.cm-bar span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); transform: translateX(-100%); animation: shine 2.4s infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.cov-meter.done .cm-bar { background: var(--ok-l); }
.cm-sub { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink2); }
.cm-sub b { color: var(--danger); }
.cov-meter.done .cm-sub b { color: var(--ok); }
.cm-sub .ico { width: 16px; height: 16px; color: var(--ok); }
.mp-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.mp-tabs button { flex: 1; border: 0; background: none; padding: 11px 6px; font-weight: 750; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; white-space: nowrap; font-size: 13.5px; }
.mp-tabs button.on { color: var(--ink); border-color: var(--brand); }
.mp-tabs em { font-style: normal; font-size: 11px; background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 6px; margin-left: 3px; vertical-align: 1px; }
.mp-body { flex: 1; overflow-y: auto; padding: 8px 12px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.grp { margin-top: 8px; }
.grp-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); padding: 8px 6px; flex-wrap: wrap; }
.grp-head em { font-style: normal; background: #eef1f8; color: var(--ink2); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.grp-head.red { color: var(--danger); } .grp-head.red em { background: var(--danger-l); color: var(--danger); }
.grp-head.green { color: #0b7d55; } .grp-head.green em { background: var(--ok-l); color: #0b7d55; }
.grp-head.green .ico { width: 16px; height: 16px; }
.grp-head small { flex-basis: 100%; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.grp-empty { padding: 10px 8px; color: var(--muted); font-size: 13px; }
details.grp summary { cursor: pointer; list-style: none; }
details.grp summary::-webkit-details-marker { display: none; }
details.grp summary::after { content: '▾'; margin-left: auto; }
.sub-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 750; color: var(--ink); padding: 8px 6px 4px; }
.sub-head i { width: 10px; height: 10px; border-radius: 3px; background: var(--dc); }
.sub-head small { color: var(--muted); font-weight: 700; }
.rr-row, .sg-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; cursor: pointer; min-height: 52px; transition: background .15s; }
.rr-row:hover, .sg-row:hover { background: #f5f7fc; }
.rr-row.hl, .sg-row.hl { background: #eef3ff; box-shadow: inset 0 0 0 1.5px #c7d4ff; }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-main b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-main small { color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-main .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.note-i .ico { width: 13px; height: 13px; color: var(--warn); vertical-align: -2px; }
.mi { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.mini-sel { width: 112px; min-height: 36px; padding: 6px 26px 6px 9px; font-size: 12.5px; font-weight: 700; border-radius: 9px; background-position: right 4px center; background-size: 18px; flex: none; }
.drv-list { grid-template-columns: minmax(0, 1fr); display: grid; gap: 10px; padding-top: 8px; }
.drv-row { border: 1px solid var(--line); border-left: 4px solid var(--dc); border-radius: 14px; padding: 11px 12px; display: grid; gap: 9px; cursor: pointer; }
.drv-row.on { box-shadow: 0 0 0 2px var(--dc); }
.dr-top { display: flex; align-items: center; gap: 10px; } .dr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .dr-main b { font-size: 13.5px; } .dr-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-chip { width: 36px; height: 36px; border-radius: 11px; background: var(--dc); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 3px 10px color-mix(in srgb, var(--dc) 40%, transparent); }
.car-chip .ico { width: 22px; height: 22px; }
.dr-kids { display: flex; gap: 5px; flex-wrap: wrap; }
.dr-act { display: flex; gap: 6px; flex-wrap: wrap; }
.build { padding-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.build .lbl { margin-bottom: -6px; }
.drv-pick { font-weight: 700; }
.build-empty { text-align: center; padding: 26px 18px; border: 1.5px dashed #d5dcec; border-radius: 16px; color: var(--ink2); }
.build-empty .ico { width: 40px; height: 40px; padding: 9px; border-radius: 14px; background: var(--brand-l); color: var(--brand); }
.build-empty b { display: block; font-size: 15px; margin: 10px 0 4px; color: var(--ink); }
.build-empty p { margin: 0; font-size: 13px; }
.me-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--dc) 8%, #fff); border: 1px solid color-mix(in srgb, var(--dc) 22%, #fff); }
.me-card b { display: block; font-size: 13.5px; } .me-card small { color: var(--ink2); }
.rt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rt-stats div { background: #f5f7fc; border-radius: 13px; padding: 10px 8px; text-align: center; }
.rt-stats b { display: block; font-size: 24px; font-weight: 850; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rt-stats small { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.rt-stats .full { background: var(--danger-l); } .rt-stats .full b { color: var(--danger); }
.route-list { grid-template-columns: minmax(0, 1fr); list-style: none; margin: 0; padding: 4px 0; position: relative; display: grid; gap: 2px; }
.route-list::before { content: ''; position: absolute; left: 15px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(180deg, var(--dc) 0 6px, transparent 6px 10px); opacity: .6; }
.route-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; position: relative; }
.route-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.route-list b { font-size: 13.5px; } .route-list small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dc); color: #fff; flex: none; box-shadow: 0 0 0 3px #fff; font-weight: 850; font-size: 13px; position: relative; }
.rl-dot .ico { width: 16px; height: 16px; }
.rl-fac .rl-dot { background: var(--ink); }
.rl-home .rl-dot { background: #fff; color: var(--dc); box-shadow: 0 0 0 3px #fff, inset 0 0 0 2.5px var(--dc); }
.det-chip { display: flex; flex-direction: column; align-items: flex-end; font-size: 12.5px; font-weight: 850; color: #b45309; white-space: nowrap; line-height: 1.15; }
.det-chip small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.det-chip.great { color: #0b7d55; }

/* ---------- pins ---------- */
.rr-pin { background: none !important; border: 0 !important; }
.pin-rider { width: 34px; height: 34px; margin: 2px; border-radius: 50%; background: var(--pc); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 850; letter-spacing: .02em; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(13, 21, 48, .35); position: relative; transition: transform .2s, opacity .2s, filter .2s; cursor: pointer; }
.pin-rider span { position: relative; z-index: 1; }
.pin-rider.needs::before, .pin-rider.needs::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--danger); animation: pinPulse 2s infinite; z-index: -1; }
.pin-rider.needs::after { animation-delay: 1s; }
@keyframes pinPulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.3); opacity: 0; } }
.pin-rider.mine { box-shadow: 0 0 0 3px var(--pc), 0 4px 14px rgba(13, 21, 48, .4); }
.pin-rider.sugg { background: var(--danger); box-shadow: 0 0 0 4px #22c55e, 0 0 18px 4px rgba(34, 197, 94, .55); }
.pin-rider.sugg::before, .pin-rider.sugg::after { border-color: #22c55e; }
.pin-rider.faded { opacity: .38; filter: saturate(.4); transform: scale(.85); }
.pin-rider.faded::before, .pin-rider.faded::after { display: none; }
.pin-rider.hl { transform: scale(1.28); z-index: 5; }
.pin-rider .seq { position: absolute; top: -9px; right: -9px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px; background: #0d1530; color: #fff; font-size: 10.5px; display: grid; place-items: center; border: 2px solid #fff; z-index: 2; }
.pin-rider .det { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); background: #16a34a; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; white-space: nowrap; border: 2px solid #fff; z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.pop-in > div { animation: bounce .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bounce { 0% { transform: scale(.4) translateY(-20px); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pin-car { width: 40px; height: 40px; margin: 2px; border-radius: 13px; background: var(--pc); color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(13, 21, 48, .35); position: relative; transition: transform .2s, opacity .2s; }
.pin-car .ico { width: 24px; height: 24px; }
.pin-car.active { transform: scale(1.18); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 35%, transparent), 0 6px 18px rgba(13, 21, 48, .4); }
.pin-car.dim { opacity: .45; }
.pin-car em { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-style: normal; background: var(--pc); color: #fff; font-size: 10.5px; font-weight: 850; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 2px solid #fff; }
.pin-fac { position: relative; width: 64px; height: 78px; }
.pf-head { position: absolute; left: 6px; top: 2px; width: 52px; height: 52px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pc); border: 4px solid #fff; box-shadow: -3px 6px 16px rgba(13, 21, 48, .35); display: grid; place-items: center; }
.pf-head .ico { transform: rotate(45deg); width: 26px; height: 26px; color: #fff; }
.pin-fac::before { content: ''; position: absolute; left: 50%; top: 66px; width: 40px; height: 14px; margin-left: -20px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 45%, transparent); animation: facPulse 2.2s infinite; }
@keyframes facPulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.pf-flag { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); background: #0d1530; color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; box-shadow: 0 3px 10px rgba(13, 21, 48, .3); }
.pin-home { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pc); border: 3px solid #fff; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.pin-home .ico { transform: rotate(45deg); width: 16px; height: 16px; color: #fff; }
path.route-live { stroke-dasharray: 12 10; animation: dash 0.9s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.rr-tip { font-weight: 700; font-size: 12px; border-radius: 8px; border: 0; box-shadow: var(--sh); }

/* popups */
.rr-popup .leaflet-popup-content-wrapper { border-radius: 18px; padding: 0; box-shadow: 0 16px 44px rgba(13, 21, 48, .28); }
.rr-popup .leaflet-popup-content { margin: 0; width: auto !important; min-width: 250px; }
.rr-popup .leaflet-popup-tip { box-shadow: none; }
.rr-popup a.leaflet-popup-close-button { top: 8px; right: 8px; width: 28px; height: 28px; font-size: 20px; line-height: 26px; color: var(--muted); }
.pop { width: 300px; max-width: calc(100vw - 60px); padding: 14px 16px 12px; display: grid; gap: 8px; font-size: 13px; }
.pop-head { display: flex; align-items: center; gap: 10px; padding-right: 22px; }
.pop-head > div { flex: 1; min-width: 0; } .pop-head b { display: block; font-size: 15px; letter-spacing: -0.01em; } .pop-head small { color: var(--muted); }
.pop-head .status { display: inline-flex; width: max-content; margin-top: 4px; }
.pop-head .badge { flex: none; }
.pop-fac { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.pop-fac .ico { width: 22px; height: 22px; }
.pop-line { display: flex; gap: 8px; align-items: flex-start; color: var(--ink2); line-height: 1.35; }
.pop-line .ico { width: 15px; height: 15px; color: var(--muted); margin-top: 1px; }
.pop-note { display: flex; gap: 8px; align-items: flex-start; background: #fff6e0; color: #7a4b04; border-radius: 10px; padding: 7px 9px; font-weight: 650; }
.pop-note .ico { width: 15px; height: 15px; color: var(--warn); margin-top: 1px; }
.pop-driver { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--dc) 10%, #fff); border-radius: 10px; padding: 8px 10px; }
.pop-driver .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc); flex: none; }
.pop-detour { display: flex; gap: 8px; align-items: center; background: var(--warn-l); color: #7a4b04; border-radius: 10px; padding: 8px 10px; }
.pop-detour.ok { background: var(--ok-l); color: #0b6b49; }
.pop-detour .ico { width: 16px; height: 16px; }
.pop-assign { display: flex; gap: 6px; }
.pop-assign select { min-height: 38px; font-size: 13px; padding: 6px 28px 6px 10px; }
.pop .btn { min-height: 42px; }
.pop-links { display: flex; gap: 6px; border-top: 1px solid var(--line2); padding-top: 9px; margin-top: 2px; }
.pop-links a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-weight: 750; font-size: 12.5px; background: #f3f6fd; border-radius: 9px; min-height: 36px; padding: 0 8px; white-space: nowrap; }
.pop-links .ico { width: 14px; height: 14px; }
.pop .seat-meter { margin: 2px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .map-panel { width: 360px; }
  .map-ctrls { right: 390px; }
  .map-ev, .map-legend { max-width: calc(100% - 420px); }
}
@media (max-width: 767px) {
  .map-shell { bottom: var(--tab-h); }
  .map-ev { top: 10px; left: 10px; right: 10px; width: auto; max-width: none; min-width: 0; padding: 8px 12px 8px 8px; border-radius: 15px; }
  .me-sport { width: 40px; height: 40px; }
  .me-txt b { font-size: 14.5px; }
  .map-legend { display: none; }
  .map-ctrls { top: 84px; right: 10px; }
  .map-btn { width: 44px; height: 44px; }
  .leaflet-top.leaflet-right { top: 136px; }
  .leaflet-control-attribution { border-radius: 6px; font-size: 9px; max-width: 240px; opacity: .85; }
  .map-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(13, 21, 48, .25); transition: height .32s cubic-bezier(.2, .9, .3, 1); height: 196px; padding-bottom: 18px; }
  .map-panel.dragging { transition: none; }
  .map-panel[data-state="half"] { height: 54%; }
  .map-panel[data-state="full"] { height: calc(100% - 72px); }
  .sheet-grab { display: flex; justify-content: center; align-items: center; height: 26px; flex: none; cursor: grab; touch-action: none; }
  .sheet-grab { position: relative; }
  .sheet-attr { position: absolute; right: 14px; top: 6px; font-size: 9.5px; color: var(--muted); }
  .sheet-attr a { color: var(--muted); }
  .sheet-grab span { width: 44px; height: 5px; border-radius: 9px; background: #cfd6e4; }
  .mp-cov { padding: 0 16px 10px; background: #fff; cursor: pointer; }
  .cm-num b { font-size: 32px; }
  .cm-bar { margin: 9px 0 7px; height: 10px; }
  .map-panel[data-state="peek"] .mp-body { overflow: hidden; }
  .mp-tabs button { font-size: 13px; }
}
