:root{font-family:system-ui,-apple-system,sans-serif;color:#172b2b;background:#f6f7f4}
*{box-sizing:border-box}
body{margin:0}
header{background:#173d39;color:white;padding:20px max(20px,calc((100vw - 1080px)/2));display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.brand{flex:none;display:block;line-height:0}
.logo{width:96px;height:96px;object-fit:contain;display:block}
.brand-text{flex:1 1 260px;min-width:0}
header small{letter-spacing:.15em}
h1{margin:6px 0;font-size:clamp(28px,5vw,49px)}
header p{color:#dce9e4;margin:6px 0 0}
.session-box{flex:0 1 auto;font-size:14px;color:#dce9e4;text-align:right}
.session-box button{margin-left:8px;padding:7px 12px}
main{max-width:1080px;margin:35px auto;padding:0 22px}
nav{display:flex;gap:10px;flex-wrap:wrap;margin:22px 0}
button{font:inherit;border:1px solid #b5c8c2;border-radius:9px;padding:11px 16px;background:white;cursor:pointer;color:#172b2b}
button:disabled{cursor:not-allowed;opacity:.65}
button.active,button.primary{background:#173d39;color:white;border-color:#173d39}
button.link{border:0;background:none;color:#195d50;text-decoration:underline;padding:11px 6px}
button.danger{border-color:#b54a3a;color:#8f2f22}
.panel{background:white;border:1px solid #e0e5df;border-radius:15px;padding:25px;margin-bottom:20px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:15px}
.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0 15px}
.tag{color:#346a60;font-size:13px;font-weight:700}
.muted{color:#61716c;font-weight:400}
input,select,textarea{font:inherit;width:100%;padding:12px;border:1px solid #cbd6d0;border-radius:8px;margin:6px 0 14px}
label{font-weight:600;font-size:14px;display:block}
label.check{display:flex;gap:10px;align-items:flex-start;font-weight:400;margin-bottom:16px}
label.check input{width:auto;margin:3px 0 0}
.notice{border-left:4px solid #b98a35;padding:12px;background:#fff8e9}
.result{min-height:1.2em;margin:12px 0 0}
.result.ok{color:#1d6b4f}
.result.err{color:#a3321f}
.hidden{display:none!important}
.badge{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.04em;border-radius:999px;padding:3px 10px;background:#eef2ef;color:#173d39}
.badge.pending{background:#fff1d6;color:#7a5414}
.badge.active{background:#dff2e8;color:#1d6b4f}
.badge.rejected{background:#fbe3df;color:#8f2f22}
.badge.suspended{background:#ece5f5;color:#553d7a}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-bottom:16px}
.stats div{border:1px solid #e0e5df;border-radius:12px;padding:12px;text-align:center}
.stats strong{display:block;font-size:26px}
.toolbar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.toolbar label{flex:0 1 240px}
.toolbar button{margin-bottom:14px}
.users{display:grid;gap:12px;margin-bottom:24px}
.user{border:1px solid #e0e5df;border-radius:12px;padding:14px 16px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:center}
.user .who{min-width:0;overflow-wrap:anywhere}
.user .actions{display:flex;gap:8px;flex-wrap:wrap}
.user .actions button{padding:8px 12px;font-size:14px}
.reset-url{width:100%;font-size:13px}
.table-wrap{overflow-x:auto;margin-bottom:24px}
table{border-collapse:collapse;width:100%;font-size:14px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid #e0e5df;vertical-align:top}
.future{margin-top:10px}
footer{max-width:1080px;margin:35px auto;padding:20px;color:#667}
a{color:#195d50}
code{background:#eef2ef;padding:1px 5px;border-radius:4px}
.doc{max-width:820px}
.doc h2{margin-top:28px}

/* ---------- V1.2.0 : brevets, carte et profil ---------- */
.small{font-size:13px}
a.button{display:inline-block;font:inherit;border:1px solid #b5c8c2;border-radius:9px;padding:11px 16px;background:white;color:#172b2b;text-decoration:none}
a.button.primary{background:#173d39;color:white;border-color:#173d39}
a.button.disabled{opacity:.6;pointer-events:none}
button.primary-outline{border-color:#173d39;color:#173d39;font-weight:600}
.actions-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:14px}
.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:0 14px;margin-top:16px}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.card{display:flex;flex-direction:column;border:1px solid #e0e5df;border-radius:14px;overflow:hidden;text-decoration:none;color:inherit;background:white;transition:border-color .15s,box-shadow .15s}
.card:hover,.card:focus-visible{border-color:#7fa59b;box-shadow:0 4px 16px rgba(23,61,57,.1)}
.card-preview{background:#eef3ef;aspect-ratio:5/3;display:flex}
.card-body{padding:14px 16px 16px}
.card-body h3{margin:6px 0 4px;font-size:18px}
.card-body p{margin:0 0 10px}
.card-facts{display:flex;gap:16px;font-size:14px;color:#61716c}
.card-facts strong{color:#172b2b;font-size:16px}
.route-preview{width:100%;height:100%}
.preview-line{fill:none;stroke:#c2410c;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.preview-start{fill:#1d6b4f;stroke:white;stroke-width:1.5}
.preview-end{fill:#173d39;stroke:white;stroke-width:1.5}
.preview-empty{fill:#61716c;font-size:12px}
.crumbs{margin:0 0 14px}
.brevet-title{font-size:clamp(24px,4vw,34px);margin:6px 0}
.facts{margin:18px 0 6px}
.facts strong{font-size:22px}
.map{height:460px;border-radius:12px;border:1px solid #e0e5df;margin:8px 0 18px;z-index:0}
.profile-box{position:relative;margin:6px 0 10px}
.profile-svg{width:100%}
.profile{display:block;width:100%;height:auto;touch-action:pan-y;cursor:crosshair;user-select:none}
.profile .grid{stroke:#e5ebe7;stroke-width:1}
.profile .axis{fill:#61716c;font-size:11px}
.profile .area{fill:#173d39;fill-opacity:.12}
.profile .line{fill:none;stroke:#173d39;stroke-width:1.8;stroke-linejoin:round}
.profile .cp-line{stroke:#c2410c;stroke-width:1;stroke-dasharray:3 3}
.profile .cp-label{fill:#c2410c;font-size:11px;font-weight:700}
.profile .guide{stroke:#172b2b;stroke-width:1}
.profile .guide-dot{fill:#173d39;stroke:white;stroke-width:2}
.profile .hidden{display:none}
.profile-tip{position:absolute;top:0;transform:translateX(8px);background:#173d39;color:white;font-size:12px;padding:4px 8px;border-radius:6px;pointer-events:none;white-space:nowrap}
.profile-tip.right{transform:translateX(calc(-100% - 8px))}
.profile-empty{padding:20px 0}
.rich p{margin:0 0 12px;line-height:1.55}
.rich ul{margin:0 0 12px;padding-left:22px;line-height:1.55}
.rich h4{margin:14px 0 6px}
.cp-icon span,.dot-icon span{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:50%;font:700 13px system-ui,sans-serif;color:white;background:#173d39;border:2px solid white;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.cp-icon.editable span{background:#c2410c;cursor:grab}
.dot-icon.start span{background:#1d6b4f}
.dot-icon.end span{background:#172b2b}
.leaflet-container{font:inherit}
/* Administration des brevets */
.panel.subtle{background:#fbfcfa}
.editor-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:flex-start}
.editor-head h3{margin:8px 0 4px;font-size:24px}
.editor-head .actions{display:flex;gap:8px;flex-wrap:wrap}
button.back{padding-left:0}
fieldset.measures{border:1px solid #e0e5df;border-radius:10px;padding:12px 14px 4px;margin:0 0 16px}
fieldset.measures legend{font-weight:700;font-size:14px;padding:0 6px}
fieldset.measures .check{margin-bottom:4px}
fieldset.measures p{margin:-8px 0 10px}
.upload{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.upload input{flex:1 1 240px;margin:0}
.analysis{border:1px solid #cbd6d0;border-radius:12px;padding:14px 16px;margin:14px 0;background:white}
.analysis h4{margin:0 0 4px}
.facts-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 18px;margin:12px 0}
.facts-list dt{font-size:12px;color:#61716c}
.facts-list dd{margin:0;font-weight:600}
.warnings{background:#fff8e9;border-left:4px solid #b98a35;margin:10px 0;padding:10px 10px 10px 30px}
.checkpoints{display:grid;gap:8px;margin-bottom:6px}
.small-btn{padding:6px 10px;font-size:13px;justify-self:start}
.cp-row{display:grid;grid-template-columns:34px minmax(160px,2fr) 110px minmax(160px,2fr) auto;gap:10px;align-items:center;border:1px solid #e0e5df;border-radius:10px;padding:8px 10px;background:white}
.cp-row.warn{border-color:#d9a54a}
.cp-row label{font-size:12px;font-weight:600}
.cp-row input{margin:2px 0 0;padding:8px}
.cp-num{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#c2410c;color:white;font-weight:700;font-size:13px}
.cp-warn{color:#8a5a0b;font-weight:600}
.cp-actions{display:flex;gap:6px}
.cp-actions button{padding:6px 10px}
.badge.b-draft{background:#eef2ef;color:#3d4f4a}
.badge.b-published{background:#dff2e8;color:#1d6b4f;margin-left:6px}
.badge.b-archived{background:#ece5f5;color:#553d7a}
#g-table button.link{padding:0;text-align:left;font-weight:600}
@media (max-width:720px){
  .cp-row{grid-template-columns:34px 1fr 100px}
  .cp-row .cp-info{grid-column:2 / -1}
  .cp-row .cp-actions{grid-column:2 / -1}
}
@media (max-width:560px){
  .map{height:340px}
  .facts strong{font-size:19px}
  .actions-row > *{flex:1 1 100%;text-align:center}
}
@media (max-width:560px){
  header{gap:14px}
  .logo{width:72px;height:72px}
  .session-box{text-align:left;width:100%}
  .panel{padding:18px}
}

.history-list{list-style:none;padding:0;display:grid;gap:14px}.history-entry{padding:18px;border:1px solid #dbe3df;border-radius:10px;background:white}.history-entry p{margin:7px 0}.history-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:12px}.history-actions a,.history-actions button{font-size:14px}
