/* Styles de la carte ARCE Ceará */

*{box-sizing:border-box}body{margin:0;font:14px Arial,sans-serif}header{background:#173b56;color:white;padding:12px}main{display:grid;grid-template-columns:350px 1fr;height:calc(100vh - 42px)}aside{overflow:auto;padding:15px}#map{height:100%}input,select{width:100%;padding:9px;margin:7px 0 14px}li{margin:6px 0}#search,#lines{display:block}aside>label{display:block}.missing{color:#a44}.note{background:#f3f4f6;padding:10px;font-size:12px}@media(max-width:700px){
body.arce-mobile main{display:flex;flex-direction:column;height:auto}
body.arce-mobile aside{max-height:43vh}
body.arce-mobile #map{height:57vh}
}
body.arce-desktop main{display:grid;grid-template-columns:350px minmax(0,1fr);height:calc(100vh - 55px)}
body.arce-desktop aside{max-height:none;min-width:0}
body.arce-desktop #map{height:100%;min-width:0}
@media(max-width:700px){
body.arce-desktop{min-width:900px}
}
#arce-display-mode{padding:7px;cursor:pointer}
/* Sélecteur de langue compact sur smartphone */
@media(max-width:700px){
 #arce-language{
   gap:3px !important;
   flex-shrink:0;
 }
 #arce-language button{
   font-size:7px !important;
   padding:2px 3px !important;
   min-width:0 !important;
   min-height:0 !important;
   line-height:1.1 !important;
 }
}

/* ARCE : typographie compacte pour les deux modes sur smartphone */
@media(max-width:700px){
 body.arce-mobile, body.arce-desktop{
   font-size:8px;
 }
 body.arce-mobile header, body.arce-desktop header{
   font-size:10px;
   padding:6px;
 }
 body.arce-mobile aside, body.arce-desktop aside{
   font-size:8px;
   padding:7px;
 }
 body.arce-mobile aside input,
 body.arce-mobile aside select,
 body.arce-mobile aside textarea,
 body.arce-mobile aside button,
 body.arce-desktop aside input,
 body.arce-desktop aside select,
 body.arce-desktop aside textarea,
 body.arce-desktop aside button{
   font-size:9px;
   padding:5px;
 }
 body.arce-mobile .note, body.arce-desktop .note{
   font-size:8px;
 }
 body.arce-mobile #contrib-panel,
 body.arce-desktop #contrib-panel{
   font-size:8px;
 }
 body.arce-mobile #arce-display-mode,
 body.arce-desktop #arce-display-mode{
   font-size:9px;
   padding:5px;
 }
}

@media(max-width:700px){
 body.arce-desktop{
   font-size:7px;
 }
 body.arce-desktop header{
   font-size:8px;
   padding:6px;
 }
 body.arce-desktop aside{
   font-size:7px;
   padding:7px;
 }
 body.arce-desktop aside input,
 body.arce-desktop aside select,
 body.arce-desktop aside textarea,
 body.arce-desktop aside button{
   font-size:7px;
   padding:4px;
 }
 body.arce-desktop .note{
   font-size:7px;
   padding:5px;
 }
 body.arce-desktop #contrib-panel{
   font-size:7px;
   padding:6px !important;
 }
 body.arce-desktop #arce-display-mode{
   font-size:8px;
   padding:4px;
 }
}




#contrib-panel form > label {
  display:block;
  margin:12px 0 5px;
}
#contrib-panel input:not([type="checkbox"]):not([type="file"]),
#contrib-panel textarea {
  display:block;
  width:100%;
  box-sizing:border-box;
  padding:8px;
}
#contrib-panel textarea {
  min-height:85px;
  resize:vertical;
}
#contrib-panel form > p label {
  display:flex;
  align-items:flex-start;
  gap:8px;
  line-height:1.4;
}
#contrib-panel input[type="checkbox"] {
  flex-shrink:0;
  margin-top:3px;
}
#contrib-panel button {
  margin:6px 5px 6px 0;
  padding:8px;
  cursor:pointer;
}
#contrib-panel button:disabled {
  cursor:not-allowed;
}


