[hidden] { display: none !important; }
:root {
  --saffron: #e8630a;
  --saffron-soft: #fff1e6;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e2dc;
  --bg: #fbf8f4;
  --card: #ffffff;
  --green: #138a52;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Hind", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
/* Map page: header / (panel + map) / footer fill the screen */
body.app { display: flex; flex-direction: column; overflow: hidden; }
.layout { flex: 1; min-height: 0; display: flex; }
#panel {
  width: 400px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#mapwrap { flex: 1; height: 100%; position: relative; }
#map { position: absolute; inset: 0; }
.basemap {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: flex; background: #fff; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18); overflow: hidden;
}
.basemap button {
  border: 0; background: #fff; padding: 8px 14px; cursor: pointer;
  font: 500 14px "Hind", sans-serif; color: var(--ink);
}
.basemap button.on { background: var(--saffron); color: #fff; }

.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--saffron); color: #fff;
  display: grid; place-items: center;
  font: 700 24px "Poppins", sans-serif;
}
.brand h1 { margin: 0; font: 700 22px "Poppins", sans-serif; letter-spacing: -0.3px; }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }

#search {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.field { position: relative; display: flex; align-items: center; }
.field input {
  width: 100%; padding: 11px 38px 11px 32px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 15px; background: #fff;
}
.field input:focus { outline: 2px solid var(--saffron); border-color: transparent; }
.dot { position: absolute; left: 12px; width: 10px; height: 10px; border-radius: 50%; }
.dot-from { background: var(--green); }
.dot-to { background: var(--saffron); }
#myloc {
  position: absolute; right: 6px; border: 0; background: none;
  font-size: 18px; color: var(--muted); cursor: pointer; padding: 4px 6px;
}
#swap {
  position: absolute; right: 52px; top: 42px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  list-style: none; margin: 4px 0 0; padding: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: none; max-height: 260px; overflow-y: auto;
}
.suggest.open { display: block; }
.suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.suggest li:hover, .suggest li.active { background: var(--saffron-soft); }
.suggest small { color: var(--muted); margin-left: 6px; }

.row { display: flex; gap: 8px; align-items: center; }
select {
  flex: 1; padding: 9px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff;
}
.check { font-size: 14px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
#go {
  padding: 12px; border: 0; border-radius: 10px;
  background: var(--saffron); color: #fff;
  font: 600 16px "Poppins", sans-serif; cursor: pointer;
}
#go:disabled { opacity: .6; cursor: wait; }

