/* ==========================================================================
   집테리어 지도 우측 버튼 레일 — zippalgo360.com/map 우측 레일과 100% 동일하게
   (2026-09-06 7차, 부대표 지시 재확인: "오른쪽 버튼들"은 헤더가 아니라 지도
   버튼이었음. 이어서 "디자인만이 아니라 기능·클릭 시 색 변화까지" + 옛
   zippalgo360.com/zipterior 의 "인테리어" 버튼(가까운/최신 포폴) 추가 지시).
   레퍼런스 실측(부대표 실브라우저 1920px, getComputedStyle) + N 원본 소스
   (/srv/zippalgo360/apps/web/src/app/map/page.tsx, NearbyPortfolioWidget.tsx):
     컨테이너: absolute right:16px, 헤더 아래 16px, flex-col items-end gap:8px
     타일 공통: 44x44, radius 12px, border 1px #e6e9e7(line), bg #fff,
       shadow-md(0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1)),
       글자/아이콘 ink(#202421) 80%, hover bg #f5f6f5(soft)
     켜진/전환 상태(controlButtonClass(active)): 배경은 그대로 흰색, 테두리와
       글자만 #bb1730(brand-red). AI 는 열려 있을 때 에메랄드 링(ring-2 #6ee7b7).
     순서: 채팅 → AI검색 → 줌 +/− → 현재위치 → 지도유형 → 면적단위 → 레이어
       → 인테리어(시공사례 위젯, 시공사례 레이어가 켜져 있을 때만)
     드롭다운 패널: 버튼 왼쪽(right-full mr-2), 버튼 상단 정렬, rounded-2xl,
       border line, bg white, shadow-lg. 레이어 패널 256px, 인테리어 320px.
   구현 원칙: style.css(9개 HTML 공유, 7일 캐시)는 건드리지 않고 이 파일에서
   덮어쓴다. style.css 의 2026-09-04(A-2) 블록이 색/배경/테두리를 !important
   로 박아놨기 때문에 그 속성들은 여기서도 !important 가 필요하다. 위치
   (top/right)는 !important 를 쓰지 않는다 — html.zt-embedded(m.html 임베드)
   등 기존 상황별 규칙이 더 구체적인 선택자로 계속 이길 수 있게.
   ========================================================================== */

