/* Routeplanner: balk bovenin, pinnen, weer onderweg */
#p4w-planner {
    position: absolute; z-index: 1004; left: 50%; transform: translateX(-50%); top: 66px;
    width: max-content; max-width: calc(100% - 20px);
    background: #fff; color: #0f172a; border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    font-family: inherit;
}
#p4w-planner[hidden] { display: none; }
body.is-phone #p4w-planner { top: 86px; left: 10px; right: 10px; transform: none; width: auto; max-width: none; }
body.nav-tabs:not(.is-phone) #p4w-planner { top: 70px; }
body.planner-on #p2d-bar { top: calc(66px + 58px) !important; }
body.planner-on.is-phone #p2d-bar { top: calc(86px + 58px) !important; }
body.planner-on #sun-bar { display: none; }
#p4w-planner.loading { opacity: 0.7; pointer-events: none; }
.pl-row { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; flex-wrap: nowrap; }
.pl-summary { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; cursor: pointer; color: inherit; min-width: 0; padding: 4px 2px; }
.pl-summary svg { width: 18px; height: 18px; color: #1d4ed8; flex: 0 0 auto; }
.pl-summary svg:last-child { width: 14px; height: 14px; color: #94a3b8; }
.pl-summary[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
.pl-summary b { font-size: 0.95rem; white-space: nowrap; }
.pl-summary .pl-time { color: #475569; font-size: 0.85rem; white-space: nowrap; }
.pl-summary .pl-stops { color: #ea580c; font-weight: 700; font-size: 0.72rem; white-space: nowrap; }
.pl-summary .pl-stops:empty { display: none; }
.pl-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border: 0; border-radius: 10px; background: #166534; color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pl-btn svg { width: 15px; height: 15px; }
.pl-btn.pl-gmaps { background: #f1f5f9; color: #0f172a; }
.pl-close { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5f9; color: #334155; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.pl-close svg { width: 16px; height: 16px; }
.pl-detail { border-top: 1px solid #e2e8f0; padding: 8px 12px 10px; max-height: 40vh; overflow-y: auto; }
.pl-detail[hidden] { display: none; }
.pl-pt { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.88rem; }
.pl-pt > svg { width: 18px; height: 18px; color: #1d4ed8; flex: 0 0 auto; }
.pl-pt.pl-dest > svg { color: #dc2626; }
.pl-pt span { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-pt small { color: #64748b; font-size: 0.72rem; }
.pl-mini { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 0.72rem; font-weight: 700; color: #334155; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.pl-mini svg { width: 14px; height: 14px; }
.pl-src { color: #94a3b8; font-size: 0.7rem; padding-top: 6px; }
/* Telefoon: naast de knoppenkolom rechts; samenvatting + sluiten op regel 1, knoppen op regel 2 */
@media (max-width: 600px) {
    body.is-phone #p4w-planner { right: 58px; }
    .pl-row { flex-wrap: wrap; padding: 6px 8px 8px 10px; }
    .pl-summary { flex: 1 1 140px; order: 1; flex-wrap: wrap; min-width: 0; }
    .pl-summary .pl-stops, .pl-summary .pl-modetxt { flex: 0 0 auto; }
    .pl-summary .pl-stops:not(:empty) ~ .pl-modetxt:not(:empty)::before { content: '· '; color: #94a3b8; }
    .pl-icon { order: 2; }
    .pl-close { order: 3; }
    .pl-btn.pl-search { order: 4; flex: 1 1 140px; justify-content: center; }
    .pl-btn.pl-gmaps { order: 5; flex: 0 1 auto; }
    .pl-detail .pl-mode { display: flex; margin: 2px 0 8px; }
    .pl-detail .pl-mode button { flex: 1; }
}
.pl-modetxt { color: #166534; font-weight: 700; font-size: 0.72rem; }
.pl-modetxt:empty { display: none; }
.pl-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 0.85rem; color: #0f172a; }
.pl-pick > svg { width: 18px; height: 18px; color: #1d4ed8; flex: 0 0 auto; }
.pl-pick span { flex: 1; }
.pl-pick[hidden] { display: none; }
#p4w-planner.picking .pl-row { display: none; }
.pl-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #1d4ed8; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; }
.pl-pin svg { width: 14px; height: 14px; color: #fff; transform: rotate(45deg); }
.pl-pin-dest { background: #dc2626; }
.pl-pin-stop { background: #ea580c; }
.pl-wx { position: absolute; transform: translate(-50%, -115%); display: flex; align-items: center; gap: 3px; background: #fff; border-radius: 12px; padding: 2px 7px; font-size: 0.74rem; font-weight: 700; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.25); white-space: nowrap; pointer-events: none; }
.pl-wx svg, .pl-wx .p4w-icon { width: 16px; height: 16px; }
.pl-wx small { color: #64748b; font-weight: 600; }
.pl-pop b { display: block; margin-bottom: 4px; }
.p4w-act-route { color: #1d4ed8; }
body.planner-pick #map { cursor: crosshair; }
.ts-smart-rain { background: #eff6ff; color: #1d4ed8; }

/* Stand 'langs de route' aan */
.pl-btn.pl-search.on { background: #ea580c; box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #ea580c; }
.pl-btn.pl-search.on svg { color: #fff; }

/* Tussenstop-knopje op kaartjes en km/tijd-labels langs de routelijn */
.ts-stop { position: absolute; top: 5px; left: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #1d4ed8; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.ts-stop svg { width: 15px; height: 15px; }
.ts-stop.is-added { background: #ea580c; }
.ts-card .ts-index { display: none; }
.ts-card:not(:has(.ts-stop)) .ts-index { display: flex; }
.pl-km { position: absolute; transform: translate(12px, -50%); background: #1d4ed8; color: #fff; border-radius: 8px; padding: 2px 7px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,0.3); pointer-events: none; }

/* Snelste / Mooiste */
.pl-mode { display: inline-flex; background: #f1f5f9; border-radius: 10px; padding: 2px; flex: 0 0 auto; }
.pl-mode button { border: 0; background: none; font: inherit; font-size: 0.74rem; font-weight: 700; color: #475569; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.pl-mode button.on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.pl-via { display: flex; align-items: center; gap: 8px; padding: 6px 0 2px; font-size: 0.8rem; color: #166534; }
.pl-via svg { width: 16px; height: 16px; flex: 0 0 auto; }
.pl-via-dot { width: 12px; height: 12px; border-radius: 50%; background: #16a34a; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }


/* Delen en bewaren */
.pl-icon { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5f9; color: #334155; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.pl-icon svg { width: 16px; height: 16px; }
.pl-fav.is-fav { color: #e11d48; }
.pl-fav.is-fav svg { fill: currentColor; }
.pl-parts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0 2px; }
.pl-parts small { flex: 1 1 100%; color: #64748b; font-size: 0.72rem; }
.pl-parts .pl-mini { text-decoration: none; }

#pl-sheet { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.pl-sheet-box { background: #fff; width: 100%; max-width: 440px; border-radius: 18px 18px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,0.25); }
@media (min-width: 700px) { #pl-sheet { align-items: center; } .pl-sheet-box { border-radius: 18px; padding-bottom: 16px; } }
.pl-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pl-sheet-title { color: #475569; font-size: 0.85rem; margin-bottom: 12px; }
.pl-sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pl-sheet-grid > * { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: #0f172a; font: inherit; font-size: 0.78rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.pl-sheet-grid svg { width: 22px; height: 22px; color: #166534; }
.pl-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 14px; }
.pl-qr[hidden] { display: none; }
.pl-qr small { color: #64748b; }
