/* 1.5 שלב 3: מפה בהירה, סיכות בועה, תוויות כתובת, כפתורי מפה עגולים */
:root { --mbtn-bg: #fff; --halo: #fff; --lab: #1f2937; --bub-bg: #fff; --bub-fg: #3b6fe8; }
:root[data-theme="dark"] { --mbtn-bg: #1a2540; --halo: #0b1224; --lab: #e5e9f4; --bub-bg: #1a2540; --bub-fg: #8fb0ff; }

.mbtn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--mbtn-bg); color: var(--blue); box-shadow: 0 2px 10px rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.mbtn:active { transform: scale(.95); }
.mtop { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 660; }
#fin-chip[hidden], #next-pill[hidden], #layer-menu[hidden], #show-menu[hidden] { display: none; }
#show-menu { position: absolute; left: 66px; top: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.35); z-index: 2; }
#btn-show .mb-txt { font-size: 13px; font-weight: 700; color: var(--blue); }
#btn-show.on { background: var(--blue); }
#show-menu .sm-sep { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--line); }
#btn-show.on .mb-txt { color: #fff; }
#fin-chip { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 10px; z-index: 650; background: var(--mbtn-bg); color: var(--text); border-radius: 12px; padding: 7px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 1.1rem; font-weight: 500; display: flex; gap: 6px; align-items: center; direction: ltr; }

#maptools { position: absolute; left: 10px; bottom: min(calc(var(--dh, 300px) + 12px), calc(100dvh - 340px - env(safe-area-inset-top))); z-index: 650; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; transition: bottom .22s ease; }
#layer-menu { position: absolute; left: 66px; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#next-pill { position: absolute; right: 10px; bottom: calc(var(--dh, 300px) + 12px); max-width: calc(100% - 86px); z-index: 650; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--mbtn-bg); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.28); font-size: 1.05rem; cursor: pointer; transition: bottom .22s ease; }
#next-pill b { color: var(--blue); font-size: 1.15rem; }
#next-pill .np-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#next-pill .ico { color: var(--blue); }

/* קרדיט Esri: קטן ושקוף, מעל המגירה */
.leaflet-bottom { bottom: var(--dh, 0px); transition: bottom .22s ease; }
.leaflet-control-attribution { font-size: 9px !important; line-height: 1.2; background: transparent !important; color: #374151; opacity: .55; padding: 0 4px !important; max-width: 60vw; text-shadow: 0 0 2px #fff; } /* קרדיט חובה, לא טקסט עבודה */
:root[data-theme="dark"] .leaflet-control-attribution { color: #cbd5e1; text-shadow: none; }

/* סיכות: בועה עם חץ. הרקע והמסגרת בכחול; הבאה בתור - מלאה וגדולה */
.pinw { background: none; border: 0; }
.bub { position: relative; width: 100%; height: calc(100% - 6px); box-sizing: border-box; border: 1.5px solid var(--bub-fg); border-radius: 8px; background: var(--bub-bg); color: var(--bub-fg); display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.25); direction: ltr; }
.bub b { font-weight: 700; }
.bub::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 7px; height: 7px; margin-left: -3.5px; background: var(--bub-bg); border-right: 2px solid var(--bub-fg); border-bottom: 2px solid var(--bub-fg); transform: rotate(45deg); box-sizing: border-box; border-radius: 0 0 3px 0; }
.bub.next { background: #2f66e6; border-color: #2f66e6; color: #fff; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.bub.next::after { background: #2f66e6; border-color: #2f66e6; bottom: -4px; }
.bub.done, .bub.failed { opacity: .6; border-color: #9aa3b2; color: #7b8494; background: #eef0f4; box-shadow: none; font-size: 11px; }
.bub.done::after, .bub.failed::after { border-color: #9aa3b2; background: #eef0f4; }
:root[data-theme="dark"] .bub.done, :root[data-theme="dark"] .bub.failed { background: #2a3350; border-color: #66708a; color: #9aa5bd; }
:root[data-theme="dark"] .bub.done::after, :root[data-theme="dark"] .bub.failed::after { background: #2a3350; border-color: #66708a; }
:root[data-theme="dark"] .bub.next { background: #5b8cff; border-color: #5b8cff; color: #0a0f1c; }
:root[data-theme="dark"] .bub.next::after { background: #5b8cff; border-color: #5b8cff; }
.fx { position: absolute; top: -6px; right: -6px; width: 13px; height: 13px; border-radius: 50%; background: #e53935; color: #fff; font-style: normal; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; border: 1.5px solid #fff; }
.bub.failed { opacity: 1; }
.bub.failed b { opacity: .6; }

/* תווית כתובת ליד הסיכה: מוסתרת עד זום רחוב (המחלקה show-labels נקבעת ב-map.js) */
.plab { display: none; position: absolute; right: 100%; top: 4px; margin-right: 4px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; font-size: 13px; font-weight: 600; color: var(--lab); pointer-events: none;
  text-shadow: -1.5px 0 var(--halo), 1.5px 0 var(--halo), 0 -1.5px var(--halo), 0 1.5px var(--halo), 0 0 4px var(--halo); }
.show-labels .plab { display: block; }
/* זום רחוק: סיכות קטנות יותר, כדי שמאות עצירות לא יהפכו לגוש */
.pins-sm .bub:not(.next) { transform: scale(.65); transform-origin: 50% 100%; }
.pins-sm .bub.next { transform: scale(.85); transform-origin: 50% 100%; }

/* 1.6: מגע על המפה - גרירה וצביטה שייכות למפה, לא לדף. הקרדיט קטן עם קישורים באותו צבע */
#map { touch-action: none; overscroll-behavior: none; }
html, body { overscroll-behavior: none; }
.leaflet-control-attribution a { color: inherit; text-decoration: none; }
.maplibregl-map { font: inherit; }

#show-menu.row, #layer-menu.row { flex-direction: row; flex-wrap: wrap; max-width: calc(100vw - 86px); width: max-content; }
:root { --sat: env(safe-area-inset-top, 0px); }

/* נהגים (שלב 3-4): עצירה אצל נהג - אפורה; שכבת "הצג במפה" - ירוק נמסר, אדום נכשל, כתום נשאר */
.bub.assigned { opacity: .55; border-color: #8e8e93; color: #6b7280; background: #e5e7eb; box-shadow: none; }
.bub.assigned::after { border-color: #8e8e93; background: #e5e7eb; }
.bub.ovdone { background: #1b8a3a; border-color: #1b8a3a; color: #fff; }
.bub.ovdone::after { background: #1b8a3a; border-color: #1b8a3a; }
.bub.ovfail { background: #d32f2f; border-color: #d32f2f; color: #fff; }
.bub.ovfail::after { background: #d32f2f; border-color: #d32f2f; }
.bub.ovopen { background: #fb8c00; border-color: #fb8c00; color: #fff; }
.bub.ovopen::after { background: #fb8c00; border-color: #fb8c00; }
.ovlast { width: 22px; height: 22px; border-radius: 50%; background: #1a73ff; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(26,115,255,.35), 0 2px 6px rgba(0,0,0,.4); }
