/* ═══ analysis-map.css — shared AOI analysis-map controls ═══════════════
   Pairs with static/js/shared/analysis-map.js (the factory renders these
   classes). Loaded by every page that hosts an analysis map (/assessment;
   dashboard joins at the pjt-analysis-panel swap).

   레이어 패널은 여기 없다 — 2026-08-24 에 components/layer-control.css 로 나갔고
   Dashboard 와 공유한다. 여기 남은 건 팩토리 고유의 것뿐이다: focus mask · 검색
   pill · Color 토글 · Operators 패널 · 오퍼레이터 범례. (docs/MAP_LAYERS.md) */

/* ── AOI focus mask: outside strips + crisp outline ────────────────── */
.amap-desat {
  position:       absolute;
  inset:          0;
  z-index:        410;               /* above the pipeline canvas (400) */
  pointer-events: none;
}
.amap-desat span {
  position:                absolute;
  display:                 block;
  background:              rgba(92, 98, 116, .34);
  -webkit-backdrop-filter: saturate(.12) blur(1.6px) brightness(.9);
  backdrop-filter:         saturate(.12) blur(1.6px) brightness(.9);
}
body.light .amap-desat span {
  background:              rgba(148, 152, 166, .34);
  -webkit-backdrop-filter: saturate(.12) blur(1.6px) brightness(1);
  backdrop-filter:         saturate(.12) blur(1.6px) brightness(1);
}
.amap-outline {
  position:       absolute;
  inset:          0;
  z-index:        420;
  pointer-events: none;
  width:          100%;
  height:         100%;
}
.amap-outline polygon {
  fill:             none;
  stroke:           var(--acc);
  stroke-width:     1.4;
  stroke-dasharray: 6 5;
}

/* ── On-map search box (opts.search) ───────────────────────────────────
   Scoped to .amap-search — the marker the FACTORY puts on the control it
   mounts itself. NOT .amap-host: the AOI landing map is an amap-host too but
   wires its own full-width search box, and it must keep it.

   map-search.css parks the control at top-LEFT, which is the Layers control's
   seat: that panel grows to 156px wide and most of the card's height the
   moment you hover or open it, so anything sitting beside it gets covered (or
   covers it). So this one lives at the top-RIGHT instead — the opposite
   corner, free on every map that mounts a search — as a collapsed magnifier
   pill (30px, same square as the Layers button) that expands leftward on
   click/focus. Expanded width is capped short of the centre so it never
   reaches the Color toggle either. */
.map-search-wrap.amap-search {
  top:        8px;
  right:      8px;
  left:       auto;
  width:      30px;
  transition: width .16s ease;
}
.map-search-wrap.amap-search.open { width: min(240px, calc(50% - 96px)); }
/* A host with the Operators control also occupies the top-right — step left of
   its 24px button. (No consumer enables both today; this keeps it honest.) */
.map-search-wrap.amap-search.amap-search-ops { right: 46px; }
.amap-search .map-search-box {
  height:        30px;
  padding:       0 var(--space-sm);
  border-color:  var(--bdr2);
  border-radius: var(--radius);
  box-shadow:    var(--sh-raised);
}
/* Collapsed, the pill IS a button — cursor and hover feedback over its whole
   face, matching the Layers toggle beside it. */
.amap-search:not(.open) .map-search-box { cursor: pointer; }
.amap-search:not(.open) .map-search-box:hover { background: var(--bg2); }
.amap-search .map-search-icon { color: var(--t1); }
.amap-search .map-search-box:hover .map-search-icon { color: var(--acc); }
/* Collapsed = a plain icon button: the field folds to zero width so the
   magnifier centres in the 30px pill instead of overflowing it. */
.amap-search:not(.open) .map-search-box {
  padding:         0;
  gap:             0;
  justify-content: center;
}
.amap-search:not(.open) .map-search-input {
  flex:    0 0 0;
  width:   0;
  opacity: 0;
  pointer-events: none;
}
.amap-search:not(.open) .map-search-clear { display: none; }
/* Right-anchored: the dropdown keeps a readable width even when the expanded
   field is capped narrow, and hangs from the wrap's right edge so it drops
   INTO the map instead of off it. */
.amap-search .map-search-results {
  position:   absolute;
  top:        100%;
  right:      0;
  min-width:  240px;
  margin-top: 4px;
}

