* { box-sizing: border-box; }
:root {
  --bg: #333333;
  --bg-soft: #3b3b3b;
  --panel: rgba(49, 49, 49, 0.96);
  --panel-2: rgba(57, 57, 57, 0.96);
  --line: rgba(255,255,255,0.085);
  --text: #f6f6f3;
  --muted: #cfd2d4;
  --muted-2: rgba(255,255,255,0.6);
  --accent: #97af1e;
  --accent-soft: #c6df4d;
  --earth: #c39a52;
  --earth-soft: #e2c898;
  --earth-dark: #4a381d;
  --shadow: 0 18px 42px rgba(0,0,0,0.28);
  --shadow-soft: 0 10px 24px rgba(0,0,0,0.22);
  --radius: 22px;
}
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: #dce99a; text-decoration: none; }
a:hover { color: #f4fad7; }
body { overflow: hidden; }
.is-hidden { display: none !important; }
#app {
  height: 100%;
  display: grid;
  grid-template-columns: 382px 1fr 330px;
}
.sidebar {
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(151,175,30,0.08), transparent 26%),
    linear-gradient(180deg, rgba(51,51,51,0.99), rgba(43,43,43,0.985));
}
.left-sidebar { border-right: 1px solid var(--line); }
.right-sidebar { border-left: 1px solid var(--line); }
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.brand-panel {
  background:
    radial-gradient(circle at top right, rgba(198,223,77,0.14), transparent 30%),
    linear-gradient(155deg, rgba(60,60,60,0.99), rgba(46,46,46,0.98));
  border-color: rgba(198,223,77,0.18);
}
.topline {
  display: inline-flex;
  margin-bottom: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
}
.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
h1 {
  margin: 0;
  font-size: 33px;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.subtitle {
  margin: 8px 0 0;
  color: #ececec;
  font-size: 14px;
  line-height: 1.45;
}
.brand-mark {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 1px solid rgba(198,223,77,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.brand-mark img {
  width: 44px;
  height: 44px;
  display: block;
}
.intro,
.small-note {
  font-size: 13px;
  line-height: 1.58;
  color: var(--muted);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.stat-card {
  border-radius: 18px;
  padding: 12px 12px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 4px;
}
.stat-card.emphasis {
  background: linear-gradient(180deg, rgba(195,154,82,0.18), rgba(195,154,82,0.08));
  border-color: rgba(195,154,82,0.28);
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8f8ef;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
h2 {
  margin: 0;
  font-size: 15px;
  color: #fafaf8;
}
h3 {
  margin: 0;
  font-size: 18px;
  color: #fafaf4;
}
.chip,
.status-pill,
.status-subpill,
.layer-badge,
.layer-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.chip,
.layer-badge,
.layer-order {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: #ededed;
}
.layer-badge {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.layer-order {
  min-height: 24px;
  padding: 4px 8px;
  color: var(--muted);
}
.layer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.segmented-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: #efefef;
  border-radius: 999px;
  min-height: 42px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.segmented-btn:hover { transform: translateY(-1px); }
.segmented-btn.is-active {
  background: rgba(151,175,30,0.16);
  border-color: rgba(198,223,77,0.3);
  color: #f5f9db;
}
.narrative-panel {
  background: linear-gradient(180deg, rgba(56,56,56,0.98), rgba(47,47,47,0.98));
}
.timeline-list {
  display: grid;
  gap: 10px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.timeline-item.emphasis {
  background: linear-gradient(180deg, rgba(195,154,82,0.14), rgba(195,154,82,0.07));
  border-color: rgba(195,154,82,0.22);
}
.timeline-year {
  height: fit-content;
  border-radius: 14px;
  padding: 8px 8px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--earth-soft);
}
.timeline-item h3 {
  font-size: 14px;
  margin-bottom: 5px;
}
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.group-panel {
  background: linear-gradient(180deg, rgba(57,57,57,0.98), rgba(48,48,48,0.98));
  border-color: rgba(198,223,77,0.14);
}
.layer-card {
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  padding: 11px 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.layer-card + .layer-card { margin-top: 10px; }
.emphasis-card {
  background: linear-gradient(180deg, rgba(195,154,82,0.16), rgba(195,154,82,0.08));
  border-color: rgba(195,154,82,0.24);
}
.layer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #fafafa;
}
input[type="checkbox"] { accent-color: var(--accent); }
.slider-wrap { margin-top: 10px; }
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid #fff;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid #fff;
  cursor: pointer;
}
.vector-card .color-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.vector-card .color-dot:hover {
  transform: translateY(-1px);
  border-color: rgba(198,223,77,0.18);
}
.color-dot span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: block;
  border: 1px solid rgba(255,255,255,0.32);
}
.color-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.06);
}
.color-panel.is-collapsed { display: none; }
.color-panel input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
}
.color-label {
  font-size: 12px;
  color: #e8e8e8;
}
.compact-panel {
  background: linear-gradient(180deg, rgba(54,54,54,0.98), rgba(46,46,46,0.98));
}
.meta-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.source-list li + li { margin-top: 6px; }
.source-panel {
  padding: 0;
  overflow: hidden;
}
.source-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
}
.source-panel summary::-webkit-details-marker { display: none; }
.source-panel[open] summary {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.source-panel .meta-list {
  padding: 14px 16px 16px 34px;
}
.map-area {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(151,175,30,0.08), transparent 26%),
    linear-gradient(180deg, #323232, #2c2c2c);
}
.map-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.18;
  pointer-events: none;
}
.map-topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.status-stack {
  display: grid;
  gap: 7px;
  pointer-events: auto;
}
.status-pill {
  color: #eff7cc;
  border: 1px solid rgba(198,223,77,0.24);
  background: rgba(50,50,50,0.86);
  backdrop-filter: blur(8px);
  justify-self: start;
}
.status-subpill {
  justify-self: start;
  min-height: 24px;
  padding: 4px 10px;
  color: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(47,47,47,0.82);
  font-weight: 600;
}
.floating-action {
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(47,47,47,0.92);
  color: #f3f3f3;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.map-shell {
  position: absolute;
  inset: 0;
}
.map-view {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.map-view.is-visible {
  visibility: visible;
  opacity: 1;
}
.map-legend-overlay {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 950;
  min-width: 240px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(41,41,41,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.legend-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 10px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #f0f0ed;
}
.legend-row + .legend-row { margin-top: 8px; }
.legend-symbol,
.legend-swatch {
  display: inline-block;
  flex: 0 0 auto;
}
.legend-lieu {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--earth);
  border: 2px solid var(--earth-dark);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}
.legend-cross {
  position: relative;
  width: 14px;
  height: 14px;
}
.legend-cross::before,
.legend-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #0d0d0d;
  transform: translate(-50%, -50%);
}
.legend-cross::before { width: 2px; height: 14px; }
.legend-cross::after { width: 14px; height: 2px; }
.legend-swatch {
  width: 18px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
}
.legend-raster-1704 { background: rgba(245, 158, 11, 0.58); }
.legend-raster-1804 { background: rgba(56, 189, 248, 0.58); }
.three-d-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(620px, calc(100% - 40px));
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(44,44,44,0.94);
  color: #f6f6f6;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
  z-index: 1200;
  line-height: 1.55;
}
.three-d-fallback.is-hidden { display: none; }
.selected-place-panel {
  background: linear-gradient(180deg, rgba(56,56,56,0.98), rgba(47,47,47,0.98));
}
.selected-empty {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
.selected-place-card {
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(195,154,82,0.16), rgba(195,154,82,0.08));
  border: 1px solid rgba(195,154,82,0.24);
}
.selected-place-card.is-hidden { display: none; }
.selected-place-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f0d9ab;
}
.selected-place-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.2;
}
.selected-place-meta {
  margin: 0;
  display: grid;
  gap: 10px;
}
.selected-place-meta div {
  display: grid;
  gap: 2px;
}
.selected-place-meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.62);
}
.selected-place-meta dd {
  margin: 0;
  font-size: 13px;
  color: #fff8e5;
}
.places-panel {
  height: calc(100% - 2px);
  display: flex;
  flex-direction: column;
}
input[type="search"] {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}
input[type="search"]:focus {
  border-color: rgba(198,223,77,0.28);
  box-shadow: 0 0 0 3px rgba(198,223,77,0.08);
}
.places-list {
  margin-top: 10px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}
