@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
:root{
  --ink:#1b1613; --paper:#faf7f2; --card:#ffffff; --line:#e8ded1;
  --brand:#7c2d12; --brand2:#b45309; --accent:#f59e0b; --ok:#15803d; --muted:#6f6657;
  --radius:14px; --shadow:0 1px 2px rgba(27,22,19,.06),0 6px 18px rgba(27,22,19,.05);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Cairo',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;
  background:var(--paper); color:var(--ink); line-height:1.6;
  -webkit-text-size-adjust:100%;
}
a{color:var(--brand)}
.top{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; background:var(--card); border-bottom:1px solid var(--line);
  position:sticky; top:0; z-index:500;
}
.brand{display:flex; align-items:center; gap:10px}
.logo{font-size:26px; line-height:1}
.top h1{font-size:19px; margin:0; font-weight:700}
.top p{margin:0; font-size:12px; color:var(--muted)}
.pill{font-size:11px; padding:3px 10px; border-radius:999px; font-weight:600; white-space:nowrap}
.pill.demo{background:#fef3c7; color:#92400e; border:1px solid #fcd34d}
.notice{
  margin:12px 16px 0; padding:10px 12px; font-size:12.5px; line-height:1.75;
  background:#fff7ed; border:1px solid #fed7aa; border-radius:var(--radius); color:#7c2d12;
}
.notice strong{color:#7c2d12}
.tabs{
  display:flex; gap:6px; padding:10px 16px 0; max-width:1020px; margin:0 auto;
}
.tab{
  flex:1; border:1px solid var(--line); background:var(--card); color:var(--ink);
  padding:9px 8px; border-radius:10px; font-family:inherit; font-size:14px; font-weight:600;
  cursor:pointer;
}
.tab.active{background:var(--brand); color:#fff; border-color:var(--brand)}
main{max-width:1020px; margin:0 auto; padding:14px 16px 40px}
.panel{display:none}
.panel.active{display:block}
.searchbar input{
  width:100%; padding:13px 15px; font-family:inherit; font-size:15px;
  border:1px solid var(--line); border-radius:var(--radius); background:var(--card);
  box-shadow:var(--shadow); color:var(--ink);
}
.searchbar input:focus{outline:2px solid #fdba74; border-color:var(--brand2)}
.chips{display:flex; flex-wrap:wrap; gap:7px; margin:12px 0 6px}
.chip{
  border:1px solid var(--line); background:var(--card); color:var(--ink);
  padding:6px 12px; border-radius:999px; font-family:inherit; font-size:13px; cursor:pointer;
}
.chip.active{background:#fde68a; border-color:#f59e0b; font-weight:700}
.count{font-size:12px; color:var(--muted); margin:6px 2px 10px}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(272px,1fr)); gap:12px}
.card{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:13px 14px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:8px;
}
.card-top{display:flex; gap:10px; align-items:flex-start}
.card-top .ico{font-size:22px; line-height:1.1}
.card h3{margin:0; font-size:15.5px; font-weight:700}
.card .area{margin:1px 0 0; font-size:12px; color:var(--muted)}
.badge-src{margin-inline-start:auto; display:flex; flex-direction:column; gap:4px; align-items:flex-end}
.tag{font-size:10.5px; padding:2px 8px; border-radius:999px; font-weight:600; white-space:nowrap}
.tag.osm{background:#e0f2fe; color:#075985; border:1px solid #bae6fd}
.tag.sample{background:#fef2f2; color:#991b1b; border:1px solid #fecaca}
.tag.warn{background:#fff7ed; color:#9a3412; border:1px solid #fed7aa}
.phone{display:flex; align-items:center; gap:8px; font-size:14px}
.phone b{direction:ltr; font-weight:700; letter-spacing:.5px}
.phone .none{color:var(--muted); font-size:12.5px}
.actions{display:flex; gap:6px; flex-wrap:wrap; margin-top:2px}
.btn{
  font-family:inherit; font-size:13px; font-weight:600; padding:7px 12px; border-radius:9px;
  border:1px solid var(--line); background:#f8f5f0; color:var(--ink); cursor:pointer;
  text-decoration:none; display:inline-flex; align-items:center; gap:5px;
}
.btn:hover{background:#f1ebe2}
.btn.call{background:var(--brand); color:#fff; border-color:var(--brand)}
.btn.wa{background:#128c7e; color:#fff; border-color:#128c7e}
.btn.primary{background:var(--brand); color:#fff; border-color:var(--brand); font-size:14px; padding:11px 16px}
.btn.wide{width:100%}
.btn[aria-disabled="true"]{opacity:.45; pointer-events:none}
.empty{
  grid-column:1/-1; background:var(--card); border:1px dashed var(--line); border-radius:var(--radius);
  padding:22px; text-align:center; color:var(--muted); font-size:13.5px;
}
.tripform{display:grid; grid-template-columns:1fr auto 1fr; gap:8px; align-items:end}
.tripform label{display:flex; flex-direction:column; gap:4px; font-size:12.5px; color:var(--muted); font-weight:600}
.tripform select{
  font-family:inherit; font-size:14px; padding:10px; border:1px solid var(--line);
  border-radius:10px; background:var(--card); color:var(--ink);
}
.tripform .swap{align-self:end; margin-bottom:1px; height:40px; width:40px; font-size:17px}
.tripform .wide{grid-column:1/-1; margin-top:4px}
.mapwrap{margin:12px 0; border-radius:var(--radius); overflow:hidden; border:1px solid var(--line); box-shadow:var(--shadow)}
#map{height:330px; width:100%; background:#eee7db}
.tripresult{font-size:14px}
.tripresult .big{
  display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px;
}
.kpi{
  flex:1; min-width:120px; background:var(--card); border:1px solid var(--line);
  border-radius:12px; padding:11px 13px; box-shadow:var(--shadow);
}
.kpi .v{font-size:21px; font-weight:700; color:var(--brand)}
.kpi .l{font-size:11.5px; color:var(--muted)}
.costs{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px}
.cost{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px 12px}
.cost .m{font-size:12.5px; color:var(--muted)}
.cost .p{font-size:17px; font-weight:700}
.settings{margin-top:14px; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:10px 14px}
.settings summary{cursor:pointer; font-weight:600; font-size:13.5px}
.fares{display:flex; flex-direction:column; gap:8px; margin:12px 0 6px}
.fares .row{display:flex; align-items:center; gap:8px; font-size:13px}
.fares input{width:76px; font-family:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:8px}
.muted{color:var(--muted)}
.small{font-size:12px}
.chat{
  background:var(--card); border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; min-height:230px; max-height:56vh; overflow-y:auto; display:flex; flex-direction:column; gap:9px;
  box-shadow:var(--shadow);
}
.msg{max-width:88%; padding:9px 13px; border-radius:14px; font-size:14px; white-space:pre-line}
.msg.user{align-self:flex-start; background:#fde68a; border-bottom-right-radius:4px}
.msg.bot{align-self:flex-end; background:#f5f1ea; border:1px solid var(--line); border-bottom-left-radius:4px}
.msg .acts{display:flex; gap:6px; flex-wrap:wrap; margin-top:8px}
.quick{display:flex; gap:6px; flex-wrap:wrap; margin:10px 0}
.quick button{font-family:inherit; font-size:12.5px; padding:6px 11px; border-radius:999px; border:1px solid var(--line); background:var(--card); cursor:pointer}
.askrow{display:flex; gap:8px}
.askrow input{
  flex:1; padding:12px 14px; font-family:inherit; font-size:14.5px;
  border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--ink);
}
footer{max-width:1020px; margin:0 auto; padding:0 16px 30px; font-size:11.5px; color:var(--muted)}
footer p{margin:4px 0}
.leaflet-container{font-family:inherit}
@media (max-width:620px){
  .tripform{grid-template-columns:1fr; gap:6px}
  .tripform .swap{justify-self:center; transform:rotate(90deg)}
  #map{height:270px}
  .top h1{font-size:17px}
  .notice{margin:10px 12px 0; font-size:12px}
  main{padding:12px 12px 34px}
  .tabs{padding:10px 12px 0}
}

/* ---------- icons ---------- */
[data-icon] svg,.ico svg,.pi svg,.btn svg{display:inline-block;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.logo{display:inline-flex}
.logo svg{width:27px;height:27px;stroke:var(--brand);stroke-width:1.8}
.tab svg{width:16px;height:16px;vertical-align:-3px}
.ico{width:36px;height:36px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;background:#fdf1e3;color:var(--brand);flex:0 0 auto}
.ico svg{width:20px;height:20px}
.cat-pharmacy{background:#e0f2fe;color:#0369a1}
.cat-clinic,.cat-doctor{background:#fde8e8;color:#b91c1c}
.cat-lab{background:#ede9fe;color:#6d28d9}
.cat-station{background:#e2e8f0;color:#334155}
.cat-hospital{background:#fee2e2;color:#b91c1c}
.cat-school{background:#dcfce7;color:#15803d}
.cat-market{background:#fef9c3;color:#a16207}
.cat-restaurant{background:#ffedd5;color:#c2410c}
.cat-gov{background:#e0e7ff;color:#3730a3}
.pi svg{width:15px;height:15px;stroke:var(--muted)}
.btn svg{width:15px;height:15px}
.chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;white-space:nowrap}
.chip b{font-weight:700;opacity:.55;font-size:11px;margin-inline-start:2px}
.badge-src{margin-inline-start:auto; align-self:center}
.actions{align-items:center}
.btn.ghost{background:transparent; border-style:dashed; color:var(--brand2); font-size:12.5px}
.area .tag{font-size:10px; padding:1px 7px; vertical-align:2px; margin-inline-start:3px}
h1.latin{font-family:'Segoe UI',system-ui,-apple-system,sans-serif; letter-spacing:.5px; font-size:20px; direction:ltr}