/* ── Color mode toggle (Type / Operator) — top-centre ──────────────── */
.amap-cmp {
  position:      absolute;
  top:           8px;
  left:          50%;
  transform:     translateX(-50%);
  z-index:       500;                /* above the desat strips (410) */
  display:       flex;
  align-items:   center;
  gap:           4px;
  padding:       var(--space-xs) var(--space-sm);
  background:    var(--bg1);
  border:        1px solid var(--bdr);
  border-radius: var(--radius);
  box-shadow:    var(--sh-raised);
  opacity:       .62;                /* hollow until hover */
  transition:    opacity .15s, box-shadow .15s;
}
.amap-cmp:hover { opacity: 1; box-shadow: var(--sh-raised); }
.amap-cmp-lbl {
  font-size:      var(--fs-xs);
  font-weight:    600;
  color:          var(--t2);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding:        0 var(--space-2xs);
}
.amap-cmp button {
  border:        none;
  background:    transparent;
  color:         var(--t1);
  font-size:     var(--fs-micro);
  font-weight:   600;
  font-family:   inherit;
  padding:       var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  cursor:        pointer;
  transition:    background .12s, color .12s;
}
.amap-cmp button:hover { color: var(--t0); background: var(--bg3); }
.amap-cmp button.on    { background: var(--acc); color: var(--on-acc); }

/* ── 왼쪽 레일 — 위치만 ─────────────────────────────────────────────
   Layers 와 Filter 의 좌표 원점. 레일이 있으면 두 패널의 top 이 지도가 아니라 서로에
   대해 정해져, 지도 안쪽 여백이 바뀌어도 한 곳만 고치면 된다. 패널 자체는
   components/layer-control.css · record-explorer.css — 여기서 정하는 건 어디에 앉고
   얼마나 높아질 수 있는가뿐이다(화면 문맥이라 공용이 아니다, docs/MAP_LAYERS.md §7). */
.amap-host > .map-rail {
  position:       absolute;
  top:            8px;
  left:           8px;
  z-index:        500;
  bottom:         8px;
  width:          0;                 /* 자리만 잡는 앵커 — 패널은 각자 뜬다 */
}
/* 레일 안에서 둘은 각자 자리를 지킨다 — 흐름에 두면 Layers 를 열 때마다 Filter 가
   저 아래로 밀려 지도 밖으로 나간다.

   **위에 있는 것이 위로 온다.** Layers 가 레일의 첫 칸이므로 z-order 도 Layers 가
   위다 — 펼친 Layers 는 아래 Filter 를 덮고, Filter 는 절대 Layers 를 뚫지 않는다.
   상호 배타로 풀지 않는 이유: Layers 는 hover 로도 열려서 클릭 기반 닫기가 걸리지
   않는다. 순서를 규칙으로 박아 두면 어떻게 열리든 결과가 같다. */
.map-rail { pointer-events: none; }
.map-rail > .lc, .map-rail > .rx { position: absolute; left: 0; pointer-events: auto; }
.map-rail > .lc { top: 0;    z-index: 2; }
.map-rail > .rx { top: 52px; z-index: 1; }  /* 0 + 42(접힌 패널) + 10(간격) */
/* 높이의 기준은 **레일**, 즉 지도 자신이다 — 뷰포트가 아니다. 전에는 100vh 에서
   쟀는데 지도는 화면보다 작게도 산다: 1366×768 에서 AOI 랜딩 지도가 601px 인데
   상한은 608px 이라 패널이 밑변을 60px 뚫고 나갔다. 넘친 부분은 지도가 잘라
   버리지만 본문은 자기가 다 보이는 줄 알아 스크롤이 거기서 멈춘다 — 마지막 두 줄
   (Shale Plays · PLSS Grid)에 손이 닿지 않았고, 브라우저 배율을 줄여야 나타났다
   (목록 높이는 px 고정인데 지도만 커져서). 레일은 top/bottom 이 박혀 있어 100% 가
   곧 지도 안쪽 높이다. */
.map-rail > .lc.lc-open, .map-rail > .lc:hover { max-height: 100%; }
.map-rail > .rx.rx-open { max-height: calc(100% - 52px); }   /* rx 는 레일의 52px 아래에서 선다 */