.place-item {
  width: 100%;
  appearance: none;
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  padding: 12px 12px 11px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.place-item:hover {
  transform: translateY(-1px);
  border-color: rgba(198,223,77,0.18);
  background: rgba(151,175,30,0.08);
}
.place-item.is-selected {
  border-color: rgba(195,154,82,0.34);
  background: rgba(195,154,82,0.16);
}
.place-name {
  font-size: 14px;
  color: #f8f8f8;
}
.place-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.place-empty {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 13px;
}
.place-tooltip {
  background: rgba(40,40,40,0.95);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px 10px;
}
.place-popup .leaflet-popup-content-wrapper,
.maplibregl-popup-content {
  background: rgba(45,45,45,0.96);
  color: #f5f5f5;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}
.popup-card {
  font-size: 13px;
  line-height: 1.5;
}
.popup-card strong { color: #fff6db; }
.calage-icon {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cross-color, #111111);
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  opacity: var(--cross-opacity, 1);
  text-shadow: 0 1px 0 rgba(255,255,255,0.16);
}
.leaflet-container,
.maplibregl-map { background: #282828; }
.leaflet-tooltip.place-tooltip::before,
.leaflet-tooltip.place-tooltip::after { display: none; }
@media (max-width: 1440px) {
  #app { grid-template-columns: 360px 1fr 308px; }
}
@media (max-width: 1180px) {
  body { overflow: auto; }
  #app {
    min-height: 100%;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 62vh) auto auto;
  }
  .left-sidebar,
  .right-sidebar {
    border: none;
    border-bottom: 1px solid var(--line);
  }
  .map-area { min-height: 520px; }
  .map-legend-overlay { left: 18px; right: auto; bottom: 18px; }
}

/* Mise à niveau publiable : ergonomie compacte, pile de couches stricte, symboles sobres */
#app { grid-template-columns: 340px 1fr 292px; }
.sidebar { padding: 12px; }
.panel { border-radius: 18px; padding: 13px; margin-bottom: 10px; }
.compact-brand .topline { margin-bottom: 9px; font-size: 10px; letter-spacing: 0.11em; }
.compact-brand h1 { font-size: 29px; }
.compact-brand .subtitle { font-size: 13px; line-height: 1.35; }
.compact-brand .intro { margin: 10px 0 0; font-size: 12.2px; line-height: 1.48; }
.compact-brand .brand-mark { width: 54px; height: 54px; }
.compact-brand .brand-mark img { width: 38px; height: 38px; }
.compact-stats { gap: 7px; margin-top: 10px; }
.compact-stats .stat-card { padding: 9px 8px; border-radius: 14px; }
.compact-stats .stat-value { font-size: 18px; }
.compact-stats .stat-label { font-size: 10px; }
.compact-panel-ui .panel-title-row { margin-bottom: 9px; }
.orientation-buttons { margin-top: 8px; grid-template-columns: 1.4fr 0.8fr; }
.segmented-btn { min-height: 36px; font-size: 12.5px; }
.layer-stack-panel { background: linear-gradient(180deg, rgba(55,55,55,0.98), rgba(46,46,46,0.98)); }
.stack-note { margin: -2px 0 10px; color: var(--muted); font-size: 11.8px; line-height: 1.45; }
.layer-group {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.025);
}
.layer-group + .layer-group { margin-top: 8px; }
.layer-group summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: #f4f4ef;
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}
.layer-group summary::-webkit-details-marker { display: none; }
.layer-group:not([open]) summary { border-bottom: none; }
.group-index {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f5f9dc;
  background: rgba(151,175,30,0.18);
  border: 1px solid rgba(198,223,77,0.22);
  font-size: 11px;
}
.depth-label {
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.compact-layer {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 9px 10px 10px;
  background: rgba(255,255,255,0.018);
}
.compact-layer + .compact-layer { margin-top: 0; border-top: 1px solid rgba(255,255,255,0.055); }
.compact-layer .toggle-label { font-size: 12.8px; gap: 8px; }
.compact-layer .layer-badge,
.compact-layer .layer-order { min-height: 21px; padding: 3px 7px; font-size: 9px; }
.compact-layer .slider-wrap { margin-top: 7px; }
.compact-layer input[type="range"] { height: 3px; }
.compact-layer input[type="range"]::-webkit-slider-thumb { width: 13px; height: 13px; }
.compact-layer input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; }
.compact-layer .color-dot { width: 24px; height: 24px; }
.color-dot span { width: 11px; height: 11px; }
.color-panel { margin-top: 7px; padding: 7px 9px; border-radius: 11px; }
.compact-source .source-block { padding: 0 13px 13px; }
.compact-source h3 { font-size: 12px; margin: 10px 0 6px; color: #fff5dc; }
.compact-source .meta-list { padding-left: 17px; font-size: 11.8px; line-height: 1.45; }
.source-panel summary { padding: 13px; }
.map-legend-overlay { min-width: 218px; padding: 12px 13px 11px; }

.place-archaeo-marker-wrapper,
.calage-marker-wrapper { background: transparent; border: none; }
.place-archaeo-marker {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% 50% 50% 18%;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--place-color, #c39a52) 88%, #2e2615 12%);
  border: 2px solid rgba(45,36,19,0.92);
  box-shadow: 0 2px 8px rgba(0,0,0,0.34), 0 0 0 2px rgba(255,255,255,0.08);
  opacity: var(--place-opacity, 1);
}
.place-archaeo-core {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 2px;
  transform: rotate(-45deg);
  background: rgba(255,248,232,0.92);
  box-shadow: inset 0 0 0 1px rgba(74,56,29,0.32);
}
.place-archaeo-marker.is-hover {
  width: 22px;
  height: 22px;
  border-color: rgba(255,248,225,0.92);
  box-shadow: 0 3px 12px rgba(0,0,0,0.4), 0 0 0 3px rgba(198,223,77,0.15);
}
.place-archaeo-marker.is-selected {
  width: 24px;
  height: 24px;
  background: #fff8e8;
  border-color: var(--place-color, #c39a52);
  box-shadow: 0 4px 16px rgba(0,0,0,0.46), 0 0 0 4px rgba(195,154,82,0.2);
}
.place-archaeo-marker.is-selected .place-archaeo-core { background: var(--place-color, #c39a52); }
.calage-target {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.7px solid var(--calage-color, #111);
  background: rgba(255,255,255,0.22);
  opacity: var(--calage-opacity, 0.95);
  box-shadow: 0 1px 3px rgba(0,0,0,0.32);
}
.calage-target span {
  width: 3.5px;
  height: 3.5px;
  border-radius: 999px;
  display: block;
  background: var(--calage-color, #111);
}
.legend-lieu {
  border-radius: 50% 50% 50% 18%;
  transform: rotate(45deg);
  background: var(--earth);
}
.legend-target {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #111;
  background: rgba(255,255,255,0.2);
}
.legend-target::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #111;
}
@media (max-width: 1440px) {
  #app { grid-template-columns: 318px 1fr 270px; }
  .sidebar { padding: 10px; }
  .panel { padding: 11px; }
  .right-sidebar .small-note { display: none; }
  .places-list { gap: 6px; }
  .place-item { padding: 10px; border-radius: 13px; }
  .place-name { font-size: 13px; }
  .place-sub { font-size: 11px; }
}

/* V2 · mise en scène mer → terre, ergonomie compacte, marqueurs écran-fixes */
#app { grid-template-columns: 318px 1fr 286px; }
.sidebar { padding: 10px; }
.panel { padding: 11px; margin-bottom: 8px; border-radius: 16px; }
.compact-brand .intro { font-size: 11.8px; line-height: 1.38; }
.compact-stats { margin-top: 8px; }
.compact-stats .stat-card { padding: 7px 8px; }
.brand-footer { margin-top: 9px; padding-top: 8px; }
.panel-title-row { margin-bottom: 8px; }
h2 { font-size: 13.5px; }
h3 { font-size: 16px; }
.stack-note { margin: -3px 0 8px; font-size: 11px; line-height: 1.34; }
.layer-group { border-radius: 13px; }
.layer-group + .layer-group { margin-top: 7px; }
.layer-group summary { padding: 7px 8px; grid-template-columns: 22px 1fr auto; gap: 7px; font-size: 12.6px; }
.group-index { width: 19px; height: 19px; font-size: 10px; }
.depth-label { font-size: 9px; }
.compact-layer { padding: 7px 8px 8px; }
.compact-layer .layer-main { gap: 6px; }
.compact-layer .toggle-label { font-size: 12px; line-height: 1.2; }
.compact-layer .slider-wrap { margin-top: 5px; }
.compact-layer .layer-badge,
.compact-layer .layer-order { min-height: 18px; padding: 2px 6px; font-size: 8.5px; }
.layer-actions { gap: 5px; }
.compact-layer .color-dot { width: 20px; height: 20px; }
.color-dot span { width: 9px; height: 9px; }
.color-panel { margin-top: 5px; padding: 5px 7px; font-size: 10.5px; }
.compact-source .source-block { padding: 0 10px 10px; }
.source-panel summary { padding: 10px; }
.compact-source .meta-list { font-size: 11px; line-height: 1.38; }
.right-sidebar .panel { padding: 11px; }
.right-sidebar h2 { line-height: 1.15; }
.selected-empty, .small-note { font-size: 11.3px; line-height: 1.35; }
.selected-place-card { padding: 10px; }
.selected-place-kicker { font-size: 10px; letter-spacing: .08em; }
.selected-place-meta { gap: 6px; }
.places-list { gap: 5px; }
.place-item { padding: 8px 9px; border-radius: 11px; }
.place-name { font-size: 12.4px; }
.place-sub { font-size: 10.5px; }

.map-topbar { top: 12px; left: 12px; right: auto; align-items: flex-start; justify-content: flex-start; }
.map-controls-left { display: flex; align-items: flex-start; gap: 8px; pointer-events: auto; }
.view-toolbar {
  min-width: 336px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background: rgba(43,43,43,0.90);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  padding: 7px;
  display: grid;
  gap: 6px;
  pointer-events: auto;
}
.view-toolbar-line { display: flex; align-items: center; gap: 6px; }
.view-toolbar-line.compact-buttons { align-items: stretch; }
.mini-segmented { display: flex; gap: 5px; grid-template-columns: none; }
.mini-segmented .segmented-btn { min-height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 999px; white-space: nowrap; }
.mini-segmented.orientation-buttons { margin-top: 0; }
.compact-status, .compact-mode-chip { min-height: 24px; padding: 3px 8px; font-size: 10.5px; }
.mode-note-inline { min-height: 21px; padding: 3px 8px; font-size: 10.5px; justify-self: start; }
.floating-action { min-height: 34px; padding: 0 12px; font-size: 12px; }
.status-stack { display: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.place-archaeo-marker-wrapper { background: transparent !important; border: none !important; display: flex; align-items: flex-end; justify-content: center; }
.maplibre-place-marker-wrapper {
  width: 24px;
  height: 28px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.maplibre-place-marker-wrapper:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 999px; }
.place-archaeo-marker {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transform-origin: 50% 50%;
}
#map2d .place-archaeo-marker { transform: rotate(calc(-45deg + var(--map-bearing, 0deg))); }
#map3d .place-archaeo-marker { transform: rotate(-45deg); }
.place-archaeo-core { transform: rotate(45deg); }
#map2d .place-archaeo-core { transform: rotate(calc(45deg + var(--map-bearing, 0deg))); }
.place-archaeo-marker.is-hover { width: 22px; height: 22px; }
.place-archaeo-marker.is-selected { width: 24px; height: 24px; }
.legend-lieu { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.map-legend-overlay { padding: 10px 11px; min-width: 205px; }
.legend-title { font-size: 10.5px; }
.legend-row { font-size: 11px; }

@media (max-width: 1440px) {
  #app { grid-template-columns: 300px 1fr 260px; }
  .view-toolbar { min-width: 318px; }
  .mini-segmented .segmented-btn { padding: 0 8px; font-size: 11px; }
  .compact-brand h1 { font-size: 26px; }
  .brand-mark { display: none; }
}

/* V3 · commandes dans l’angle supérieur droit et bloc projet épuré */
.map-topbar { left: auto !important; right: 12px !important; justify-content: flex-end !important; }
.map-controls-left { flex-direction: row-reverse; justify-content: flex-end; }
.compact-brand .brand-row { align-items: center; }
.compact-brand .hero-stats { margin-top: 9px; }
.compact-brand { padding-bottom: 10px; }

/* V4 · dépendance points de calage / carte ancienne */
.layer-card.is-disabled-by-parent {
  opacity: 0.48;
  filter: grayscale(0.18);
}
.layer-card.is-disabled-by-parent .toggle-label::after {
  content: "carte désactivée";
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.62);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.layer-card.is-disabled-by-parent input,
.layer-card.is-disabled-by-parent button { cursor: not-allowed; }

/* V7 · verrouillage fort des niveaux Leaflet */
.leaflet-tile-pane { z-index: 100 !important; }
.leaflet-chandelierRasterPane-pane { z-index: 500 !important; }
.leaflet-calage1804Pane-pane { z-index: 520 !important; }
.leaflet-championRasterPane-pane { z-index: 540 !important; }
.leaflet-calage1704Pane-pane { z-index: 560 !important; }
.leaflet-lieuxPane-pane { z-index: 580 !important; }
.affine-historic-image { image-rendering: auto; pointer-events: none !important; }

.map-controls-right{display:flex;align-items:flex-start;gap:8px;pointer-events:auto;justify-content:flex-end;}
.map-topbar{left:auto!important;right:12px!important;justify-content:flex-end!important;}

/* v13 refinements */
.maplibregl-ctrl-top-left { top: 12px; left: 12px; }
.map-topbar { left: auto !important; right: 12px !important; justify-content: flex-end !important; }
.inline-recenter { min-height: 28px; padding: 0 10px; }
.layer-group summary { display: grid; grid-template-columns: 26px 1fr 22px; align-items: center; gap: 6px; }
.group-eye { width: 22px; height: 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: var(--accent-soft); font-size: 12px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.group-eye.is-off { color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.03); }
.group-chevron { justify-self: end; color: rgba(255,255,255,0.55); transition: transform .18s ease; font-size: 14px; }
.layer-group:not([open]) .group-chevron { transform: rotate(-90deg); }
.place-archaeo-marker { width: 14px !important; height: 20px !important; }
.place-archaeo-marker.is-hover { width: 15.5px !important; height: 22px !important; }
.place-archaeo-marker.is-selected { width: 17px !important; height: 24px !important; }
.place-archaeo-core { width: 5px !important; height: 6px !important; }
.maplibre-place-marker-wrapper { width: 18px !important; height: 28px !important; }

/* v14 · symboles lieux remis en proportion non déformée */
.place-archaeo-marker {
  width: 15px !important;
  height: 15px !important;
  border-radius: 50% 50% 50% 0 !important;
  transform: rotate(-45deg) !important;
  transform-origin: 50% 50% !important;
}
#map2d .place-archaeo-marker { transform: rotate(-45deg) !important; }
#map3d .place-archaeo-marker { transform: rotate(-45deg) !important; }
.place-archaeo-marker.is-hover { width: 16.5px !important; height: 16.5px !important; }
.place-archaeo-marker.is-selected { width: 18px !important; height: 18px !important; }
.place-archaeo-core {
  width: 5px !important;
  height: 5px !important;
  transform: rotate(45deg) !important;
}
#map2d .place-archaeo-core { transform: rotate(45deg) !important; }
.maplibre-place-marker-wrapper { width: 18px !important; height: 22px !important; }

/* v15 · bloc de commandes et titre */
.brand-topline-with-logo { display: flex; align-items: center; gap: 10px; line-height: 1.05; }
.brand-mark-inline { width: 34px; height: 34px; flex: 0 0 34px; display:flex; align-items:center; justify-content:center; border-radius:999px; border:1px solid rgba(198,223,77,.18); background:rgba(255,255,255,.04); }
.brand-mark-inline img { width: 24px; height: 24px; object-fit: contain; }
50% { box-shadow:0 0 0 8px rgba(151,175,30,.05); } }
.view-toolbar-line.compact-buttons { gap: 6px; flex-wrap: nowrap; }
.view-toolbar .segmented-btn { white-space: nowrap; }
.inline-recenter { order: 3; }

/* v17 technical consolidation */
.inert-map2d{display:none!important;}
.maplibregl-ctrl-top-left{top:12px;left:12px;}

/* V38 — panneau diagnostic */
.diagnostic-toggle {
  border-color: rgba(198, 223, 77, 0.32);
}

.diagnostic-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  width: min(440px, calc(100vw - 36px));
  max-height: min(680px, calc(100vh - 36px));
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(45, 45, 45, 0.98);
  border: 1px solid rgba(198, 223, 77, 0.24);
  box-shadow: 0 24px 70px rgba(0,0,0,0.46);
  color: #f3f3f3;
}

.diagnostic-panel.is-hidden { display: none; }

.diagnostic-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.diagnostic-panel-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.diagnostic-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #c6df4d;
  margin-bottom: 4px;
}

.diagnostic-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #f3f3f3;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.diagnostic-grid {
  display: grid;
  gap: 7px;
  margin: 0;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: minmax(135px, 0.9fr) minmax(0, 1.4fr);
  gap: 10px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
}

.diagnostic-row dt {
  color: rgba(255,255,255,0.64);
  font-size: 12px;
}

.diagnostic-row dd {
  margin: 0;
  font-size: 12px;
  color: #fff;
  overflow-wrap: anywhere;
}

.diagnostic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.62);
  font-size: 11px;
}

.diagnostic-footer a {
  color: #c6df4d;
  text-decoration: none;
}

@media (max-width: 720px) {
  .diagnostic-panel {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }
  .diagnostic-row {
    grid-template-columns: 1fr;
  }
  .diagnostic-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* V39 — commandes de vue clarifiées et diagnostic discret */
.view-toolbar {
  gap: 7px;
}

.view-state-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 2px 3px 0;
}

.state-label {
  font-size: 9.5px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(255,255,255,.46);
  user-select: none;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.075);
  color: rgba(255,255,255,.78);
  font-size: 10.8px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.view-action-line {
  display: flex;
  align-items: stretch;
  gap: 7px;
  flex-wrap: nowrap;
}

.mode-note-inline {
  display: none !important;
}

.view-action-line .segmented,
.view-action-line .floating-action {
  box-shadow: none;
}

.view-action-line .orientation-buttons .segmented-btn {
  min-width: 62px;
}

.left-sidebar-footer {
  margin-top: 10px;
  padding: 2px 2px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.diagnostic-icon-button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.54);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.diagnostic-icon-button:hover,
.diagnostic-icon-button:focus-visible {
  border-color: rgba(198,223,77,.36);
  background: rgba(151,175,30,.10);
  color: #c6df4d;
  outline: none;
  transform: translateY(-1px);
}

.diagnostic-toggle {
  display: none !important;
}

@media (max-width: 1440px) {
  .view-action-line { gap: 5px; }
  .view-action-line .orientation-buttons .segmented-btn { min-width: auto; }
  .state-chip { font-size: 10.2px; padding: 0 7px; }
}

/* V40 — lecture rapide déplacée pour libérer les crédits de basemap */
.map-legend-overlay {
  left: 18px !important;
  right: auto !important;
  bottom: 18px !important;
}

/* V46 — narration colonne gauche */
.narrative-panel summary span:first-child {
  letter-spacing: .01em;
}

.narrative-block h3 {
  margin-top: 12px;
  margin-bottom: 5px;
}

.narrative-block h3:first-child {
  margin-top: 2px;
}

.narrative-block p {
  margin: 0 0 9px;
  color: rgba(255,255,255,.76);
  font-size: 11.4px;
  line-height: 1.42;
}

.narrative-block .source-list {
  margin-top: 4px;
}

/* V47 — compactage narratif du bloc Composer la carte */
.layer-composer-panel {
  padding-bottom: 11px;
}

.layer-composer-panel .compact-title-row h2 {
  letter-spacing: .01em;
}

.narrative-layer-note {
  margin-bottom: 9px;
  color: rgba(255,255,255,.70);
  font-size: 11.4px;
  line-height: 1.38;
}

.compact-layer-composer {
  display: grid;
  gap: 6px;
}

.layer-composer-row {
  margin: 0;
  padding: 7px 8px;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(118px, 1fr) minmax(88px, 0.85fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  box-shadow: none;
}

.lieux-composer-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-color: rgba(198,223,77,.17);
  background: rgba(151,175,30,.075);
}

.current-composer-row {
  grid-template-columns: minmax(118px, 1fr) minmax(88px, 0.85fr);
}

.composer-main-toggle,
.calage-inline-control,
.opacity-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgba(255,255,255,.84);
  font-size: 11.6px;
  line-height: 1.15;
  cursor: pointer;
}

