body { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
#exag { display: flex; gap: 4px; flex-wrap: wrap; }
#help {
  margin: 0;
  padding: 0 0 0 16px;
  color: var(--text-secondary);
  font-size: 12px;
}
#help[hidden] { display: none; }
#stage { flex: 1; position: relative; min-width: 0; min-height: 0; background: var(--map-well); border-radius: 16px; overflow: hidden; }
#view { width: 100%; height: 100%; display: block; touch-action: none; }
#nez {
  position: absolute;
  left: 50%;
  top: 62%;
  z-index: 3;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
#nez::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -10px;
  width: 2px;
  height: 8px;
  background: rgba(255, 255, 255, 0.9);
}
#nez[hidden] { display: none; }
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.layer-list label {
  background: var(--bg-page);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}
#tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute;
  transform: translate(-50%, -130%);
  background: rgba(19, 19, 19, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
.tag.nav { background: #003366; }
.tag.papi { background: #9f2d12; }
.tag.approche { background: #b45309; }
.tag.fissure { background: #7f1d1d; }
#zone-carte {
  position: absolute;
  left: 12px;
  bottom: 118px;
  z-index: 8;
  margin: 0;
  max-width: min(420px, calc(100% - 24px));
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#zone-carte[hidden] { display: none; }
#zone-carte p { margin: 0; font-size: 13px; white-space: pre-wrap; line-height: 1.35; }
#batiment {
  position: absolute;
  left: 12px;
  bottom: 58px;
  z-index: 8;
  margin: 0;
  max-width: min(420px, calc(100% - 24px));
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#batiment[hidden] { display: none; }
#actif {
  position: absolute;
  left: 12px;
  bottom: 96px;
  z-index: 8;
  margin: 0;
  max-width: min(420px, calc(100% - 24px));
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#actif[hidden] { display: none; }
#actif p { margin: 0; font-size: 13px; line-height: 1.35; }
#batiment p { margin: 0; font-size: 13px; white-space: pre-wrap; line-height: 1.35; }
#hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 6;
  margin: 0;
  max-width: min(520px, calc(100% - 300px));
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
}
#feux-legende {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  margin: 0;
  max-width: min(420px, calc(100% - 24px));
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 4px 8px;
  font-size: 12px;
  pointer-events: none;
}
#feux-legende[hidden] { display: none; }
#present-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
#present-bar[hidden] { display: none; }
#arcal-3d {
  position: absolute;
  left: auto;
  right: 12px;
  bottom: 36px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: min(250px, calc(100% - 24px));
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
#arcal-3d #arcal-state { margin: 0; font-size: 12px; color: var(--text-secondary); }
#arcal-3d #arcal-state.on { color: var(--color-primary); font-weight: 600; }
#arcal-3d .radio-mic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 64px;
  padding: 2px 4px 4px;
  background: var(--bg-page);
}
#arcal-3d .radio-mic.keyed .ptt { fill: #F59E0B; }
#arcal-3d .radio-mic.live { border-color: var(--color-primary); }
#arcal-3d #arcal-clicks { font-size: 10px; color: var(--text-muted); }
#arcal-3d button.on { outline: 2px solid var(--color-accent); }
#present-bar button.on { outline: 2px solid var(--color-accent); }
body.presentation header,
body.presentation #status,
body.presentation #drawer,
body.presentation #feux-legende,
body.presentation #tags,
body.presentation #maille-legende,
body.presentation #credit { display: none; }
#maille-legende {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 4px 8px;
  font-size: 12px;
}
#maille-legende[hidden] { display: none; }
#maille-legende i {
  width: 112px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1e59b8, #2e9e8c, #e8c447, #b83829);
}
#credit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  margin: 0;
  color: #f8fafc;
  font-size: 11px;
  text-shadow: 0 1px 2px #131313;
}
#grue, #pluie, #hauteur, #conformite, #chantier {
  position: static;
  width: auto;
  max-height: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#grue[hidden] { display: none; }