/* ARCE mobile compact 20261106 */

/* Sélecteur conservé pour le JavaScript, mais invisible */
#lines,
aside > label:has(+ #lines) {
    display:none !important;
}

@media(max-width:700px) {

    body.arce-mobile {
        font-size:14px !important;
    }

    body.arce-mobile header {
        padding:5px 8px !important;
        font-size:12px !important;
    }

    body.arce-mobile main {
        display:flex !important;
        flex-direction:column !important;
        height:auto !important;
    }

    body.arce-mobile aside {
        padding:7px !important;
        max-height:32dvh !important;
        font-size:13px !important;
    }

    body.arce-mobile aside input,
    body.arce-mobile aside button {
        font-size:13px !important;
        padding:7px !important;
    }

    body.arce-mobile #map {
        height:68dvh !important;
        min-height:350px !important;
    }

    body.arce-mobile .note {
        font-size:11px !important;
    }

    body.arce-mobile #arce-language button {
        font-size:11px !important;
        padding:3px 5px !important;
    }
}

/* ARCE correction responsive 20261106 */

#arce-title,
#lines,
aside > label:has(+ #lines) {
    display:none !important;
}

@media(max-width:700px) {
    html, body {
        width:100%;
        max-width:100%;
        overflow-x:hidden;
    }

    body.arce-mobile header {
        display:flex !important;
        flex-wrap:wrap !important;
        justify-content:center !important;
        align-items:center !important;
        gap:6px !important;
        width:100%;
    }

    body.arce-mobile header > * {
        min-width:0;
        max-width:100%;
    }

    body.arce-mobile #arce-language {
        flex-wrap:wrap;
        justify-content:center;
    }

    body.arce-mobile main {
        display:flex !important;
        flex-direction:column !important;
        width:100% !important;
        height:auto !important;
    }

    body.arce-mobile aside {
        width:100%;
        max-height:35dvh !important;
        overflow-y:auto;
        overflow-x:hidden;
    }

    body.arce-mobile #search {
        width:100%;
        min-width:0;
    }

    body.arce-mobile #map {
        display:block;
        width:100% !important;
        min-width:0 !important;
        height:60dvh !important;
        min-height:300px !important;
        flex:none;
    }
}

/* ARCE fenetre contribution 20261106 */

/* Fenêtre indépendante du panneau de recherche */
#contrib-panel:not([hidden]) {
    display:block !important;
    position:fixed !important;
    z-index:100000 !important;
    top:50% !important;
    left:50% !important;
    transform:translate(-50%,-50%) !important;
    width:min(520px,calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100dvh - 30px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    background:white !important;
    color:#222 !important;
    border:1px solid #777 !important;
    border-radius:12px !important;
    padding:16px !important;
    box-shadow:0 0 0 100vmax rgba(0,0,0,.55),
               0 12px 35px rgba(0,0,0,.3) !important;
    font-size:14px !important;
}

#contrib-panel[hidden] {
    display:none !important;
}

#contrib-panel input:not([type="hidden"]),
#contrib-panel textarea {
    max-width:100%;
    font-size:16px !important;
}

#contrib-panel #contrib-close {
    position:sticky;
    bottom:0;
    background:#173b56;
    color:white;
    border:0;
    border-radius:6px;
    padding:10px 16px;
}

/* Bandeau compact sur smartphone */
@media(max-width:700px) {
    body.arce-mobile header {
        padding:3px 5px !important;
        gap:3px !important;
        justify-content:center !important;
    }

    body.arce-mobile #arce-reseau-general {
        min-height:0 !important;
        padding:3px 5px !important;
        font-size:10px !important;
    }

    body.arce-mobile #arce-display-mode {
        padding:3px 5px !important;
        font-size:10px !important;
    }

    body.arce-mobile #arce-language {
        gap:3px !important;
    }

    body.arce-mobile #arce-language button {
        font-size:10px !important;
        padding:2px 4px !important;
    }

    body.arce-mobile #contrib-panel {
        font-size:14px !important;
    }
}