.composer-main-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opacity-inline {
  gap: 7px;
  color: rgba(255,255,255,.58);
  font-size: 10.4px;
  cursor: default;
}

.opacity-inline input[type="range"] {
  width: 100%;
  min-width: 78px;
  max-width: 132px;
}

.calage-inline-control {
  justify-content: flex-end;
  color: rgba(255,255,255,.66);
  font-size: 10.6px;
  white-space: nowrap;
}

.calage-inline-control.is-disabled-by-parent {
  opacity: .45;
}

.composer-color {
  justify-self: end;
}

.composer-color-panel {
  margin-top: -2px;
  margin-bottom: 2px;
  padding: 6px 8px;
}

@media (max-width: 1440px) {
  .layer-composer-row {
    grid-template-columns: minmax(108px, 1fr) minmax(74px, 0.8fr) auto;
    gap: 6px;
    padding: 6px 7px;
  }
  .current-composer-row {
    grid-template-columns: minmax(108px, 1fr) minmax(74px, 0.8fr);
  }
  .composer-main-toggle,
  .calage-inline-control,
  .opacity-inline {
    font-size: 10.8px;
  }
}

/* V48 — hiérarchie carte / réglages */
.historical-composer-card {
  margin: 0;
  padding: 8px 9px 7px;
  border-radius: 13px;
  box-shadow: none;
  display: grid;
  gap: 6px;
}

