:root {
  color-scheme: dark;
  --bg: #0d1a36;
  --bg-2: #13244a;
  --fg: #e3eaf8;
  --muted: #8fa0c4;
  --line: #24365f;
  --bar: #1b2c55;
  --osm: #00d8ff;
  --existant: #9aa7c7;
  --construction: #7c9cff;
  --instruction: #ffc940;
  --annonce: #ff5fc8;
  --site_cle_en_main: #ff8a3d;
  --opposition: #ff4d5e;
  --recours: #5be38a;
  --warn-bg: #2a2a3c;
  --warn-line: #e0a93a;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#map { position: absolute; inset: 0; }
a { color: #7fd8ff; }
.maplibregl-ctrl-group, .maplibregl-ctrl-attrib { background: var(--bg-2) !important; color: var(--muted); }
.maplibregl-ctrl-group button { filter: invert(1) hue-rotate(180deg); }
.maplibregl-ctrl-attrib a { color: var(--fg); }
.maplibregl-ctrl-scale { background: rgb(13 26 54 / .7); color: var(--fg); border-color: var(--muted); }
code { font-size: 12px; background: var(--bar); padding: 0 3px; border-radius: 3px; }

#panel { position: absolute; top: 12px; left: 12px; z-index: 2;
  width: min(390px, calc(100vw - 32px)); max-height: calc(100vh - 24px); display: flex; }
#legend { background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgb(0 0 0 / .45); width: 100%; display: flex; flex-direction: column;
  max-height: 100%; }
#legend summary { cursor: pointer; padding: 10px 14px; background: var(--bg-2); border-radius: 10px; list-style: none; display: flex;
  flex-direction: column; }
#legend summary::-webkit-details-marker { display: none; }
#legend summary .title { font-weight: 650; font-size: 15px; }
#legend summary .title::after { content: " ▸"; color: var(--muted); }
#legend[open] summary .title::after { content: " ▾"; }
#legend summary .sub { color: var(--muted); font-size: 12.5px; }
#legend .content { overflow-y: auto; padding: 0 14px 14px; border-top: 1px solid var(--line); }

section { padding-top: 10px; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: 6px 0 6px; }
.big { font-size: 26px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
label.layer { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
label.layer small { color: var(--muted); }
.sw { width: 12px; height: 12px; border-radius: 50%; background: var(--c); display: inline-block;
  flex: none; border: 1px solid rgb(0 0 0 / .2); }
.sw.ring { background: transparent; border: 2.5px solid #ff4d5e; }
.slider { display: block; margin: 6px 0; font-size: 13px; }
.slider input { width: 100%; }

table.bars { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.bars td { padding: 2px 0; vertical-align: middle; }
table.bars td.l { width: 46%; padding-right: 6px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 0; }
table.bars td.b { width: 34%; }
table.bars td.v { width: 20%; text-align: right; padding-left: 6px; white-space: nowrap; }
table.bars .bar { height: 8px; border-radius: 4px; background: var(--c, var(--osm)); min-width: 2px; }
table.bars .track { background: var(--bar); border-radius: 4px; }

ul.conf { padding-left: 18px; margin: 6px 0; }
#conf-list details { border: 1px solid var(--line); border-radius: 6px; margin: 4px 0; }
#conf-list summary { cursor: pointer; padding: 4px 8px; font-weight: 600; font-size: 13px; }
#conf-list ul { margin: 0; padding: 0 8px 6px 22px; font-size: 12.5px; }
#conf-list li { cursor: pointer; }
#conf-list li:hover { text-decoration: underline; }
.warn { background: var(--warn-bg); border-left: 3px solid var(--warn-line); padding: 8px 10px;
  border-radius: 4px; font-size: 12.5px; margin-top: 8px; }

.maplibregl-popup-content { background: var(--bg); color: var(--fg); max-width: 360px;
  max-height: 60vh; overflow-y: auto; font-size: 13px; }
.maplibregl-popup-tip { border-top-color: var(--bg) !important; border-bottom-color: var(--bg) !important; }
.pop h3 { margin: 0 0 4px; font-size: 14.5px; }
.pop .badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 8px;
  color: #fff; background: var(--c); margin-bottom: 4px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 4px 0; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop pre { background: var(--bar); padding: 6px; border-radius: 4px; white-space: pre-wrap;
  font-size: 11.5px; margin: 4px 0; }
.pop .desc { white-space: pre-wrap; font-size: 12px; color: var(--muted); max-height: 140px;
  overflow-y: auto; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.pop .links a { margin-right: 10px; }
.pop button { font: inherit; font-size: 12px; cursor: pointer; }

@media (max-width: 520px) {
  #panel { top: auto; bottom: 16px; left: 16px; max-height: 70vh; }
}

input[type=range] { accent-color: var(--osm); }
input[type=checkbox] { accent-color: var(--osm); }
#legend[open] summary { border-radius: 10px 10px 0 0; }

  border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; }
nav.zones a.on { background: var(--bar); color: var(--fg); border-color: var(--osm); }
body.no-nuage .nuage-only { display: none; }
h2 small { text-transform: none; letter-spacing: 0; }

#changes-list details { border: 1px solid var(--line); border-radius: 6px; margin: 4px 0; }
#changes-list summary { cursor: pointer; padding: 4px 8px; font-size: 13px; }
#changes-list ul { margin: 0; padding: 0 8px 6px 18px; font-size: 12.5px; list-style: none; }
#changes-list li { cursor: pointer; padding: 1px 0; }
#changes-list li:hover { text-decoration: underline; }
.chg { display: inline-block; width: 14px; font-weight: 700; }
.chg.cree { color: var(--recours); }
.chg.modifie { color: var(--instruction); }
.chg.supprime { color: var(--opposition); }
