* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #map { height: 100%; width: 100%; }
body {
  font-family: Tahoma, "Segoe UI", Vazirmatn, sans-serif;
  overflow: hidden;
  color: #1f2937;
}
#map { position: absolute; inset: 0; }

/* پنل جستجو */
#panel {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 350px; max-width: calc(100vw - 28px);
  background: rgba(255,255,255,.98); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.16); border: 1px solid rgba(0,0,0,.06);
  padding: 14px; direction: rtl; backdrop-filter: blur(6px);
}
.brand { display:flex; align-items:center; justify-content:space-between; font-weight:800; font-size:19px; color:#2E86DE; margin-bottom:12px; }
.brand .logo { font-size:20px; }
.brand-actions { display:flex; gap:6px; }
.brand-actions button {
  border:1px solid #e2e6eb; background:#fff; color:#2E86DE; border-radius:16px;
  padding:5px 12px; font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer;
}
.brand-actions button:hover { background:#f1f6ff; }
#admin-btn { color:#8e44ad; border-color:#e6d6f0; }

/* مودال‌ها */
.overlay { position:fixed; inset:0; z-index:50; background:rgba(17,24,39,.45);
  display:flex; align-items:center; justify-content:center; backdrop-filter:blur(2px); }
.modal { position:relative; width:340px; max-width:calc(100vw - 32px); background:#fff;
  border-radius:18px; padding:22px; direction:rtl; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.modal-title { font-weight:800; font-size:18px; color:#2E86DE; margin-bottom:14px; }
.modal-hint { font-size:13px; color:#6b7280; margin-bottom:10px; }
.modal input { width:100%; border:1px solid #dfe3e8; border-radius:10px; padding:12px;
  font-family:inherit; font-size:16px; margin-bottom:12px; outline:none; text-align:center; letter-spacing:2px; }
.modal input:focus { border-color:#2E86DE; }
.modal button.primary { width:100%; border:0; background:#2E86DE; color:#fff; border-radius:10px;
  padding:12px; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; }
.modal button.secondary { width:100%; border:0; background:transparent; color:#6b7280;
  padding:10px; font-family:inherit; font-size:13px; cursor:pointer; margin-top:6px; }
.modal-close { position:absolute; top:12px; left:14px; border:0; background:transparent;
  font-size:18px; color:#9aa0a6; cursor:pointer; }
.devcode { background:#fff7e6; border:1px dashed #f0b429; border-radius:8px; padding:8px;
  font-size:12px; color:#8a6d3b; margin-bottom:10px; text-align:center; }
.modal-err { background:#fdecea; border:1px solid #f5c6cb; color:#c0392b; border-radius:8px;
  padding:9px 12px; font-size:13px; margin-bottom:12px; text-align:center; }

/* تب‌ها و فرم تنظیمات در پنل مدیریت */
.admin-tabs { display:flex; gap:6px; margin-bottom:12px; border-bottom:1px solid #eef1f5; }
.atab { border:0; background:transparent; padding:8px 12px; font-family:inherit; font-size:13px;
  font-weight:700; color:#6b7280; cursor:pointer; border-bottom:2px solid transparent; }
.atab.active { color:#2E86DE; border-bottom-color:#2E86DE; }
.fld { display:block; font-size:12.5px; color:#374151; font-weight:600; margin-bottom:10px; }
.fld input, .fld select { width:100%; margin-top:5px; border:1px solid #dfe3e8; border-radius:9px;
  padding:9px 11px; font-family:inherit; font-size:13.5px; outline:none; text-align:right; letter-spacing:0; }
.fld input[dir="ltr"] { text-align:left; }
.fld input:focus, .fld select:focus { border-color:#2E86DE; }
#set-save { margin-top:4px; }
.admin-modal { width:420px; display:flex; flex-direction:column; max-height:88vh; padding-top:16px; }
.admin-modal .modal-title, .admin-modal .admin-tabs { flex:0 0 auto; }
.admin-body { flex:1 1 auto; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch;
  margin:0 -6px; padding:0 6px; }
.admin-list { max-height:none; }
.admin-item { border:1px solid #eef1f5; border-radius:12px; padding:12px; margin-bottom:10px; }
.admin-item .ai-name { font-weight:700; font-size:14px; }
.admin-item .ai-meta { font-size:12px; color:#6b7280; margin:4px 0 8px; }
.admin-item .ai-actions { display:flex; gap:8px; }
.admin-item .ai-actions button { flex:1; border:0; border-radius:8px; padding:8px; font-family:inherit;
  font-size:13px; font-weight:700; cursor:pointer; }
.admin-item .ai-approve { background:#27ae60; color:#fff; }
.admin-item .ai-reject { background:#e74c3c; color:#fff; }
.search { display:flex; align-items:center; gap:6px; background:#f1f3f5; border-radius:12px; padding:0 12px;
  border:1px solid transparent; transition:border-color .15s, background .15s; }
.search:focus-within { background:#fff; border-color:#2E86DE; }
.search input { flex:1; border:0; background:transparent; padding:13px 4px; font-size:15px; outline:none; font-family:inherit; }
.search button { border:0; background:transparent; color:#9aa0a6; font-size:16px; cursor:pointer; }
.search button:hover { color:#e74c3c; }

/* چیپ‌های فیلتر دسته */
#chips { display:flex; gap:6px; overflow-x:auto; padding:10px 0 4px; scrollbar-width:thin; }
#chips::-webkit-scrollbar { height:4px; }
#chips::-webkit-scrollbar-thumb { background:#d0d5db; border-radius:2px; }
.chip {
  flex:0 0 auto; border:1px solid #e2e6eb; background:#fff; color:#374151;
  padding:6px 11px; border-radius:18px; font-size:12.5px; font-family:inherit; cursor:pointer;
  white-space:nowrap; transition:all .12s;
}
.chip:hover { border-color:#2E86DE; color:#2E86DE; }
.chip.active { background:#2E86DE; color:#fff; border-color:#2E86DE; }

#suggestions { list-style:none; margin-top:6px; max-height:320px; overflow:auto; }
#suggestions li { padding:10px 8px; border-radius:8px; cursor:pointer; display:flex; flex-direction:column; }
#suggestions li:hover { background:#f1f6ff; }
#suggestions .main { font-size:14px; font-weight:600; }
#suggestions .sub { font-size:12px; color:#6b7280; margin-top:2px; }
#suggestions .cat { font-size:11px; color:#2E86DE; }

#place-card { margin-top:8px; padding:10px; background:#f8fafc; border-radius:10px; }
.pc-title { font-weight:700; font-size:15px; }
.pc-sub { font-size:12px; color:#6b7280; margin:4px 0 8px; }
.pc-actions button, #route-clear {
  border:0; background:#2E86DE; color:#fff; padding:9px 14px; border-radius:9px;
  cursor:pointer; font-size:13px; font-family:inherit; font-weight:600; transition:filter .15s;
}
.pc-actions button:hover, #route-clear:hover { filter:brightness(1.08); }

#route-box { margin-top:8px; padding:12px; background:#f8fafc; border-radius:12px; border:1px solid #eef1f5; }
.route-row { display:flex; align-items:center; gap:8px; padding:5px 0; font-size:13px; }
.dot { width:11px; height:11px; border-radius:50%; display:inline-block; flex:0 0 auto;
  box-shadow:0 0 0 3px rgba(0,0,0,.05); }
.dot.from { background:#27ae60; } .dot.to { background:#e74c3c; }
/* توقف‌های میانی (waypoints) */
.dot.stop { width:16px; height:16px; border-radius:50%; background:var(--brand); color:#fff;
  font-size:10px; font-weight:700; line-height:16px; text-align:center; box-shadow:0 0 0 3px rgba(46,134,222,.15); }
.stop-row .stop-del { margin-inline-start:auto; border:0; background:none; color:#c0392b;
  font-size:14px; cursor:pointer; flex:0 0 auto; padding:2px 4px; }
.add-stop { background:#eef4ff; color:var(--brand); border:1px dashed #b9d4f5; width:100%;
  border-radius:10px; padding:8px; font-family:inherit; font-size:13px; cursor:pointer; margin:2px 0 4px; }
.add-stop:hover { background:#e2eeff; }
.stop-pin { width:24px; height:24px; border-radius:50%; background:var(--brand); border:2px solid #fff;
  box-shadow:0 1px 5px rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:12px; font-weight:700; }
#route-summary { font-size:14px; color:#111; margin:8px 0; font-weight:700; }
#route-clear { background:#e74c3c; margin-top:8px; width:100%; }

#hint {
  position:absolute; bottom:56px; left:50%; transform:translateX(-50%); z-index:9;
  background:rgba(17,24,39,.9); color:#fff; padding:9px 16px; border-radius:22px; font-size:13px;
  box-shadow:0 4px 14px rgba(0,0,0,.25); display:flex; align-items:center; gap:7px; max-width:90vw;
}
#hint::before { content:"📍"; font-size:14px; }
#attr {
  position:absolute; bottom:8px; left:8px; z-index:9;
  background:rgba(255,255,255,.8); padding:3px 8px; border-radius:6px; font-size:11px; color:#374151;
}
.hidden { display:none !important; }

/* دکمهٔ افزودن مکان */
#add-place-btn {
  position:absolute; bottom:20px; right:16px; z-index:11;
  background:#2E86DE; color:#fff; border:0; border-radius:24px; padding:12px 18px;
  font-family:inherit; font-size:14px; font-weight:700; cursor:pointer;
  box-shadow:0 4px 16px rgba(46,134,222,.4); display:flex; align-items:center; gap:6px;
}
#add-place-btn:hover { filter:brightness(1.08); }
#add-place-btn.arming { background:#e67e22; box-shadow:0 4px 16px rgba(230,126,34,.5); }

/* فرم افزودن مکان */
#add-form {
  position:absolute; bottom:20px; right:16px; z-index:12; width:300px; max-width:calc(100vw - 32px);
  background:#fff; border-radius:16px; box-shadow:0 8px 30px rgba(0,0,0,.22);
  padding:16px; direction:rtl; border:1px solid rgba(0,0,0,.06);
}
.af-title { font-weight:800; font-size:15px; color:#2E86DE; margin-bottom:12px; }
#add-form input, #add-form select {
  width:100%; border:1px solid #dfe3e8; border-radius:10px; padding:10px 12px; margin-bottom:10px;
  font-family:inherit; font-size:14px; outline:none; background:#fff;
}
#add-form input:focus, #add-form select:focus { border-color:#2E86DE; }
.af-coord { font-size:12px; color:#6b7280; margin-bottom:12px; }
.af-actions { display:flex; gap:8px; }
.af-actions button {
  flex:1; border:0; border-radius:10px; padding:11px; font-family:inherit; font-size:14px;
  font-weight:700; cursor:pointer; background:#27ae60; color:#fff;
}
.af-actions button.secondary { background:#eef1f5; color:#374151; }
.af-actions button:hover { filter:brightness(1.05); }

/* توست پیام */
#toast {
  position:absolute; bottom:80px; left:50%; transform:translateX(-50%); z-index:13;
  background:#27ae60; color:#fff; padding:11px 20px; border-radius:22px; font-size:13.5px;
  font-weight:600; box-shadow:0 4px 16px rgba(0,0,0,.25);
}
#toast.err { background:#e74c3c; }

.maplibregl-popup-content { direction:rtl; font-family:Tahoma,sans-serif; font-size:13px; border-radius:10px; }
.mk { width:20px; height:20px; border-radius:50% 50% 50% 0; background:#e74c3c; transform:rotate(-45deg);
      border:2px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,.3); }

/* پین مبدأ/مقصد مسیر (اشک‌شکل) */
.pin { width:22px; height:22px; border-radius:50% 50% 50% 0; transform:rotate(-45deg);
       border:2px solid #fff; box-shadow:0 3px 8px rgba(0,0,0,.35); cursor:pointer; }
.pin.from { background:#27ae60; }
.pin.to   { background:#e74c3c; }

/* ══════════════ کارت جزئیات مکان + پنل کاربری + موقعیت من ══════════════ */
#loc-btn {
  position:absolute; bottom:86px; right:16px; z-index:11; width:44px; height:44px;
  border-radius:50%; border:0; background:#fff; color:#2E86DE; font-size:22px; cursor:pointer;
  box-shadow:0 3px 12px rgba(0,0,0,.22); display:flex; align-items:center; justify-content:center;
}
#loc-btn:hover { background:#f1f6ff; }
#loc-btn.active { color:#fff; background:#2E86DE; }

/* bottom sheet عمومی */
.sheet {
  position:absolute; z-index:14; background:#fff; direction:rtl;
  left:16px; bottom:16px; width:340px; max-width:calc(100vw - 32px);
  border-radius:16px; box-shadow:0 10px 40px rgba(0,0,0,.22); padding:14px 16px 16px;
  max-height:min(82vh, 660px); overflow-y:auto; overscroll-behavior:contain;
}
.sheet-handle { display:none; }
/* سرِ کارت همیشه بالا بماند تا دکمهٔ بستن با اسکرول محتوا از دست نرود. */
.pd-head { display:flex; align-items:flex-start; gap:10px; position:sticky; top:0;
  background:#fff; padding:2px 0 8px; z-index:2; }
.sheet-close { padding:4px 6px; margin:-4px -4px 0 0; }
.pd-icon { font-size:26px; line-height:1; flex:0 0 auto; }
.pd-info { flex:1; min-width:0; }
.pd-name { font-weight:800; font-size:16px; }
.pd-cat { font-size:12.5px; color:#6b7280; margin-top:3px; }
.sheet-close { border:0; background:transparent; font-size:16px; color:#9aa0a6; cursor:pointer; }
.pd-actions { display:flex; gap:8px; margin-top:12px; }
.pd-btn { flex:1; border:0; border-radius:10px; padding:11px; font-family:inherit; font-size:13.5px;
  font-weight:700; cursor:pointer; background:#eef1f5; color:#374151; }
.pd-btn.primary { background:#2E86DE; color:#fff; }
.pd-btn:hover { filter:brightness(1.05); }

/* پنل کاربری */
.up-phone { direction:ltr; text-align:right; font-weight:700; font-size:15px; color:#111;
  background:#f1f6ff; border-radius:10px; padding:10px 12px; margin-bottom:14px; }
.up-sec { font-size:13px; font-weight:700; color:#6b7280; margin-bottom:8px; }
.up-places { max-height:40vh; overflow:auto; margin-bottom:14px; }
.up-item { display:flex; align-items:center; gap:8px; padding:9px 4px; border-bottom:1px solid #f0f2f5;
  font-size:13.5px; cursor:pointer; }
.up-item .upi-name { flex:1; }
.badge { font-size:11px; padding:2px 8px; border-radius:10px; font-weight:700; }
.badge.approved { background:#e6f6ec; color:#188038; }
.badge.pending  { background:#fff4e5; color:#b26a00; }
.badge.rejected { background:#fdecea; color:#c0392b; }
.primary.danger { background:#e74c3c; }

/* ══════════════════════════ رِسپانسیو موبایل ══════════════════════════ */
@media (max-width: 640px) {
  /* پنل بالا فقط جستجو + چیپ‌ها را نگه می‌دارد (فشرده). */
  /* backdrop-filter را حذف می‌کنیم چون عناصر fixed داخلی (کارت/کادر مسیر) را به‌جای
     viewport به این پنل میخ می‌کرد و bottom sheet بالای صفحه می‌افتاد. */
  #panel {
    top:8px; right:8px; left:8px; width:auto; max-width:none; margin:0;
    border-radius:16px; padding:10px 12px 6px; max-height:82vh; overflow-y:auto;
    backdrop-filter:none;
  }
  .brand { font-size:17px; margin-bottom:8px; }
  .search input { font-size:16px; }   /* جلوگیری از زوم iOS */
  #suggestions { max-height:42vh; }

  /* کارت مکان و کادر مسیر از پنل جدا و به bottom sheet تبدیل می‌شوند. */
  #place-card, #route-box {
    position:fixed; left:0; right:0; bottom:0; top:auto; margin:0 !important; z-index:20;
    max-height:70vh; overflow-y:auto; border-radius:20px 20px 0 0; border:0;
    box-shadow:0 -8px 30px rgba(0,0,0,.22);
    padding:16px 16px calc(16px + env(safe-area-inset-bottom)); background:#fff;
  }
  #place-card::before, #route-box::before {
    content:""; display:block; width:40px; height:4px; border-radius:2px;
    background:#d5d9e0; margin:-4px auto 12px;
  }

  /* دکمه‌های شناور بالای safe-area */
  #add-place-btn { bottom:calc(16px + env(safe-area-inset-bottom)); right:12px;
    padding:11px 15px; font-size:13px; }
  #loc-btn { bottom:calc(74px + env(safe-area-inset-bottom)); right:14px; }
  #hint { bottom:calc(74px + env(safe-area-inset-bottom)); font-size:12px; padding:7px 12px; }

  /* مودال‌ها → bottom sheet تمام‌عرض */
  .overlay { align-items:flex-end; }
  .modal { width:100%; max-width:none; border-radius:20px 20px 0 0; padding:18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .admin-modal { width:100%; }
  .modal input { font-size:16px; }

  /* کارت جزئیات → bottom sheet با دستگیره */
  .sheet { left:0; right:0; bottom:0; width:auto; max-width:none;
    border-radius:20px 20px 0 0; padding:8px 16px calc(16px + env(safe-area-inset-bottom)); }
  .sheet-handle { display:block; width:40px; height:4px; border-radius:2px; background:#d5d9e0;
    margin:2px auto 10px; }

  /* فرم افزودن مکان → bottom sheet */
  #add-form { left:0; right:0; bottom:0; width:auto; max-width:none;
    border-radius:20px 20px 0 0; padding:16px 16px calc(18px + env(safe-area-inset-bottom)); }

  /* وقتی bottom sheet باز است، دکمه‌های شناور پنهان تا روی هم نیفتند. */
  body.sheet-open #add-place-btn, body.sheet-open #loc-btn { display:none !important; }
}

/* ══════════════════════ داشبورد / پنل کاربری کامل ══════════════════════ */
.dash { position:fixed; inset:0; z-index:60; background:rgba(17,24,39,.5); direction:rtl;
  display:flex; align-items:center; justify-content:center; backdrop-filter:blur(3px); }
.dash-shell { width:min(980px, 96vw); height:min(680px, 94vh); background:#fff; border-radius:18px;
  overflow:hidden; display:flex; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.dash-nav { width:230px; flex:0 0 auto; background:#f7f9fc; border-left:1px solid #eef1f5;
  padding:16px 12px; display:flex; flex-direction:column; overflow-y:auto; }
.dash-brand { font-weight:800; font-size:16px; color:#2E86DE; display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.dash-user { font-size:12.5px; color:#6b7280; direction:ltr; text-align:right; margin-bottom:12px; }
#dash-menu { display:flex; flex-direction:column; gap:2px; flex:1; }
.dnav { border:0; background:transparent; text-align:right; padding:10px 12px; border-radius:9px;
  font-family:inherit; font-size:13.5px; color:#374151; cursor:pointer; font-weight:600; }
.dnav:hover { background:#eef3fb; }
.dnav.active { background:#2E86DE; color:#fff; }
.dash-logout { margin-top:10px; border:0; background:#fdecea; color:#c0392b; border-radius:9px;
  padding:10px; font-family:inherit; font-weight:700; font-size:13px; cursor:pointer; }
.dash-main { flex:1; position:relative; padding:24px 26px; overflow-y:auto; }
.dash-close { position:absolute; top:16px; left:18px; border:0; background:#f1f3f5; width:32px; height:32px;
  border-radius:50%; font-size:15px; color:#6b7280; cursor:pointer; }
.dsec h2 { font-size:19px; font-weight:800; color:#1f2937; margin-bottom:16px; }
.dhint { font-size:13px; color:#6b7280; margin:6px 0 14px; }
.stat-row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.stat { flex:1; min-width:120px; background:#f7f9fc; border:1px solid #eef1f5; border-radius:14px; padding:16px; text-align:center; }
.stat-n { font-size:28px; font-weight:800; color:#2E86DE; }
.stat-l { font-size:12.5px; color:#6b7280; margin-top:4px; }
.dlist { display:flex; flex-direction:column; gap:2px; }
.drow { display:flex; align-items:center; gap:10px; padding:11px 6px; border-bottom:1px solid #f0f2f5;
  font-size:14px; cursor:pointer; }
.drow .dr-name { flex:1; }
.drow .dr-del { border:0; background:transparent; color:#e74c3c; cursor:pointer; font-size:15px; }
.drow .dr-edit { border:0; background:transparent; cursor:pointer; font-size:14px; opacity:.75; }
.drow .dr-edit:hover { opacity:1; }
/* ویرایشِ درجای مکانِ ذخیره‌شده */
.fav-row.editing { cursor:default; }
.fav-edit { display:flex; flex-wrap:wrap; align-items:center; gap:7px; width:100%; }
.fav-edit .fav-name-in { flex:1 1 120px; min-width:0; padding:8px 10px; border:1px solid #d5dbe3;
  border-radius:9px; font-family:inherit; font-size:13.5px; }
.fav-edit .fav-cat-in { flex:0 0 auto; padding:8px 8px; border:1px solid #d5dbe3; border-radius:9px;
  font-family:inherit; font-size:13px; background:#fff; }
.fav-edit-btns { display:flex; gap:6px; margin-inline-start:auto; }
.fav-edit-btns .fav-save { border:0; background:var(--brand); color:#fff; border-radius:9px;
  padding:8px 12px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.fav-edit-btns .fav-cancel { border:0; background:#eef1f5; color:#444; border-radius:9px;
  padding:8px 12px; font-family:inherit; font-size:13px; cursor:pointer; }
.soon { background:#f7f9fc; border:1px dashed #cfd6e0; border-radius:12px; padding:22px; text-align:center;
  color:#8a93a2; font-size:13.5px; }
.dbtn { display:block; width:100%; border:0; background:#2E86DE; color:#fff; border-radius:10px; padding:12px;
  font-family:inherit; font-weight:700; font-size:14px; cursor:pointer; margin-bottom:10px; }
.dbtn.ghost { background:#f1f3f5; color:#374151; }
.dbtn.danger { background:#e74c3c; }
.apikey { direction:ltr; text-align:left; background:#f7f9fc; border:1px solid #eef1f5; border-radius:10px;
  padding:10px 12px; font-family:monospace; font-size:12px; word-break:break-all; margin-bottom:14px; }
.srow { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 0;
  border-bottom:1px solid #f0f2f5; font-size:14px; font-weight:600; color:#374151; }
.srow select { border:1px solid #dfe3e8; border-radius:9px; padding:8px 10px; font-family:inherit; font-size:13.5px; }
.srow.toggle input { width:20px; height:20px; }

@media (max-width: 640px) {
  .dash { align-items:flex-end; }
  .dash-shell { width:100%; height:92vh; border-radius:18px 18px 0 0; flex-direction:column; }
  .dash-nav { width:auto; flex-direction:row; overflow-x:auto; padding:10px; border-left:0;
    border-bottom:1px solid #eef1f5; gap:6px; }
  .dash-brand, .dash-user, .dash-logout { display:none; }
  #dash-menu { flex-direction:row; gap:6px; }
  .dnav { white-space:nowrap; padding:8px 12px; font-size:12.5px; }
  .dash-main { padding:18px 16px calc(20px + env(safe-area-inset-bottom)); }
}

/* حالت‌های حرکت (کنترل بخش‌بندی‌شده) و دستورالعمل‌های پله‌به‌پله */
.route-modes { display:flex; gap:6px; margin-bottom:12px; background:#f1f3f5; padding:4px; border-radius:12px; }
.rmode { flex:1; border:0; background:transparent; border-radius:9px; padding:9px 0;
  font-size:20px; line-height:1; cursor:pointer; transition:all .12s; filter:grayscale(.25); }
.rmode:hover { background:#e6ebf2; }
.rmode.active { background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.12); filter:none; }
.route-steps { max-height:220px; overflow-y:auto; margin:8px 0; }
.rstep { display:flex; align-items:flex-start; gap:9px; padding:9px 4px; border-bottom:1px solid #f0f2f5; font-size:13px; }
.rs-ic { flex:0 0 auto; width:22px; text-align:center; font-size:15px; color:#2E86DE; }
.rs-tx { flex:1; line-height:1.6; }
.rs-dist { color:#6b7280; font-size:12px; }

/* مسیرهای جایگزین + شروع ناوبری + بنر ناوبری */
/* گزینه‌های مسیر (پرهیز از طرح ترافیک و …) */
.route-opts { margin:0 0 10px; }
.ro-toggle { display:inline-flex; align-items:center; gap:7px; cursor:pointer; font-size:13px;
  background:#f1f3f5; border-radius:10px; padding:7px 11px; user-select:none; }
.ro-toggle input { width:16px; height:16px; accent-color:var(--brand); cursor:pointer; }
/* زمانِ حرکت (برنامه‌ریزیِ سفر مثل گوگل «حرکت در…») */
.route-depart { margin:0 0 10px; position:relative; }
.depart-btn { border:0; background:#f1f3f5; border-radius:10px; padding:8px 12px; font-size:13px;
  font-weight:700; cursor:pointer; color:var(--text); }
.depart-btn.on { background:#eaf2ff; color:#1a6dff; }
.depart-panel { margin-top:8px; background:#fff; border:1px solid #e2e6eb; border-radius:12px;
  padding:10px; display:flex; flex-direction:column; gap:8px; box-shadow:0 6px 18px rgba(0,0,0,.08); }
.depart-panel input { border:1px solid #d7dbe2; border-radius:9px; padding:8px 10px; font:inherit;
  font-family:inherit; }
.depart-actions { display:flex; gap:8px; justify-content:flex-end; }
.depart-actions button { border:0; border-radius:9px; padding:8px 14px; font-weight:700; cursor:pointer;
  background:#f1f3f5; color:var(--text); }
.depart-actions button.primary { background:#1a6dff; color:#fff; }
.rs-plan { margin-top:5px; font-size:12.5px; color:#1a6dff; font-weight:700; }
.route-alts-list { display:flex; gap:6px; margin-bottom:10px; overflow-x:auto; }
.ralt { flex:0 0 auto; min-width:96px; border:1px solid #e2e6eb; background:#fff; border-radius:12px;
  padding:8px 12px; cursor:pointer; text-align:center; font-family:inherit; transition:all .12s; }
.ralt b { display:block; font-size:15px; color:#111; }
.ralt span { font-size:11px; color:#6b7280; }
.ralt.active { border-color:#2E86DE; background:#f1f6ff; }
.ralt.active b { color:#2E86DE; }
.route-start { width:100%; border:0; background:#27ae60; color:#fff; border-radius:10px; padding:13px;
  font-family:inherit; font-size:15px; font-weight:800; cursor:pointer; margin:6px 0 4px; }
.route-start:hover { filter:brightness(1.06); }

.nav-top { position:fixed; top:0; left:0; right:0; z-index:40; background:#1f7a3d; color:#fff;
  display:flex; align-items:center; gap:14px; padding:16px 18px calc(16px + env(safe-area-inset-top));
  box-shadow:0 4px 16px rgba(0,0,0,.3); direction:rtl; }
.nav-ic { font-size:34px; line-height:1; flex:0 0 auto; }
.nav-tx { flex:1; }
#nav-instr { font-size:18px; font-weight:800; }
#nav-dist { font-size:14px; opacity:.9; margin-top:2px; }
.nav-bottom { position:fixed; bottom:0; left:0; right:0; z-index:40; background:#fff;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 18px calc(14px + env(safe-area-inset-bottom)); box-shadow:0 -4px 16px rgba(0,0,0,.18); direction:rtl; }
#nav-eta { font-size:15px; font-weight:700; color:#111; }
#nav-end { border:0; background:#e74c3c; color:#fff; border-radius:10px; padding:11px 22px;
  font-family:inherit; font-weight:700; font-size:14px; cursor:pointer; }
/* هنگام ناوبری، کنترل‌های دیگر پنهان */
body.nav-on #panel, body.nav-on #add-place-btn, body.nav-on #loc-btn, body.nav-on #hint { display:none !important; }

/* ===== رنگ برند (از سوپرادمین قابل تغییر) ===== */
:root { --brand:#2E86DE; }
.brand > span:first-child { color:var(--brand); }
.logo { color:var(--brand); }

/* ===== تنظیمات سایت (پنل سوپرادمین، رندر خودکار از schema) ===== */
.site-grp { border:1px solid #eef0f3; border-radius:12px; padding:12px 14px; margin-bottom:14px; }
.site-grp h4 { font-size:13px; color:var(--brand); margin-bottom:12px; font-weight:800;
  border-bottom:1px solid #f0f2f5; padding-bottom:8px; }
.fld textarea { width:100%; margin-top:5px; border:1px solid #dfe3e8; border-radius:9px;
  padding:8px 10px; font-family:inherit; font-size:13px; resize:vertical; }
.fld input[type="color"] { width:52px; height:34px; padding:2px; margin-top:5px; cursor:pointer; }
.fld-toggle { display:flex; align-items:center; justify-content:space-between; gap:12px;
  font-size:13px; color:#374151; font-weight:600; margin-bottom:10px; padding:7px 2px; }
.fld-toggle input[type="checkbox"] { width:42px; height:24px; appearance:none; -webkit-appearance:none;
  background:#cbd2d9; border-radius:24px; position:relative; cursor:pointer; transition:background .15s; flex:0 0 auto; }
.fld-toggle input[type="checkbox"]::after { content:""; position:absolute; top:2px; right:2px;
  width:20px; height:20px; border-radius:50%; background:#fff; transition:right .15s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.fld-toggle input[type="checkbox"]:checked { background:#27ae60; }
.fld-toggle input[type="checkbox"]:checked::after { right:20px; }
#site-save { margin-top:6px; }

/* ===== تبلیغ درون‌برنامه‌ای ===== */
.ad-banner { position:fixed; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom));
  z-index:35; display:flex; align-items:center; gap:10px; text-decoration:none; direction:rtl;
  background:#fff; border:1px solid rgba(0,0,0,.08); border-radius:14px; padding:10px 12px;
  box-shadow:0 8px 26px rgba(0,0,0,.18); color:#1f2937; font-size:13.5px; font-weight:600;
  max-width:520px; margin:0 auto; }
.ad-banner.ad-top { top:calc(74px + env(safe-area-inset-top)); bottom:auto; }
.ad-badge { flex:0 0 auto; background:#f1c40f; color:#5c4500; font-size:10px; font-weight:800;
  border-radius:6px; padding:2px 6px; }
#ad-img { width:44px; height:44px; object-fit:cover; border-radius:9px; flex:0 0 auto; }
#ad-text { flex:1; line-height:1.5; }
#ad-close { flex:0 0 auto; border:0; background:#eef0f3; color:#555; border-radius:50%;
  width:26px; height:26px; cursor:pointer; font-size:13px; }
/* وقتی تبلیغ پایین است، دکمه‌های شناور را کمی بالا ببر تا روی‌هم نیفتند. */
body.has-ad.ad-bottom #loc-btn { bottom:calc(84px + env(safe-area-inset-bottom)); }
/* تبلیغ نباید روی شیت‌ها/مودال‌ها بیفتد و کلیک را بگیرد (مثل گوگل‌مپ، هنگام باز بودن پنل پنهان). */
body.sheet-open .ad-banner { display:none !important; }
body:has(.overlay:not(.hidden)) .ad-banner { display:none !important; }

/* ===== حالت تعمیرات ===== */
.maint-banner { position:fixed; top:0; left:0; right:0; z-index:60; background:#b91c1c; color:#fff;
  text-align:center; padding:10px 14px calc(10px + env(safe-area-inset-top)); font-size:13.5px; font-weight:700; }

/* بنر قطعِ اتصال (آفلاین/تابِ ملی) — پایینِ صفحه تا با نوارِ بالا تداخل نکند */
.net-banner { position:fixed; left:12px; right:12px; z-index:59; direction:rtl;
  bottom:calc(12px + env(safe-area-inset-bottom)); max-width:520px; margin:0 auto;
  background:#334155; color:#fff; border-radius:12px; box-shadow:0 6px 22px rgba(0,0,0,.3);
  display:flex; align-items:center; gap:9px; padding:11px 14px; font-size:13px; line-height:1.5; }
.net-banner .nb-ic { font-size:18px; flex:0 0 auto; }
/* هنگام آفلاین، بنر مسیریابی/ناوبری نباید رویش بیفتد */
body.net-off.nav-on .net-banner { display:none; }

/* ===== نظر و امتیاز کاربران ===== */
.pd-reviews { border-top:1px solid #eef0f3; margin-top:12px; padding-top:12px; }
.rv-summary { display:flex; align-items:center; gap:8px; font-size:14px; min-height:22px; }
.rv-avg { font-size:22px; font-weight:800; color:#111; }
.rv-avg-stars { color:#f1c40f; letter-spacing:1px; }
.rv-count { color:#6b7280; font-size:12.5px; }
.rv-none { color:#6b7280; font-size:13px; }
.rv-toptags { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.rv-toptag { background:#eef4fd; color:#1b62b3; border-radius:20px; padding:3px 10px; font-size:12px; }
.rv-add-btn { width:100%; border:1px solid var(--brand); background:#fff; color:var(--brand);
  border-radius:10px; padding:10px; font-family:inherit; font-weight:700; font-size:14px; cursor:pointer; margin:4px 0 8px; }
.rv-add-btn:hover { background:#f2f8ff; }
.rv-form { background:#f8f9fb; border-radius:12px; padding:12px; margin-bottom:10px; }
.rv-stars-pick { font-size:30px; color:#d5d9e0; letter-spacing:4px; text-align:center; cursor:pointer; direction:ltr; }
.rv-stars-pick span { cursor:pointer; transition:color .1s; }
.rv-stars-pick span.on { color:#f1c40f; }
.rv-q { font-size:12.5px; color:#374151; font-weight:600; margin:10px 0 6px; }
.rv-tags { display:flex; flex-wrap:wrap; gap:6px; }
.rv-tag { border:1px solid #dfe3e8; background:#fff; color:#374151; border-radius:20px;
  padding:5px 11px; font-family:inherit; font-size:12.5px; cursor:pointer; }
.rv-tag.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.rv-form textarea { width:100%; margin-top:10px; border:1px solid #dfe3e8; border-radius:9px;
  padding:9px 11px; font-family:inherit; font-size:13.5px; resize:vertical; direction:rtl; }
.rv-form-act { display:flex; gap:8px; margin-top:10px; }
.rv-submit { flex:1; border:0; background:#27ae60; color:#fff; border-radius:9px; padding:10px;
  font-family:inherit; font-weight:700; cursor:pointer; }
.rv-submit:disabled { opacity:.6; cursor:default; }
.rv-cancel { border:0; background:#eef0f3; color:#555; border-radius:9px; padding:10px 16px;
  font-family:inherit; cursor:pointer; }
.rv-msg { font-size:12.5px; color:#c0392b; margin-top:8px; min-height:14px; }
.rv-list { margin-top:6px; }
.rv-item { border-top:1px solid #f0f2f5; padding:10px 0; }
.rv-head { display:flex; justify-content:space-between; align-items:center; }
.rv-author { font-size:13px; font-weight:700; color:#374151; }
.rv-item-stars { color:#f1c40f; letter-spacing:1px; direction:ltr; }
.rv-body-txt { font-size:13px; color:#4b5563; margin-top:5px; line-height:1.6; }
.rv-itags { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.rv-itag { background:#f2f4f7; color:#555; border-radius:14px; padding:2px 8px; font-size:11.5px; }
.rv-foot { display:flex; gap:8px; margin-top:8px; }
.rv-help, .rv-report { border:1px solid #e3e6ea; background:#fff; color:#555; border-radius:8px;
  padding:5px 10px; font-family:inherit; font-size:12px; cursor:pointer; }
.rv-help.on { background:#eaf7ef; color:#1f7a3d; border-color:#bfe6cd; }
.rv-help:disabled { opacity:.6; cursor:default; }

/* مشارکت‌های من (داشبورد) */
.contrib-row { align-items:flex-start; }
.cr-stars { color:#f1c40f; margin-right:6px; direction:ltr; font-size:13px; }
.cr-body { display:block; font-size:12.5px; color:#6b7280; margin-top:3px; }
.cr-meta { display:block; font-size:11.5px; color:#9aa0a6; margin-top:3px; }
.badge.published { background:#eaf7ef; color:#1f7a3d; }

/* صف نظرها (سوپرادمین) */
.rvq-tabs { display:flex; gap:6px; margin-bottom:10px; }
.rvq-tab { border:1px solid #e3e6ea; background:#fff; color:#555; border-radius:20px;
  padding:5px 12px; font-family:inherit; font-size:12.5px; cursor:pointer; }
.rvq-tab.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.ai-body { font-size:13px; color:#4b5563; margin:4px 0; line-height:1.6; }
.rv-flagged { color:#c0392b; }

/* ===== کنسول سوپرادمین (تمام‌صفحه) ===== */
.admin-shell { width:min(1040px, 96vw); height:min(720px, 94vh); }
.atab-sec h2 { font-size:20px; margin-bottom:14px; color:#111; }
.atab-sec h3 { font-size:15px; margin:14px 0 10px; color:#374151; }
#admin-menu { display:flex; flex-direction:column; gap:2px; }
.ubadge { font-size:10.5px; background:#eef0f3; color:#555; border-radius:6px; padding:2px 7px; font-weight:700; }
.ubadge.on { background:#eaf7ef; color:#1f7a3d; }
.ubadge.me { background:#eef4fd; color:#1b62b3; }
.admin-item .ai-actions .u-promote { background:#2E86DE; color:#fff; }
.admin-item .ai-actions .u-demote { background:#8e44ad; color:#fff; }
.admin-item .ai-actions .u-delete, .admin-item .ai-actions .danger { background:#e74c3c; color:#fff; }

/* مدیریت تبلیغات */
.ads-toolbar { margin:12px 0; }
.ads-list { display:flex; flex-direction:column; gap:10px; }
.ad-card { display:flex; align-items:center; gap:12px; border:1px solid #eef1f5; border-radius:14px; padding:10px; }
.ad-thumb { width:96px; height:56px; object-fit:cover; border-radius:9px; flex:0 0 auto; background:#f1f3f5; }
.ad-thumb.noimg { display:flex; align-items:center; justify-content:center; font-size:11px; color:#9aa0a6; }
.ad-info { flex:1; min-width:0; }
.ad-c-title { font-weight:700; font-size:14px; }
.ad-c-act { display:flex; gap:6px; flex:0 0 auto; }
.ad-c-act button { border:0; border-radius:8px; padding:7px 12px; font-family:inherit; font-size:12.5px;
  font-weight:700; cursor:pointer; background:#eef0f3; color:#374151; }
.ad-c-act .ad-del { background:#fdecea; color:#c0392b; }
.ad-editor { border:1px solid #e3e6ea; border-radius:14px; padding:16px; margin-top:14px; background:#f8f9fb; }
.ad-editor-act { display:flex; gap:8px; margin-top:8px; }
.ad-preview { margin:8px 0; }
.ad-preview img { max-width:100%; max-height:140px; border-radius:10px; border:1px solid #e3e6ea; }

/* بنر تبلیغِ تصویری در وب‌اپ */
.ad-banner.has-img { padding:0; overflow:hidden; gap:0; }
.ad-banner.has-img #ad-img { width:100%; height:auto; max-height:90px; border-radius:14px; object-fit:cover; }
.ad-banner.has-img #ad-text { position:absolute; bottom:6px; right:10px; color:#fff;
  text-shadow:0 1px 3px rgba(0,0,0,.7); font-size:12.5px; }
.ad-banner.has-img .ad-badge { position:absolute; top:6px; right:6px; }
.ad-banner.has-img #ad-close { position:absolute; top:6px; left:6px; background:rgba(0,0,0,.4); color:#fff; }

/* ===== هوش مصنوعی ===== */
#ai-search-btn { border:0; background:transparent; font-size:16px; cursor:pointer; padding:0 2px; }
#ai-search-btn:hover { transform:scale(1.15); }
.ai-understood { margin-top:8px; background:linear-gradient(90deg,#eef4fd,#f3edff); color:#1b3a63;
  border:1px solid #dbe6f7; border-radius:10px; padding:8px 12px; font-size:12.5px; }
.ai-understood b { color:#6b3fc0; }
.sug-empty { padding:12px 8px; color:#9aa0a6; font-size:13px; list-style:none; }
.rv-ai-summary { background:linear-gradient(90deg,#eef4fd,#f3edff); border:1px solid #dbe6f7;
  color:#1b3a63; border-radius:10px; padding:8px 12px; font-size:12.5px; margin:8px 0; line-height:1.6; }

/* ===== آپلود تصویر تبلیغ ===== */
.ad-upload-row { display:flex; align-items:center; gap:10px; margin-top:6px; }
.ad-upload-status { font-size:12px; color:#6b7280; }
.ad-upload-status.ok { color:#1f7a3d; }
.ad-upload-status.err { color:#c0392b; }

/* ===== کنترل لایه‌های نقشه (مثل گوگل‌مپ) ===== */
#layers-btn { position:absolute; bottom:140px; right:16px; z-index:11; width:44px; height:44px;
  border:0; border-radius:12px; background:#fff; box-shadow:0 3px 12px rgba(0,0,0,.22);
  font-size:20px; cursor:pointer; }
#layers-btn:hover { background:#f2f8ff; }
.layers-panel { position:absolute; bottom:140px; right:70px; z-index:20; width:240px;
  background:#fff; border-radius:14px; box-shadow:0 10px 34px rgba(0,0,0,.24); padding:14px; direction:rtl;
  max-height:calc(100vh - 210px); overflow-y:auto; }
body.has-ad.ad-bottom #layers-btn { bottom:calc(138px + env(safe-area-inset-bottom)); }
/* هنگام باز بودن شیت/ناوبری، کنترل لایه‌ها هم مثل بقیهٔ دکمه‌های شناور پنهان شود. */
body.sheet-open #layers-btn, body.sheet-open .layers-panel,
body.nav-on #layers-btn, body.nav-on .layers-panel { display:none !important; }
.lp-title { font-size:12px; color:#6b7280; font-weight:700; margin:6px 2px 8px; }
.lp-bases { display:flex; gap:10px; margin-bottom:6px; }
.lp-base { flex:1; border:2px solid #e3e6ea; background:#fff; border-radius:12px; padding:6px;
  font-family:inherit; font-size:12px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:5px; }
.lp-base.active { border-color:var(--brand); color:var(--brand); font-weight:700; }
/* در حالتِ تمِ خودکار، دکمه‌های دستیِ روز/شب کم‌رنگ می‌شوند (نشانهٔ کنترلِ خودکار). */
.lp-base.auto-dim { opacity:.55; }
.lp-base.auto-dim.active { opacity:.8; }
.lp-thumb { width:100%; height:40px; border-radius:8px; }
.lp-thumb.day { background:linear-gradient(135deg,#e9e7e2 40%,#a5d0f0); }
.lp-thumb.night { background:linear-gradient(135deg,#1a2029 40%,#1b3a5b); }
.lp-toggle { display:flex; align-items:center; justify-content:space-between; gap:10px;
  font-size:13px; color:#374151; font-weight:600; padding:8px 2px; cursor:pointer; }
.lp-toggle input[type="checkbox"] { width:40px; height:22px; appearance:none; -webkit-appearance:none;
  background:#cbd2d9; border-radius:22px; position:relative; cursor:pointer; transition:background .15s; flex:0 0 auto; }
.lp-toggle input[type="checkbox"]::after { content:""; position:absolute; top:2px; right:2px;
  width:18px; height:18px; border-radius:50%; background:#fff; transition:right .15s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.lp-toggle input[type="checkbox"]:checked { background:#27ae60; }
.lp-toggle input[type="checkbox"]:checked::after { right:20px; }
@media (max-width:640px) {
  #layers-btn { bottom:calc(126px + env(safe-area-inset-bottom)); right:14px; }
  body.has-ad.ad-bottom #layers-btn { bottom:calc(200px + env(safe-area-inset-bottom)); }
  .layers-panel { bottom:calc(126px + env(safe-area-inset-bottom)); right:14px; left:14px; width:auto;
    max-height:calc(100vh - 300px); overflow-y:auto; }
}

/* ===== کارت مکان: گالری/جزئیات/عکس/اشتراک ===== */
.pd-gallery { display:flex; gap:8px; overflow-x:auto; padding:10px 0 4px; }
.pd-photo { position:relative; flex:0 0 auto; }
.pd-photo img { width:120px; height:90px; object-fit:cover; border-radius:10px; cursor:pointer; background:#eef0f3; }
.pd-photo.pending img { opacity:.75; }
.pd-photo-badge { position:absolute; bottom:6px; right:6px; background:rgba(0,0,0,.6); color:#fff;
  font-size:10px; border-radius:6px; padding:1px 6px; }
.pd-info-rows { margin-top:6px; }
.pd-row { display:flex; align-items:center; gap:10px; padding:8px 2px; font-size:13.5px; color:#374151;
  border-bottom:1px solid #f2f4f7; text-decoration:none; }
a.pd-row { color:#1b62b3; }
.pd-row span:first-child { flex:0 0 auto; }
.pd-add-photo { width:100%; border:1px dashed #cbd2d9; background:#fff; color:#374151; border-radius:10px;
  padding:10px; font-family:inherit; font-size:13.5px; cursor:pointer; margin:10px 0 4px; }
.pd-add-photo:hover { border-color:var(--brand); color:var(--brand); }
#af-phone, #af-website, #af-hours { width:100%; border:1px solid #dfe3e8; border-radius:9px;
  padding:9px 11px; font-family:inherit; font-size:13.5px; margin-bottom:8px; outline:none; }

/* صف عکس‌ها (سوپرادمین) */
.admin-photos { display:flex; flex-direction:column; gap:10px; }
.aphoto { display:flex; gap:12px; border:1px solid #eef1f5; border-radius:12px; padding:10px; }
.aphoto img { width:110px; height:80px; object-fit:cover; border-radius:9px; flex:0 0 auto; background:#f1f3f5; }
.aphoto-info { flex:1; min-width:0; }
.phq-tab { border:1px solid #e3e6ea; background:#fff; color:#555; border-radius:20px;
  padding:5px 12px; font-family:inherit; font-size:12.5px; cursor:pointer; }
.phq-tab.active { background:var(--brand); color:#fff; border-color:var(--brand); }

/* ===== سطح‌بندی و نشان‌ها (مشارکت‌های من) ===== */
.contrib-level { background:linear-gradient(135deg,#eef4fd,#f3edff); border:1px solid #dbe6f7;
  border-radius:14px; padding:14px 16px; margin-bottom:12px; }
.cl-head { display:flex; align-items:center; gap:12px; }
.cl-emoji { font-size:32px; }
.cl-title { font-weight:800; font-size:15px; color:#1b3a63; }
.cl-points { font-size:12.5px; color:#6b7280; margin-top:2px; }
.cl-bar { height:8px; background:#dbe1ea; border-radius:6px; margin:12px 0 6px; overflow:hidden; }
.cl-bar span { display:block; height:100%; background:linear-gradient(90deg,#2E86DE,#8e44ad); border-radius:6px; }
.cl-next { font-size:12px; color:#6b3fc0; font-weight:600; }
.contrib-badges { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:14px; }
.badge-chip { font-size:12px; border-radius:20px; padding:5px 11px; background:#f1f3f5; color:#9aa0a6;
  border:1px solid #e8ebf0; filter:grayscale(1); opacity:.65; }
.badge-chip.on { background:#eaf7ef; color:#1f7a3d; border-color:#bfe6cd; filter:none; opacity:1; font-weight:700; }

/* نقطهٔ آبیِ «موقعیت من» (مثل گوگل‌مپ) */
.me-dot { width:18px; height:18px; border-radius:50%; background:#2E86DE; border:3px solid #fff;
  box-shadow:0 0 0 4px rgba(46,134,222,.3), 0 2px 6px rgba(0,0,0,.3); }

/* ===== نوار مبدأ/مقصدِ قابل ویرایش (مثل گوگل‌مپ) ===== */
.route-row.editable { cursor:pointer; border-radius:8px; padding:7px 8px; transition:background .12s; }
.route-row.editable:hover { background:#eef4ff; }
.route-row .ep-label { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.route-row .ep-edit { color:#9aa6b5; font-size:12px; opacity:0; transition:opacity .12s; flex:0 0 auto; }
.route-row.editable:hover .ep-edit { opacity:1; }
.route-row.editing { background:#e5efff; box-shadow:inset 0 0 0 2px var(--brand); }
.route-row.editing .ep-edit { opacity:1; color:var(--brand); }

/* ===== جست‌وجوهای اخیر ===== */
#suggestions .sug-head { flex-direction:row; align-items:center; justify-content:space-between;
  cursor:default; padding:8px; color:#6b7280; font-size:12px; font-weight:700; }
#suggestions .sug-head:hover { background:none; }
#suggestions .sug-clear { border:0; background:none; color:#2E86DE; font-family:inherit;
  font-size:12px; cursor:pointer; font-weight:700; }

/* ===== ناوبریِ سبک ویز ===== */
.nav-dist { font-size:22px; font-weight:900; margin-bottom:2px; line-height:1.1; }
#nav-instr { font-size:16px; font-weight:800; }
.nav-then { font-size:12.5px; opacity:.82; margin-top:4px; padding-top:4px;
  border-top:1px solid rgba(255,255,255,.22); }
/* پیکانِ جهت‌دارِ حرکت */
.nav-puck { filter:drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
/* دکمهٔ بازگشت به مسیر وقتی کاربر نقشه را جابه‌جا کرده */
.nav-recenter { position:fixed; left:50%; transform:translateX(-50%);
  bottom:calc(88px + env(safe-area-inset-bottom)); z-index:41; border:0; cursor:pointer;
  background:#2E86DE; color:#fff; font-family:inherit; font-weight:800; font-size:14px;
  padding:11px 20px; border-radius:24px; box-shadow:0 4px 16px rgba(0,0,0,.32); }
/* نوار پایینِ ناوبری: سرعت | زمان رسیدن | پایان */
.nav-speed { display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-width:56px; background:#f2f5f9; border-radius:12px; padding:6px 10px; }
.nav-speed b { font-size:20px; font-weight:900; color:#111; line-height:1; }
.nav-speed small { font-size:10px; color:#6b7280; margin-top:2px; }
.nav-eta-wrap { flex:1; text-align:center; }
.nav-eta-time { font-size:16px; font-weight:900; color:#1f7a3d; }
.nav-eta-sub { font-size:13px; color:#374151; margin-top:2px; }
#nav-end { flex:0 0 auto; }
/* همراهِ هوشمندِ مسیر (پیشنهادِ مکان‌های سرِ راه) */
.nav-tip { position:fixed; left:12px; right:12px; z-index:41;
  bottom:calc(140px + env(safe-area-inset-bottom)); direction:rtl;
  background:#fff; border-radius:14px; box-shadow:0 6px 22px rgba(0,0,0,.24);
  display:flex; align-items:center; gap:10px; padding:10px 12px; max-width:520px; margin:0 auto; }
.nav-tip .nt-ai { font-size:18px; flex:0 0 auto; }
.nav-tip .nt-ic { font-size:20px; flex:0 0 auto; }
.nav-tip .nt-tx { flex:1; display:flex; flex-direction:column; min-width:0; }
.nav-tip .nt-tx b { font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-tip .nt-tx small { font-size:11.5px; color:#6b7280; margin-top:1px; }
.nav-tip .nt-go { border:0; background:var(--brand); color:#fff; font-family:inherit;
  font-weight:700; font-size:13px; padding:8px 14px; border-radius:10px; cursor:pointer; flex:0 0 auto; }
.nav-tip .nt-x { border:0; background:none; color:#9aa6b5; font-size:15px; cursor:pointer; flex:0 0 auto; }

/* هشدارِ رخدادِ سرِ راه حینِ ناوبری (سبک ویز) — بالای صفحه زیرِ کارتِ دستور */
.nav-alert { position:fixed; left:12px; right:12px; z-index:42;
  top:calc(96px + env(safe-area-inset-top)); direction:rtl;
  background:#ff5252; color:#fff; border-radius:14px; box-shadow:0 6px 22px rgba(0,0,0,.28);
  display:flex; align-items:center; gap:10px; padding:10px 12px; max-width:520px; margin:0 auto;
  animation:na-in .25s ease; }
@keyframes na-in { from { transform:translateY(-8px); opacity:0; } to { transform:none; opacity:1; } }
.nav-alert .na-ic { font-size:22px; flex:0 0 auto; }
.nav-alert .na-tx { flex:1; display:flex; flex-direction:column; min-width:0; }
.nav-alert .na-tx b { font-size:14.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-alert .na-tx small { font-size:11.5px; opacity:.92; margin-top:1px; }
.nav-alert .na-x { border:0; background:none; color:rgba(255,255,255,.85); font-size:16px; cursor:pointer; flex:0 0 auto; }

/* دکمهٔ بستنِ پنل لایه‌ها */
.lp-close { position:absolute; top:8px; left:8px; border:0; background:#f2f5f9; color:#6b7280;
  width:26px; height:26px; border-radius:50%; cursor:pointer; font-size:13px; line-height:1; }
.lp-close:hover { background:#e5e9ef; color:#111; }
.layers-panel { position:absolute; }

/* ════════════════════════════════════════════════════════════════════
   بازطراحیِ مدرن و مینیمال (فونت واریزمتن، سایه‌های نرم، گوشه‌های کروی)
   این بلوک آخر است تا بر قواعد قبلی اولویت داشته باشد.
   ════════════════════════════════════════════════════════════════════ */
@font-face { font-family:"Vazirmatn"; src:url("/fonts-src/Vazirmatn-Regular.ttf") format("truetype");
  font-weight:400; font-display:swap; }
@font-face { font-family:"Vazirmatn"; src:url("/fonts-src/Vazirmatn-Bold.ttf") format("truetype");
  font-weight:700 900; font-display:swap; }

:root {
  --brand:#2E86DE; --brand-600:#2277d0; --brand-700:#1b66b8;
  --ink:#161c26; --muted:#6b7280; --line:#eaeef3; --bg-soft:#f4f6f9;
  --r-sm:10px; --r-md:14px; --r-lg:20px; --r-xl:26px;
  --sh-1:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.07);
  --sh-2:0 6px 18px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --sh-3:0 22px 55px rgba(16,24,40,.20), 0 8px 18px rgba(16,24,40,.10);
}
body { font-family:"Vazirmatn","Segoe UI",Tahoma,sans-serif; color:var(--ink);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }

/* ---- پنل جست‌وجو ---- */
/* توجه: backdrop-filter اینجا تنظیم نمی‌شود؛ روی موبایل عناصرِ fixed داخلی (شیتِ
   مسیر/کارت) را به‌جای viewport به پنل میخ می‌کند و شیت به بالای صفحه می‌پرد. */
#panel { border-radius:24px; box-shadow:var(--sh-3); border:1px solid rgba(16,24,40,.05);
  background:rgba(255,255,255,.99); }
.brand { font-weight:800; letter-spacing:-.2px; }
.brand-actions button { border-radius:14px; border-color:var(--line); transition:all .15s; }
.brand-actions button:hover { border-color:var(--brand); box-shadow:var(--sh-1); }
.search { background:var(--bg-soft); border-radius:16px; border:1.5px solid transparent; }
.search:focus-within { background:#fff; border-color:var(--brand); box-shadow:0 0 0 4px rgba(46,134,222,.12); }
.chip { border-radius:20px; border-color:var(--line); font-weight:600; }
.chip.active { box-shadow:0 6px 16px rgba(46,134,222,.30); }

/* ---- پیشنهادها ---- */
#suggestions li { padding:11px 12px; border-radius:14px; transition:background .12s; }
#suggestions li[data-pick]:hover { background:var(--bg-soft); }
#suggestions .main { font-size:14px; }

/* ---- کارت‌ها و دکمه‌ها ---- */
#place-card { border-radius:16px; background:var(--bg-soft); }
#route-box { border-radius:18px; background:#fff; border:1px solid var(--line); box-shadow:var(--sh-1); }
.pc-actions button, #route-clear, .pd-btn, .af-actions button,
.modal button.primary, #route-start { border-radius:14px; }
.pc-actions button, #route-start { box-shadow:0 6px 16px rgba(46,134,222,.28); }
.sheet, .modal, #add-form { border-radius:24px; box-shadow:var(--sh-3); }

/* ---- کنترل‌های شناور: مربعِ کروی، سایهٔ نرم، بدونِ تداخل با زوم ---- */
#loc-btn, #layers-btn { border-radius:16px; box-shadow:var(--sh-2); border:1px solid var(--line);
  width:46px; height:46px; }
#loc-btn:hover, #layers-btn:hover { box-shadow:var(--sh-3); }
#add-place-btn { border-radius:18px; box-shadow:0 10px 26px rgba(46,134,222,.42);
  background:linear-gradient(135deg,var(--brand),var(--brand-700)); }
.layers-panel { border-radius:22px; box-shadow:var(--sh-3); }
.lp-base { border-radius:14px; }

/* زوم به پایین‌چپ منتقل شد تا با دکمه‌های سمت راست تداخل نکند (رفعِ «افزودن مکان روی زوم») */
.maplibregl-ctrl-bottom-left { bottom:30px; left:12px; }
.maplibregl-ctrl-group { border-radius:16px !important; overflow:hidden;
  box-shadow:var(--sh-2) !important; border:1px solid var(--line) !important; }
.maplibregl-ctrl-group button { width:42px !important; height:42px !important; }
.maplibregl-ctrl-group button+button { border-top:1px solid var(--line) !important; }

/* ---- ناوبریِ مدرن (سبک ویز) ---- */
.nav-top { background:linear-gradient(135deg,#22a35a,#12813f); color:#fff;
  border-radius:0 0 var(--r-lg) var(--r-lg); box-shadow:0 12px 34px rgba(18,129,63,.30);
  padding:calc(14px + env(safe-area-inset-top)) 18px 16px; gap:14px; }
.nav-ic { width:54px; height:54px; border-radius:16px; background:rgba(255,255,255,.16);
  display:flex; align-items:center; justify-content:center; font-size:26px; }
.nav-dist { font-size:22px; font-weight:900; letter-spacing:-.3px; }
#nav-instr { font-size:16.5px; font-weight:800; line-height:1.35; }
.nav-then { border-top-color:rgba(255,255,255,.24); }

.nav-bottom { display:block; background:#fff; border-radius:var(--r-xl) var(--r-xl) 0 0;
  box-shadow:0 -14px 44px rgba(16,24,40,.16); max-height:none;
  padding:4px 16px calc(12px + env(safe-area-inset-bottom)); }
.nav-handle { display:flex; justify-content:center; padding:9px 0 7px; cursor:grab; touch-action:none; }
.nav-handle span { width:44px; height:5px; border-radius:3px; background:#d7dbe2; }
.nav-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nav-speed { min-width:58px; background:var(--bg-soft); border-radius:14px; padding:7px 10px; }
.nav-speed b { font-size:20px; font-weight:900; }
.nav-eta-time { font-size:16px; font-weight:900; color:#12813f; }
#nav-end { background:#fdecec; color:#e5484d; border-radius:14px; padding:11px 20px; font-weight:800; }
#nav-end:hover { background:#fbdcdc; filter:none; }
.nav-share { flex:0 0 auto; border:0; background:#eaf2ff; color:#1a6dff; border-radius:14px;
  padding:11px 14px; font-weight:800; font-size:14px; cursor:pointer; }
.nav-share:hover { background:#dbe8ff; filter:none; }
.nav-share.on { background:#1a6dff; color:#fff; }

/* بنرِ تماشای زندهٔ سفر (گیرندهٔ لینک) */
.trip-view { position:fixed; top:12px; left:12px; right:12px; z-index:61; direction:rtl;
  background:#fff; border-radius:16px; box-shadow:0 8px 30px rgba(0,0,0,.18);
  padding:12px 14px; border:2px solid #1a6dff; }
.trip-view .tv-row { display:flex; align-items:center; gap:12px; }
.trip-view .tv-ic { font-size:26px; flex:0 0 auto; }
.trip-view .tv-txt { flex:1; min-width:0; }
.trip-view .tv-title { font-weight:900; font-size:16px; }
.trip-view .tv-sub { font-size:13px; color:var(--muted); }
.trip-view .tv-eta { flex:0 0 auto; font-weight:900; font-size:15px; color:#12813f; text-align:center; }
.trip-view.ended { border-color:#94a3b8; }
.trip-view.ended .tv-eta { color:#94a3b8; }
/* حالتِ گیرندهٔ لینک: پنل/جستجو و دکمه‌های شناور را پنهان کن تا تمرکز روی سفر باشد. */
body.trip-viewing #panel, body.trip-viewing #layers-btn, body.trip-viewing #loc-btn,
body.trip-viewing #report-btn, body.trip-viewing #measure-btn { display:none !important; }
.nav-steps-full { display:none; }
.nav-bottom.expanded .nav-steps-full { display:block; max-height:44vh; overflow-y:auto;
  -webkit-overflow-scrolling:touch; padding:2px 2px 10px; margin-bottom:6px; }
.nsf-head { position:sticky; top:0; background:#fff; display:flex; justify-content:space-between;
  align-items:baseline; font-weight:800; font-size:14px; padding:6px 4px 10px; z-index:1; }
.nsf-head span { font-size:12.5px; color:var(--muted); font-weight:700; }
.nsf-row { display:flex; align-items:flex-start; gap:10px; padding:9px 4px; border-top:1px solid #f2f4f7; }
.nsf-ic { flex:0 0 auto; width:30px; height:30px; border-radius:9px; background:var(--bg-soft);
  color:var(--brand); display:flex; align-items:center; justify-content:center; font-size:15px; }
.nsf-tx { flex:1; font-size:13.5px; line-height:1.5; }
.nsf-tx small { display:block; color:var(--muted); font-size:12px; margin-top:1px; }

/* پیکانِ ناوبری + کارتِ همراهِ مسیر: گوشه‌های نرم‌تر */
.nav-recenter { border-radius:22px; box-shadow:0 8px 22px rgba(46,134,222,.4); }
.nav-tip { border-radius:18px; box-shadow:var(--sh-3); }
.nav-tip .nt-go { border-radius:12px; }

/* موبایل: زوم را پنهان کن (لمس: پینچ)، هَندلِ کارت‌ها ظریف‌تر */
@media (max-width:640px) {
  .maplibregl-ctrl-bottom-left { display:none; }
  #place-card, #route-box { border-radius:24px 24px 0 0; }
}
/* هنگام ناوبری، زوم پایین‌چپ هم پنهان تا با کارتِ پایین تداخل نکند */
body.nav-on .maplibregl-ctrl-bottom-left { display:none !important; }
/* هدفِ لمسیِ بزرگ‌ترِ دکمهٔ پاک‌کردنِ جست‌وجو (به‌ویژه موبایل) */
.search button { padding:9px 8px; border-radius:10px; }
.search button:active { background:#eef1f5; }

/* موبایل: کلِ شیتِ مسیر به‌سادگی اسکرول می‌شود (مثل گوگل‌مپ) — تا با محتوای بلند
   (هزینه/هشدارها/مراحل) هیچ‌چیز گیر نکند و همه‌چیز در دسترس بماند. */
@media (max-width:640px) {
  #route-box { max-height:82vh; overflow-y:auto; -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain; }
}
/* هنگام ویرایشِ مبدأ/مقصد در موبایل، شیتِ مسیر پنهان تا پیشنهادها تمام‌صفحه دیده شوند */
@media (max-width:640px) { body.ep-editing #route-box { display:none !important; } }

/* ===== طرح ترافیک / زوج‌وفرد: هزینه و هشدارِ مسیر + بنرِ وضعیت ===== */
.route-restrictions { margin:8px 0; display:flex; flex-direction:column; gap:6px; }
.rr-cost { background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; border-radius:12px;
  padding:9px 12px; font-size:13px; }
.rr-cost b { color:#c2410c; }
.rr-warn { background:#fef2f2; border:1px solid #fecaca; color:#991b1b; border-radius:12px;
  padding:9px 12px; font-size:12.5px; display:flex; flex-direction:column; gap:2px; }
.rr-warn b { font-size:13px; }
.rr-warn span { color:#b91c1c; opacity:.9; line-height:1.5; }

.traffic-status { position:fixed; left:50%; transform:translateX(-50%); z-index:12; direction:rtl;
  bottom:calc(84px + env(safe-area-inset-bottom));
  background:#fff; border-radius:16px; box-shadow:var(--sh-2); border:1px solid var(--line);
  display:flex; align-items:center; gap:10px; padding:8px 14px; font-size:12.5px; max-width:92vw; }
.traffic-status .ts-date { font-weight:800; white-space:nowrap; }
.traffic-status .ts-plate b { color:#c0392b; }
.traffic-status .ts-act { color:#6b7280; white-space:nowrap; }
.traffic-status .ts-act.on { color:#188038; font-weight:700; }
.traffic-status .ts-off { color:#b26a00; font-weight:700; }
body.sheet-open .traffic-status, body.nav-on .traffic-status { display:none !important; }
/* دسکتاپ: پنل هم مثل موبایل در صورتِ بلندشدن (مسیر + مراحل + هشدارها) داخلی اسکرول شود */
@media (min-width:641px) { #panel { max-height:calc(100dvh - 28px); overflow-y:auto; } }

/* برآوردِ هزینهٔ سفر (سوخت/CO₂/طرح) */
.route-cost { margin:6px 0; padding:9px 12px; border-radius:12px; background:#f0f7ff;
  border:1px solid #d6e6fb; color:#1b4f8a; font-size:12.5px; display:flex;
  flex-wrap:wrap; align-items:center; gap:6px; }
.route-cost b { color:#12813f; }
.route-cost .rc-sep { color:#9aa6b5; margin:0 2px; }

/* خروجیِ مسیر (GPX/GeoJSON) */
.route-export { display:flex; align-items:center; gap:8px; margin:8px 0 0; font-size:12.5px; color:var(--muted); }
.route-export button { border:1px solid var(--line); background:#fff; color:var(--brand);
  border-radius:10px; padding:6px 12px; font-family:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.route-export button:hover { background:#f0f7ff; border-color:var(--brand); }

/* ===== رخدادهای ترافیکی (سبکِ ویز) ===== */
#report-btn { position:absolute; left:12px; bottom:112px; z-index:11; width:46px; height:46px;
  border-radius:16px; border:0; cursor:pointer; font-size:22px; background:#fff8ec;
  box-shadow:var(--sh-2); border:1px solid #fde3b8; }
#report-btn:hover { background:#fef1d6; box-shadow:var(--sh-3); }
body.sheet-open #report-btn, body.sheet-open .report-menu { display:none !important; }
/* حینِ ناوبری، دکمهٔ گزارش بماند (مثل ویز) اما بالاتر تا با نوارها تداخل نکند. */
body.nav-on #report-btn { bottom:auto; top:42%; z-index:41; background:#ff9f43; color:#fff;
  border-color:#ff9f43; box-shadow:0 6px 18px rgba(255,159,67,.45); }
body.nav-on .report-menu { bottom:auto; top:calc(42% + 56px); z-index:41; }
.report-menu { position:absolute; left:12px; bottom:168px; z-index:20; direction:rtl;
  background:#fff; border-radius:16px; box-shadow:var(--sh-3); border:1px solid var(--line);
  padding:8px; display:grid; grid-template-columns:1fr 1fr; gap:6px; width:230px; }
.report-menu button { display:flex; align-items:center; gap:8px; border:1px solid var(--line);
  background:#fff; border-radius:12px; padding:9px 10px; font-family:inherit; font-size:13px;
  font-weight:700; color:var(--ink); cursor:pointer; }
.report-menu button:hover { background:var(--bg-soft); border-color:var(--brand); }
.report-menu .rm-e { font-size:18px; }
.inc-mk { font-size:24px; line-height:1; cursor:pointer; filter:drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
/* حبابِ شمارشِ خوشهٔ رخدادها (زوم کم) */
.inc-cluster { min-width:30px; height:30px; padding:0 6px; border-radius:16px; cursor:pointer;
  background:#2E86DE; color:#fff; border:2.5px solid #fff; box-shadow:0 2px 8px rgba(0,0,0,.3);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px;
  font-family:"Vazirmatn",sans-serif; }
@media (max-width:640px) {
  #report-btn { bottom:calc(72px + env(safe-area-inset-bottom)); }
  .report-menu { bottom:calc(128px + env(safe-area-inset-bottom)); }
}

/* دسترسی‌پذیری (ایزوکرون) در پنلِ لایه‌ها */
.iso-mins { display:flex; gap:5px; flex-wrap:wrap; margin:2px 0 4px; }
.iso-mins button { flex:1 1 auto; min-width:40px; border:1px solid var(--line); background:#fff;
  color:var(--ink); border-radius:10px; padding:7px 6px; font-family:inherit; font-size:12.5px;
  font-weight:700; cursor:pointer; }
.iso-mins button:hover { border-color:var(--brand); color:var(--brand); }
.iso-mins button.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.iso-mins button.off { color:var(--muted); flex:0 0 auto; }

/* دکمهٔ صدای راهنمای ناوبری */
.nav-mute { flex:0 0 auto; border:0; background:rgba(255,255,255,.16); color:#fff;
  width:40px; height:40px; border-radius:12px; font-size:18px; cursor:pointer; }
.nav-mute:hover { background:rgba(255,255,255,.26); }
.nav-mute.off { opacity:.7; }

/* میان‌بُرِ خانه/محل کار */
.quick-places { display:flex; gap:8px; margin-top:8px; }
.quick-places .qp { flex:1; display:flex; align-items:center; gap:8px; justify-content:center;
  border:1px solid var(--line); background:#fff; border-radius:14px; padding:9px 10px;
  font-family:inherit; font-size:13px; font-weight:700; color:var(--ink); cursor:pointer; min-width:0; }
.quick-places .qp:hover { border-color:var(--brand); background:var(--bg-soft); }
.quick-places .qp .qp-ic { font-size:16px; flex:0 0 auto; }
.quick-places .qp .qp-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-places .qp:not(.set) .qp-label { color:var(--muted); font-weight:600; }

/* مقصدهای اخیر (مسیریابیِ یک‌لمسی مثل گوگل/ویز) */
.recent-dests { margin-top:10px; }
.recent-dests .rd-head { display:flex; align-items:center; justify-content:space-between; margin:0 2px 6px; }
.recent-dests .rd-title { font-size:12px; font-weight:800; color:var(--muted); }
.recent-dests .rd-clear { border:0; background:none; color:var(--muted); font:inherit; font-size:12px;
  cursor:pointer; padding:2px 4px; }
.recent-dests .rd-clear:hover { color:#e5484d; }
.recent-dests .rd-chips { display:flex; gap:8px; overflow-x:auto; padding-bottom:2px; }
.recent-dests .rd-chip { flex:0 0 auto; max-width:200px; display:flex; align-items:center; gap:6px;
  border:1px solid var(--line); background:#fff; border-radius:20px; padding:7px 12px;
  font-family:inherit; font-size:13px; font-weight:700; color:var(--ink); cursor:pointer; }
.recent-dests .rd-chip:hover { border-color:var(--brand); background:var(--bg-soft); }
.recent-dests .rd-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ابزارِ اندازه‌گیریِ فاصله */
.lp-tool { width:100%; border:1px solid var(--line); background:#fff; color:var(--ink);
  border-radius:12px; padding:9px 10px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.lp-tool:hover { border-color:#8e44ad; color:#8e44ad; background:#faf5ff; }
.lp-tool[disabled] { opacity:.6; cursor:default; }
.lp-tool-sub { margin-top:6px; font-size:12px; font-weight:600; }
.offline-status { font-size:12px; color:var(--muted); margin:6px 2px 0; min-height:1em; direction:rtl; }
.measure-badge { position:fixed; top:calc(14px + env(safe-area-inset-top)); left:50%;
  transform:translateX(-50%); z-index:30; direction:rtl; background:#8e44ad; color:#fff;
  border-radius:16px; box-shadow:var(--sh-2); display:flex; align-items:center; gap:10px;
  padding:8px 8px 8px 14px; font-size:13px; font-weight:800; }
.measure-badge button { border:0; background:rgba(255,255,255,.22); color:#fff; width:26px; height:26px;
  border-radius:50%; cursor:pointer; font-size:13px; }
.measure-badge button:hover { background:rgba(255,255,255,.35); }

/* دکمهٔ اشتراک در کارتِ مکان */
.pc-actions { display:flex; gap:8px; }
.pc-actions #route-here { flex:1; }
.pc-share { flex:0 0 auto; background:var(--bg-soft) !important; color:var(--brand) !important;
  width:42px; padding:9px !important; }
.pc-share:hover { filter:none; background:#e8f0fb !important; }