.status { font-size: 14px; color: var(--muted); min-height: 0; }
.status.error { color: #b42318; }

#routes { display: flex; flex-direction: column; gap: 8px; }
.route-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; cursor: pointer;
}
.route-card.selected { border: 2px solid var(--saffron); padding: 11px; }
.route-top { display: flex; justify-content: space-between; align-items: baseline; }
.route-time { font: 600 18px "Poppins", sans-serif; }
.route-km { color: var(--muted); }
.route-via { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.route-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.pill { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }
.pill.toll { background: var(--saffron-soft); border-color: #f7c9a5; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.chip.off { opacity: .45; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.actions a {
  display: block; text-align: center; padding: 10px; border-radius: 10px;
  border: 1px solid var(--saffron); color: var(--saffron);
  text-decoration: none; font-weight: 600;
}
.stops { list-style: none; margin: 0; padding: 0; border-left: 2px dashed var(--line); margin-left: 10px; }
.stops li {
  position: relative; padding: 8px 8px 8px 18px; cursor: pointer; border-radius: 8px;
}
.stops li:hover { background: #fff; }
.stops li::before {
  content: ""; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c, #999); border: 2px solid var(--bg);
}
.stop-name { font-weight: 600; }
.stop-sub { font-size: 13px; color: var(--muted); }
.stop-km { float: right; font-size: 13px; color: var(--muted); }

.foot { margin-top: auto; font-size: 11px; color: var(--muted); }
.maplibregl-popup-content { font-family: "Hind", sans-serif; border-radius: 10px; }

@media (max-width: 760px) {
  body.app { overflow: auto; height: auto; }
  .layout { flex-direction: column-reverse; }
  #panel { width: 100%; height: auto; border-right: 0; overflow: visible; }
  #mapwrap { flex: none; height: 45vh; position: sticky; top: 0; }
}

/* ---------- v5: user box, ads, dialogs ---------- */
.brand-text { flex: 1; min-width: 0; }
.userbox { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.userbox button, .userbox a {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 5px 10px; font: 500 13px "Hind", sans-serif; cursor: pointer;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.userbox .ub-admin { background: var(--ink); color: #fff; border-color: var(--ink); }
.userbox .ub-link { border: 0; background: none; color: var(--muted); padding: 5px 2px; }

.addplace {
  border: 1px dashed var(--saffron); background: var(--saffron-soft); color: #9a3f06;
  border-radius: 10px; padding: 9px; font: 600 14px "Hind", sans-serif; cursor: pointer;
}

.ad { position: relative; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.ad img { display: block; width: 100%; height: auto; }
.ad-label {
  position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
}
.ad-map { position: absolute; right: 10px; bottom: 30px; width: 260px; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

.pickbar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.pickbar button { margin-left: 8px; border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

.stop-nav {
  display: inline-block; margin-top: 3px; font-size: 13px; font-weight: 600;
  color: var(--saffron); text-decoration: none;
}

.dlg {
  border: 0; border-radius: 16px; padding: 22px; width: min(420px, 94vw);
  box-shadow: 0 20px 50px rgba(0,0,0,.25); font-family: "Hind", sans-serif; color: var(--ink);
}
.dlg::backdrop { background: rgba(20,20,30,.45); }
.dlg h3 { margin: 0 0 12px; font: 600 19px "Poppins", sans-serif; }
.dlg h4 { margin: 16px 0 6px; }
.dlg-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; background: var(--bg); padding: 4px; border-radius: 10px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; font: 600 14px "Hind", sans-serif; cursor: pointer; }
.tabs button.on { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.dform { display: flex; flex-direction: column; gap: 10px; }
.dform label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.dform label.check { flex-direction: row; align-items: center; }
.dform input, .dform select, .dform textarea {
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400;
}
.dform small, .small { color: var(--muted); font-size: 12px; font-weight: 400; }
.dform button { padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: 600 14px "Hind", sans-serif; cursor: pointer; }
.dform button.primary { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.dform button:disabled { opacity: .6; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dmsg { margin: 10px 0 0; font-size: 14px; color: #b42318; min-height: 1em; }
.dmsg.ok { color: var(--green); }
.mylist { list-style: none; padding: 0; margin: 0; max-height: 180px; overflow-y: auto; }
.mylist li { padding: 6px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .ad-map { display: none; }
}

.satnote {
  position: absolute; top: 54px; left: 12px; z-index: 5; max-width: 260px;
  background: rgba(31,36,48,.85); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 8px;
}

/* ---------- v10: header with menu ---------- */
.topbar {
  flex-shrink: 0; height: 58px; display: flex; align-items: center; gap: 16px;
  padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.tb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.tb-brand .logo { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
.tb-name { font: 700 19px "Poppins", sans-serif; letter-spacing: -0.3px; }
.beta {
  font: 600 10px "Hind", sans-serif; background: var(--saffron-soft); color: #9a3f06;
  border: 1px solid #f7c9a5; border-radius: 6px; padding: 1px 6px; vertical-align: middle; margin-left: 4px;
}
.tb-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tb-nav > a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: 8px;
}
.tb-nav > a:hover { background: var(--bg); }
.tb-nav > a.on { color: var(--saffron); }
.tb-nav .userbox { margin-left: 8px; }
.userbox .tb-login, .tb-login {
  display: inline-block; background: var(--saffron); border-color: var(--saffron); color: #fff !important; text-decoration: none;
  border-radius: 20px; padding: 6px 14px; font-weight: 600; font-size: 14px;
}
.tb-burger { display: none; margin-left: auto; border: 0; background: none; font-size: 24px; cursor: pointer; }

/* ---------- v10: footer ---------- */
.sitefoot {
  flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 8px 18px; background: #1f2430; color: #b9bdc7; font-size: 12px;
}
.sitefoot a { color: #e6e8ec; text-decoration: none; }
.sitefoot a:hover { text-decoration: underline; }
.sitefoot nav { display: flex; gap: 14px; }
.sitefoot .credits { margin-left: auto; color: #8d93a0; }
.sitefoot .credits a { color: #b9bdc7; }

/* ---------- v10: content pages (About, Privacy, Terms, Contact) ---------- */
body.page { display: flex; flex-direction: column; min-height: 100vh; }
.page-main { flex: 1; width: min(860px, 100% - 32px); margin: 28px auto 40px; }
.page-main h1 { font: 700 30px "Poppins", sans-serif; margin: 0 0 6px; }
.page-main h2 { font: 600 20px "Poppins", sans-serif; margin: 28px 0 8px; }
.page-main p, .page-main li { line-height: 1.65; font-size: 16px; }
.page-main .lead { color: var(--muted); font-size: 17px; margin-top: 0; }
.page-main .card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 14px 0;
}
.page-main .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.page-main .updated { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .tb-burger { display: block; }
  .tb-nav {
    display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
  }
  .tb-nav.open { display: flex; }
  .tb-nav .userbox { margin: 6px 0 0; justify-content: flex-start; }
  .sitefoot { justify-content: center; text-align: center; }
  .sitefoot .credits { margin-left: 0; width: 100%; }
  .page-main .grid2 { grid-template-columns: 1fr; }
}
.page-main a { color: #b54708; }
.page-main a:hover { color: var(--saffron); }

/* ---------- v11: trip summary popup ---------- */
.tripbtn {
  width: 100%; margin-bottom: 8px; padding: 10px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--saffron); color: #fff; font: 600 15px "Hind", sans-serif;
}
.dlg-trip { width: min(760px, 96vw); max-height: 90vh; overflow-y: auto; padding: 22px 24px; }
.dlg-trip h3 { margin: 0; font: 700 22px "Poppins", sans-serif; }
.dlg-trip h4 { margin: 0; font: 600 16px "Poppins", sans-serif; display: inline; }
.dlg-trip section { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.dlg-trip section > h4 { display: block; margin-bottom: 10px; }
.trip-head { padding-bottom: 14px; }
.trip-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.trip-kpis div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.trip-kpis b { display: block; font: 700 19px "Poppins", sans-serif; }
.trip-kpis span { font-size: 12px; color: var(--muted); }
.trip-kpis .kpi-total { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.trip-kpis .kpi-total span { color: #ffe6d4; }

.fuel-tabs { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.fuel-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 16px;
  font: 600 14px "Hind", sans-serif; cursor: pointer;
}
.fuel-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.calc-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.calc-grid label.check { flex-direction: row; align-items: center; gap: 6px; grid-column: 1 / -1; }
.calc-grid input[type=number] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.calc-out { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; }
.calc-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.calc-row.grand { font-size: 17px; border-bottom: 1px solid var(--ink); }
.calc-row.grand b { color: var(--saffron); }
.calc-note { padding: 8px 0; font-size: 14px; line-height: 1.5; }
.calc-note .warn { display: block; margin-top: 6px; color: #b42318; font-weight: 600; }

.trip-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.trip-tbl th { text-align: left; background: var(--bg); padding: 6px 8px; }
.trip-tbl td { padding: 6px 8px; border-top: 1px solid var(--line); }
.trip-tbl td:last-child, .trip-tbl th:last-child { text-align: right; white-space: nowrap; }
.trip-tbl tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }

.dlg-trip details summary { cursor: pointer; list-style: none; margin-bottom: 8px; }
.dlg-trip details summary::-webkit-details-marker { display: none; }
.dlg-trip details summary::before { content: "▸ "; color: var(--muted); }
.dlg-trip details[open] summary::before { content: "▾ "; }
.cnt { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font: 600 12px "Hind", sans-serif; }
.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-list li { display: flex; gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.trip-list li:hover { background: var(--bg); }
.trip-list .km { width: 70px; flex-shrink: 0; color: var(--muted); }
.tag { background: #dcf5e8; color: #0b6b3e; border-radius: 6px; padding: 0 6px; font-size: 11px; }
.tag.grey { background: #eee; color: #555; }
.trip-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.trip-actions a, .trip-actions button {
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font: 600 14px "Hind", sans-serif; cursor: pointer; text-decoration: none; color: var(--ink);
}
.trip-actions .primary { background: var(--saffron); border-color: var(--saffron); color: #fff; }

@media (max-width: 760px) {
  .trip-kpis, .calc-grid { grid-template-columns: 1fr 1fr; }
  .dlg-trip { padding: 18px 14px; }
}

/* Print / Save PDF: only the trip summary */
@media print {
  body.app > *:not(#dlg-trip) { display: none !important; }
  body.app { overflow: visible; height: auto; display: block; }
  #dlg-trip { position: static; display: block; width: 100%; max-height: none; overflow: visible; box-shadow: none; padding: 0; }
  #dlg-trip::backdrop { display: none; }
  #dlg-trip .dlg-x, #dlg-trip .trip-actions, #dlg-trip .fuel-tabs { display: none; }
  #dlg-trip details > * { display: block; }
}

/* ---------- v12: Google satellite / Earth links ---------- */
.glinks { position: absolute; left: 12px; bottom: 34px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; }
.glinks a {
  background: #fff; color: var(--ink); text-decoration: none; font: 600 13px "Hind", sans-serif;
  padding: 7px 11px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.glinks a:hover { background: var(--saffron); color: #fff; }
.trip-list .nm { flex: 1; }
.trip-list .gsat { text-decoration: none; font-size: 16px; padding: 0 4px; }
@media (max-width: 760px) { .glinks { bottom: 30px; } .glinks a { font-size: 12px; padding: 6px 9px; } }
@media print { .trip-list .gsat { display: none; } }

/* ---------- v14: admin toll rates in trip popup ---------- */
.trip-tbl td.adm { text-align: right; }
.ratebtn, .smallbtn, .rf-save {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 9px;
  font: 600 12px "Hind", sans-serif; cursor: pointer;
}
.rf-save { background: var(--saffron); color: #fff; border-color: var(--saffron); padding: 8px 14px; }
.rateform td { background: var(--saffron-soft); }
.rf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.rf-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 500; }
.rf-grid input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; min-width: 0; width: 100%; box-sizing: border-box; }
.trip-tbl tr.rateform td:last-child { text-align: left; white-space: normal; }
@media (max-width: 760px) { .rf-grid { grid-template-columns: 1fr 1fr; } }
@media print { .ratebtn, .rateform, .smallbtn { display: none !important; } }
.actions a.rajmarg { margin-top: 8px; border-color: var(--line); color: var(--ink); font-weight: 500; font-size: 14px; }
.trip-tbl { table-layout: fixed; }
.trip-tbl th:first-child { width: 64px; }
.trip-tbl th:nth-child(3) { width: 130px; }
.trip-tbl th:nth-child(4) { width: 96px; }
.trip-tbl td { overflow-wrap: anywhere; }
.dlg-trip section a { color: #b54708; }

/* ---------- v15: dropdown menu ---------- */
.tb-nav > a { padding: 8px 10px; font-size: 14.5px; }
.tb-drop { position: relative; }
.tb-drop-btn {
  border: 0; background: none; font: 500 14.5px "Hind", sans-serif; color: var(--ink);
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.tb-drop-btn:hover, .tb-drop.open .tb-drop-btn { background: var(--bg); }
.tb-drop-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); min-width: 230px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
}
.tb-drop:hover .tb-drop-menu, .tb-drop.open .tb-drop-menu { display: block; }
.tb-drop-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.tb-drop-menu a:hover, .tb-drop-menu a.on { background: var(--saffron-soft); color: #9a3f06; }
.tb-drop-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@media (max-width: 1100px) { .tb-nav > a { padding: 8px 7px; font-size: 13.5px; } .tb-name { font-size: 17px; } }
@media (max-width: 900px) {
  .tb-burger { display: block; }
  .tb-nav {
    display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,.08); max-height: calc(100vh - 58px); overflow-y: auto;
  }
  .tb-nav.open { display: flex; }
  .tb-drop-btn { display: none; }
  .tb-drop-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0; min-width: 0; }
  .tb-nav .userbox { margin: 6px 0 0; justify-content: flex-start; }
}

/* ---------- v15: map legend ---------- */
.legend {
  position: absolute; top: 12px; right: 52px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px 12px;
  max-width: min(520px, calc(100% - 200px)); justify-content: flex-end;
  background: rgba(255,255,255,.94); border-radius: 10px; padding: 7px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  font: 500 13px "Hind", sans-serif; color: var(--ink);
}
.lg-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.lg-line { width: 18px; height: 5px; border-radius: 3px; display: inline-block; }
@media (max-width: 760px) { .legend { top: auto; bottom: 8px; right: 8px; max-width: calc(100% - 16px); font-size: 12px; } }
.tag.star { background: #fff4d6; color: #8a5a00; }

/* ---------- v17: "show on route" tick boxes ---------- */
.incl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.incl-title { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.incl label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.incl input { width: 16px; height: 16px; accent-color: var(--saffron); }
.incl-note { background: var(--bg); border-radius: 8px; padding: 8px 10px; }

/* ---------- v19: trip summary as a right-side panel ---------- */
.dlg-trip[open] {
  position: fixed; inset: 58px 0 0 auto; margin: 0; z-index: 25;
  width: min(480px, 100vw); height: calc(100vh - 58px); max-height: none;
  border-radius: 0; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0,0,0,.12);
  overflow-y: auto; padding: 18px 18px 22px;
}
.dlg-trip .trip-kpis { grid-template-columns: 1fr 1fr; }
.dlg-trip .calc-grid { grid-template-columns: 1fr 1fr; }
.dlg-trip .calc-grid label.check { grid-column: 1 / -1; }
.dlg-trip .rf-grid { grid-template-columns: 1fr 1fr; }
.dlg-trip .trip-tbl th:nth-child(3) { width: 96px; }
.town { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: #fff; }
.town > summary { padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 !important; }
.dlg-trip .town > summary::before { content: "▸"; color: var(--muted); }
.dlg-trip .town[open] > summary::before { content: "▾"; }
.town-name { font-weight: 700; }
.town[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg); border-radius: 10px 10px 0 0; }
.town .trip-list { padding: 0 6px; }
@media (max-width: 760px) {
  .dlg-trip[open] { inset: auto 0 0 0; width: 100%; height: 72vh; border-radius: 16px 16px 0 0; border-left: 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
}
@media print { .dlg-trip[open] { position: static; height: auto; width: 100%; box-shadow: none; border: 0; } .town { break-inside: avoid; } }
@media (min-width: 761px) {
  body.trip-open #mapwrap .legend, body.trip-open #mapwrap .maplibregl-ctrl-top-right { right: min(490px, 100vw); }
  body.trip-open #mapwrap .ad-map { display: none; }
}

/* ---------- v21: My trips ---------- */
.mylist.trips { max-height: 260px; }
.mylist.trips li { display: flex; align-items: center; gap: 6px; }
.mylist.trips .tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mylist.trips button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 7px; cursor: pointer; font: 600 12px "Hind", sans-serif; }
.mylist.trips .star { border: 0; background: none; font-size: 17px; color: #c9c2ba; padding: 0 2px; }
.mylist.trips .star.on { color: #f0a500; }
.linkish { border: 0; background: none; color: var(--muted); font: 500 12px "Hind", sans-serif; cursor: pointer; float: right; text-decoration: underline; }

/* ---------- v21: live GPS + drive mode ---------- */
#mapwrap { position: relative; }
.gps-btn {
  position: absolute; right: 10px; bottom: 120px; z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 20px; cursor: pointer;
}
.gps-btn.on { background: #e8f1ff; }
.gps-btn.on.follow { background: #1a73e8; }
.gps-btn.wait { animation: gpsPulse 1s infinite alternate; }
@keyframes gpsPulse { to { box-shadow: 0 0 0 8px rgba(26,115,232,.25); } }
.gps-dot { width: 20px; height: 20px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(26,115,232,.22), 0 1px 4px rgba(0,0,0,.4); position: relative; }
.gps-arrow { display: none; position: absolute; left: 50%; top: -13px; transform: translateX(-50%);
  border: 7px solid transparent; border-bottom: 11px solid #1a73e8; }
.gps-dot.moving .gps-arrow { display: block; }
.gps-toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 8; max-width: 90%;
  background: #1f2430; color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.drive-hud {
  position: absolute; left: 10px; bottom: 10px; z-index: 6; width: min(380px, calc(100% - 20px));
  background: #fff; border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 12px; max-height: 60%; overflow-y: auto;
}
.hud-top { display: flex; gap: 8px; align-items: center; }
.hud-big { flex: 1; text-align: center; }
.hud-big b { display: block; font: 700 22px "Poppins", sans-serif; color: var(--ink); }
.hud-big small { color: var(--muted); font-size: 12px; }
.hud-stop { background: #d93025; color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; cursor: pointer; }
.hud-prog { height: 6px; background: #eee; border-radius: 3px; margin: 10px 0 4px; overflow: hidden; }
.hud-prog span { display: block; height: 100%; width: 0; background: var(--saffron); transition: width .5s; }
.hud-route { margin-bottom: 6px; }
.hud-off { background: #fff3cd; border-radius: 8px; padding: 8px; font-size: 14px; margin-bottom: 6px; }
.hud-off button { margin-left: 6px; border: 0; background: var(--saffron); color: #fff; border-radius: 6px; padding: 5px 10px; font-weight: 600; cursor: pointer; }
.hud-next { list-style: none; margin: 0; padding: 0; }
.hud-next li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hud-next li.toll { background: #fff8f1; }
.hud-next .hn-ic { font-size: 18px; width: 24px; text-align: center; }
.hud-next .hn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hud-next .hn-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-next .hn-main small { color: var(--muted); }
.hud-next .hn-km { font-weight: 700; white-space: nowrap; }
.hud-next a { text-decoration: none; color: var(--saffron); font-weight: 700; padding: 0 4px; }
.hud-next li.arrived { font-weight: 600; color: var(--green); }
.hud-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hud-btns button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; font: 600 13px "Hind", sans-serif; cursor: pointer; }
.t-drive { background: #1a73e8 !important; color: #fff !important; border-color: #1a73e8 !important; }
/* drive mode = full-screen map (phone and desktop) */
body.driving #mapwrap { position: fixed !important; inset: 0; height: auto !important; z-index: 60; background: #e9e5df; }
body.driving .gps-btn { bottom: auto; top: 12px; }
body.driving #mapwrap .legend, body.driving #mapwrap .ad-map { display: none; }
.install-btn { border: 1px solid var(--saffron); background: #fff; color: var(--saffron); border-radius: 18px; padding: 5px 12px; font: 600 13px "Hind", sans-serif; cursor: pointer; margin-right: 6px; }
@media (max-width: 760px) {
  .drive-hud { max-height: 55%; }
}

/* ---------- v22: rich footer (all content pages) ---------- */
.sitefoot.rich { display: block; padding: 0; background: linear-gradient(180deg, #1f2430, #171b24); color: #b9bdc7; font-size: 14px; }
.sf-grid {
  width: min(1180px, 100% - 32px); margin: 0 auto; padding: 40px 0 26px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.3fr; gap: 28px;
}
.sf-grid h4 { margin: 0 0 12px; color: #fff; font: 600 15px "Poppins", sans-serif; padding-bottom: 8px; border-bottom: 2px solid var(--saffron); display: inline-block; }
.sf-grid > div > a { display: block; padding: 4px 0; color: #c9ccd4; }
.sf-grid > div > a::before { content: "› "; color: var(--saffron); }
.sf-grid a:hover { color: #fff; text-decoration: none; }
.sf-logo { display: flex !important; align-items: center; gap: 10px; font: 700 20px "Poppins", sans-serif; color: #fff !important; }
.sf-logo::before { content: none !important; }
.sf-logo .logo { width: 36px; height: 36px; font-size: 19px; border-radius: 10px; }
.sf-brand p { line-height: 1.6; margin: 12px 0 0; }
.sf-by b { color: #fff; }
.sf-install { margin-top: 14px; border: 1px solid var(--saffron); background: transparent; color: #ffb27a; border-radius: 10px; padding: 8px 14px; font: 600 14px "Hind", sans-serif; cursor: pointer; }
.sf-contact p { display: flex; gap: 10px; margin: 0 0 12px; line-height: 1.45; }
.sf-contact .sf-ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: rgba(232,99,10,.15); display: grid; place-items: center; font-size: 15px; }
.sf-contact b { display: block; color: #fff; font-weight: 600; }
.sf-contact a { color: #c9ccd4; }
.sf-bottom {
  width: min(1180px, 100% - 32px); margin: 0 auto; padding: 14px 0 18px; border-top: 1px solid #2f3544;
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; font-size: 12.5px; color: #8d93a0;
}
.sf-bottom .credits { margin: 0; }
.sf-bottom a { color: #b9bdc7; }
@media (max-width: 980px) { .sf-grid { grid-template-columns: 1fr 1fr; } .sf-brand, .sf-contact { grid-column: 1 / -1; } }
@media (max-width: 520px) { .sf-grid { grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 28px; } .sf-bottom { justify-content: center; text-align: center; } }
.sitefoot.rich, .sitefoot.rich .sf-grid { text-align: left; }
.dfilter { max-width: 100%; }

/* ---------- v26: stay tags ---------- */
.tag.free { background: #dcfae6; color: #067647; font-weight: 700; }
.tag.budget { background: #fef0c7; color: #93370d; }

/* ---------- v27: ad spaces – bottom strip + right side (all pages) ---------- */
.ad2 { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ad2 img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ad2 .ad-label { position: absolute; top: 4px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.ad-house { display: flex; align-items: center; justify-content: center; gap: 4px 14px; flex-wrap: wrap; text-align: center;
  height: 100%; padding: 8px 12px; text-decoration: none !important; color: var(--ink) !important;
  background: repeating-linear-gradient(135deg, #fff8f1 0 14px, #fff 14px 28px); }
.ad-house b { font: 700 15px "Poppins", sans-serif; color: #b54708; }
.ad-house span { font-size: 13.5px; color: var(--muted); }
.ad-house em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--saffron); }
.ad-house:hover b { text-decoration: underline; }

/* bottom strip: full width above the footer */
.ad-bottom { flex-shrink: 0; width: min(970px, 100% - 24px); height: 90px; margin: 14px auto; }

/* right side: tall box fixed on the right edge on wide screens */
.ad-side { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); width: 160px; height: 600px; max-height: calc(100vh - 140px); z-index: 20; display: none; }
.ad-side .ad-house { flex-direction: column; gap: 10px; padding: 16px 10px; }
@media (min-width: 1540px) { .ad-side:not([hidden]) { display: block; } }

/* home page (full-screen map): bottom strip under the map, side box on the map's right edge */
body.app .ad-bottom { width: 100%; max-width: none; height: 70px; margin: 0; border-radius: 0; border-width: 1px 0 0; }
body.app .ad-side { top: 140px; transform: none; right: 12px; width: 160px; height: 300px; max-height: calc(100vh - 360px); }
@media (min-width: 1200px) { body.app .ad-side:not([hidden]) { display: block; } }
body.app.trip-open .ad-side, body.driving .ad-side, body.driving .ad-bottom { display: none !important; }
@media (max-width: 640px) { .ad-bottom { height: 70px; } .ad-house span { display: none; } }
.ad-side .ad-house em { font-size: 11.5px; word-break: break-all; }
.ad-side .ad-house b { font-size: 14px; }

/* ---------- v28: globe logo ---------- */
.logo-img { width: 44px; height: 44px; display: block; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(11,61,145,.18)); }
.sf-logo .logo-img { width: 38px; height: 38px; filter: none; background: #fff; border-radius: 50%; padding: 2px; }
.tb-brand .logo-img { width: 40px; height: 40px; }