.composer-map-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: rgba(255,255,255,.88);
  font-size: 12.1px;
  line-height: 1.15;
  font-weight: 700;
  cursor: pointer;
}

.composer-map-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-subline {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
}

.composer-subline .opacity-inline {
  justify-content: flex-start;
}

.composer-subline .calage-inline-control {
  justify-content: flex-end;
}

.composer-section-title {
  margin: 3px 2px -2px;
  color: rgba(255,255,255,.48);
  font-size: 9.7px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

@media (max-width: 1440px) {
  .composer-subline {
    grid-template-columns: minmax(88px, 1fr) auto;
    gap: 7px;
    padding-left: 18px;
  }
  .composer-map-title { font-size: 11.4px; }
}

/* V49 — affinage ergonomique du bloc Composer la carte */
.layer-composer-panel {
  padding: 12px 12px 13px;
}

.compact-layer-composer {
  gap: 7px;
}

.lieux-composer-row {
  min-height: 34px;
  padding: 7px 9px;
  grid-template-columns: minmax(0, 1fr) 24px;
  column-gap: 8px;
}

.historical-composer-card {
  padding: 9px 10px 9px;
  gap: 7px;
}

.composer-map-title,
.composer-main-toggle {
  min-width: 0;
}

.composer-map-title input,
.composer-main-toggle input,
.calage-inline-control input {
  flex: 0 0 auto;
}

.composer-subline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding-left: 22px;
  padding-right: 2px;
}