.grue-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grue-head strong { font-size: 14px; font-weight: 600; }
#grue label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
#grue-hint { margin: 0; font-size: 12px; color: var(--text-secondary); }
#grue details summary { cursor: pointer; font-size: 12px; color: var(--text-secondary); }
#grue details label { margin-top: 6px; }
#grue-result { margin: 0; font-size: 13px; white-space: pre-wrap; color: var(--text-primary); }
#grue-result.perce { color: var(--color-danger); font-weight: 600; }
#grue-result.ok { color: var(--color-success); }
#grue-result.serre { color: #8a5a12; font-weight: 600; }
#grue-list { list-style: none; margin: 0; padding: 0; max-height: 160px; overflow: auto; }
#grue-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
#grue-list button { padding: 2px 8px; min-height: 28px; }
#hauteur { overflow: visible; }
#hauteur[hidden] { display: none; }
#hauteur-note { margin: 0; font-size: 12px; color: var(--text-secondary); }
#hauteur-legende { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
#hauteur-legende li { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.3; }
#hauteur-legende .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
#hauteur-legende .bleu { background: #2f7de1; }
#hauteur-legende .orange { background: #e07a1f; }
#hauteur-legende .jaune { background: #e6b325; }
#hauteur-legende .rouge { background: #d64545; }
#hauteur-sens { margin: 0; font-size: 12px; color: var(--text-secondary); }
#conformite {
  font-size: 12px;
  line-height: 1.35;
}
#conformite[hidden] { display: none; }
#conformite strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
#conformite p { margin: 0 0 6px; color: var(--text-secondary); }
#conformite ul { margin: 0; padding-left: 16px; }
#conformite li { margin: 0 0 4px; }
#hauteur .grue-head,
#hauteur-note,
#hauteur-legende,
#hauteur-sens { flex-shrink: 0; }
#hauteur-list { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 1 1 auto; }
#hauteur-list li { border-top: 1px solid var(--border); }
#hauteur-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text-primary);
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  min-height: 28px;
  font-size: 12px;
}
#hauteur-list li.perce button { color: var(--color-danger); font-weight: 600; }
#pluie { color: var(--text-primary); }
#pluie[hidden] { display: none; }
#pluie-note,
#pluie-result { margin: 0; font-size: 12px; line-height: 1.35; }
#pluie-note[hidden] { display: none; }
#pluie-note { color: var(--text-secondary); }
#pluie-result { font-size: 13px; white-space: pre-wrap; }
#pluie-mm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#pluie-mm label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
#pluie-mm input { width: 72px; }
#pluie-piste { margin: 0; font-size: 12px; color: var(--text-secondary); }
#pluie-bac-aide,
#pluie-bac-note { margin: 0; font-size: 12px; line-height: 1.35; color: var(--text-secondary); }
#pluie-bac,
#pluie-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#pluie-bac label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
#pluie-vit { width: 88px; }
.tag.perce { background: #9f2d2d; }
.tag.serre { background: #8a5a12; }
#feux-note, #chantier-note, #chantier-use { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.35; }
#feux-details summary { cursor: pointer; color: var(--text-primary); font-weight: 600; }
#feux-details p { margin: 6px 0 0; }
#chantier-list, #chantier-saved, #eau-list { list-style: none; margin: 0; padding: 0; }
#chantier-list li, #chantier-saved li, #eau-list li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
@media (max-width: 800px) {
  #stage { min-height: 52vh; }
  .exag-note { display: none; }
  #exag { flex-wrap: nowrap; }
  #exag button { flex: 1; min-width: 0; padding-inline: 4px; }
  #feux-legende { top: 8px; left: 8px; right: 8px; max-width: none; }
  #maille-legende { top: 52px; right: 8px; }
  #maille-legende i { width: 72px; }
  #hauteur-legende { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  #arcal-3d {
    top: 58px;
    right: 8px;
    bottom: auto;
    left: auto;
    max-width: min(220px, 72vw);
  }
  #hud {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    z-index: 6;
  }
  #actif, #batiment, #zone-carte {
    left: 8px;
    right: 8px;
    max-width: none;
    z-index: 8;
  }
  #batiment { bottom: 64px; }
  #actif { bottom: 64px; }
  #zone-carte { bottom: 148px; }
  #credit { display: none; }
}
