/* World > continent > region. The grid is an aid, the coast is continuous. */
.live-map-viewport { touch-action: none; cursor: var(--cur-grab, grab); background: #264850; }
.live-map-viewport.is-dragging { cursor: var(--cur-grabbing, grabbing); }
svg.live-world { background: #264850; }
.region-canvas-host {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  background: #244f59;
  touch-action: none;
  user-select: none;
}
.live-region-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}
.live-world .continent-shape, .live-world .continent-label { cursor: var(--cur-pointer, pointer); }
.live-world .continent-shape:hover > path:last-child,
.live-world .continent-shape:focus-visible > path:last-child,
.live-world .continent-shape:hover > use:last-child,
.live-world .continent-shape:focus-visible > use:last-child { stroke: #f5df99; stroke-width: 5; }
.live-world .continent-label rect { fill: #182b24; fill-opacity: 0; stroke: #d4b872; stroke-opacity: 0; stroke-width: .9; }
.live-world .continent-label:hover rect,
.live-world .continent-label:focus-visible rect { fill-opacity: .74; stroke-opacity: .78; }
.live-world .continent-label text,
.live-world .continent-label .continent-name {
  fill: #f7eed2;
  stroke: #142520;
  stroke-width: 3.4px;
  stroke-linejoin: round;
  paint-order: stroke;
  font: 600 16.5px Georgia, serif;
}
.live-world .continent-label:hover .continent-name,
.live-world .continent-label:focus-visible .continent-name { fill: #fff6d6; }
.live-world .continent-label .continent-count {
  font: 10.5px Georgia, serif;
  fill: #c4d0c5;
  opacity: .78;
  stroke: #142520;
  stroke-width: 2.6px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.live-world .continent-label .continent-count[data-has-cities="1"] {
  font-weight: 600;
  fill: #ebd07f;
  opacity: .96;
}
.live-world .map-city-name { fill: #fcf2d7; stroke: #263728; stroke-width: 1.5; paint-order: stroke; font: 6px Georgia, serif; pointer-events: none; }
/* Region (32x20 cells): compact fixed-width dark band under each city, owner
   dot and coloured name, as in the 2011 reference; screen size kept stable. */
.live-world .map-city-label .map-label-scale { transform: scale(var(--map-label-k, 1)); }
.live-world .map-city-label .map-city-plate { fill: #111712; fill-opacity: .74; stroke: #000; stroke-opacity: .35; stroke-width: .2; }
.live-world .map-city-label .map-city-name { stroke: none; font: 600 2.5px Georgia, serif; letter-spacing: .02px; fill: #efe3c7; }
.live-world .map-city-label .map-city-owner { fill: #a98a63; stroke: #0c100c; stroke-width: .25; }
.live-world .map-city-label[data-relation="mine"] .map-city-name { fill: #f1d77f; }
.live-world .map-city-label[data-relation="mine"] .map-city-owner { fill: #e9c24f; }
.live-world .map-city-label[data-relation="ally"] .map-city-name,
.live-world .map-city-label[data-relation="alliance"] .map-city-name { fill: #9fd5ea; }
.live-world .map-city-label[data-relation="ally"] .map-city-owner,
.live-world .map-city-label[data-relation="alliance"] .map-city-owner { fill: #5fb3d6; }
.live-world .map-city-label[data-relation="allied"] .map-city-name { fill: #b6efb1; }
.live-world .map-city-label[data-relation="allied"] .map-city-owner { fill: #55c45d; }
.live-world .map-city-label[data-relation="nap"] .map-city-name { fill: #96ece4; }
.live-world .map-city-label[data-relation="nap"] .map-city-owner { fill: #38c4b8; }
.live-world .map-city-label[data-relation="enemy"] .map-city-name { fill: #f9a29a; }
.live-world .map-city-label[data-relation="enemy"] .map-city-owner { fill: #e2483c; }
.live-world .map-city-label[data-relation="other"] .map-city-name { fill: #efe3c7; }
.live-world .map-city-label[data-relation="other"] .map-city-owner { fill: #a98a63; }
.live-world .map-city-label[data-relation="lawless"] .map-city-name { fill: #d4ccb8; }
.live-world .map-city-label[data-relation="lawless"] .map-city-owner { fill: #8b8170; }
/* Region city hit target: always invisible. Global art-theme rules
   ([data-world-x]:hover rect, .world-marker:hover drop-shadow, focus outline)
   would otherwise paint the whole hit box black with a gold rim and a halo. */
.live-world .world-marker .map-city-hit,
.live-world .world-marker:hover .map-city-hit,
.live-world .world-marker:focus-visible .map-city-hit { fill: #000; fill-opacity: 0; stroke: none; filter: none; }
.live-world .world-marker[data-region-city],
.live-world .world-marker[data-region-city]:hover,
.live-world .world-marker[data-region-city]:focus-visible { filter: none; outline: none; }
/* Discreet hover: the painted city brightens slightly; the label band keeps its size. */
.live-world .world-marker[data-region-city]:hover .painted-sprite,
.live-world .world-marker[data-region-city]:focus-visible .painted-sprite { filter: brightness(1.1) saturate(1.04); }
.live-world .world-marker[data-region-city]:hover .map-city-plate,
.live-world .world-marker[data-region-city]:focus-visible .map-city-plate { fill: #111712; fill-opacity: .86; stroke: #e8d08a; stroke-opacity: .7; stroke-width: .2; }
/* Painted sites (POI lot, Region and Continent): the same protections as the painted cities. Their hit target stays
   invisible, the level badge keeps its look, the site group gets no square halo or outline; hover brightens the drawing
   as for cities, keyboard focus adds a discreet ivory glow on the drawing itself (no opaque square). */
.live-world .world-marker .map-site-hit,
.live-world .world-marker:hover .map-site-hit,
.live-world .world-marker:focus-visible .map-site-hit { fill: #000; fill-opacity: 0; stroke: none; filter: none; }
.live-world .world-marker:has(> .map-site-hit),
.live-world .world-marker:has(> .map-site-hit):hover,
.live-world .world-marker:has(> .map-site-hit):focus-visible { filter: none; outline: none; }
.live-world .world-marker:has(> .map-site-hit):hover .map-level-badge,
.live-world .world-marker:has(> .map-site-hit):focus-visible .map-level-badge { fill-opacity: .88; stroke: #c9ad6a; stroke-opacity: .7; }
.live-world .world-marker:has(> .map-site-hit):hover .painted-sprite { filter: brightness(1.1) saturate(1.04); }
.live-world .world-marker:has(> .map-site-hit):focus-visible .painted-sprite { filter: brightness(1.12) saturate(1.04) drop-shadow(0 0 1px #fff0bd); }
.live-world .map-level-badge { fill: #1f1a14; fill-opacity: .88; stroke: #c9ad6a; stroke-width: .3; stroke-opacity: .7; }
.live-world .map-level-text { fill: #f2e6c7; font: 700 3.6px Georgia, serif; pointer-events: none; }
/* Final label layer: bands stay clickable and select their own city cell. */
.live-world [data-map-labels] .map-city-label { cursor: var(--cur-pointer, pointer); }
/* Local review references: neutral band, hollow light dot. */
.live-world .map-city-label[data-relation="reference"] .map-city-plate { fill: #182024; fill-opacity: .8; stroke: #c9c3ad; stroke-opacity: .55; stroke-width: .2; stroke-dasharray: .8 .5; }
.live-world .map-city-label[data-relation="reference"] .map-city-name { fill: #e8e2cf; font-style: italic; }
.live-world .map-city-label[data-relation="reference"] .map-city-owner { fill: none; stroke: #efe9d6; stroke-width: .35; }
.map-tools .map-reference-toggle[aria-pressed="true"] { border-color: #e5c16c; color: #fff4d2; }
/* Painted illustrations are never pixelated, at any zoom. */
.live-world image { image-rendering: auto; }
.live-world .world-marker { cursor: var(--cur-pointer, pointer); }
.live-map-viewport .floating-overlay-top {
  max-width: calc(100% - 24px);
}
.live-map-viewport .map-breadcrumb,
.map-breadcrumb {
  pointer-events: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 8px;
  background-color: #211912;
  background-image: linear-gradient(180deg, rgba(44, 33, 23, 0.9), rgba(26, 19, 13, 0.92));
  border: 1px solid #8a7044;
  border-radius: var(--radius-sm, 4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(235, 206, 138, 0.16);
  color: #f4ebd7;
  font: 500 12px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
.map-breadcrumb button:not(.help-trigger) {
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 1px 3px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ebd089;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: var(--cur-pointer, pointer);
}
.map-breadcrumb button:not(.help-trigger):hover {
  color: #fff7df;
  background: rgba(229, 193, 108, 0.16);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.map-breadcrumb button:not(.help-trigger):focus-visible {
  outline: 2px solid #e5c16c;
  outline-offset: 1px;
  color: #fff7df;
}
.map-breadcrumb button[aria-current="location"] {
  color: #fbf3df;
  font-weight: 700;
}
.map-breadcrumb-sep {
  color: #c7b48a;
  font-size: 12px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.map-breadcrumb strong,
.map-breadcrumb-current {
  color: #fbf3df;
  font-weight: 700;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.map-breadcrumb .help-trigger {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-left: 3px;
  border: 1px solid rgba(222, 190, 118, 0.68);
  background: rgba(235, 208, 137, 0.1);
  color: #ebd089;
  font: 700 11.5px/1 Georgia, serif;
}
.map-breadcrumb .help-trigger:hover,
.map-breadcrumb .help-trigger[aria-expanded="true"] {
  background: rgba(229, 193, 108, 0.26);
  border-color: #e7c470;
  color: #fff8e8;
}
.map-breadcrumb .help-trigger:focus-visible {
  outline: 2px solid #e5c16c;
  outline-offset: 1px;
}
.live-map-viewport .map-tools,
.floating-tools.map-tools {
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(34, 26, 18, 0.9);
  border: 1px solid #8a7044;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
}
.map-tools .map-coordinate { display: flex; align-items: center; gap: 6px; margin: 0; }
.map-coordinate label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #f3e8cf;
  font: 600 11.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.map-coordinate .input { width: 52px; min-width: 0; padding: 3px 5px; height: 27px; font-size: 12px; font-variant-numeric: tabular-nums; border-color: #8c6f41; }
.map-tools .btn { min-height: 27px; padding: 3px 9px; font-size: 12px; }
.map-tools .btn-icon { min-width: 27px; padding: 3px 6px; }
.scene-tabs { flex-wrap: nowrap; }
.live-city-stage .harbor-site { cursor: var(--cur-pointer, pointer); }
.live-wall-portrait { display: block; width: 100%; height: 180px; margin: 6px 0 12px; }
.dock-walls-button { margin-bottom: 10px; font-size: 12px; }
@media (max-width: 600px) {
  .live-map-viewport .map-breadcrumb,
  .map-breadcrumb { padding: 3px 6px; gap: 3px 4px; font-size: 11.5px; }
  .scene-tabs .scene-tab { padding-inline: 8px; min-width: 0; }
}
/* Monde : vue stratégique au style de la capture LoU 677121 (aplats, quadrillage,
   rivières sur les arêtes, marqueurs plats). Les marqueurs, repères et traits de
   sélection gardent leur taille à l'écran grâce aux variables posées par la caméra. */
.live-world.world-view { background: #4a87a1; }
.live-world.world-view .wv-s { transform: scale(var(--wv-px, 1)); }
.live-world.world-view .wv-ls { transform: scale(var(--wv-lpx, 1)); }
.live-world.world-view .wv-selection rect:first-child { stroke-width: calc(var(--wv-1px, .15) * 3.2); }
.live-world.world-view .wv-selection rect:last-of-type { stroke-width: calc(var(--wv-1px, .15) * 1.6); }
.live-world.world-view .wv-hover { stroke-width: calc(var(--wv-1px, .15) * 1.2); }
.world-map-viewport:focus-visible { outline: 2px solid #e5c16c; outline-offset: -3px; }
.world-hover-tip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  padding: 4px 8px;
  background: rgba(24, 19, 13, 0.92);
  border: 1px solid #8a7044;
  border-radius: 3px;
  color: #f4ebd7;
  font: 600 12px/1.25 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.world-legend-dock {
  position: absolute;
  z-index: 6;
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  width: 344px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 68px);
  overflow-y: auto;
  overflow-x: hidden;
}
.world-legend {
  background: rgba(34, 26, 18, 0.92);
  border: 1px solid #8a7044;
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
  color: #f3e8cf;
  font: 500 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.world-legend summary {
  cursor: var(--cur-pointer, pointer);
  padding: 5px 9px;
  color: #ebd089;
  font-weight: 700;
}
.world-legend summary:focus-visible { outline: 2px solid #e5c16c; outline-offset: -2px; }
.world-legend-filters { margin: 0; padding: 0 8px 4px; border: 0; }
.world-legend-filters legend { padding: 0; color: #c7b48a; font-size: 11px; }
.world-legend-row {
  display: grid;
  grid-template-columns: 16px 20px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  cursor: var(--cur-pointer, pointer);
}
.world-legend-row input { margin: 0; accent-color: #d9b45c; }
.world-legend-row input:focus-visible { outline: 2px solid #e5c16c; outline-offset: 1px; }
.world-legend-count { color: #c7b48a; font-variant-numeric: tabular-nums; }
.world-legend-icon { display: block; background: #9c9351; border-radius: 3px; }
.world-legend-stages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 4px 8px 8px;
  border-top: 1px solid rgba(138, 112, 68, 0.5);
}
.world-legend-caption { flex-basis: 100%; color: #c7b48a; font-size: 11px; }
.world-legend-stage { display: inline-flex; align-items: center; gap: 3px; }
/* World filters of the LoU capture (2026-11-17): level and score bounds under their row; a category the game does not
   produce yet (count 0) stays readable but quieter. */
/* Finishing (owner captures NL1j1C and UuoJxx, 2026-11-17): the level bounds on a compact sub-line aligned on the labels
   (checkbox 16 + gap 6 + icon 20 + gap 6), the score threshold inside its own row; warm parchment fields with a bronze
   border and brown figures, scoped to the legend so they replace the white of .input (style.css). */
.world-legend-range { display: flex; align-items: center; gap: 5px; margin-top: -3px; padding: 0 0 5px 48px; color: #c7b48a; font-size: 11px; white-space: nowrap; }
.world-legend .world-legend-number {
  width: 44px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0 1px 0 5px;
  background: #f1e2bd;
  color: #2b1d0f;
  border: 1px solid #9a7741;
  border-radius: 3px;
  box-shadow: inset 0 1px 1px rgba(60, 40, 15, 0.28);
  font: 600 11.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
.world-legend .world-legend-number.is-score { width: 66px; }
.world-legend .world-legend-number:not(.is-score) { width: 36px; padding-inline: 3px; }
.world-legend .world-legend-number:focus,
.world-legend .world-legend-number:focus-visible { outline: 2px solid #e5c16c; outline-offset: 1px; border-color: #e5c16c; background: #f8ecd0; }
/* One line per filter (owner capture JFSde5, 2026-11-17): the threshold and the level bounds stay on their row, the count
   aligned right; a legend wider than a small screen scrolls inside its dock rather than leaving the screen. */
.world-legend-row.has-field > span:not(.world-legend-count) { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; white-space: nowrap; }
.world-legend-row.has-range .world-legend-range { display: inline-flex; gap: 4px; margin: 0 0 0 4px; padding: 0; }
.world-legend-niv { color: #c7b48a; font-size: 11px; }
.world-legend-row.is-empty > span:not(.world-legend-count) { opacity: .62; }
.map-tools .world-zoom-tools { display: inline-flex; gap: 4px; }
.map-tools .world-continent-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #f3e8cf;
  font: 600 11.5px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.map-tools .world-continent-pick .input { width: auto; min-width: 0; height: 27px; padding: 2px 28px 2px 6px; font-size: 12px; border-color: #8c6f41; }
@media (max-width: 760px) {
  .world-legend-dock { top: 52px; right: 8px; left: auto; bottom: auto; width: min(328px, calc(100% - 16px)); max-height: calc(100% - 116px); }
  .map-tools .world-continent-pick { display: none; }
}
/* Region depth layer: decor shares the depth order of sites and cities but never
   catches the pointer (a click on a tree in front of a town selects its cell). */
.live-world [data-depth-layer] [data-region-resource] { pointer-events: none; }

/* Lot D2 — Cartouche parchemin/bronze au survol 60 fps en Région */
.region-hover-tip {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  min-width: 196px;
  max-width: 288px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #f5e8c7 0%, #ead6ab 100%);
  border: 1px solid #8a6532;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(14, 10, 6, 0.52), inset 0 1px 0 rgba(255, 250, 236, 0.72);
  color: #2c1e10;
  font: 500 12px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
.region-hover-tip .rh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  font-family: Georgia, serif;
  font-size: 13px;
  color: #1f140a;
}
.region-hover-tip .rh-lvl,
.region-hover-tip .rh-coords {
  padding: 1px 5px;
  border-radius: 3px;
  background: #2b1f13;
  color: #f4dfb0;
  font: 700 11px/1.2 system-ui, sans-serif;
}
.region-hover-tip .rh-rel {
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(55, 38, 18, 0.35);
  background: #dcc79c;
  color: #2f2011;
  font: 700 10.5px/1.2 system-ui, sans-serif;
}
.region-hover-tip .rh-rel[data-rel="mine"] { background: #3b2d12; color: #f7df8b; border-color: #b78d38; }
.region-hover-tip .rh-rel[data-rel="ally"],
.region-hover-tip .rh-rel[data-rel="alliance"] { background: #163244; color: #a7dcf2; border-color: #4b94b8; }
.region-hover-tip .rh-rel[data-rel="allied"] { background: #19381d; color: #b7efb2; border-color: #48a651; }
.region-hover-tip .rh-rel[data-rel="nap"] { background: #133836; color: #9df0e8; border-color: #36b0a5; }
.region-hover-tip .rh-rel[data-rel="enemy"] { background: #461715; color: #ffb2ab; border-color: #c9463c; }
.region-hover-tip .rh-meta {
  color: #5d4528;
  font-size: 11px;
  margin-bottom: 3px;
}
.region-hover-tip .rh-line {
  font-size: 11.5px;
  color: #312112;
}
.region-hover-tip .rh-tag {
  font-weight: 700;
  color: #5b3b14;
}
.region-hover-tip .rh-shield {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(138, 101, 50, 0.32);
  color: #1f3c63;
  font-weight: 600;
  font-size: 11px;
}

/* Finitions Carte Monde : Légende des icônes, couleurs personnalisées & Signets */
.world-legend + .world-legend { margin-top: 6px; }
.world-icon-guide-section {
  padding: 4px 8px 8px;
  border-top: 1px solid rgba(138, 112, 68, 0.4);
}
.world-icon-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  color: #c7b48a;
  font-size: 11px;
  font-weight: 600;
}
.world-icon-guide-head > .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.world-icon-guide-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
}
.world-icon-guide-row.is-static {
  grid-template-columns: 20px 1fr;
}
.world-icon-guide-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.world-icon-guide-copy strong {
  color: #f5ebd4;
  font-size: 11.5px;
  line-height: 1.2;
}
.world-icon-guide-copy small {
  color: #c4b28a;
  font-size: 10.5px;
  line-height: 1.2;
}
.world-color-input {
  width: 24px;
  height: 20px;
  padding: 0;
  border: 1px solid #9a7741;
  border-radius: 3px;
  background: transparent;
  cursor: var(--cur-pointer, pointer);
}
.world-bookmark-form {
  display: grid;
  grid-template-columns: 1fr 66px auto;
  gap: 5px;
  padding: 2px 8px 6px;
}
.world-bookmark-form .input {
  min-width: 0;
  height: 25px;
  padding: 2px 6px;
  font-size: 11.5px;
  background: #f1e2bd;
  color: #2b1d0f;
  border: 1px solid #9a7741;
}
.world-bookmark-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.world-bookmark-empty {
  color: #c4b28a;
  font-size: 11px;
  padding: 2px 0;
}
.world-bookmark-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
}
.world-bookmark-jump {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid rgba(154, 119, 65, 0.55);
  border-radius: 3px;
  background: rgba(24, 18, 12, 0.65);
  color: #f4ebd7;
  font: 600 11.5px/1.2 system-ui, sans-serif;
  text-align: left;
  cursor: var(--cur-pointer, pointer);
}
.world-bookmark-jump:hover {
  border-color: #e5c16c;
  background: rgba(229, 193, 108, 0.16);
}
.world-bookmark-star { color: #ffd859; }
.world-bookmark-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-bookmark-coords { color: #d8c394; font-variant-numeric: tabular-nums; font-size: 11px; }

/* Fiche d'inspection enrichie (tactique élémentaire, temps de trajet, actions rapides) */
.inspector-tactical {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(154, 119, 65, 0.45);
  border-radius: 4px;
  background: rgba(34, 25, 16, 0.24);
}
.inspector-progress { margin: 4px 0 6px; height: 7px; }
.inspector-weakness { color: #b9651b; }
.inspector-travel-block {
  margin: 10px 0;
}
.inspector-subheading {
  margin: 0 0 5px;
  font: 700 12px/1.25 Georgia, serif;
  color: var(--ink-strong, #3b2816);
}
.inspector-travel-table {
  width: 100%;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.inspector-travel-table th,
.inspector-travel-table td {
  padding: 3px 6px;
}
.inspector-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* ==========================================================================
 * Slice 4 — Refonte ergonomique & dédoublonnage Vue Monde + Fiche d'inspection
 * Panneau unifié « Carte & Légende » en haut à droite (Filtres | Signets | Couleurs),
 * barre .map-tools harmonisée à 28 px, et zéro recouvrement avec Messagerie / Inspecteur.
 * ========================================================================== */

.world-legend-dock {
  position: absolute;
  z-index: 6;
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
  width: 344px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 68px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9a7741 rgba(24, 18, 12, 0.55);
}

/* Quand la barre .map-tools remonte au-dessus de la languette ou du volet ouvert de Messagerie,
 * .world-legend-dock borne sa hauteur maximale juste au-dessus de .map-tools (zéro chevauchement). */
.hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat) .world-legend-dock {
  max-height: calc(100% - 96px);
}

.hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-open) .world-legend-dock {
  max-height: calc(100% - var(--aether-chat-open-height, 260px) - 62px);
}

@media (min-width: 901px) {
  /* La barre Messagerie repliée (5 canaux rapides = 481 px) + .map-tools (607 px) demandent >= 1140 px de scène
   * pour tenir côte à côte ; en dessous (ex. 1440x900 où la scène fait 1060 px), .map-tools reste à bottom: 42px. */
  .hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-collapsed) .world-map-viewport .floating-tools.map-tools {
    bottom: 42px;
  }

  @container (min-width: 1140px) {
    .hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-collapsed) .world-map-viewport .floating-tools.map-tools {
      bottom: 12px;
    }

    .hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-collapsed) .world-legend-dock {
      max-height: calc(100% - 68px);
    }
  }

  @container (min-width: 1180px) {
    .hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-open:not(.aether-chat-wide)) .world-legend-dock {
      max-height: calc(100% - 68px);
    }
  }

  @container (min-width: 1340px) {
    .hud-stage.live-map-stage:has(> #aether-chat-root > .aether-chat-wide) .world-legend-dock {
      max-height: calc(100% - 68px);
    }
  }

  /* Laisse le fil d'Ariane (.map-breadcrumb à top: 48px) intégralement dégagé au-dessus de la fiche .live-map-inspector */
  .hud-stage.live-map-stage:has(> .world-map-viewport):has(> #aether-chat-root > .aether-chat) > .live-map-inspector {
    --inspector-top: 80px;
  }
}

@media (max-width: 760px) {
  .world-legend-dock {
    top: 52px;
    right: 8px;
    left: auto;
    bottom: auto;
    width: min(328px, calc(100% - 16px));
    max-height: calc(100% - 116px);
  }
}

/* Panneau unifié « Carte & Légende » à 3 onglets */
.world-dock-card {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(38, 29, 20, 0.95), rgba(25, 19, 13, 0.96));
  border: 1px solid #967746;
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(235, 206, 138, 0.16);
}

.world-dock-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  list-style: none;
  user-select: none;
}

.world-dock-summary::-webkit-details-marker {
  display: none;
}

.world-dock-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 12.5px/1.2 Georgia, "Palatino Linotype", serif;
  color: #f4dfb0;
}

.world-dock-title::before {
  content: "▸";
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: #d8b566;
  transition: transform 100ms ease;
}

.world-dock-card[open] .world-dock-title::before {
  transform: rotate(90deg);
}

.world-dock-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(229, 193, 108, 0.16);
  border: 1px solid rgba(216, 181, 102, 0.45);
  color: #ebd6a3;
  font: 600 10.5px/1.35 system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.world-dock-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px 8px 6px;
  background: rgba(16, 12, 8, 0.42);
  border-top: 1px solid rgba(138, 112, 68, 0.36);
  border-bottom: 1px solid rgba(138, 112, 68, 0.42);
}

.world-dock-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 3px 6px;
  border-radius: 3px;
  border: 1px solid rgba(138, 112, 68, 0.48);
  background: linear-gradient(180deg, rgba(61, 47, 33, 0.88), rgba(40, 30, 21, 0.92));
  color: #dfd1b5;
  font: 600 11.5px/1.15 system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: var(--cur-pointer, pointer);
}

.world-dock-tab:hover {
  color: #fff8e8;
  border-color: #bfa05f;
}

.world-dock-tab.is-active,
.world-dock-tab[aria-selected="true"] {
  color: #fff9eb;
  background: linear-gradient(180deg, #986f28 0%, #684917 100%);
  border-color: #e4c16f;
  box-shadow: inset 0 1px 0 rgba(255, 246, 218, 0.3);
}

.world-dock-tab:focus-visible {
  outline: 2px solid #e5c16c;
  outline-offset: 1px;
}

.world-dock-panel {
  padding-top: 4px;
}

.world-dock-panel[hidden] {
  display: none !important;
}

.world-dock-card .world-legend-filters {
  padding: 2px 8px 4px;
}

.world-dock-card .world-legend-filters + .world-legend-filters {
  padding-top: 3px;
  border-top: 1px solid rgba(138, 112, 68, 0.25);
}

.world-dock-card .world-legend-row {
  min-height: 22px;
  font-size: 11.5px;
}

.world-dock-card .world-icon-guide-section {
  border-top: 0;
  padding: 4px 8px 8px;
}

.world-dock-card .btn-sm,
.world-legend .btn-sm {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.15;
}

.world-bookmark-form {
  padding: 4px 8px 6px;
  align-items: center;
}

.world-bookmark-input,
.world-bookmark-coords-input {
  box-sizing: border-box;
  border-radius: 3px;
}

.world-bookmark-coords-input {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.world-bookmark-delete {
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
}

.wv-legend-icon {
  display: block;
  flex-shrink: 0;
}

/* Harmonisation stricte 28 px de la barre d'outils .map-tools en bas à droite */
.live-map-viewport .floating-tools.map-tools {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: var(--radius-sm, 4px);
}

.live-map-viewport .floating-tools.map-tools :is(.btn, .btn-sm, .btn-icon) {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
}

.live-map-viewport .floating-tools.map-tools .btn-icon {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.live-map-viewport .floating-tools.map-tools :is(.map-coordinate .input, .world-continent-pick select.input) {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  box-sizing: border-box;
  font-size: 12px;
}

.live-map-viewport .floating-tools.map-tools .world-continent-pick select.input {
  max-width: 152px;
  padding: 2px 26px 2px 7px;
}

.map-breadcrumb .map-breadcrumb-coords {
  font-variant-numeric: tabular-nums;
}

/* Fiche d'inspection (.live-map-inspector) — contraste parchemin & utilitaires dédoublonnés */
.live-map-inspector .inspector-tactical {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(140, 108, 58, 0.42);
  border-radius: 4px;
  background: rgba(188, 156, 98, 0.14);
}

.live-map-inspector .inspector-city-utils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.live-map-inspector .btn-sm {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11.5px;
  line-height: 1.2;
}

.live-map-inspector .inspector-sea-note {
  margin: 5px 0 0;
  font-size: 11px;
}

/* Couches SVG de la vue Monde et classes unitaires conservées */
.world-icon-legend,
.world-bookmarks {
  box-sizing: border-box;
}

.aether-chat-toggle-label {
  display: inline;
}

.live-world.world-view :is(
  .wv-outside,
  .wv-sea,
  .wv-land,
  .wv-resources,
  .wv-rivers,
  .wv-grid,
  .wv-sectors,
  .wv-labels,
  .wv-label,
  .wv-pois,
  .wv-poi,
  .wv-active-city,
  .wv-bookmarks,
  .wv-bookmark,
  .wv-selection
) {
  vector-effect: none;
}