.opacity-inline {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  color: rgba(255,255,255,.62);
}

.opacity-inline span {
  white-space: nowrap;
}

.opacity-inline input[type="range"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  display: block;
}

.calage-inline-control {
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px 3px 0;
  color: rgba(255,255,255,.72);
  gap: 6px;
}

.calage-inline-control span {
  white-space: nowrap;
}

.current-composer-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 8px 10px 8px;
}

.current-composer-row .opacity-inline {
  padding-left: 22px;
}

.composer-section-title {
  margin: 5px 2px -1px;
  padding-top: 2px;
}

@media (max-width: 1440px) {
  .historical-composer-card,
  .current-composer-row {
    padding-left: 9px;
    padding-right: 9px;
  }
  .composer-subline,
  .current-composer-row .opacity-inline {
    padding-left: 20px;
  }
  .opacity-inline {
    grid-template-columns: 45px minmax(0, 1fr);
    gap: 7px;
  }
}

/* V50 — accordéons narratifs dans Comprendre la carte */
.narrative-accordion {
  display: grid;
  gap: 6px;
}

.narrative-accordion-item {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.035);
  overflow: hidden;
}

.narrative-accordion-item summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,.86);
  font-size: 11.8px;
  font-weight: 750;
  line-height: 1.2;
}

