:root{
  /* Marque Swaswa : orange vif (aplats : bandeau, boutons) ; --brand-ink = orange foncé pour les petits textes
     sur fond clair (prix, liens, onglets), lisible à 5,2:1 */
  --brand:#FB7701; --brand-2:#E86A00; --brand-ink:#C2410C; --brand-soft:#FFF3E6; --brand-line:#FDCB9A;
  /* Vert = signaux de confiance uniquement (carte vérifiée, mission confirmée) */
  --green:#14532d; --green-2:#166534; --green-soft:#e7f3ea; --green-line:#bfdcc8;
  --bg:#f6f2e9; --card:#fff; --line:#e6e0d2; --text:#1c1917; --muted:#78716c;
  --amber:#b45309; --amber-soft:#fef3c7; --red:#b91c1c; --red-soft:#fee2e2; --blue:#1d4ed8; --blue-soft:#dbeafe;
  --radius:16px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:#e9e4d8;color:var(--text);font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#shell{max-width:480px;min-height:100vh;margin:0 auto;background:var(--bg);display:flex;flex-direction:column;position:relative;box-shadow:0 0 40px rgba(0,0,0,.08)}
#view{flex:1;display:flex;flex-direction:column;min-width:0}
a{color:var(--brand-ink);text-decoration:none}
h1,h2,h3{margin:0}
.pad{padding:16px}
.stack>*+*{margin-top:12px}
.row{display:flex;align-items:center;gap:10px}
.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.tiny{font-size:11.5px}
.center{text-align:center}
.hidden{display:none!important}
.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
svg.ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* barres */
.bar{display:flex;align-items:center;gap:8px;padding:12px 14px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.bar h1{font-size:16px;font-weight:600;flex:1;min-width:0}
.iconbtn{width:36px;height:36px;border-radius:50%;border:0;background:transparent;display:flex;align-items:center;justify-content:center;color:var(--text);cursor:pointer}
.iconbtn:hover{background:#f3efe4}
.hero{background:linear-gradient(135deg,#FF8A1F 0%,#FB7701 55%,#F06A00 100%);color:#fff;padding:20px 16px 26px;border-radius:0 0 28px 28px}
.hero h1{font-size:22px;font-weight:600;margin:14px 0 4px}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:18px;letter-spacing:-.2px}
.brand .logo{width:36px;height:36px;border-radius:50%;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.brand .logo img{width:26px;height:auto;display:block}
.chip{display:inline-flex;align-items:center;gap:5px;background:rgba(255,255,255,.14);padding:5px 10px;border-radius:99px;font-size:12.5px}

/* nav bas */
#nav{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(4,1fr);z-index:30;padding-bottom:env(safe-area-inset-bottom)}
#nav:empty{display:none}
#nav a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 0 8px;color:#a8a29e;font-size:11px;position:relative}
#nav a.on{color:var(--brand-ink);font-weight:600}
#nav .dot{position:absolute;top:6px;left:calc(50% + 8px);min-width:8px;height:8px;background:var(--red);border-radius:50%}

/* cartes et boutons */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px}
.card.link{display:block;color:inherit}
.card.link:active{background:#faf8f2}
.card.sel{border-color:var(--brand)}
.card.good{border-color:var(--green-line);background:var(--green-soft)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--brand);background:var(--brand);color:#fff;border-radius:12px;padding:11px 16px;font:inherit;font-weight:600;cursor:pointer;width:100%}
.btn:hover{background:var(--brand-2)}
.btn:disabled{opacity:.5;cursor:not-allowed}
/* boutons secondaires neutres : le rouge plein = action principale, le rouge sur blanc = action risquée */
.btn.ghost{background:#fff;color:var(--text);border-color:#d6d0c2}
.btn.ghost:hover{background:#f3efe4}
.btn.danger{background:#fff;color:var(--red);border-color:#e7b4b4}
.btn.sm{padding:8px 12px;font-size:13.5px;width:auto}
.btns{display:flex;gap:8px}
.btns>*{flex:1}
label.f{display:block;font-size:13px;font-weight:600;margin:12px 0 5px}
input,select,textarea{width:100%;font:inherit;color:inherit;background:#fff;border:1px solid #d6d0c2;border-radius:12px;padding:10px 12px}
textarea{resize:vertical;min-height:80px}
input:focus,select:focus,textarea:focus{outline:2px solid var(--brand-line);border-color:var(--brand)}
.seg{display:flex;background:#fff;border:1px solid var(--line);border-radius:14px;padding:4px;gap:4px}
.seg button{flex:1;border:0;background:transparent;border-radius:10px;padding:9px 8px;font:inherit;text-align:start;cursor:pointer;color:#57534e}
.seg button b{display:block;font-size:14px}
.seg button span{font-size:11.5px;opacity:.75}
.seg button.on{background:var(--brand);color:#fff}
.cats{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.cat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px;text-align:start;cursor:pointer;font:inherit;color:inherit}
.cat:hover{border-color:var(--brand)}
.cat .ic{color:var(--brand);margin-bottom:6px;width:24px;height:24px}
.cat b{display:block;font-size:14.5px}
.cat span{font-size:12px;color:var(--muted);line-height:1.3;display:block;margin-top:2px}

/* badges */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:99px;background:#f0ece0;color:#57534e;white-space:nowrap}
.badge .ic{width:13px;height:13px}
.badge.green{background:var(--green-soft);color:var(--green)}
.badge.amber{background:var(--amber-soft);color:var(--amber)}
.badge.red{background:var(--red-soft);color:var(--red)}
.badge.blue{background:var(--blue-soft);color:var(--blue)}
.avatar{width:42px;height:42px;border-radius:50%;background:var(--brand-soft);color:var(--brand-ink);display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.avatar.lg{width:72px;height:72px;font-size:24px}
.stars{color:#d97706;display:inline-flex;align-items:center;gap:3px;font-weight:600;font-size:13px}
.stars .ic{width:14px;height:14px;fill:currentColor;stroke:none}
.price{font-size:19px;font-weight:700;color:var(--brand-ink)}
.price s{font-size:12.5px;color:var(--muted);font-weight:400;margin-inline-start:4px}
.quote{font-style:italic;color:#57534e;font-size:13.5px;margin:6px 0 0}
.note{display:flex;gap:8px;align-items:flex-start;background:#efece1;border-radius:12px;padding:10px 12px;font-size:12.5px;color:#57534e}
.note .ic{width:16px;height:16px;margin-top:1px;color:var(--brand)}
.note.warn{background:var(--amber-soft);color:#78350f}
.note.warn .ic{color:var(--amber)}

/* photos, cartes */
.thumbs{display:flex;gap:8px;flex-wrap:wrap}
.thumbs .t{position:relative;width:74px;height:74px;border-radius:12px;overflow:hidden;background:#e6e0d2}
.thumbs img{width:100%;height:100%;object-fit:cover;display:block}
.thumbs .t button{position:absolute;top:3px;inset-inline-end:3px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(0,0,0,.6);color:#fff;cursor:pointer;font-size:13px;line-height:1}
.add{width:74px;height:74px;border:2px dashed #cfc8b6;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:11px;cursor:pointer;background:transparent;font-family:inherit;gap:2px}
.gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.gallery img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;display:block}
.map{height:210px;border-radius:14px;overflow:hidden;border:1px solid var(--line);background:#e8e4d8;position:relative;z-index:1}
.map.sm{height:170px}
.nomap{display:flex;align-items:center;justify-content:center;height:100%;color:var(--muted);font-size:13px;padding:16px;text-align:center}

/* chat */
.chat{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:6px;min-height:200px}
.bubble{max-width:80%;padding:9px 12px;border-radius:16px;font-size:14px;word-wrap:break-word;background:#fff;border:1px solid var(--line);align-self:flex-start;border-end-start-radius:4px}
.bubble.me{align-self:flex-end;background:var(--brand);color:#fff;border-color:var(--brand);border-radius:16px;border-end-end-radius:4px}
.bubble time{display:block;font-size:10.5px;opacity:.65;margin-top:2px}
.composer{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);background:#fff;position:sticky;bottom:0}
.composer input{border-radius:99px}
.composer button{width:42px;height:42px;border-radius:50%;border:0;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none}

/* étoiles de notation */
.rate{display:flex;justify-content:center;gap:6px;margin:8px 0}
.rate button{border:0;background:none;cursor:pointer;color:#d6d0c2;padding:2px}
.rate button.on{color:#d97706}
.rate svg{width:34px;height:34px;fill:currentColor;stroke:none}
.tags{display:flex;flex-wrap:wrap;gap:6px}
.tags button{border:1px solid var(--brand-line);background:#fff;color:var(--brand-ink);border-radius:99px;padding:6px 11px;font:inherit;font-size:13px;cursor:pointer}
.tags button.on{background:var(--brand-soft);font-weight:600}

.steps{list-style:none;margin:0;padding:0}
.steps li{display:flex;gap:10px;align-items:flex-start;padding:5px 0;color:var(--muted)}
.steps li i{width:20px;height:20px;border-radius:50%;background:#e6e0d2;display:flex;align-items:center;justify-content:center;flex:none;color:#fff;font-style:normal}
.steps li i .ic{width:12px;height:12px;stroke-width:3}
.steps li.done{color:var(--text)}
.steps li.done i{background:var(--green)}
.switch{position:relative;width:50px;height:30px;flex:none}
.switch input{opacity:0;width:100%;height:100%;position:absolute;inset:0;margin:0;cursor:pointer;z-index:2}
.switch span{position:absolute;inset:0;background:#cfc8b6;border-radius:99px;transition:.2s}
.switch span::after{content:"";position:absolute;left:3px;top:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:.2s}
.switch input:checked+span{background:var(--brand)}
.switch input:checked+span::after{transform:translateX(20px)}
.empty{text-align:center;color:var(--muted);padding:40px 24px}
.empty .ic{width:36px;height:36px;margin-bottom:8px;opacity:.5}
.spin{width:16px;height:16px;border:2px solid var(--brand);border-top-color:transparent;border-radius:50%;animation:sp .8s linear infinite;display:inline-block;vertical-align:-3px}
@keyframes sp{to{transform:rotate(360deg)}}
.tabs{display:flex;border-bottom:1px solid var(--line);background:#fff}
.tabs button{flex:1;border:0;background:none;padding:13px;font:inherit;font-weight:600;color:var(--muted);border-bottom:3px solid transparent;cursor:pointer}
.tabs button.on{color:var(--brand-ink);border-bottom-color:var(--brand)}
.checks{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.checks label{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font-size:13.5px;cursor:pointer}
.checks input{width:auto}
#toast{position:fixed;left:50%;bottom:84px;transform:translate(-50%,20px);background:#1c1917;color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:.25s;z-index:999;max-width:90%;text-align:center}
#toast.show{opacity:1;transform:translate(-50%,0)}
.leaflet-container{font:inherit}

/* sécurité : fenêtre du bas, signalements, conditions */
[hidden]{display:none!important}
.sheet{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-end;justify-content:center}
.sheet-bg{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.sheet-body{position:relative;background:#fff;width:100%;max-width:480px;border-radius:20px 20px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom));max-height:88vh;overflow:auto}
.rep{display:inline-flex;align-items:center;gap:3px;border:0;background:none;color:var(--muted);font:inherit;font-size:11px;padding:2px 0;cursor:pointer;margin-top:3px}
.rep .ic{width:11px;height:11px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:13px;margin:14px 0 4px;line-height:1.4}
.check input{width:20px;height:20px;margin-top:1px;flex:none}
.linkrow{display:flex;align-items:center;gap:10px;padding:10px 0;border-top:1px solid var(--line);color:var(--text)}
.linkrow .ic{width:18px;height:18px;color:var(--muted)}
.btn.solid-danger{background:var(--red);border-color:var(--red);color:#fff}
.btn.solid-danger:hover{background:#991b1b}

/* assistant */
.botfab{position:fixed;bottom:calc(74px + env(safe-area-inset-bottom));right:max(14px, calc(50% - 226px));z-index:90;display:flex;align-items:center;gap:7px;border:0;background:var(--brand);color:#fff;padding:12px 16px;border-radius:99px;font:inherit;font-weight:600;font-size:14px;box-shadow:0 4px 14px rgba(0,0,0,.25);cursor:pointer}
.botfab:hover{background:var(--brand-2)}
.botfab .ic{width:20px;height:20px}
.sheet.full .sheet-body{padding:0;height:min(88vh,720px);display:flex;flex-direction:column;overflow:hidden}
.botwrap{display:flex;flex-direction:column;height:100%;min-height:0}
.bothead{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
.bothead .iconbtn{font-size:26px;line-height:1}
.botmsgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:8px;min-height:0;background:var(--bg)}
.bubble.bot{max-width:92%;line-height:1.5}
.botactions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 4px}
.chips button{border:1px solid var(--brand-line);background:#fff;color:var(--brand-ink);border-radius:99px;padding:7px 12px;font:inherit;font-size:13px;cursor:pointer}
.chips button:hover{background:var(--brand-soft)}
.typing{display:inline-flex;gap:4px;align-items:center;padding:12px 14px}
.typing i{width:7px;height:7px;border-radius:50%;background:#a8a29e;animation:blink 1s infinite ease-in-out}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes blink{0%,80%,100%{opacity:.25}40%{opacity:1}}
.has-fab #view{padding-bottom:64px}

/* négociation */
.nego{margin-top:8px;padding:8px 10px;border-radius:10px;background:var(--brand-soft);color:#7c2d12;font-size:13px;display:flex;gap:6px;align-items:center}
.nego .ic{width:15px;height:15px;flex:none}
.nego.ok{background:var(--green-soft);color:var(--green)}
.nego.wait{background:#f3efe4;color:#57534e}
.nego-card{border-color:var(--brand);border-width:2px}
.btns>.wide{flex:1.7;white-space:nowrap}

/* langue */
.langsel{width:auto;padding:5px 8px;border-radius:99px;border:0;background:rgba(255,255,255,.2);color:#fff;font-size:13px}
.langsel option{color:#1c1917}
.botlang{padding:8px 14px;font-size:12.5px;color:var(--muted);background:#f3efe4;border-bottom:1px solid var(--line)}
/* arabe : de droite à gauche */
[dir=rtl] .dirflip{transform:scaleX(-1)}
[dir=rtl] .botfab{right:auto;left:max(14px, calc(50% - 226px))}
[dir=rtl] .switch span::after{left:auto;right:3px}
[dir=rtl] .switch input:checked+span::after{transform:translateX(-20px)}
[dir=rtl] body{font-family:system-ui,-apple-system,"Segoe UI","Noto Sans Arabic",Tahoma,sans-serif}
[dir=rtl] ul{padding-left:0;padding-right:18px}

/* photo de profil */
.avatar{overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar.sm{width:28px;height:28px;font-size:11px}
.avatar-edit{position:relative;border:0;cursor:pointer;padding:0;overflow:visible;font:inherit;font-weight:700}
.avatar-edit img{border-radius:50%}
.avatar-cam{position:absolute;bottom:-2px;inset-inline-end:-2px;width:26px;height:26px;border-radius:50%;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;border:2px solid #fff}
.avatar-cam .ic{width:14px;height:14px}
.mini-av{width:26px;height:26px;border-radius:50%;object-fit:cover;vertical-align:middle;margin-inline-end:6px}

/* suivi en direct */
.pulse{width:10px;height:10px;border-radius:50%;background:#16a34a;flex:none;box-shadow:0 0 0 0 rgba(22,163,74,.6);animation:pulse 1.6s infinite}
@keyframes pulse{70%{box-shadow:0 0 0 9px rgba(22,163,74,0)}100%{box-shadow:0 0 0 0 rgba(22,163,74,0)}}
.trk-info{margin-top:8px;padding:10px 12px;border-radius:12px;background:#fff;border:1px solid var(--line)}
.trk-line{display:flex;gap:10px;align-items:flex-start}
.trk-line .ic{width:18px;height:18px;margin-top:2px;flex:none}
.trk-line.live .pulse{margin-top:5px}
.trk-line.ok{color:var(--green)}
.trk-line.warn{color:#78350f}
.trk-pin{width:38px;height:38px;border-radius:50%;background:var(--brand);color:#fff;border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;overflow:hidden}
.trk-pin img{width:100%;height:100%;object-fit:cover}
.trk-pin.stale{filter:grayscale(.7);opacity:.8}
.trk-pin-wrap{transition:transform 1.2s linear}
.leaflet-zoom-anim .trk-pin-wrap{transition:none}
.track-card{border:2px solid var(--brand)}
.trackbar{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:10px;padding:9px 14px;background:#fff7ed;border-bottom:2px solid var(--brand);font-size:13.5px;font-weight:600}
.trackbar a{color:#7c2d12}
.trackbar button{border:1px solid var(--brand);background:#fff;color:#7c2d12;border-radius:99px;padding:5px 12px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}

/* moyens de paiement */
.paygrid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.paychip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:start;border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 12px;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer;color:var(--text)}
.paychip small{font-size:11px;font-weight:500;color:var(--muted)}
.paychip.on{border-color:var(--brand);background:var(--brand-soft);box-shadow:inset 0 0 0 1px var(--brand)}
.paychip:disabled{opacity:.55;cursor:not-allowed;background:#f3efe4}
.payline{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin-top:8px}
.paytag{display:inline-block;font-size:11.5px;font-weight:600;padding:2px 8px;border-radius:99px;background:#f0ece0;color:#57534e}
.paytag.match{background:var(--green-soft);color:var(--green)}
.checks label.dim{opacity:.6}