/* ── Operators control — top-RIGHT, mirrors the Layers control (top-left).
   Hosts the operator FILTER (isolate · eye · Reset). Right-anchored so the panel
   opens leftward into the map; the toggle button stays pinned to the top-right. */
.amap-ops {
  position:       absolute;
  top:            8px;
  right:          8px;
  z-index:        500;
  display:        flex;
  flex-direction: column;
  max-height:     calc(100% - 16px);
  overflow:       hidden;
  background:     var(--bg1);
  border:         1px solid var(--bdr2);
  border-radius:  var(--radius);
  padding:        var(--space-xs);
  box-shadow:     var(--sh-raised);
}
.amap-ops-toggle {
  display:         flex;
  align-items:     center;
  justify-content: center;
  align-self:      flex-end;   /* stay at the right edge as the panel grows leftward */
  width:           24px;
  height:          24px;
  padding:         0;
  color:           var(--t1);
  background:      none;
  border:          none;
  border-radius:   var(--radius);
  cursor:          pointer;
  flex-shrink:     0;
}
.amap-ops-toggle:hover              { background: var(--bg2); color: var(--t0); }
.amap-ops.open .amap-ops-toggle     { color: var(--acc); }
.amap-ops:hover, .amap-ops.open     { min-width: 160px; }
.amap-ops-body { display: none; overflow-y: auto; min-height: 0; padding: var(--space-xs) var(--space-sm) var(--space-sm); width: 100%; }
.amap-ops:hover .amap-ops-body,
.amap-ops.open  .amap-ops-body { display: block; }
/* Panel text sized to match the Layers panel (labels = --fs-micro) — the legend
   defaults (head 11px / rows 12px) read too big in this compact control. */
.amap-ops .amap-leg-head        { font-size: var(--fs-2xs); letter-spacing: .05em; }
.amap-ops .amap-leg-head button { font-size: var(--fs-2xs); }
.amap-ops .amap-leg-list        { gap: 1px; margin-top: 4px; }
.amap-ops .amap-leg-row         { font-size: var(--fs-micro); padding: 3px var(--space-xs); }
.amap-ops .amap-leg-empty       { font-size: var(--fs-micro); }

/* ── Operator legend (host element provided by the page) ───────────── */
.amap-leg-head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  font-size:       var(--rpt-s, 11px);
  font-weight:     700;
  letter-spacing:  .06em;
  color:           var(--t2);
  padding:         0 var(--space-2xs);
  flex-shrink:     0;
}
.amap-leg-head button {
  font-size:   var(--rpt-s, 11px);
  color:       var(--acc);
  cursor:      pointer;
  background:  none;
  border:      none;
  padding:     0;
  font-family: inherit;
}
.amap-leg-head button:hover { text-decoration: underline; }
.amap-leg-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; margin-top: 5px; }
.amap-leg-row {
  display:       flex;
  align-items:   center;
  gap:           7px;
  padding:       var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm);
  font-size:     var(--rpt-b, 12px);
  color:         var(--t0);
  cursor:        pointer;
  border:        1px solid transparent;
  border-radius: var(--radius);
  background:    var(--bg2);
  transition:    background .12s, border-color .12s, opacity .12s;
}
.amap-leg-row:hover { background: var(--bg3); }
.amap-leg-row.focus { border-color: var(--acc); box-shadow: inset 2px 0 0 var(--acc); }
.amap-leg-row.off   { opacity: .45; }
.amap-leg-sw { flex-shrink: 0; width: 14px; height: 4px; border-radius: 2px; }
.amap-leg-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amap-leg-eye {
  flex-shrink:     0;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  width:           20px;
  height:          20px;
  padding:         0;
  color:           var(--t2);
  background:      none;
  border:          none;
  border-radius:   var(--radius);
  cursor:          pointer;
  transition:      background .12s, color .12s;
}
.amap-leg-eye:hover { background: var(--bg2); color: var(--t0); }
.amap-leg-empty { font-size: var(--rpt-b, 12px); color: var(--t2); padding: var(--space-xs) var(--space-2xs); }

/* Zoom control skin → shared in base.css (tokenized, all maps). Only the
   bottom-right POSITIONING stays here (factory adds the control there so it
   doesn't collide with the layers control at top-left). */
.amap-host .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin: 0 10px 10px 0; }