.narrative-accordion-item summary::-webkit-details-marker {
  display: none;
}

.narrative-accordion-item summary::after {
  content: "＋";
  color: rgba(198,223,77,.82);
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

.narrative-accordion-item[open] summary {
  color: #f6f6f3;
  background: rgba(151,175,30,.08);
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.narrative-accordion-item[open] summary::after {
  content: "−";
}

.narrative-accordion-item p,
.narrative-accordion-item ul {
  margin: 0;
  padding: 9px 10px 10px;
}

.narrative-accordion-item .source-list {
  padding-left: 22px;
}


/* V52 — fiches lieux et tooltips muséaux */
.selected-place-panel .panel-title-row h2 { letter-spacing: .01em; }
.selected-place-card {
  background: radial-gradient(circle at 18% 0%, rgba(198,223,77,.10), transparent 30%), linear-gradient(180deg, rgba(195,154,82,0.17), rgba(44,42,36,0.94));
  border-color: rgba(195,154,82,0.30);
  padding: 15px;
}
.selected-place-kicker { margin-bottom: 7px; color: rgba(240,217,171,.88); }
.selected-place-badges, .popup-badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.selected-place-badges span, .popup-badge-row span {
  display: inline-flex; align-items: center; min-height: 18px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid rgba(198,223,77,.18); background: rgba(151,175,30,.10); color: rgba(246,246,238,.78);
  font-size: 9.8px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.selected-place-badges .is-hidden { display: none; }
.selected-place-location { margin: -6px 0 11px; color: rgba(255,255,255,.64); font-size: 12.4px; line-height: 1.35; }
.selected-place-narrative, .selected-place-warning { margin: 0; font-size: 12.6px; line-height: 1.55; color: rgba(255,255,255,.78); }
.selected-place-warning { margin-top: 9px; padding: 9px 10px; border-radius: 12px; border: 1px solid rgba(198,223,77,.14); background: rgba(151,175,30,.07); color: rgba(246,246,238,.76); }
.selected-place-warning.is-empty { display: none; }
.selected-place-details { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 9px; }
.selected-place-details summary { cursor: pointer; color: rgba(255,255,255,.70); font-size: 11.4px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.selected-place-details .selected-place-meta { margin-top: 9px; }
.places-panel .small-note { line-height: 1.45; }
.place-item { padding: 10px 11px; }
.place-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.place-number { color: rgba(240,217,171,.78); font-size: 10.4px; letter-spacing: .08em; text-transform: uppercase; }
.place-badge { flex: 0 0 auto; border-radius: 999px; padding: 1px 6px 2px; border: 1px solid rgba(198,223,77,.16); background: rgba(151,175,30,.08); color: rgba(246,246,238,.68); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; }
.place-name { font-size: 13.7px; line-height: 1.25; }
.place-sub { margin-top: 4px; font-size: 11.6px; line-height: 1.28; }
.maplibregl-popup.place-popup { max-width: 280px !important; }
.maplibregl-popup-content { padding: 0; }
.museum-popup { padding: 11px 12px 12px; min-width: 210px; }
.popup-kicker { margin-bottom: 4px; color: rgba(240,217,171,.78); font-size: 9.8px; letter-spacing: .11em; text-transform: uppercase; }
.popup-card strong { display: block; color: #fff6db; font-size: 14.2px; line-height: 1.2; }
.popup-meta { margin-top: 5px; color: rgba(255,255,255,.66); font-size: 12px; line-height: 1.35; }
.popup-hint { margin-top: 8px; color: rgba(198,223,77,.72); font-size: 11px; line-height: 1.3; }
.popup-badge-row { margin: 7px 0 0; }


/* V54 · intégration écosystème lab.manoux.net */
.manoux-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.manoux-logo-link {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(198,223,77,0.18);
  flex: 0 0 auto;
}

.manoux-logo-link img {
  width: 30px;
  height: 30px;
  display: block;
}

.manoux-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.manoux-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: #f2f2ee;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.manoux-btn:hover {
  border-color: rgba(198,223,77,0.32);
  background: rgba(151,175,30,0.12);
  color: #f7fbdf;
}

.manoux-brand-btn {
  color: #f5f9db;
  border-color: rgba(151,175,30,0.22);
}

.manoux-brand-btn img {
  width: 17px;
  height: 17px;
  display: block;
}

.source-credit-item {
  color: var(--muted);
}

@media (max-width: 1360px) {
  .manoux-header-actions {
    gap: 6px;
  }
  .manoux-btn {
    padding-inline: 8px;
    font-size: 10.5px;
  }
}


.selected-place-manoux-note {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid rgba(198,223,77,0.16);
  background:
    linear-gradient(135deg, rgba(151,175,30,0.08), rgba(195,154,82,0.08)),
    rgba(0,0,0,0.10);
}

.manoux-note-kicker {
  margin-bottom: 4px;
  color: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.selected-place-manoux-note p {
  margin: 0;
  color: rgba(246,246,238,0.78);
  font-size: 12.4px;
  line-height: 1.45;
}


/* V59 · header Manoux réagencé */
.manoux-project-header {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}

.project-title-lines {
  display: grid;
  gap: 1px;
  min-width: 0;
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-title-lines span {
  display: block;
  white-space: nowrap;
}

.right-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 1px;
}

.right-header-actions .manoux-btn {
  min-height: 31px;
}

@media (max-width: 1360px) {
  .project-title-lines {
    font-size: 10px;
    letter-spacing: 0.105em;
  }
  .right-header-actions {
    gap: 6px;
  }
}


/* V60 · boutons header compactés */
.right-header-actions .manoux-return-btn {
  padding-inline: 11px;
}

.right-header-actions .manoux-brand-btn {
  max-width: 118px;
  min-width: 0;
  padding-inline: 8px 10px;
  overflow: hidden;
}

.right-header-actions .manoux-brand-btn span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1360px) {
  .right-header-actions .manoux-brand-btn {
    max-width: 104px;
  }
}


/* V61 · cartel d’introduction */
.map-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    radial-gradient(circle at center, rgba(0,0,0,0.18), rgba(0,0,0,0.38));
  pointer-events: auto;
}

.map-intro-card {
  position: relative;
  width: min(610px, calc(100vw - 520px));
  min-width: 420px;
  padding: 22px 24px 20px;
  border-radius: 24px;
  border: 1px solid rgba(198,223,77,0.24);
  background:
    radial-gradient(circle at top right, rgba(151,175,30,0.13), transparent 34%),
    linear-gradient(155deg, rgba(49,49,49,0.98), rgba(38,38,38,0.97));
  box-shadow: 0 28px 80px rgba(0,0,0,0.48);
  backdrop-filter: blur(14px);
}

.map-intro-kicker {
  margin-bottom: 8px;
  color: var(--accent-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.map-intro-card h2 {
  margin: 0 0 12px;
  max-width: 520px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.map-intro-card p {
  margin: 0 0 10px;
  color: rgba(246,246,238,0.82);
  font-size: 14px;
  line-height: 1.55;
}

.map-intro-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.map-intro-primary {
  border: 1px solid rgba(198,223,77,0.32);
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(151,175,30,0.22);
  color: #f7fbdf;
  font-weight: 850;
  cursor: pointer;
}

.map-intro-primary:hover {
  background: rgba(151,175,30,0.32);
}

.map-intro-close {
  position: absolute;
  top: 11px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  color: rgba(246,246,238,0.84);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.map-intro-close:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}

.intro-reopen-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(198,223,77,0.24);
  background: rgba(151,175,30,0.10);
  color: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.intro-reopen-btn:hover {
  background: rgba(151,175,30,0.18);
  color: #f7fbdf;
}

@media (max-width: 1180px) {
  .map-intro-card {
    width: min(560px, calc(100vw - 60px));
    min-width: 0;
  }
}


/* V62 · cartel accueil + chargement fusionnés */
.map-intro-card[data-intro-state="loading"] .map-intro-primary,
.map-intro-card[data-intro-state="error"] .map-intro-primary {
  opacity: 0.42;
  cursor: wait;
}

.map-intro-steps {
  display: grid;
  gap: 7px;
  margin: 15px 0 10px;
  padding: 0;
  list-style: none;
}

.map-intro-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 27px;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(246,246,238,0.62);
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 12px;
  font-weight: 750;
}

.map-intro-steps li::before {
  content: "○";
  width: 18px;
  color: rgba(255,255,255,0.38);
  font-size: 13px;
  text-align: center;
}

.map-intro-steps li.is-active {
  color: #f7fbdf;
  border-color: rgba(198,223,77,0.24);
  background: rgba(151,175,30,0.11);
}

.map-intro-steps li.is-active::before {
  content: "⟳";
  color: var(--accent-soft);
}

.map-intro-steps li.is-done {
  color: rgba(246,246,238,0.82);
}

.map-intro-steps li.is-done::before {
  content: "✓";
  color: var(--accent-soft);
}

.map-intro-status {
  min-height: 20px;
  color: rgba(246,246,238,0.66);
  font-size: 12.2px !important;
}

.map-intro-card[data-intro-state="ready"] .map-intro-kicker::after {
  content: " · prêt";
  color: var(--accent-soft);
}


/* V63 · responsive safe + tiroirs mobiles */
.mobile-map-toolbar,
.mobile-sidebar-close,
.mobile-drawer-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  #app {
    grid-template-columns: 330px 1fr 300px;
  }

  .sidebar {
    padding: 12px;
  }

  .panel {
    padding: 13px;
    margin-bottom: 11px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  #app {
    display: block;
    height: 100%;
  }

  .map-area {
    height: 100vh;
    width: 100vw;
  }

  .map-shell {
    height: 100%;
    border-radius: 0;
  }

  .map-topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    align-items: flex-start;
    pointer-events: none;
  }

  .view-toolbar {
    max-width: calc(100vw - 20px);
    transform: scale(0.92);
    transform-origin: top left;
    pointer-events: auto;
  }

  .left-sidebar,
  .right-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: min(88vw, 390px);
    max-width: 390px;
    height: 100dvh;
    overflow-y: auto;
    padding: 12px;
    transition: transform 180ms ease, box-shadow 180ms ease;
    border: 0;
    box-shadow: 0 24px 70px rgba(0,0,0,0.48);
  }

  .left-sidebar {
    left: 0;
    transform: translateX(-105%);
  }

  .right-sidebar {
    right: 0;
    transform: translateX(105%);
  }

  .left-sidebar.is-mobile-open,
  .right-sidebar.is-mobile-open {
    transform: translateX(0);
  }

  .mobile-sidebar-close {
    position: sticky;
    top: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin: 0 0 10px auto;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #f6f6f3;
    font-weight: 850;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    pointer-events: none;
    opacity: 0;
    background: rgba(0,0,0,0.42);
    transition: opacity 180ms ease;
  }

  .mobile-drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-map-toolbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 16;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(43,43,43,0.92);
    box-shadow: 0 16px 42px rgba(0,0,0,0.36);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
  }

  .mobile-map-toolbar button {
    min-height: 34px;
    padding: 8px 11px;
    border: 1px solid rgba(198,223,77,0.18);
    border-radius: 999px;
    background: rgba(151,175,30,0.12);
    color: #f7fbdf;
    font-weight: 850;
    font-size: 12px;
  }

  .map-legend-overlay {
    display: none;
  }

  .right-header-actions {
    justify-content: flex-start;
  }

  .map-intro-card {
    width: min(560px, calc(100vw - 28px));
    min-width: 0;
    max-height: 82dvh;
    overflow-y: auto;
  }
}