/* ARCE bandeau deux lignes 20261106 */
@media(max-width:700px) {
    body.arce-mobile header {
        display:grid !important;
        grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
        gap:3px 5px !important;
        align-items:center !important;
        padding:4px 5px !important;
        width:100% !important;
    }

    body.arce-mobile #arce-reseau-general {
        grid-column:1 !important;
        grid-row:1 !important;
        width:100% !important;
        min-width:0 !important;
        min-height:0 !important;
        padding:3px 2px !important;
        font-size:9px !important;
        line-height:1.15 !important;
        white-space:normal !important;
    }

    body.arce-mobile #arce-display-mode {
        grid-column:2 !important;
        grid-row:1 !important;
        width:100% !important;
        min-width:0 !important;
        padding:3px 2px !important;
        font-size:9px !important;
        line-height:1.15 !important;
    }

    body.arce-mobile #arce-language {
        grid-column:1 / -1 !important;
        grid-row:2 !important;
        display:flex !important;
        justify-content:center !important;
        flex-wrap:nowrap !important;
        gap:4px !important;
        min-width:0 !important;
    }

    body.arce-mobile #arce-language button {
        font-size:10px !important;
        padding:2px 5px !important;
        line-height:1.1 !important;
        white-space:nowrap !important;
    }
}

/* ARCE recherche compacte 20261106 */
@media(max-width:700px) {

    body.arce-mobile aside {
        padding:4px 6px !important;
        max-height:none !important;
        overflow:visible !important;
    }

    body.arce-mobile aside > label {
        font-size:10px !important;
        line-height:1.1 !important;
        margin:0 0 3px !important;
    }

    body.arce-mobile #search {
        height:27px !important;
        padding:3px 6px !important;
        margin:0 0 5px !important;
        font-size:12px !important;
    }

    body.arce-mobile #all-lines,
    body.arce-mobile #contrib-open {
        display:block !important;
        width:100% !important;
        min-height:0 !important;
        height:27px !important;
        padding:3px 5px !important;
        margin:0 0 5px !important;
        font-size:11px !important;
        line-height:1.15 !important;
        white-space:nowrap !important;
    }

    body.arce-mobile #map {
        height:60dvh !important;
        min-height:300px !important;
    }
}

/* Fiche des étapes ARCE */
#arce-fiche-etapes[hidden] {
    display:none !important;
}

#arce-fiche-etapes {
    margin:5px 0;
    padding:6px;
    border:1px solid #aeb9c3;
    border-radius:6px;
    background:white;
}

#arce-fiche-etapes summary {
    cursor:pointer;
    font-size:12px;
    font-weight:bold;
}

#arce-fiche-etapes[open] {
    max-height:45dvh;
    overflow-y:auto;
}

#arce-fiche-etapes #stops {
    padding-left:20px;
}

/* Résultats de recherche ARCE */
#arce-resultats[hidden]{display:none!important}
#arce-resultats{
 position:relative;
 z-index:1000;
 max-height:180px;
 overflow-y:auto;
 background:white;
 border:1px solid #9baebb;
 border-radius:5px;
 margin:2px 0 5px;
}
#arce-resultats .arce-resultat{
 display:block;
 width:100%;
 padding:8px;
 text-align:left;
 background:white;
 color:#172b3b;
 border:0;
 border-bottom:1px solid #e1e6ea;
 white-space:normal;
 font-size:12px;
}
#arce-resultats .arce-resultat:focus,
#arce-resultats .arce-resultat:hover{
 background:#dcecf8;
}


/* Infobulles Leaflet compactes sur smartphone */
@media (max-width:700px) {
 .leaflet-popup-content-wrapper {
   max-width:calc(100vw - 50px) !important;
   border-radius:7px !important;
 }

 .leaflet-popup-content {
   width:auto !important;
   max-width:calc(100vw - 75px) !important;
   min-width:0 !important;
   margin:8px 12px !important;
   font-size:11px !important;
   line-height:1.3 !important;
   overflow-wrap:anywhere !important;
   white-space:normal !important;
 }

 .leaflet-popup-content * {
   max-width:100% !important;
   overflow-wrap:anywhere !important;
 }

 .leaflet-popup-close-button {
   width:26px !important;
   height:26px !important;
   font-size:20px !important;
   line-height:26px !important;
 }
}

