/* Mes territoires — v522, template validé sans bloc promotionnel */
body.citizen-territories-page .citizen-body{background:#fff!important;padding-top:22px!important}
body.citizen-territories-page .citizen-body>.container{max-width:1260px!important;padding-left:20px!important;padding-right:20px!important}
body.citizen-territories-page .citizen-main{max-width:none!important}
.territory-v3-page{max-width:1180px;margin:0 auto;font-family:'Inter',Arial,sans-serif;color:#1b242d}

/* En-tête — mêmes tailles que Mes projets */
.territory-v3-head{padding:4px 0 19px;margin:0 0 22px}
.territory-v3-head .kicker{margin:0 0 8px;color:#d65020;font:750 12px/1.3 'Inter',Arial,sans-serif;letter-spacing:.12em;text-transform:uppercase}
.territory-v3-head h2{margin:8px 0;color:#1b242d;font:760 clamp(30px,3.1vw,37px)/1.1 'Inter',Arial,sans-serif;letter-spacing:-.03em}
.territory-v3-head p{max-width:760px;margin:0;color:#5d6770;font:400 15px/1.5 'Inter',Arial,sans-serif}

/* Bandeau vert */
.territory-v3-stats{display:grid;grid-template-columns:repeat(4,1fr);margin:0 0 20px;padding:18px 24px;border-radius:7px;background:#195B6E;color:#fff}
.territory-v3-stats>div{display:grid;grid-template-columns:50px 38px minmax(0,1fr);align-items:center;gap:10px;min-height:68px;padding:0 24px;border-right:1px solid rgba(255,255,255,.32)}
.territory-v3-stats>div:first-child{padding-left:0}.territory-v3-stats>div:last-child{padding-right:0;border-right:0}
.territory-v3-stats>div>span{display:grid;place-items:center;width:44px;height:44px;border:1px solid rgba(255,255,255,.48);border-radius:50%}
.territory-v3-icon{display:block;width:20px;height:20px}
.territory-v3-stats strong{font:800 29px/1 'Inter',Arial,sans-serif}
.territory-v3-stats p{display:grid;gap:1px;margin:0;font:650 12px/1.18 'Inter',Arial,sans-serif}
.territory-v3-stats small{font-size:12px;font-weight:500}

/* Barre de contrôle */
.territory-v3-toolbar{display:grid;grid-template-columns:auto minmax(240px,1fr) 170px auto;gap:10px;align-items:center;margin:0 0 16px}
.territory-v3-tabs{display:flex;gap:6px;align-items:center}
.territory-v3-tabs button{min-height:38px;padding:0 13px;border:1px solid transparent;border-radius:20px;background:#f1f4f4;color:#43555f;font:650 13px/1 'Inter',Arial,sans-serif;cursor:pointer;white-space:nowrap}
.territory-v3-tabs button.active{background:#195B6E;color:#fff}
.territory-v3-search{display:flex;align-items:center;gap:8px;height:42px;padding:0 12px;border:1px solid #d8e1e3;border-radius:6px;background:#fff;color:#195B6E}
.territory-v3-search .territory-v3-icon{width:18px;height:18px}
.territory-v3-search input{width:100%;border:0;outline:0;background:transparent;color:#195B6E;font:500 13px 'Inter',Arial,sans-serif}
.territory-v3-sort{display:flex;align-items:center;gap:7px;height:42px;padding:0 10px;border:1px solid #d8e1e3;border-radius:6px;background:#fff;color:#195B6E}
.territory-v3-sort .territory-v3-icon{width:17px;height:17px}
.territory-v3-sort select{min-width:0;width:100%;border:0;outline:0;background:transparent;color:#195B6E;font:650 13px 'Inter',Arial,sans-serif}
.territory-v3-add{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:0 14px;border-radius:6px;background:#195B6E;color:#fff!important;text-decoration:none!important;font:700 13px/1 'Inter',Arial,sans-serif;white-space:nowrap}
.territory-v3-add .territory-v3-icon{width:17px;height:17px}

/* Grille + colonne droite */
.territory-v3-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}
.territory-v3-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-width:0}
.territory-v3-card{overflow:hidden;border:1px solid #dfe5e6;border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(13,36,48,.04);transition:transform .16s,border-color .16s,box-shadow .16s}
.territory-v3-card[hidden]{display:none!important}
.territory-v3-card:hover,.territory-v3-highlight{transform:translateY(-2px);border-color:#BDD6DE;box-shadow:0 7px 20px rgba(13,69,69,.09)}
.territory-v3-photo{position:relative;height:128px;background:#edf2f1}
.territory-v3-photo img{display:block;width:100%;height:100%;object-fit:cover}
.territory-v3-photo>span{position:absolute;right:8px;top:8px;display:inline-flex;align-items:center;min-height:25px;padding:0 9px;border-radius:13px;background:rgba(255,255,255,.92);color:#195B6E;font:650 11px/1 'Inter',Arial,sans-serif}
.territory-v3-card-body{padding:12px}
.territory-v3-card-title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.territory-v3-card-title h3{margin:0 0 4px!important;color:#1b242d!important;font:760 18px/1.25 'Inter',Arial,sans-serif!important;letter-spacing:-.03em!important}
.territory-v3-card-title p{margin:0!important;color:#61727c!important;font:500 12px/1.3 'Inter',Arial,sans-serif!important}
.territory-v3-follow{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:31px;padding:0 9px;border:1px solid #BDD6DE;border-radius:16px;background:#fff;color:#195B6E;font:700 12px/1 'Inter',Arial,sans-serif;cursor:pointer;white-space:nowrap}
.territory-v3-follow .territory-v3-icon{width:14px;height:14px}
.territory-v3-follow.active{border-color:#BDD6DE;background:#E7F0F3;color:#195B6E}
.territory-v3-desc{min-height:52px;margin:9px 0 10px!important;color:#5f6d76!important;font:400 12px/1.45 'Inter',Arial,sans-serif!important}
.territory-v3-counts{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;padding:10px 0;border-top:1px solid #edf0f1}
.territory-v3-counts span{display:grid;grid-template-columns:18px auto;grid-template-rows:auto auto;column-gap:4px;align-items:center;color:#195B6E}
.territory-v3-counts .territory-v3-icon{grid-row:1/3;width:16px;height:16px}
.territory-v3-counts b{font:750 12px/1 'Inter',Arial,sans-serif}
.territory-v3-counts small{margin-top:3px;color:#71808a;font:500 10px/1 'Inter',Arial,sans-serif;white-space:nowrap}
.territory-v3-view{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;min-height:38px;border:0;border-radius:5px;background:#E7F0F3;color:#195B6E;font:700 13px/1 'Inter',Arial,sans-serif;cursor:pointer}
.territory-v3-view .territory-v3-icon{width:15px;height:15px}

/* Carte */
.territory-v3-side{display:grid;gap:14px;position:sticky;top:92px}
.territory-v3-map-card,.territory-v3-news{border:1px solid #dfe5e6;border-radius:8px;background:#fff;overflow:hidden}
.territory-v3-side-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 13px;border-bottom:1px solid #edf0f1}
.territory-v3-side-head h3{margin:0!important;color:#1b242d!important;font:760 15px/1.2 'Inter',Arial,sans-serif!important}
.territory-v3-side-head a,.territory-v3-side-head button{padding:0;border:0;background:transparent;color:#195B6E!important;text-decoration:none!important;font:700 11px/1.2 'Inter',Arial,sans-serif;cursor:pointer}
.territory-v3-map{position:relative;height:278px;overflow:hidden;background-color:#E7F0F3;background-image:linear-gradient(rgba(238,248,245,.28),rgba(238,248,245,.28)),url("https://upload.wikimedia.org/wikipedia/commons/d/d3/C%C3%B4te_d%27Ivoire-map-blank.png");background-repeat:no-repeat;background-position:center;background-size:contain}
.territory-v3-map:before{content:none}
.territory-v3-country{position:absolute;left:48%;top:48%;z-index:2;padding:3px 6px;border-radius:5px;background:rgba(255,255,255,.82);color:#195B6E;font-size:14px;transform:translate(-50%,-50%)}
.territory-v3-map-pin{position:absolute;z-index:3;display:flex;align-items:center;gap:4px;padding:3px 6px 3px 3px;border:0;border-radius:14px;background:#fff;color:#195B6E;font:650 9px/1 'Inter',Arial,sans-serif;box-shadow:0 2px 7px rgba(0,0,0,.13);cursor:pointer;transform:translate(-50%,-50%)}
.territory-v3-map-pin>span{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#233b66;color:#fff}
.territory-v3-map-pin.followed>span{background:#195B6E}
.territory-v3-map-pin .territory-v3-icon{width:12px;height:12px}
.territory-v3-map-legend{position:absolute;left:10px;right:10px;bottom:9px;z-index:4;display:flex;gap:12px;padding:7px 9px;border-radius:6px;background:rgba(255,255,255,.92);color:#195B6E;font:500 10px/1 'Inter',Arial,sans-serif}
.territory-v3-map-legend span{display:flex;align-items:center;gap:5px}
.territory-v3-map-legend i{width:9px;height:9px;border-radius:50%;background:#233b66}.territory-v3-map-legend i.followed{background:#195B6E}
.territory-v3-map.expanded{height:420px}

/* Actualités */
.territory-v3-news-list{display:grid}
.territory-v3-news-list>a{display:grid;grid-template-columns:64px minmax(0,1fr);gap:9px;min-height:82px;padding:10px 12px;border-bottom:1px solid #edf0f1;color:inherit!important;text-decoration:none!important}
.territory-v3-news-list>a:last-child{border-bottom:0}
.territory-v3-news-list>a:hover{background:#F2F8FA}
.territory-v3-news-list img{width:64px;height:60px;border-radius:5px;object-fit:cover}
.territory-v3-news-list span{display:grid;align-content:center;min-width:0}
.territory-v3-news-list small{margin-bottom:3px;color:#195B6E;font:650 10px/1.2 'Inter',Arial,sans-serif}
.territory-v3-news-list strong{display:-webkit-box;overflow:hidden;color:#195B6E;font:700 12px/1.3 'Inter',Arial,sans-serif;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.territory-v3-news-list time{margin-top:4px;color:#7a8890;font:500 10px/1 'Inter',Arial,sans-serif}
.territory-v3-news-empty{padding:18px;color:#667780;font-size:12px}

/* Ajout */
.territory-v3-add-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,1fr);gap:24px;align-items:center;margin-top:18px;padding:17px;border:1px solid #dfe7e6;border-radius:7px;background:#F2F8FA}
.territory-v3-add-panel h3{margin:0 0 5px!important;color:#195B6E!important;font:760 15px/1.2 'Inter',Arial,sans-serif!important}
.territory-v3-add-panel p{margin:0!important;color:#687881!important;font:400 12px/1.45 'Inter',Arial,sans-serif!important}
.territory-v3-suggestions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}
.territory-v3-suggestions button{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:0 11px;border:1px solid #cddcdb;border-radius:18px;background:#fff;color:#195B6E;font:700 12px/1 'Inter',Arial,sans-serif;cursor:pointer}
.territory-v3-suggestions .territory-v3-icon{width:14px;height:14px}
.territory-v3-filter-empty{padding:20px;text-align:center;color:#687881;font-size:13px}

/* Tablette */
@media(max-width:1050px){
  .territory-v3-toolbar{grid-template-columns:auto minmax(220px,1fr) 165px}
  .territory-v3-add{grid-column:1/-1;justify-self:end}
  .territory-v3-layout{grid-template-columns:minmax(0,1fr) 310px}
  .territory-v3-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:800px){
  .territory-v3-layout{display:block}
  .territory-v3-side{position:static;margin-top:16px}
  .territory-v3-side{grid-template-columns:1fr 1fr}
}
/* Mobile */
@media(max-width:650px){
  body.citizen-territories-page .citizen-body{padding-top:14px!important}
  body.citizen-territories-page .citizen-body>.container{padding-left:18px!important;padding-right:18px!important}
  .territory-v3-head{padding:4px 0 16px;margin-bottom:18px}
  .territory-v3-head .kicker{font-size:12px}
  .territory-v3-head h2{font-size:29px;line-height:1.1;margin:8px 0}
  .territory-v3-head p{font-size:15px;line-height:1.5}
  .territory-v3-stats{grid-template-columns:repeat(2,1fr);margin:0 -18px 18px;padding:10px 18px;border-radius:0}
  .territory-v3-stats>div{grid-template-columns:38px 32px minmax(0,1fr);gap:7px;min-height:64px;padding:8px 10px;border-right:0;border-bottom:1px solid rgba(255,255,255,.2)}
  .territory-v3-stats>div:nth-child(odd){border-right:1px solid rgba(255,255,255,.2)}
  .territory-v3-stats>div:nth-last-child(-n+2){border-bottom:0}
  .territory-v3-stats>div>span{width:34px;height:34px}
  .territory-v3-stats .territory-v3-icon{width:17px;height:17px}
  .territory-v3-stats strong{font-size:24px}
  .territory-v3-stats p,.territory-v3-stats small{font-size:11px}
  .territory-v3-toolbar{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
  .territory-v3-toolbar::-webkit-scrollbar{display:none}
  .territory-v3-tabs{display:contents}
  .territory-v3-tabs button{flex:0 0 auto;min-height:42px;font-size:13px}
  .territory-v3-search{flex:0 0 240px;height:44px}
  .territory-v3-search input{font-size:13px}
  .territory-v3-sort{flex:0 0 150px;height:44px}
  .territory-v3-sort select{font-size:13px}
  .territory-v3-add{flex:0 0 auto;min-height:44px;font-size:13px}
  .territory-v3-grid{grid-template-columns:1fr;gap:12px}
  .territory-v3-photo{height:150px}
  .territory-v3-card-title h3{font-size:15px!important}
  .territory-v3-card-title p,.territory-v3-desc{font-size:12px!important}
  .territory-v3-follow{font-size:12px}
  .territory-v3-view{font-size:13px}
  .territory-v3-side{grid-template-columns:1fr}
  .territory-v3-map{height:260px}
  .territory-v3-side-head h3{font-size:15px!important}
  .territory-v3-news-list strong{font-size:12px}
  .territory-v3-add-panel{grid-template-columns:1fr;gap:14px;margin-top:16px}
  .territory-v3-add-panel h3{font-size:15px!important}
  .territory-v3-add-panel p{font-size:12px!important}
  .territory-v3-suggestions{justify-content:flex-start}
  .territory-v3-suggestions button{font-size:12px;min-height:40px}
}