@media (max-width: 560px) {
  .view-toolbar {
    transform: scale(0.84);
    max-width: 118vw;
  }

  .mobile-map-toolbar {
    bottom: 12px;
    max-width: calc(100vw - 18px);
  }

  .mobile-map-toolbar button {
    min-height: 32px;
    padding-inline: 9px;
    font-size: 11.5px;
  }

  .left-sidebar,
  .right-sidebar {
    width: min(92vw, 370px);
  }

  .manoux-project-header {
    grid-template-columns: 42px 1fr;
  }

  .project-title-lines {
    white-space: normal;
  }
}

/* V64 · suivi non bloquant du chargement des cartes anciennes */
.historical-load-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 19;
  width: min(360px, calc(100% - 36px));
  padding: 13px 14px 12px;
  border: 1px solid rgba(198,223,77,0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(151,175,30,0.12), transparent 38%),
    rgba(41,41,41,0.91);
  box-shadow: 0 20px 52px rgba(0,0,0,0.34);
  color: #f6f6ee;
  backdrop-filter: blur(10px);
  transition: opacity .28s ease, transform .28s ease;
}

.historical-load-panel.is-hidden {
  opacity: 0;
  transform: translateY(9px);
  pointer-events: none;
}

.historical-load-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: #f7fbdf;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.historical-load-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: 0 0 0 5px rgba(198,223,77,0.12);
}