/* Correction largeur des infobulles ARCE sur smartphone */
@media (max-width:700px) {
 .leaflet-popup-content-wrapper {
   width:min(260px, calc(100vw - 48px)) !important;
   max-width:calc(100vw - 48px) !important;
   box-sizing:border-box !important;
 }

 .leaflet-popup-content {
   width:auto !important;
   min-width:0 !important;
   max-width:none !important;
   margin:10px 24px 10px 10px !important;
   font-size:11px !important;
   line-height:1.35 !important;
   overflow-wrap:break-word !important;
   word-break:normal !important;
   white-space:normal !important;
 }

 .leaflet-popup-content * {
   word-break:normal !important;
   overflow-wrap:break-word !important;
 }

 .leaflet-popup-close-button {
   z-index:10 !important;
   top:2px !important;
   right:2px !important;
 }
}


/* ARCE_RESEAU_MOBILE_LISIBILITE */
body.arce-mobile #map .leaflet-overlay-pane
path[stroke="#1764a0"][stroke-opacity="0.12"] {
    stroke-width: 2px !important;
    stroke-opacity: 0.35 !important;
}
/* FIN_ARCE_RESEAU_MOBILE_LISIBILITE */

/* ARCE_ETIQUETTES_ZOOM */
.leaflet-tooltip.arce-etiquette-etape {
 background:#e8f5e9;
 color:#205c35;
 border:1px solid #8fbc9c;
 border-radius:3px;
 padding:2px 4px;
 font-size:10px;
 font-weight:500;
 box-shadow:none;
 pointer-events:none;
}
.leaflet-tooltip.arce-etiquette-etape::before {
 display:none;
}
/* FIN_ARCE_ETIQUETTES_ZOOM */

/* ARCE_ETIQUETTES_MOBILE_COMPACTES */
body.arce-mobile .leaflet-tooltip.arce-etiquette-etape {
    font-size:8px;
    line-height:1.1;
    padding:1px 2px;
    border-width:1px;
    border-radius:2px;
    white-space:nowrap;
}
/* FIN_ARCE_ETIQUETTES_MOBILE_COMPACTES */


/* Avertissement visible uniquement pendant l'envoi d'une photo */
#contrib-result.arce-envoi-actif {
  color: #dc2626;
  font-size: 1.13rem;
  font-weight: 700;
  text-align: center;
  animation: arce-clignotement 1.2s ease-in-out infinite;
}
@keyframes arce-clignotement {
  0%, 100% { opacity: 1; }
  50% { opacity: .28; }
}
@media (prefers-reduced-motion: reduce) {
  #contrib-result.arce-envoi-actif { animation: none; }
}


/* ARCE formulaire photo mobile compact 20261108 */
@media (max-width:700px) {
  body.arce-mobile #contrib-panel form > label {
    margin:5px 0 2px;
    line-height:1.2;
  }

  body.arce-mobile #contrib-panel input:not([type="checkbox"]):not([type="file"]),
  body.arce-mobile #contrib-panel textarea {
    padding:5px 7px;
    font-size:14px;
  }

  body.arce-mobile #contrib-panel textarea {
    min-height:48px;
    height:48px;
  }

  body.arce-mobile #contrib-panel button {
    margin:3px 0;
  }

  body.arce-mobile #contrib-panel #contrib-result {
    margin:5px 0;
  }
}


/* FOND_CEARA_ARCE_20261108 */
body.arce-mobile aside,
body.arce-desktop aside {
    background-image:
        linear-gradient(
            rgba(255,255,255,0.78),
            rgba(255,255,255,0.78)
        ),
        url("/arce/static/fond_ceara_arce.webp");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
}

/* ARCE fond Ceará masqué sur smartphone */
@media (max-width:700px) {
    body.arce-mobile aside {
        background-image:none !important;
    }
}