/* ---- 컨테이너 ---- */
.map-shell > .map-quick-controls{
  right: 16px;               /* 레퍼런스 right-4 */
  top: 97px;                 /* 고정 헤더 81px + 레퍼런스 top-4(16px) */
  gap: 8px;                  /* 레퍼런스 gap-2 */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.map-quick-controls .map-rail-group{ display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.map-quick-controls .map-rail-chat,
.map-quick-controls .map-rail-layer,
.map-quick-controls .map-rail-feed{ position: relative; }
.map-quick-controls .map-rail-feed[hidden]{ display: none; }

/* ---- 타일 공통 ---- */
.map-quick-controls .map-chat-button,
.map-quick-controls .ai-search-button,
.map-quick-controls .zipterior-zoom-control,
.map-quick-controls .locate-control,
.map-quick-controls .map-type-control,
.map-quick-controls .area-unit-control,
.map-quick-controls .map-layer-button,
.map-quick-controls .interior-feed-button{
  box-sizing: border-box;
  width: 44px !important;
  margin: 0;
  padding: 0 !important;
  border-radius: 12px !important;
  border: 1px solid #e6e9e7 !important;
  background: #fff !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1) !important;
  backdrop-filter: none !important;
  color: rgba(32,36,33,.8) !important;
  flex: 0 0 auto;
}
.map-quick-controls .map-chat-button,
.map-quick-controls .ai-search-button,
.map-quick-controls .locate-control,
.map-quick-controls .map-type-control,
.map-quick-controls .area-unit-control,
.map-quick-controls .map-layer-button,
.map-quick-controls .interior-feed-button{
  position: relative;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: inherit;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.map-quick-controls .map-chat-button:hover,
.map-quick-controls .locate-control:hover,
.map-quick-controls .map-layer-button:hover,
.map-quick-controls .interior-feed-button:hover{
  background: #f5f6f5 !important;           /* 레퍼런스 hover:bg-soft */
}
.map-quick-controls .map-chat-button svg,
.map-quick-controls .locate-control svg,
.map-quick-controls .map-layer-button svg{
  width: 20px !important; height: 20px !important; display: block;
  fill: none; stroke: currentColor;
}
.map-quick-controls .map-chat-button path{ fill: none; stroke: currentColor; stroke-width: 1.8; }
.map-quick-controls .locate-control svg{ stroke-width: 2; }

/* ---- 켜진/전환 상태 = 빨간 테두리+글자 (N controlButtonClass(active)) ----
   - .is-open : 채팅/레이어/인테리어 패널이 열려 있을 때(js/zp-map-rail.js)
   - .locate-control.active : 위치 확인 중(app.js 가 붙였다가 1.2초 뒤 뗌)
   - 지도유형 위성 / 면적단위 ㎡ : 기본값(일반/평)이 아닌 쪽이 켜졌을 때 */
.map-quick-controls .map-chat-button.is-open,
.map-quick-controls .map-layer-button.is-open,
.map-quick-controls .interior-feed-button.is-open,
.map-quick-controls .locate-control.active,
.map-quick-controls .map-type-control:has(button[data-map-type="satellite"].active),
.map-quick-controls .area-unit-control:has(button[data-area-unit="m2"].active){
  border-color: #bb1730 !important;
  color: #bb1730 !important;
  background: #fff !important;
}
.map-quick-controls .map-type-control:has(button[data-map-type="satellite"].active) button.active,
.map-quick-controls .area-unit-control:has(button[data-area-unit="m2"].active) button.active{
  color: #bb1730 !important;
}

/* 채팅 미확인 배지: N 과 동일(우상단 16px 빨간 원, 숫자 9px). 숫자는
   js/zp-map-rail.js 가 app.js 의 aria-label("새 채팅 N개 열기")에서 읽어 채움. */
.map-quick-controls .map-chat-new{
  position: absolute; left: auto; top: -4px; right: -4px; transform: none;
  min-width: 16px; height: 16px; padding: 0 4px; display: none;
  align-items: center; justify-content: center;
  border-radius: 999px; background: #bb1730; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: 0; box-shadow: none;
}
.map-quick-controls .map-chat-button.has-unread .map-chat-new{ display: flex; }

/* ---- AI 검색: 그라데이션 타일 + "AI" 배지, 열려 있으면 에메랄드 링 ---- */
.map-quick-controls .ai-search-button{
  border-color: transparent !important;
  background: linear-gradient(to bottom right, #38bdf8 0%, #2dd4bf 50%, #10b981 100%) !important;
  color: #fff !important;
}
.map-quick-controls .ai-search-button:hover{ filter: brightness(1.1); }
.map-quick-controls .ai-search-button.is-open{
  box-shadow: 0 0 0 2px #6ee7b7, 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1) !important; /* ring-2 ring-emerald-300 */
}
.map-quick-controls .ai-search-button svg{ width: 20px; height: 20px; display: block; }
.map-quick-controls .ai-search-new{
  position: absolute; top: -4px; right: -4px;
  padding: 0 4px; border-radius: 999px;
  background: #fff; color: #0d9488;          /* 레퍼런스 text-teal-600 */
  font-size: 8px; font-weight: 700; line-height: 14px;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
}

/* ---- 줌 +/− 묶음 ---- */
.map-quick-controls .zipterior-zoom-control{
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  height: auto;
  background: rgba(255,255,255,.95) !important;   /* 레퍼런스 bg-white/95 */
  backdrop-filter: blur(8px) !important;           /* 레퍼런스 backdrop-blur */
}
.map-quick-controls .zipterior-zoom-control button{
  width: 100% !important;
  height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgba(32,36,33,.8) !important;
  font-family: inherit;
  font-size: 20px;                 /* 레퍼런스 text-xl */
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.map-quick-controls .zipterior-zoom-control button + button{ border-top: 1px solid #e6e9e7 !important; }
.map-quick-controls .zipterior-zoom-control button:hover,
.map-quick-controls .zipterior-zoom-control button:active{
  background: #f5f6f5 !important;
  color: rgba(32,36,33,.8) !important;
}

/* ---- 지도유형(일반/위성)·면적단위(평/㎡): 현재 값 하나만 타일로 표시
   (A-2 방식 유지 — 클릭하면 index.html 인라인 스크립트가 숨은 반대쪽 버튼을
   대신 눌러 app.js 기존 로직을 그대로 태운다). 기본값은 ink 80%, 전환된
   상태(위성/㎡)는 위 규칙으로 빨강. ---- */
.map-quick-controls .map-type-control > span,
.map-quick-controls .area-unit-control > span,
.map-quick-controls .map-type-control button:not(.active),
.map-quick-controls .area-unit-control button:not(.active){ display: none !important; }
.map-quick-controls .map-type-control button.active,
.map-quick-controls .area-unit-control button.active{
  display: flex !important; align-items: center !important; justify-content: center !important;
  width: 100% !important; height: 100% !important;
  padding: 0 !important; border: 0 !important; border-radius: 12px !important;
  background: #fff !important;
  color: rgba(32,36,33,.8) !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
.map-quick-controls .map-type-control button.active:hover,
.map-quick-controls .area-unit-control button.active:hover{ background: #f5f6f5 !important; }

/* ---- 레이어 버튼 배지(켜진 레이어 수) ---- */
.map-quick-controls .map-rail-badge{
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; display: flex;
  align-items: center; justify-content: center;
  border-radius: 999px; background: #bb1730; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.map-quick-controls .map-rail-badge[hidden]{ display: none; }

/* ---- 인테리어(시공사례 위젯) 버튼: 두 줄 글자 ---- */
.map-quick-controls .interior-feed-button{
  flex-direction: column !important;
  gap: 2px;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
.map-quick-controls .interior-feed-button span{ display: block; }

/* ---- 드롭다운 패널 공통(레이어/인테리어): 버튼 왼쪽, 상단 정렬 ---- */
.map-rail-panel{
  position: absolute; right: 100%; top: 0; margin-right: 8px;
  background: #fff; border: 1px solid #e6e9e7; border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); /* shadow-lg */
  overflow-x: hidden; overflow-y: auto; text-align: left; color: #202421;
  font-family: Pretendard,"Noto Sans KR",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  z-index: 5;
  scrollbar-width: thin;   /* 뷰포트보다 길어지면(레이어 패널) 안에서 스크롤 -- js가 max-height 지정 */
}
.map-rail-panel[hidden]{ display: none; }
.map-layer-panel{ width: 256px; }
.interior-feed-panel{ width: 320px; }
.map-rail-panel p{ margin: 0; }
.map-rail-panel button{ font-family: inherit; }

/* 레이어 패널 내부 */
.mlp-head{ display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #e6e9e7; }
.mlp-title{ font-size: 14px; font-weight: 700; color: #202421; }
.mlp-close, .ifp-close{
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; color: #777e79; font-size: 14px; cursor: pointer;
}
.mlp-close:hover, .ifp-close:hover{ background: #f5f6f5; color: #202421; }
.mlp-group{ padding: 12px 16px; border-top: 1px solid #e6e9e7; }
.mlp-group:first-child{ border-top: 0; }
.mlp-group-label{ margin: 0 0 6px !important; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: #777e79; }
.mlp-rows{ display: flex; flex-direction: column; gap: 2px; }
.mlp-row{
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left;
  transition: background-color .15s ease;
}
.mlp-row:hover{ background: #f5f6f5; }
.mlp-row.is-on{ background: #f5f6f5; }
.mlp-row[disabled]{ opacity: .45; cursor: not-allowed; }
.mlp-row[disabled]:hover{ background: transparent; }
.mlp-left{ display: flex; align-items: center; gap: 8px; min-width: 0; }
.mlp-right{ display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mlp-dot{ width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; }
.mlp-name{ font-size: 14px; font-weight: 500; color: #202421; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlp-count{ font-size: 11px; font-weight: 500; color: #777e79; }
.mlp-soon{ border-radius: 999px; background: #f5f6f5; padding: 2px 6px; font-size: 10px; font-weight: 600; color: #777e79; }
.mlp-switch{
  position: relative; width: 36px; height: 20px; border-radius: 999px; background: #e6e9e7; flex: 0 0 auto;
  transition: background-color .15s ease;
}
.mlp-row.is-on .mlp-switch{ background: #21463b; } /* brand-green */
.mlp-switch::after{
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  transition: transform .15s ease;
}
.mlp-row.is-on .mlp-switch::after{ transform: translateX(16px); }
.mlp-note{ display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #e6e9e7; background: rgba(245,246,245,.6); padding: 12px 16px; }
.mlp-note p{ display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 1.6; color: #21463b; }
.mlp-note-dot{ width: 6px; height: 6px; border-radius: 999px; background: #21463b; flex: 0 0 auto; }
.mlp-foot{ border-top: 1px solid #e6e9e7; padding: 12px 16px; }
.mlp-save{
  width: 100%; border: 0; border-radius: 8px; background: #21463b; color: #fff;
  padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; transition: opacity .15s ease;
}
.mlp-save:hover{ opacity: .9; }
.mlp-foot p{ margin-top: 6px !important; font-size: 10px; line-height: 1.6; color: #777e79; }

/* 인테리어(시공사례) 패널 내부 — N NearbyPortfolioWidget 그대로 */
.ifp-head{ display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #e6e9e7; }
.ifp-tabs{ display: flex; gap: 4px; }
.ifp-tab{
  border: 0; background: transparent; border-radius: 999px; padding: 4px 10px;
  font-size: 11px; font-weight: 600; color: #777e79; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.ifp-tab:hover{ background: #f5f6f5; }
.ifp-tab.is-active{ background: rgba(33,70,59,.15); color: #21463b; }   /* bg-brand-green/15 text-brand-green */
.ifp-body{ padding: 8px; }
.ifp-msg{ padding: 24px 12px; text-align: center; font-size: 11px; line-height: 1.6; color: #777e79; white-space: pre-line; }
.ifp-pages{
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -ms-overflow-style: none; scrollbar-width: none;
}
.ifp-pages::-webkit-scrollbar{ display: none; }
.ifp-page{
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-content: start;
  height: 176px; width: 100%; flex: 0 0 100%; scroll-snap-align: center;
}
.ifp-item{
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border: 0; background: transparent; border-radius: 8px; padding: 6px; text-align: left; cursor: pointer;
  transition: background-color .15s ease;
}
.ifp-item:hover{ background: #f5f6f5; }
.ifp-thumb{ width: 40px; height: 40px; flex: 0 0 auto; border-radius: 8px; overflow: hidden; background: #f5f6f5; display: block; }
.ifp-thumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.ifp-info{ min-width: 0; flex: 1; display: block; }
.ifp-name{ font-size: 11px; font-weight: 700; color: #202421; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ifp-sub{ font-size: 9px; color: #777e79; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ifp-meta{ font-size: 9px; color: #21463b; }
.ifp-dots{ margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ifp-dot{ width: 6px; height: 6px; border-radius: 999px; background: #e6e9e7; transition: all .15s ease; }
.ifp-dot.is-active{ width: 8px; height: 8px; background: rgba(32,36,33,.7); }

/* ---- 옛 "내 주변 시공사례" 상시 위젯/재오픈 탭은 N 과 동일하게 인테리어
   버튼 드롭다운으로 대체되어 숨김(app.js 가 여전히 5개를 불러와 채우지만
   화면엔 안 보임 — 기능은 위 드롭다운이 18개로 확장해 대신함). ---- */
.map-shell > .nearby-widget,
.map-shell > .nearby-widget-reopen{ display: none !important; }

/* ---- AI 검색 패널: N 과 동일 위치(right-4 top-20 → 헤더 81px + 80px),
   340px, 70vh, rounded-2xl, 레일 위에 겹쳐 뜸. index.html 인라인 <style>보다
   특이도가 높아 순서와 무관하게 이긴다. ---- */
.map-shell > .ai-search-panel{
  top: 161px; right: 16px; width: 340px; max-height: 70vh;
  border-radius: 16px; border: 1px solid #e6e9e7;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); /* shadow-2xl */
  z-index: 900;
}