.historical-load-intro {
  margin: 0 0 10px;
  color: rgba(246,246,238,0.72);
  font-size: 12.4px;
  line-height: 1.42;
}

.historical-load-list {
  display: grid;
  gap: 7px;
}

.historical-load-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  color: rgba(246,246,238,0.82);
  font-size: 12.2px;
}

.historical-load-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
}

.historical-load-row.is-loading .historical-load-dot,
.historical-load-row.is-source-ready .historical-load-dot,
.historical-load-row.is-slow .historical-load-dot {
  border-color: rgba(198,223,77,0.58);
  border-top-color: var(--accent-soft);
  animation: historicalLoadSpin .82s linear infinite;
}

.historical-load-row.is-ready .historical-load-dot {
  border-color: var(--accent);
  background: var(--accent);
  animation: none;
}

.historical-load-row.is-error .historical-load-dot {
  border-color: #e97979;
  background: #e97979;
  animation: none;
}

.historical-load-row.is-slow .historical-load-status {
  color: var(--accent-soft);
}

.historical-load-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 720;
}

.historical-load-status {
  color: rgba(246,246,238,0.62);
  font-size: 11.4px;
  white-space: nowrap;
}

.historical-load-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: rgba(246,246,238,0.58);
  font-size: 11.5px;
}

.historical-load-foot button {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 5px 9px;
  color: rgba(246,246,238,0.86);
  background: rgba(255,255,255,0.06);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.historical-load-foot button:hover {
  border-color: rgba(198,223,77,0.36);
  background: rgba(151,175,30,0.16);
}

@keyframes historicalLoadSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .historical-load-panel {
    left: 10px;
    right: 10px;
    bottom: 62px;
    width: auto;
    padding: 11px 12px;
  }

  .historical-load-foot {
    align-items: flex-start;
  }
}
