/* CAPTR · page Territoires couverts */
.territoires-page main{padding-bottom:0}
.terr-intro{padding-block:clamp(40px,6vw,76px) clamp(32px,4vw,52px)}
.terr-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin:30px 0 0;max-width:760px;border:1px solid var(--line-dark);border-radius:14px;overflow:hidden;background:var(--line-dark)}
.terr-stats div{padding:16px 18px;background:var(--canvas-2)}
.terr-stats dt{font-size:13px;color:var(--on-dark-soft)}
.terr-stats dd{margin:4px 0 0;font:600 clamp(28px,3.4vw,40px)/1 var(--font-display);letter-spacing:-.03em;color:#fff}
.terr-stats div:nth-child(2) dd{color:var(--cyan)}
.page-intro .terr-measured-note{margin-top:18px;font-size:14px;color:var(--on-dark-soft)}

.terr-tools{position:sticky;top:var(--header-h);z-index:5;background:rgba(242,246,247,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.terr-tools-inner{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding-block:12px}
.terr-filter{display:flex;flex-wrap:wrap;gap:6px}
.terr-filter button{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:6px 14px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--ink);font-size:14px;font-weight:600}
.terr-filter button span{font:500 12px var(--font-mono);color:var(--muted)}
.terr-filter button[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff}
.terr-filter button[aria-pressed=true] span{color:var(--cyan)}
.terr-filter button:focus-visible,.terr-search input:focus-visible,.terr-open:focus-visible,.pt:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.terr-search{flex:1 1 260px;max-width:420px}
.terr-search input{width:100%;min-height:40px;padding:8px 14px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);color:var(--ink)}
.terr-result{flex-basis:100%;margin:0;font-size:13px;color:var(--muted)}
.terr-result:empty{display:none}
.terr-legend{margin-top:28px}
.terr-legend li{flex-wrap:wrap;min-width:0}
.chip-excluded{background:#eef1f3;color:#5d6a72}.chip-excluded::before{border-radius:2px;transform:rotate(45deg)}

.terr-region{padding-block:clamp(48px,7vw,88px) 0}
.terr-region-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:12px 32px;margin-bottom:22px}
.terr-region-head h2{flex:1 1 520px;font-size:clamp(28px,3.8vw,48px)}
.terr-region-count{font:500 13px var(--font-mono);color:var(--muted)}

.terr-map{margin:0;border-radius:18px;overflow:hidden;background:var(--canvas);box-shadow:0 1px 0 var(--line-dark) inset}
.terr-map-scroll{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
.terr-map svg{display:block;width:100%;height:auto;max-height:78vh}
#carte-atlantique svg,#carte-indien svg{max-width:820px;margin-inline:auto}
.terr-map figcaption{padding:10px 16px 12px;border-top:1px solid var(--line-dark);font-size:13px;color:var(--on-dark-soft);background:var(--canvas-2)}
.map-sea{fill:#071722}
.map-grid{fill:none;stroke:#13303e;stroke-width:.6}
.map-land{fill:#1b3d4d;stroke:#2c5a6c;stroke-width:.5;fill-rule:evenodd}
.map-label{font:500 12.5px var(--font-body);fill:#8fa9b4;paint-order:stroke;stroke:#071722;stroke-width:3px;stroke-linejoin:round;pointer-events:none}
.map-label.is-measured{font-weight:700;font-size:14px;fill:#fff}
.pt{cursor:pointer;outline:none}
.pt-hit{fill:transparent}
.pt-mark{transition:transform .15s ease;transform-box:fill-box;transform-origin:center}
.pt-measured .pt-mark{fill:var(--cyan);stroke:#071722;stroke-width:2}
.pt-ready .pt-mark{fill:#071722;stroke:var(--cyan);stroke-width:1.8}
.pt-partial .pt-mark,.pt-none .pt-mark{fill:#071722;stroke:#7f9aa6;stroke-width:1.4}
.pt-excluded .pt-mark{fill:none;stroke:#7f9aa6;stroke-width:1.6}
.pt:hover .pt-mark,.pt:focus-visible .pt-mark,.pt.is-hot .pt-mark{transform:scale(1.6)}
.pt.is-hot .pt-mark{stroke:#fff}
.pt.is-dim{opacity:.18}

.terr-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px;margin:20px 0 0;padding:0;list-style:none}
.terr{position:relative;display:grid;grid-template-columns:1fr auto;align-content:start;gap:6px 12px;padding:16px 16px 15px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.terr[data-status=measured]{border-color:#9fd9cc;box-shadow:inset 3px 0 0 var(--cyan-deep)}
.terr.is-hot{border-color:var(--cyan-deep)}
.terr[hidden]{display:none}
.terr-open{display:flex;flex-direction:column;gap:2px;min-width:0;text-decoration:none;color:var(--ink);border-radius:6px}
.terr-name{font:600 18px/1.25 var(--font-display);letter-spacing:-.015em}
.terr-open:hover .terr-name{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}
.terr-scope{font-size:13px;line-height:1.45;color:var(--muted)}
.terr>.chip{align-self:start}
.terr-fact{grid-column:1/-1;font-size:14px;line-height:1.55;color:var(--muted)}
.terr-children{grid-column:1/-1;display:grid;gap:8px;margin:8px 0 0;padding:10px 0 0;border-top:1px dashed var(--line);list-style:none}
.terr-children .terr{padding:10px 12px;border-radius:10px;background:#f7fafb}
.terr-children .terr-name{font-size:15px}
.terr-children .terr-fact{font-size:13px}

.terr-sources{margin-top:clamp(56px,8vw,104px);padding-block:clamp(48px,7vw,88px);background:var(--surface);border-top:1px solid var(--line)}
.terr-sources h2{font-size:clamp(28px,3.8vw,48px)}
.terr-sources-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:28px 36px;margin-top:32px}
.terr-sources-grid h3{font-size:17px;margin-bottom:8px}
.terr-sources-grid p{font-size:15px;line-height:1.65;color:var(--muted)}
.terr-cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:36px}

.terr-dialog{width:min(920px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:20px;background:var(--surface);color:var(--ink);box-shadow:0 30px 80px rgba(3,20,28,.45);overflow:auto}
.terr-dialog::backdrop{background:rgba(4,16,23,.62);backdrop-filter:blur(3px)}
.terr-dialog[open]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.terr-dialog-close{position:absolute;top:12px;right:12px;z-index:2;margin:0}
.terr-dialog-close button{min-height:38px;padding:6px 14px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--ink);font-size:14px;font-weight:600}
.terr-dialog-map{display:grid;place-items:center;min-height:300px;background:#071722}
.terr-dialog-map svg{display:block;width:100%;height:auto;max-height:70dvh}
.terr-dialog-map .map-land{fill:#2b6377;stroke:#2b6377;stroke-width:.7;stroke-linejoin:round}
.terr-dialog-map .map-marker{fill:var(--cyan);stroke:#071722;stroke-width:2.5}
.terr-dialog-map .map-ring{fill:none;stroke:var(--cyan);stroke-width:1.5;opacity:.5}
.terr-dialog-map p{padding:24px;color:var(--on-dark-soft);font-size:14px}
.terr-dialog-body{padding:56px 28px 28px}
.terr-dialog-region{font:600 14px var(--font-display);color:var(--cyan-deep)}
.terr-dialog-body h2{margin:6px 0 4px;font-size:clamp(28px,3.4vw,38px)}
.terr-dialog-scope{font-size:14px;color:var(--muted);margin-bottom:12px}
.terr-dialog-fact{margin-top:12px;font-size:15px;line-height:1.6}
.terr-dialog-facts{display:grid;gap:8px;margin:18px 0 0;padding:14px 0 0;border-top:1px solid var(--line);font-size:14px}
.terr-dialog-facts div{display:flex;justify-content:space-between;gap:16px}
.terr-dialog-facts dt{color:var(--muted)}
.terr-dialog-facts dd{margin:0;text-align:right;font-weight:600}
.terr-dialog-links{display:grid;gap:8px;margin-top:20px}
.terr-dialog-links .btn{width:100%}

@media (max-width:760px){
  .terr-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .terr-tools{top:0;position:relative}
  .terr-map svg{width:760px;max-width:none;max-height:none}
  #carte-mediterranee svg,#carte-pacifique svg{width:880px}
  #carte-atlantique svg,#carte-indien svg{width:620px;max-width:none}
  .terr-list{grid-template-columns:1fr}
  .terr-dialog[open]{grid-template-columns:1fr}
  .terr-dialog-map{min-height:220px}
  .terr-dialog-map svg{max-height:42dvh}
  .terr-dialog-body{padding:20px 18px 22px}
}
@media (prefers-reduced-motion:reduce){.pt-mark{transition:none}}
.map-leader{fill:none;stroke:#5fdcc6;stroke-width:1;opacity:.7}
