/* ── 페이지·컴포넌트 CSS — React 원본에서 그대로 옮김 (2026-10-15) ── */

/* ===== Header.css ===== */
/* 공용 헤더 — 랜딩 헤더(.ld-nav)를 그대로 옮겨온 스타일. 랜딩·업로드가 공유한다.
   로고 글자는 공용 .md-logo(theme.css)가 담당 — 여기선 배치만. */

.hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--md-header-y) var(--md-gutter);
  /* 히어로 섹션(z-index:2) 위로 — 언어 드롭다운이 섹션에 안 가리게 */
  position: relative;
  z-index: 20;
}

.hd-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hd-menu a {
  color: var(--md-muted);
  text-decoration: none;
  font-size: 13px;
}

.hd-menu a:hover {
  color: var(--md-text);
}

.hd-navlink {
  color: var(--md-muted);
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.hd-navlink:hover,
.hd-navlink[aria-current='page'] {
  color: var(--md-text);
}

.hd-cta {
  border: 1px solid var(--md-accent);
  color: var(--md-accent);
  background: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
}

.hd-cta:hover {
  background: var(--md-accent-dim);
}

/* ── 반응형 (랜딩에서 쓰던 규칙 그대로) ─────────────── */
@media (max-width: 900px) {
  .hd-menu {
    gap: 16px;
  }
}

@media (max-width: 560px) {
  .hd-menu a {
    display: none; /* 모바일 — 마당 버튼만 유지 */
  }
}

/* ===== LangSelect.css ===== */
.lang-select {
  position: relative;
  display: inline-block;
}

.lang-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  opacity: 0.85;
}
.lang-select-btn:hover {
  opacity: 1;
}
.lang-globe {
  font-size: 14px;
  line-height: 1;
}
.lang-current {
  letter-spacing: 0.04em;
}

.lang-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: transparent;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 130px;
  background: var(--panel, #171a1f);
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 1000; /* 백드롭(900)보다 확실히 위 — 안의 버튼이 백드롭에 가리지 않게 */
  pointer-events: auto;
}
.lang-menu li {
  margin: 0;
  pointer-events: auto;
}
.lang-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.8;
  pointer-events: auto;
}
.lang-opt:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
  opacity: 1;
}
.lang-opt.is-active {
  opacity: 1;
  font-weight: 600;
  color: var(--md-accent, #e0703a);
}

/* ===== Landing.css ===== */
/* 랜딩은 shell.css(피그마 '02 매스', 2026-11-02)가 전부 맡는다 — 10-13 종이 바탕 규칙은 지움(세로 가운데·여백·버튼 색이 새 시안과 부딪혀서) */

/* ===== LoginPage.css ===== */
.lg-page {
  display: flex;
  min-height: 100vh;
  background: var(--md-bg);
  color: var(--md-text);
  font-family: var(--md-sans);
}

/* ── 좌: 3D 매싱 프리뷰 ── */
.lg-visual {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex; /* Canvas가 flex로 실제 크기를 갖게 — absolute면 r3f가 0으로 측정 */
  border-right: 1px solid var(--md-line);
}

/* 글자 표현은 공용 .md-logo — 여기선 배치만 */
.lg-logo {
  position: absolute;
  top: 26px;
  left: 30px;
  z-index: 2;
}

.lg-logo-link{
  color: var(--md-text);
  text-decoration: none;
}

.lg-scene {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.iso-svg {
  width: 100%;
  height: 100%;
  max-width: 560px;
  max-height: 70%;
}

.lg-visual-caption {
  position: absolute;
  left: 30px;
  bottom: 24px;
  z-index: 2;
  color: var(--md-muted);
  font-size: 12px;
}

/* ── 우: 폼 ── */
.lg-form-wrap {
  width: 460px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 40px 56px;
}

.lg-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.lg-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--md-muted);
}

.lg-title {
  font-family: var(--md-serif);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.5px;
  margin: 10px 0 34px;
}

.lg-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 26px;
}

.lg-field > span {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
  margin-bottom: 10px;
}

.lg-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lg-forgot {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.lg-forgot:hover {
  color: var(--md-text);
}

.lg-field input {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--md-line);
  color: var(--md-text);
  font-size: 15px;
  padding: 4px 0 10px;
  outline: none;
  transition: border-color 0.15s;
}

.lg-field input::placeholder {
  color: #5a5346;
}

.lg-field input:focus {
  border-bottom-color: var(--md-accent);
}

.lg-msg {
  font-size: 13px;
  color: #e08a4a;
  margin-bottom: 18px;
}

.lg-submit {
  align-self: flex-start;
  background: none;
  border: 0;
  border-bottom: 2px solid var(--md-accent);
  color: var(--md-text);
  font-size: 16px;
  padding: 0 2px 6px;
  cursor: pointer;
  margin-bottom: 30px;
}

.lg-submit span {
  color: var(--md-accent);
  margin-left: 4px;
}

.lg-or {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--md-muted);
  font-size: 12px;
  margin-bottom: 20px;
}

.lg-or::before,
.lg-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--md-line);
}

.lg-google {
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  color: var(--md-text);
  font-size: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.lg-google:hover {
  border-color: var(--md-muted);
}

.lg-swap {
  margin-top: 28px;
  font-size: 13px;
  color: var(--md-muted);
}

.lg-swap button {
  background: none;
  border: 0;
  color: var(--md-accent);
  font-size: 13px;
  cursor: pointer;
  margin-left: 8px;
  border-bottom: 1px solid transparent;
}

.lg-swap button:hover {
  border-bottom-color: var(--md-accent);
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 820px) {
  .lg-page {
    flex-direction: column;
  }

  .lg-visual {
    flex: none;
    height: 34vh;
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--md-line);
  }

  .lg-form-wrap {
    width: auto;
    flex: 1;
    padding: 32px 24px;
    align-items: flex-start;
  }

  .lg-title {
    font-size: 30px;
    margin-bottom: 26px;
  }
}

/* 아이디·비밀번호 기억하기 (2026-10-15) */
.lg-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 14px;
  font-size: 12.5px;
  color: var(--md-muted);
  cursor: pointer;
  user-select: none;
}
.lg-remember input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--md-accent);
  cursor: pointer;
}
.lg-remember em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: var(--md-muted);
  opacity: 0.75;
}

/* 구글 버튼 컨테이너 — GIS가 iframe 버튼을 그린다 */
.lg-google-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: 18px;
}
.lg-google[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== MapLibreScene.css ===== */
.mls {
  position: absolute;
  inset: 0;
}

.mls-map {
  position: absolute;
  inset: 0;
}

.mls-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-muted);
  font-size: 13px;
  background: #0e1116;
}

/* 베이스맵 전환 (일반/위성) — 좌하단 */
.mls-basemap {
  position: absolute;
  bottom: 28px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 2px;
  background: rgba(15, 13, 10, 0.82);
  border: 1px solid var(--md-line);
  border-radius: 9px;
  padding: 3px;
}

.mls-basemap button {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--md-muted);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}

.mls-basemap button:hover {
  color: var(--md-text);
}

/* ===== MassingScene.css ===== */

/* ===== VWorldMap.css ===== */
.vwmap-wrap {
  position: absolute;
  inset: 0;
  background: #0F0D0A;
}

.vwmap-host {
  position: absolute;
  inset: 0;
}

.vwmap-host canvas {
  width: 100%;
  height: 100%;
}

.vwmap-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--md-text);
  background: var(--md-bg);
  word-break: keep-all;
}

.vwmap-error-samples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.vwmap-error-samples button {
  border: 1px solid var(--md-accent);
  background: none;
  color: var(--md-accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* ── VWorld 기본 도구 모음 재배치 (주인님 2026-07-31) ──────────────────
   VWorld API가 만드는 도구 패널(#naviTopPannel3d)은 기본이 우측 상단 세로 스택이라
   오른쪽 대지 정보 패널과 겹친다. 겹치지 않게 화면 하단 중앙에 가로 한 줄로 붙인다.
   API가 만드는 DOM이라 우리 CSS로 덮어쓴다 — 클래스(zoom-top-right)가 위치를 정하므로
   위치 속성은 !important로 확실히 이긴다. */
#naviTopPannel3d.dt-api-map--tool {
  top: auto !important;
  right: auto !important;
  /* 축척·저작권 바 위. 대지 정보 패널(.site-panel)과는 별개 값 — 따로 조정한다 */
  bottom: 18px !important;
  left: 50% !important;
  transform: translateX(-50%);
  width: auto !important;
  height: auto !important;
  flex-direction: row !important;
  align-items: flex-end;
  gap: 8px;
  /* 지도 위 요소 위로, 단 우리 UI(패널·검색)보다는 아래 */
  z-index: 1 !important;
}

/* 각 버튼 그룹도 가로로 눕힌다 */
#naviTopPannel3d .dt-api-map--tool-btns,
#naviTopPannel3d .dt-api-map--tool-btns-measure {
  flex-direction: row !important;
  width: auto !important;
  height: auto !important;
}

/* 좁은 화면 — 도구가 화면 폭을 넘지 않게 줄바꿈 허용 */
@media (max-width: 720px) {
  #naviTopPannel3d.dt-api-map--tool {
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 24px);
  }
}

/* ===== AppShell.css ===== */
.app {
  display: flex;
  height: 100vh;
  background: var(--md-bg);
  color: var(--md-text);
  font-family: var(--md-sans);
}

/* ── 사이드바 ─────────────────────────── */
.app-side {
  width: 230px;
  flex-shrink: 0;
  border-right: 1px solid var(--md-line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 글자 표현(크기·굵기·자간·색)은 공용 .md-logo — 여기선 배치만 */
.app-logo {
  margin-bottom: 14px;
}

.app-newchat {
  background: none;
  border: 0;
  color: var(--md-text);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.app-newchat .plus {
  color: var(--md-accent);
  margin-right: 4px;
}

.app-search {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--md-muted);
  font-size: 13px;
  padding: 4px 0;
  outline: none;
}

.app-search:focus {
  border-bottom-color: var(--md-line);
  color: var(--md-text);
}

.app-recents-label {
  margin-top: 22px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.app-recents {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-recent {
  background: none;
  border: 0;
  color: var(--md-muted);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-recent:hover {
  color: var(--md-text);
  background: var(--md-bg-raised);
}

.app-recent.active {
  color: var(--md-text);
  background: var(--md-bg-raised);
}

.app-recents-empty {
  color: var(--md-muted);
  font-size: 12px;
  padding: 5px 6px;
}

.app-logout {
  background: none;
  border: 1px solid var(--md-line);
  color: var(--md-muted);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  cursor: pointer;
}

/* ── 메인 ─────────────────────────── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px 12px;
  /* 헤더를 본문(.app-body, position:relative) 위로 — 언어 드롭다운이 안 가리게 */
  position: relative;
  z-index: 20;
}

/* 스텝 탭은 가운데, 언어 셀렉터는 오른쪽 끝 — 스페이서가 양쪽을 균등히 밀어낸다.
   (주인님 2026-07-31: 언어 버튼이 Design 탭과 겹치던 원인 = spacer 규칙 부재로 폭 0) */
.app-top-spacer {
  flex: 1;
  min-width: 12px;
}

.app-lang {
  flex: none;
}

.app-steps {
  display: flex;
  gap: 26px;
  flex: none;
}

.app-step {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.app-step.active {
  color: var(--md-accent);
}

.app-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.app-body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.app-burger {
  display: none;
  background: none;
  border: 1px solid var(--md-line);
  color: var(--md-text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
}

.app-side-backdrop {
  display: none;
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 900px) {
  .app-side {
    width: 190px;
    padding: 16px 14px;
  }

  .app-top {
    padding: 12px 20px 10px;
  }

  .app-steps {
    gap: 18px;
  }
}

@media (max-width: 680px) {
  /* 사이드바 → 오프캔버스 */
  .app-side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: 230px;
    background: var(--md-bg);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
  }

  .app-side.open {
    transform: translateX(0);
  }

  .app-side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.5);
  }

  .app-burger {
    display: block;
  }

  .app-top {
    padding: 10px 14px 8px;
    gap: 10px;
  }

  .app-steps {
    gap: 14px;
    overflow-x: auto;
  }

  .app-step {
    font-size: 12px;
    white-space: nowrap;
  }
}

/* 서버 저장/로드 실패 안내 — 2026-10-14 백엔드 연동 */
.app-sync-msg {
  margin: 8px 12px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #8a3b2e;
  background: #f8e9e5;
  border-radius: 6px;
}

/* ===== Site.css ===== */
.site {
  position: absolute;
  inset: 0;
}

.site-search {
  position: absolute;
  z-index: 10;
  top: 16px;
  left: 20px;
  background: var(--md-bg-raised);
  border: 1px solid var(--md-line);
  border-radius: 999px;
  padding: 9px 18px;
}

/* 검색 결과 목록 (2026-10-16) */
.site-search-hits {
  position: absolute;
  z-index: 11;
  top: 58px;
  left: 20px;
  width: 300px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--md-bg-raised);
  border: 1px solid var(--md-line);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.site-search-hit {
  background: none;
  border: 0;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--md-text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-search-hit:hover {
  background: var(--md-line);
}

.site-search-hit .hit-title {
  font-size: 13px;
}

.site-search-hit .hit-addr {
  font-size: 11px;
  color: var(--md-muted);
}

.site-search-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: 0;
  color: var(--md-muted);
  cursor: pointer;
  font-size: 12px;
}

.site-search input {
  background: none;
  border: 0;
  outline: none;
  color: var(--md-text);
  font-size: 13px;
  width: 200px;
}

/* 영역 직접 지정 버튼 — 검색창 아래 */
.site-draw {
  position: absolute;
  z-index: 10;
  top: 62px;
  left: 20px;
  background: var(--md-bg-raised);
  border: 1px solid var(--md-line);
  border-radius: 999px;
  color: var(--md-text);
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
}

.site-draw:hover {
  border-color: var(--md-muted);
}

.site-draw.on {
  border-color: var(--md-accent);
  color: var(--md-accent);
}

.site-toast {
  position: absolute;
  z-index: 10;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 13, 10, 0.92);
  border: 1px solid var(--md-line);
  color: var(--md-text);
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  word-break: keep-all;
}

.site-panel {
  position: absolute;
  z-index: 10;
  top: 16px;
  right: 16px;
  /* 지도 하단 축척·저작권 바를 피해 끝난다 — 내용이 길면 패널 안에서 스크롤.
     지도 도구(#naviTopPannel3d)와는 별개 값이다 — 각각 따로 조정한다 */
  bottom: 50px;
  width: 250px;
  background: var(--md-bg);
  border: 1px solid var(--md-line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sp-eyebrow {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--md-accent);
}

.sp-title {
  font-family: var(--md-serif);
  font-size: 21px;
  margin-top: 10px;
}

.sp-addr {
  color: var(--md-muted);
  font-size: 12px;
  margin-top: 4px;
}

.sp-rows {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}

.sp-row {
  padding: 10px 0;
  border-top: 1px solid var(--md-line);
}

.sp-label {
  font-size: 11px;
  color: var(--md-muted);
}

.sp-value {
  font-size: 16px;
  margin-top: 3px;
}

.sp-value.small {
  font-size: 13px;
}

/* Esquisse 1단계 — 대지 읽기 발견 */
.sp-reading {
  margin-top: 16px;
  border-top: 1px solid var(--md-line);
  padding-top: 12px;
}

.sp-reading-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-accent);
}

.sp-find {
  margin-top: 12px;
}

.sp-find-title {
  font-size: 12px;
}

.sp-find-text {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--md-muted);
  line-height: 1.65;
  word-break: keep-all;
}

/* 다음 단계 CTA — 패널 바닥에 고정(sticky), 내용은 그 위에서 스크롤 (2026-10-15) */
.sp-foot {
  position: sticky;
  bottom: -20px; /* 패널 padding 만큼 내려 바닥에 붙인다 */
  margin: auto -20px -20px;
  padding: 14px 20px 20px;
  background: linear-gradient(to bottom, transparent, var(--md-bg) 14px);
}

.sp-cta {
  width: 100%;
  padding: 12px 14px;
  background: var(--md-accent);
  border: 1px solid var(--md-accent);
  border-radius: 8px;
  color: var(--md-bg);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: filter 0.15s;
}

.sp-cta:hover {
  filter: brightness(1.08);
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 680px) {
  .site-search {
    top: 10px;
    left: 12px;
    padding: 7px 14px;
  }

  .site-search input {
    width: 140px;
    font-size: 12px;
  }

  /* 정보 패널 → 하단 시트 */
  .site-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 46%;
    padding: 16px;
  }

  .sp-title {
    font-size: 18px;
  }

  .sp-value {
    font-size: 14px;
  }

  .site-toast {
    bottom: auto;
    top: 54px;
  }
}

/* 씬 전환 (지도 ↔ 스튜디오) — 영역 지정 버튼 아래 */
.site-scene-toggle {
  position: absolute;
  z-index: 10;
  top: 62px;
  left: 130px;
  display: flex;
  gap: 2px;
  background: var(--md-bg-raised);
  border: 1px solid var(--md-line);
  border-radius: 999px;
  padding: 6px;
}

.site-scene-toggle button {
  background: none;
  border: 0;
  border-radius: 999px;
  color: var(--md-muted);
  font-size: 11.5px;
  padding: 5px 12px;
  cursor: pointer;
}

.site-scene-toggle button.active {
  background: var(--md-line);
  color: var(--md-text);
}

/* 스튜디오 모드 — 필지 미선택 안내 */
.site-studio-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-muted);
  font-size: 13px;
  background: var(--md-bg);
}

/* ===== Narrative.css ===== */
.nar {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.nar-empty {
  padding: 60px;
  color: var(--md-muted);
}

.nar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 48px 24px;
}

.nar-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.nar-title {
  font-family: var(--md-serif);
  font-weight: 400;
  font-size: 26px;
  margin: 8px 0 0;
}

.nar-params {
  margin-top: 22px;
  color: var(--md-accent);
  font-size: 12px;
}

.nar-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 12px;
}

.nar-msg {
  margin-top: 26px;
  max-width: 640px;
}

.nar-speaker {
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.nar-speaker.ai {
  color: var(--md-muted);
}

.nar-speaker.user {
  color: var(--md-accent);
}

.nar-text {
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.nar-text.typing {
  color: var(--md-muted);
  letter-spacing: 3px;
}

.nar-input {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--md-line);
  padding-top: 14px;
  margin-top: 14px;
  gap: 10px;
}

.nar-input input,
.nar-input textarea {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--md-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
  max-height: 160px;
  padding: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.nar-input { align-items: flex-end; }
.nar-input button { flex: none; }

.nar-input button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--md-line);
  background: none;
  color: var(--md-text);
  cursor: pointer;
}

.nar-cta {
  align-self: flex-end;
  margin-top: 14px;
  background: none;
  border: 0;
  color: var(--md-accent);
  font-size: 14px;
  cursor: pointer;
}

.nar-cta:disabled {
  opacity: 0.35;
  cursor: default;
}

.nar-cta:not(:disabled):hover {
  text-decoration: underline;
}

.nar-side {
  width: 240px;
  flex-shrink: 0;
  border-left: 1px solid var(--md-line);
  padding: 24px 22px;
  overflow-y: auto;
}

.nar-side-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.nar-side-empty {
  margin-top: 18px;
  color: var(--md-muted);
  font-size: 12px;
  line-height: 1.7;
}

.nar-block {
  margin-top: 22px;
}

.nar-block-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--md-accent);
}

.nar-block-text {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--md-text);
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 900px) {
  .nar-main {
    padding: 16px 24px 20px;
  }

  .nar-side {
    width: 200px;
    padding: 20px 16px;
  }
}

@media (max-width: 680px) {
  .nar {
    flex-direction: column;
  }

  .nar-main {
    flex: 1;
    min-height: 0;
    padding: 12px 16px 14px;
  }

  .nar-title {
    font-size: 20px;
  }

  /* PROJECT NARRATIVE → 하단 2열 섹션 */
  .nar-side {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--md-line);
    max-height: 32%;
    overflow-y: auto;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    align-content: start;
  }

  .nar-side-title,
  .nar-side-empty {
    grid-column: 1 / -1;
  }

  .nar-block {
    margin-top: 14px;
  }
}

/* 대화 내용으로 바로 매싱 — 보조 CTA */
.nar-cta.secondary {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--md-line);
  color: var(--md-muted);
}

.nar-cta.secondary:not(:disabled):hover {
  border-color: var(--md-accent);
  color: var(--md-text);
}

/* 단계 구분 (2026-07-27) — 채팅 안 덱·2단계 디바이더 */
.nar-phase-badge { margin-left: 10px; font-size: 10.5px; letter-spacing: 0.08em; padding: 3px 9px;
  border-radius: 20px; border: 1px solid rgba(226,105,78,0.5); color: #E2694E; vertical-align: 1px; }
.nar-phase-badge.p1 { border-color: rgba(255,255,255,0.25); color: #b9b3a8; }
.nar-phase-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; }
.nar-phase-divider::before, .nar-phase-divider::after { content: ''; flex: 1; height: 1px;
  background: rgba(226,105,78,0.45); }
.nar-phase-divider span { font-size: 12px; letter-spacing: 0.14em; color: #E2694E; white-space: nowrap; }
.nar-log .deck, .nar-log .deck-hint { border-top: none; padding-top: 4px; margin-top: 10px; }

/* 페이즈 토글 (안 B — 2026-07-28) — 기존 뱃지 자리를 클릭 가능한 1|2로 */
.nar-phase-toggle {
  display: inline-flex;
  gap: 2px;
  margin-left: 10px;
  vertical-align: middle;
}
.nar-phase-toggle button {
  background: none;
  border: 1px solid var(--md-line, #2a2e36);
  color: var(--md-muted, #6d7178);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
}
.nar-phase-toggle button:first-child { border-radius: 4px 0 0 4px; }
.nar-phase-toggle button:last-child { border-radius: 0 4px 4px 0; }
.nar-phase-toggle button.on {
  color: var(--md-accent, #d97b4a);
  border-color: var(--md-accent, #d97b4a);
}
.nar-phase-toggle button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ===== ProcessPanel.css ===== */
/* AI 진행 패널 — 다크·라이트 화면 공용 (하르라인 박스, 접기/펼치기) */
.pp {
  border: 1px solid var(--md-line, #2a2e36);
  border-radius: 8px;
  overflow: hidden;
  max-width: 640px;
}
.pp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--md-muted, #9a978f);
  font-size: 12px;
  padding: 8px 11px;
  cursor: pointer;
  text-align: left;
}
.pp-head:hover {
  color: var(--md-text, #cfccc4);
}
.pp-chev {
  flex: none;
  width: 12px;
  color: var(--md-accent, #d97b4a);
}
.pp-label {
  flex: none;
  font-weight: 600;
  color: var(--md-text, #cfccc4);
}
.pp-phase {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pp-dots {
  flex: none;
  display: inline-flex;
  gap: 2px;
}
.pp-dots i {
  font-style: normal;
  animation: pp-blink 1.2s infinite;
}
.pp-dots i:nth-child(2) {
  animation-delay: 0.2s;
}
.pp-dots i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes pp-blink {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}
.pp-body {
  border-top: 1px solid var(--md-line, #2a2e36);
  padding: 9px 12px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--md-muted, #8d8a83);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.pp-body-cap {
  color: var(--md-accent, #d97b4a);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  margin: 2px 0 4px;
}

/* ===== CandidateDeck.css ===== */
/* Narrative 안에 심긴 '세 채 제안' 덱 (2026-07-24 Parti 통합) */
.deck { margin-top: 18px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; }
.deck-inner { display: flex; flex-direction: column; }
.deck-sub { font-size: 12.5px; color: #6b675f; line-height: 1.6; margin: 4px 0 12px; }
.deck-hint { margin-top: 18px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px;
  font-size: 12.5px; color: #6b675f; }
/* 덱 안에서는 카드가 좁은 폭에 3개 들어가야 하므로 축소 */
.deck .cb-cards { gap: 10px; }
.deck .cb-card { padding: 10px; }
.deck .cb-name { font-size: 14px; }
.deck .cb-parti { font-size: 12px; }
.deck .cb-desc { font-size: 11.5px; max-height: 8.5em; overflow: hidden; }

/* webp 과정 방법론 생성 존 */
.proc-zone { margin-top: 14px; border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 12px; }
.cb-gen.webp { border-color: #7a6a3f; color: #d8c890; }
.cb-card.proc { border-color: rgba(216,200,144,0.35); }
.proc-strip { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-start; max-width: 300px; }
.proc-strip img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; opacity: 0.85; }

/* ===== Parti.css ===== */
.parti {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.parti-empty {
  padding: 60px;
  color: var(--md-muted);
  line-height: 1.7;
  max-width: 520px;
}

.parti-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 48px 32px;
}

.parti-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.parti-title {
  font-family: var(--md-serif);
  font-weight: 400;
  font-size: 26px;
  margin: 8px 0 0;
}

.parti-sub {
  margin-top: 10px;
  color: var(--md-muted);
  font-size: 13px;
  max-width: 560px;
  line-height: 1.7;
}

.parti-sec-label {
  margin-top: 34px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-accent);
}

.parti-tensions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}

.parti-tension {
  border: 1px solid var(--md-line);
  border-radius: 10px;
  padding: 14px 16px;
}

.pt-label {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-kind {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--md-line);
  color: var(--md-muted);
}

.pt-kind.k-site {
  color: #6fa1ff;
  border-color: rgba(111, 161, 255, 0.35);
}

.pt-kind.k-program {
  color: var(--md-accent);
  border-color: rgba(255, 255, 255, 0.18);
}

.pt-evidence {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--md-muted);
  line-height: 1.7;
}

.parti-cands {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  max-width: 840px;
}

.parti-cand {
  text-align: left;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 12px;
  padding: 18px;
  color: var(--md-text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.parti-cand:hover {
  border-color: var(--md-muted);
}

.parti-cand.on {
  border-color: var(--md-accent);
}

.pc-phrase {
  font-family: var(--md-serif);
  font-size: 17px;
  line-height: 1.5;
}

.pc-tension {
  margin-top: 10px;
  font-size: 11px;
  color: var(--md-accent);
}

.pc-rationale {
  margin-top: 10px;
  font-size: 12px;
  color: var(--md-muted);
  line-height: 1.65;
}

.pc-precedent {
  margin-top: 14px;
  font-size: 11px;
  color: var(--md-muted);
  border: 1px dashed var(--md-line);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
}

.parti-cta {
  margin-top: 28px;
  background: none;
  border: 0;
  color: var(--md-accent);
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}

.parti-cta:disabled {
  color: var(--md-muted);
  cursor: default;
  opacity: 0.5;
}

.parti-cta:not(:disabled):hover {
  text-decoration: underline;
}

.parti-side {
  width: 270px;
  flex-shrink: 0;
  border-left: 1px solid var(--md-line);
  padding: 24px 22px;
  overflow-y: auto;
}

.parti-side-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.parti-side-empty {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--md-muted);
  line-height: 1.7;
}

.parti-side-block {
  margin-top: 18px;
  border-top: 1px solid var(--md-line);
  padding-top: 14px;
}

.psb-phrase {
  font-family: var(--md-serif);
  font-size: 15px;
  line-height: 1.5;
}

.psb-note {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--md-muted);
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 900px) {
  .parti-main {
    padding: 18px 24px 28px;
  }

  .parti-side {
    width: 220px;
  }
}

@media (max-width: 680px) {
  .parti {
    flex-direction: column;
    overflow-y: auto;
  }

  .parti-main {
    overflow: visible;
    padding: 16px 16px 8px;
  }

  .parti-side {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--md-line);
    padding: 18px 16px 28px;
  }
}

/* 선례 태깅 버튼 + 카드 내 근거 이미지 */
.parti-tagbtn {
  margin-left: 12px;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 999px;
  color: var(--md-text);
  font-size: 11px;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: 0;
}

.parti-tagbtn:hover:not(:disabled) {
  border-color: var(--md-accent);
  color: var(--md-accent);
}

.parti-tagbtn:disabled {
  color: var(--md-muted);
  cursor: default;
}

.pc-precedent.has-img {
  padding: 0;
  border: 1px solid var(--md-line);
  border-style: solid;
  overflow: hidden;
  text-align: left;
}

.pc-precedent.has-img img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
}

.pc-precedent-cap {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--md-muted);
  line-height: 1.5;
}

/* AI 후보 상태 표시 */
.parti-ai-note {
  color: var(--md-muted);
  font-size: 12px;
}

/* 선례 사람 검증 (유지/수정/거부) */
.prv {
  margin-top: 40px;
}

.prv-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--md-text);
}

.prv-badge {
  font-size: 11px;
  color: var(--md-accent);
}

.prv-badge.done {
  color: var(--md-muted);
}

.prv-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
}

.prv-item {
  display: flex;
  gap: 12px;
  border: 1px solid var(--md-line);
  border-radius: 10px;
  padding: 10px;
}

.prv-item.reviewed {
  opacity: 0.62;
}

.prv-img {
  width: 86px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.prv-body {
  flex: 1;
  min-width: 0;
}

.prv-title {
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prv-status {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--md-muted);
}

.prv-status.rejected {
  color: #e2694e;
}

.prv-chips {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.prv-chip {
  font-size: 10.5px;
  border: 1px solid var(--md-line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--md-muted);
  background: none;
}

.prv-chip.sel {
  cursor: pointer;
}

.prv-chip.sel.on {
  border-color: var(--md-accent);
  color: var(--md-accent);
}

.prv-parti {
  margin-top: 6px;
  font-family: var(--md-serif);
  font-size: 12.5px;
  line-height: 1.5;
}

.prv-meta {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--md-muted);
}

.prv-edit-label {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--md-muted);
}

.prv-parti-edit {
  margin-top: 8px;
  width: 100%;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  color: var(--md-text);
  font-size: 12px;
  padding: 8px;
  resize: vertical;
}

.prv-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

.prv-actions button {
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 7px;
  color: var(--md-text);
  font-size: 11.5px;
  padding: 5px 12px;
  cursor: pointer;
}

.prv-actions button:hover {
  border-color: var(--md-accent);
}

.prv-actions button.danger:hover {
  border-color: #e2694e;
  color: #e2694e;
}

/* 문화 렌즈 건축 창작 (이 땅을 위한 세 채) */
.cb {
  margin-top: 44px;
}

.cb-sub {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--md-muted);
  line-height: 1.65;
  max-width: 560px;
}

.cb-gen {
  margin-top: 14px;
  background: none;
  border: 1px solid var(--md-accent);
  border-radius: 9px;
  color: var(--md-accent);
  font-size: 12.5px;
  padding: 10px 18px;
  cursor: pointer;
}

.cb-gen:disabled {
  opacity: 0.65;
  cursor: default;
}

.cb-gen.ghost {
  border-color: var(--md-line);
  color: var(--md-muted);
}

.cb-cards {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  max-width: 860px;
}

.cb-card {
  text-align: left;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  color: var(--md-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cb-card:hover:not(:disabled) {
  border-color: var(--md-accent);
}

.cb-card-culture {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--md-accent);
  text-transform: uppercase;
}

.cb-thumb {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.cb-noimg {
  padding: 30px 0;
  text-align: center;
  font-size: 11px;
  color: var(--md-muted);
}

.cb-name {
  font-family: var(--md-serif);
  font-size: 16px;
}

.cb-parti {
  font-family: var(--md-serif);
  font-size: 12.5px;
  color: var(--md-muted);
  line-height: 1.5;
}

.cb-desc {
  font-size: 11.5px;
  color: var(--md-muted);
  line-height: 1.6;
}

.cb-ref {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--md-line);
  padding-top: 8px;
}

.cb-ref img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}

.cb-ref span {
  font-size: 10px;
  color: var(--md-muted);
  line-height: 1.5;
}

.cb-cta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--md-accent);
}

.cb-error {
  margin-top: 10px;
  font-size: 11.5px;
  color: #e2694e;
}

/* 파르티 생략 — 대화 내용 그대로 매싱 (보조 CTA) */
.parti-cta.skip {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--md-line);
  color: var(--md-muted);
}

.parti-cta.skip:not(:disabled):hover {
  border-color: var(--md-accent);
  color: var(--md-text);
}

/* 건물 후보 생성 진행 표시 (2026-07-23 개편) */
.cb-progress {
  font-size: 12.5px;
  color: var(--md-muted);
  padding: 14px 4px;
  line-height: 1.7;
}

/* ── 생성 라이브 진행 보드 (2026-07-24 — "멈췄는지 모르겠다" UX) ── */
.cb-prog-head { font-weight: 600; margin-bottom: 6px; }
.cb-dots i { display: inline-block; font-weight: 700; animation: cbBounce 1.2s infinite; }
.cb-dots i:nth-child(2) { animation-delay: 0.15s; }
.cb-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cbBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.cb-prog-row { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 2px 0; color: #6b675f; }
.cb-prog-row b { min-width: 30px; }
.cb-prog-row.done span { color: #3c7a44; }
.cb-prog-row.fail span { color: #b04a3a; }
.cb-prog-row.thinking span, .cb-prog-row.writing span, .cb-prog-row.revise span { color: #8a6d3b; }

/* ===== PhaseDeck.css ===== */
/* 단계형 덱 (2026-07-27) — 1단계 스케치 카드·2단계 디테일 반영 */
.cb-card.sketch { background: #f5f4f1; }
.cb-card.sketch .cb-thumb { background: #f5f4f1; }
.pd2 .cb-cards { margin-top: 10px; }

/* ===== Massing.css ===== */
.mas {
  position: absolute;
  inset: 0;
  display: flex;
}

.mas-empty {
  padding: 60px;
  color: var(--md-muted);
}

.mas-side {
  width: 270px;
  flex-shrink: 0;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  /* BASIS·구조 3안 패널이 길어지면 사이드바 자체가 스크롤 (없으면 하단 접근 불가) */
  overflow-y: auto;
}

.mas-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.mas-title {
  font-family: var(--md-serif);
  font-weight: 400;
  font-size: 22px;
  margin: 8px 0 0;
}

.mas-label {
  margin-top: 34px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.mas-options {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}

.mas-options button {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 2px 6px;
  border-bottom: 2px solid transparent;
}

.mas-options button.active {
  color: var(--md-text);
  border-bottom-color: var(--md-accent);
}

.mas-control {
  margin-top: 28px;
  border-top: 1px solid var(--md-line);
  padding-top: 16px;
}

.mas-control-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.mas-val {
  color: var(--md-accent);
}

.mas-control input[type='range'] {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--md-accent);
}

.mas-control.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.mas-toggle {
  background: none;
  border: 0;
  color: var(--md-muted);
  cursor: pointer;
  font-size: 13px;
}

.mas-toggle.on {
  color: var(--md-accent);
}

.mas-foot {
  margin-top: 10px;
}

.mas-foot-val {
  margin-top: 10px;
  font-size: 13px;
  color: var(--md-text);
}

.mas-foot-cap {
  margin-top: 5px;
  font-size: 11px;
  color: var(--md-muted);
}

.mas-cta {
  margin-top: auto;
  background: none;
  border: 0;
  color: var(--md-accent);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  padding: 12px 0;
}

.mas-cta:hover {
  text-decoration: underline;
}

.mas-canvas {
  flex: 1;
  min-width: 0;
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 680px) {
  .mas {
    flex-direction: column;
    overflow-y: auto;
  }

  .mas-side {
    width: auto;
    padding: 14px 20px;
  }

  .mas-title {
    font-size: 19px;
  }

  .mas-label {
    margin-top: 20px;
  }

  .mas-control {
    margin-top: 16px;
  }

  .mas-cta {
    margin-top: 8px;
    padding: 8px 0;
  }

  .mas-canvas {
    flex: none;
    height: 320px;
    min-height: 320px;
  }
}

/* 파르티·선례 근거 블록 */
.mas-basis {
  margin-top: 22px;
}

.mas-basis-phrase {
  font-family: var(--md-serif);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 8px;
}

.mas-basis-img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--md-line);
  margin-top: 10px;
}

.mas-basis-sum {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--md-muted);
  line-height: 1.6;
}

.mas-basis-proj {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* 선례와 우리 대지의 연결 근거 — 요약(선례 자기 대지 이야기)과 명확히 구분 */
.mas-basis-link {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--md-text);
  border-left: 2px solid var(--md-accent);
  padding-left: 9px;
}

.mas-basis-link b {
  color: var(--md-accent);
  font-weight: 600;
}

.mas-basis-sum-label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--md-muted);
  margin-bottom: 3px;
  text-transform: uppercase;
}

/* 시트 수기 태그 vs Claude 재검증 결과 */
.mas-basis-verify {
  margin-top: 6px;
  font-size: 11px;
  color: var(--md-muted);
  line-height: 1.6;
}

.mas-basis-verify.warn {
  color: #e2694e;
}

/* 선례 구조 모드 토글 */
.mas-shape-toggle {
  margin-top: 12px;
  width: 100%;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  color: var(--md-text);
  font-size: 12px;
  padding: 9px 12px;
  cursor: pointer;
}

.mas-shape-toggle:hover {
  border-color: var(--md-accent);
}

.mas-shape-toggle.on {
  border-color: var(--md-accent);
  color: var(--md-accent);
}

.mas-shape-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--md-muted);
  line-height: 1.6;
}

/* 선례 구조 3안 비교·이미지 대조 패널 */
.psp {
  margin-top: 18px;
}

.psp-btn {
  margin-top: 10px;
  width: 100%;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  color: var(--md-text);
  font-size: 12px;
  padding: 9px 12px;
  cursor: pointer;
}

.psp-btn:hover:not(:disabled) {
  border-color: var(--md-accent);
}

.psp-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.psp-btn.ghost {
  color: var(--md-muted);
}

.psp-cands {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.psp-cand {
  text-align: left;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--md-text);
}

.psp-cand:hover:not(:disabled) {
  border-color: var(--md-accent);
}

.psp-cand.on {
  border-color: var(--md-accent);
}

.psp-cand img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.psp-noimg {
  padding: 20px 0;
  text-align: center;
  font-size: 11px;
  color: var(--md-muted);
}

.psp-cand-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}

.psp-cand.on .psp-cand-label {
  color: var(--md-accent);
}

.psp-cand-approach {
  margin-top: 3px;
  font-size: 11px;
  color: var(--md-muted);
  line-height: 1.55;
}

.psp-actions {
  display: flex;
  gap: 8px;
}

.psp-actions .psp-btn.ghost {
  flex: 0 0 auto;
  width: auto;
}

.psp-verdict {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.6;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  padding: 8px 10px;
}

.psp-verdict.ok {
  color: #4d8a5e;
  border-color: #4d8a5e55;
}

.psp-verdict.warn {
  color: #e2694e;
  border-color: #e2694e55;
}

.psp-verdict ul {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--md-muted);
}

.psp-error {
  margin-top: 8px;
  font-size: 11px;
  color: #e2694e;
}

/* AI 매싱 3안 — Narrative 근거 생성 */
.mas-ai-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--md-muted);
  line-height: 1.6;
}

.mas-ai-strategy {
  margin-top: 10px;
  border: 1px solid var(--md-line);
  border-radius: 8px;
  padding: 10px 12px;
}

.mas-ai-strategy-title {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mas-ai-strategy-text {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--md-muted);
}

.mas-ai-again {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--md-line);
  border-radius: 7px;
  color: var(--md-text);
  font-size: 11px;
  padding: 6px 10px;
  cursor: pointer;
}

.mas-ai-again:hover:not(:disabled) {
  border-color: var(--md-accent);
}

.mas-ai-again:disabled {
  opacity: 0.5;
  cursor: default;
}

.mas-val-src {
  font-size: 10.5px;
  color: var(--md-muted);
  font-weight: 400;
}

/* 채팅 기반 프로젝트 — 3안 도착 전 캔버스 상태 표시 (프리셋 볼륨 금지) */
.mas-canvas-wait {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: var(--md-muted);
  padding: 24px;
}

.mas-canvas-wait .mas-ai-again {
  margin-top: 12px;
}

.mas-ai-err {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #e2694e;
  word-break: break-all;
}

/* 1단계 형태 무대 (2026-07-27) */
.mas-opt-tabs { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mas-opt-tab { text-align: left; font-size: 12.5px; padding: 7px 10px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14); background: transparent; color: #b9b3a8; cursor: pointer; }
.mas-opt-tab.active { border-color: #E2694E; color: #f0e9dc; }
.mas-control input[type='range'] { width: 100%; margin-top: 6px; }

/* ══ Massing V5 (2026-07-28 피그마 시안 — 다크 풀블리드 무대) ══════════════ */
/* 종이 팔레트 + 본문 꽉 채움(주인님 2026-10-19). 디자인 단계(.dsn)와 같은 absolute 배치 */
.mas5 {
  position: absolute;
  inset: 0;
  display: flex;
  min-height: 0;
  background: var(--md-bg);
  color: var(--md-text);
}
.mas5-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px 40px 20px;
  gap: 14px;
  overflow-y: auto;
}
.mas5-empty {
  margin: auto;
  color: var(--md-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.mas5-head { flex: none; }
.mas5-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--md-muted);
  margin-bottom: 6px;
}
.mas5-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--md-text);
}
.mas5-sub {
  font-size: 12px;
  color: var(--md-muted);
  letter-spacing: 0.04em;
}
.mas5-body {
  /* 무대:채팅 = 4:1.5 로 높이를 나눈다 — 3D 무대를 더 크게(주인님 2026-10-26 "뷰어가 작음"). 남는 세로는 채팅 로그가 가져간다 */
  flex: 4 1 0;
  min-height: 420px;
  display: flex;
  gap: 28px;
}
.mas5-params {
  width: 250px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* 내용이 무대 높이를 넘으면 열 안에서 스크롤 — 아래 채팅 영역을 덮지 않게(주인님 2026-10-19 겹침) */
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}
.mas5-parti { flex: none; }
.mas5-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--md-muted);
}
.mas5-abc { display: flex; gap: 14px; }
.mas5-abc-btn {
  background: none;
  border: none;
  color: var(--md-muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.mas5-abc-btn.active { color: var(--md-text); }
.mas5-abc-btn.dim { opacity: 0.35; cursor: default; }
.mas5-kv { margin: 4px 0 0; display: flex; flex-direction: column; gap: 11px; }
.mas5-kv-row { display: flex; justify-content: space-between; font-size: 13px; }
.mas5-kv-row dt { color: var(--md-muted); }
.mas5-kv-row dd { margin: 0; color: var(--md-accent); font-weight: 600; }
.mas5-gfa { font-size: 11.5px; color: var(--md-muted); }
.mas5-ctx { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--md-line); }
.mas5-dims { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--md-line); }
.mas5-dims .mas5-kv { gap: 6px; margin-top: 6px; }
.mas5-dims .mas5-kv-row { font-size: 12px; }
.mas5-dims .mas5-kv-row dd { color: var(--md-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.mas5-ctx .mas5-kv { gap: 7px; }
.mas5-ctx .mas5-kv-row { font-size: 12px; gap: 10px; }
.mas5-ctx .mas5-kv-row dd { color: var(--md-text); font-weight: 500; text-align: right; word-break: keep-all; }
.mas5-ctx .mas5-kv-row dd.bad { color: #b3261e; font-weight: 700; }
.mas5-angle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--md-muted);
  margin-top: 6px;
}
.mas5-angle input { accent-color: var(--md-accent); }
/* 내부 구조 토글(2026-10-19) */
.mas5-interior { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.mas5-field { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mas5-select { background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; color: var(--md-text); }
.mas5-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mas5-chip { background: none; border: 1px solid var(--md-line); color: var(--md-muted); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; cursor: pointer; line-height: 1.3; }
.mas5-chip:hover { border-color: var(--md-accent); color: var(--md-accent); }
.mas5-chip.on { background: var(--md-accent); border-color: var(--md-accent); color: #fff; }
.mas5-chip.main { font-weight: 600; }
.mas5-chip:disabled { opacity: 0.4; cursor: default; }
/* 층별 보기·조닝 패널(2026-10-19 ③) */
.mas5-floors { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--md-line); }
.mas5-zoning { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.mas5-zoning-head { font-size: 11.5px; color: var(--md-muted); }
.mas5-zone-list { display: flex; flex-direction: column; gap: 5px; }
.mas5-zone { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.mas5-zone-sw { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(27, 25, 23, 0.15); }
.mas5-zone-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mas5-zone-area { color: var(--md-muted); font-variant-numeric: tabular-nums; }
.mas5-zone-empty { font-size: 11.5px; color: var(--md-muted); line-height: 1.6; }
.mas5-parti {
  margin-top: auto;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--md-muted);
}
.mas5-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #F5F4F1; /* 스케치 썸네일과 같은 종이 바탕 */
}
/* 무대 위 UI — 외부|내부 전환(좌) · 층 탭(중) (2026-10-19) */
.mas5-stage-ui { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; pointer-events: none; z-index: 2; }
.mas5-stage-ui > * { pointer-events: auto; }
.mas5-seg { display: inline-flex; background: color-mix(in srgb, var(--md-bg-raised) 92%, transparent); border: 1px solid var(--md-line); border-radius: 999px; padding: 3px; box-shadow: 0 1px 2px rgba(27, 25, 23, 0.06); }
.mas5-seg button { background: none; border: 0; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--md-muted); cursor: pointer; }
.mas5-seg button.on { background: var(--md-text); color: var(--md-bg); }
.mas5-seg button:disabled { opacity: 0.4; cursor: default; }
.mas5-stage-note { font-size: 12px; font-weight: 600; color: var(--md-muted); background: color-mix(in srgb, var(--md-bg-raised) 92%, transparent); border: 1px solid var(--md-line); border-radius: 999px; padding: 6px 12px; }
.mas5-stage-note.bad { color: #B5591B; }
.mas5-floortabs { display: inline-flex; gap: 4px; background: color-mix(in srgb, var(--md-bg-raised) 92%, transparent); border: 1px solid var(--md-line); border-radius: 999px; padding: 3px; }
.mas5-floortabs button { background: none; border: 0; border-radius: 999px; min-width: 40px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--md-muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.mas5-floortabs button.on { background: var(--md-accent); color: #fff; }
.mas5-zone { width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 6px; cursor: pointer; color: inherit; font: inherit; }
.mas5-zone:hover { border-color: var(--md-line); background: color-mix(in srgb, var(--md-bg-raised) 70%, transparent); }
.mas5-zone.on { border-color: var(--md-accent); background: color-mix(in srgb, var(--md-accent) 10%, transparent); }
.mas5-zone-sel { font-size: 11.5px; color: var(--md-accent); line-height: 1.55; }
.mas5-chat {
  flex: 1.5 1 0;
  min-height: 160px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mas5-chat-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  /* 로그는 채팅 영역의 남는 높이를 전부 차지 — 초과분은 스크롤 */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.mas5-chat-row { display: flex; gap: 14px; font-size: 13px; line-height: 1.55; }
.mas5-chat-who {
  flex: none;
  width: 34px;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding-top: 1px;
}
.mas5-chat-who.you { color: var(--md-accent); }
.mas5-chat-who.ai { color: var(--md-muted); }
.mas5-chat-text { color: var(--md-text); }
.mas5-chat-text.dim { color: var(--md-muted); }
/* 입력줄 + 버튼줄 — 한 행(주인님 2026-10-19). 입력이 남는 폭을 먹고 버튼은 오른쪽 끝 */
.mas5-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  border-top: 1px solid var(--md-line);
  padding-top: 10px;
}
.mas5-bottom {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}
.mas5-chat-input {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
}
.mas5-chat-input input,
.mas5-chat-input textarea {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--md-text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 6px 0;
  resize: none;
  overflow-y: auto;
  max-height: 120px;
  white-space: pre-wrap;
  word-break: break-word;
}
.mas5-chat-input { align-items: flex-end; }
.mas5-chat-input textarea::placeholder { color: color-mix(in srgb, var(--md-muted) 70%, transparent); }
.mas5-chat-input input::placeholder { color: color-mix(in srgb, var(--md-muted) 70%, transparent); }
.mas5-send {
  background: none;
  border: none;
  color: var(--md-accent);
  font-size: 17px;
  cursor: pointer;
  padding: 0 6px;
}
.mas5-send:disabled { opacity: 0.3; cursor: default; }
.mas5-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
}
.mas5-ghost {
  background: none;
  border: none;
  color: var(--md-muted);
  font-size: 13px;
  cursor: pointer;
}
.mas5-ghost:hover { color: var(--md-text); }
.mas5-cta {
  background: none;
  border: none;
  color: var(--md-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--md-accent);
}
.mas5-cta:disabled { opacity: 0.4; cursor: default; }
.mas5-ghost:disabled { opacity: 0.4; cursor: default; }

/* ── Massing V5 반응형 (680px↓ — 앱 공통 모바일 브레이크포인트) ─────────── */
@media (max-width: 680px) {
  .mas5-main {
    padding: 16px 16px 14px;
    gap: 12px;
  }
  .mas5-title {
    font-size: 19px;
  }
  .mas5-body {
    flex: none; /* 데스크톱 flex:1을 해제 — 내용이 넘치면 겹치지 않고 main 스크롤로 */
    flex-direction: column;
    gap: 14px;
    min-height: 0;
  }
  .mas5-params {
    width: 100%;
    gap: 10px;
  }
  .mas5-parti {
    margin-top: 4px; /* column 흐름에선 auto 밀기 해제 */
  }
  .mas5-stage {
    flex: none;
    height: 300px;
    min-height: 300px;
    order: -1; /* 모바일은 무대 먼저 — 3D가 첫 화면에 보이게 */
  }
  .mas5-row {
    flex-wrap: wrap; /* 좁은 화면에선 버튼줄이 아래로 */
    gap: 10px 18px;
  }
  .mas5-bottom {
    flex-basis: 100%;
  }
  .mas5-foot {
    margin-left: auto;
    gap: 18px;
  }
  .mas5-chat {
    flex: none;
    min-height: 0;
  }
  .mas5-chat-log {
    max-height: 160px;
  }
  .mas5-chat-row {
    font-size: 12.5px;
  }
}

/* ── 버전 레일 (피그마 V1~V∞ + save 고정) ──────────────────────────────── */
/* 폭 = 본문의 18% − 간격: 무대(stage) 오른쪽 끝이 입력줄(82%)과 정확히 맞아떨어진다 */
.mas5-vrail {
  width: calc(18% - 28px);
  min-width: 170px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.mas5-vrail-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}
.mas5-vchip {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  flex: none;
}
.mas5-vlabel {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--md-muted);
  margin-bottom: 4px;
}
.mas5-vchip img,
.mas5-vempty {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--md-line);
  border-radius: 4px;
  background: var(--md-bg-raised);
}
.mas5-vchip:hover img {
  border-color: var(--md-muted);
}
.mas5-vchip.active .mas5-vlabel {
  color: var(--md-accent);
}
.mas5-vchip.active img {
  border-color: var(--md-accent);
}
.mas5-vchip.dim {
  opacity: 0.35;
  cursor: default;
}
.mas5-vhint {
  font-size: 11px;
  color: color-mix(in srgb, var(--md-muted) 70%, transparent);
  line-height: 1.6;
}
.mas5-save {
  flex: none;
  border: 1px solid var(--md-line);
  background: none;
  color: var(--md-text);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 8px 0;
  border-radius: 4px;
  cursor: pointer;
}
.mas5-save:hover:not(:disabled) {
  border-color: var(--md-accent);
  color: var(--md-accent);
}
.mas5-save:disabled {
  opacity: 0.4;
  cursor: default;
}
.mas5-save + .mas5-save {
  margin-top: 6px;
}
/* 실사화 보기 — 지금 카메라 화면 이미지 */
.mas5-shot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.mas5-shot-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(1400px, 100%);
  max-height: 100%;
}
.mas5-shot-main {
  display: flex;
  gap: 10px;
  min-height: 0;
}
.mas5-shot-frame {
  position: relative;
  flex: 0 1 auto;
  min-width: min(480px, 100%);
  min-height: 160px;
}
/* 지난 이미지 줄(2026-11-05) — 가운데 이미지 높이만큼만 서고, 넘치면 끌거나 휠로 훑는다. 높이를 줄이 정하지 않게 안쪽을 절대 배치 */
.mas5-shot-strip {
  position: relative;
  flex: none;
  width: 132px;
}
.mas5-shot-strip-in {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}
.mas5-shot-strip-in:active {
  cursor: grabbing;
}
.mas5-shot-thumb {
  position: relative;
  flex: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #2a2a2a;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s, border-color 0.15s;
}
.mas5-shot-thumb:hover {
  opacity: 1;
}
.mas5-shot-thumb.on {
  border-color: #fff;
  opacity: 1;
}
.mas5-shot-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  pointer-events: none;
}
.mas5-shot-when {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
}
.mas5-shot-thumb.is-busy {
  cursor: default;
  opacity: 1;
}
.mas5-shot-thumb.is-busy img {
  filter: brightness(0.5);
}
.mas5-shot-spin {
  position: absolute;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mas5-shot-spin 0.8s linear infinite;
}
@keyframes mas5-shot-spin {
  to {
    transform: rotate(360deg);
  }
}
.mas5-shot-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (max-width: 680px) {
  .mas5-shot-main {
    flex-direction: column;
  }
  .mas5-shot-strip {
    width: auto;
    height: 76px;
  }
  .mas5-shot-strip-in {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 4px;
    touch-action: pan-x;
  }
  .mas5-shot-thumb {
    width: 104px;
  }
}
.mas5-shot-status {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mas5-shot-status.err {
  background: rgba(150, 30, 20, 0.85);
  white-space: normal;
  border-radius: 8px;
}
.mas5-shot-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  border-radius: 6px;
  background: #e2e2e0;
}
.mas5-shot-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.mas5-shot-btn {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: none;
  color: #fff;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
}
.mas5-shot-btn:hover {
  border-color: #fff;
}

@media (max-width: 680px) {
  .mas5-vrail {
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }
  .mas5-vrail-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .mas5-vchip {
    min-width: 110px;
  }
  .mas5-save {
    width: 64px;
  }
}

/* 페이즈 토글 (안 B — 2026-07-28) */
.mas5-phase-toggle {
  display: inline-flex;
  gap: 2px;
  margin-left: 10px;
  vertical-align: middle;
}
.mas5-phase-toggle button {
  background: none;
  border: 1px solid var(--md-line);
  color: var(--md-muted);
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
}
.mas5-phase-toggle button:first-child { border-radius: 4px 0 0 4px; }
.mas5-phase-toggle button:last-child { border-radius: 0 4px 4px 0; }
.mas5-phase-toggle button.on {
  color: var(--md-accent);
  border-color: var(--md-accent);
}
.mas5-phase-toggle button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ===== Design.css ===== */
.dsn {
  position: absolute;
  inset: 0;
  display: flex;
}

.dsn-empty {
  padding: 60px;
  color: var(--md-muted);
}

/* ── REFINE 채팅 ── */
.dsn-side {
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--md-line);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}

.dsn-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.dsn-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 14px;
}

.dsn-hint {
  color: var(--md-muted);
  font-size: 12px;
  line-height: 1.7;
}

.dsn-msg {
  margin-bottom: 20px;
}

.dsn-speaker {
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.dsn-speaker.ai { color: var(--md-muted); }
.dsn-speaker.user { color: var(--md-accent); }

.dsn-text {
  font-size: 12px;
  line-height: 1.7;
}

.dsn-input {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--md-line);
  padding-top: 12px;
}

.dsn-input input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--md-text);
  font-size: 13px;
}

.dsn-input button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--md-line);
  background: none;
  color: var(--md-text);
  cursor: pointer;
}

/* ── 메인 ── */
.dsn-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dsn-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 28px 0;
}

.dsn-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
}

.dsn-title {
  font-family: var(--md-serif);
  font-weight: 400;
  font-size: 22px;
  margin: 8px 0 0;
}

.dsn-views {
  display: flex;
  gap: 18px;
  align-items: center;
}

.dsn-views button {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 13px;
  cursor: pointer;
}

.dsn-views button.active {
  color: var(--md-accent);
}

.dsn-views .dsn-export {
  color: var(--md-text);
  border: 1px solid var(--md-line);
  border-radius: 999px;
  padding: 6px 14px;
}

.dsn-views .dsn-export:hover {
  border-color: var(--md-accent);
  color: var(--md-accent);
}

.dsn-imagetabs {
  display: flex;
  gap: 16px;
  padding: 12px 28px 0;
}

.dsn-imagetabs button {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 12px;
  cursor: pointer;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.dsn-imagetabs button.active {
  color: var(--md-text);
  border-bottom-color: var(--md-accent);
}

.dsn-canvas {
  flex: 1;
  min-height: 0;
  position: relative;
  margin-top: 8px;
}

.dsn-caption {
  position: absolute;
  left: 290px;
  bottom: 16px;
  color: var(--md-muted);
  font-size: 11px;
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 900px) {
  .dsn-side {
    width: 200px;
    padding: 16px;
  }
}

@media (max-width: 680px) {
  .dsn {
    flex-direction: column;
  }

  /* 캔버스 먼저, REFINE 채팅은 아래로 */
  .dsn-main {
    order: 1;
    flex: 1;
    min-height: 0;
  }

  .dsn-side {
    order: 2;
    width: auto;
    border-right: 0;
    border-top: 1px solid var(--md-line);
    max-height: 30%;
    padding: 12px 16px;
  }

  .dsn-head {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px 0;
  }

  .dsn-title {
    font-size: 18px;
  }

  .dsn-views {
    gap: 12px;
  }

  .dsn-imagetabs {
    padding: 10px 16px 0;
    flex-wrap: wrap;
  }

  .dsn-caption {
    left: 16px;
    bottom: 10px;
  }
}

/* 3D 씬 전환 (스튜디오 ↔ 실지도) */
.dsn-scene-toggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 2px;
  background: rgba(15, 13, 10, 0.82);
  border: 1px solid var(--md-line);
  border-radius: 9px;
  padding: 3px;
}

.dsn-scene-toggle button {
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--md-muted);
  font-size: 11.5px;
  padding: 5px 12px;
  cursor: pointer;
}

.dsn-scene-toggle button.active {
  background: var(--md-line);
  color: var(--md-text);
}

/* ===== ExportModal.css ===== */
.exp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exp {
  width: 560px;
  max-width: 92vw;
  background: var(--md-bg-raised);
  border: 1px solid var(--md-line);
  border-radius: 12px;
  padding: 22px 24px;
  color: var(--md-text);
}

.exp-head {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--md-line);
  padding-bottom: 14px;
}

.exp-title {
  font-family: var(--md-serif);
  font-size: 18px;
}

.exp-file {
  flex: 1;
  text-align: right;
  color: var(--md-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-x {
  background: none;
  border: 0;
  color: var(--md-muted);
  cursor: pointer;
  font-size: 13px;
}

.exp-notice { margin: 14px 0 14px; padding: 14px 16px; border: 1px solid #B5591B; background: rgba(181, 89, 27, 0.08); border-radius: 8px; }
.exp-notice-title { font-weight: 700; font-size: 14px; color: #8F4212; margin-bottom: 6px; }
.exp-notice-body { font-size: 12.5px; line-height: 1.6; color: #3A3632; }
/* 내보내기 전 확인 창(2026-11-05) — 안내문 아래 물음과 예/아니오 */
.exp-ask { margin: 2px 0 16px; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--md-text); }
.exp-foot.is-gate .exp-actions { gap: 8px; }
.exp-no { background: none; border: 1px solid var(--md-line); color: var(--md-text); font-size: 13px; border-radius: 8px; padding: 9px 18px; min-width: 76px; cursor: pointer; }
.exp-no:hover, .exp-no:focus-visible { border-color: var(--md-text); outline: none; }
.exp-foot.is-gate .exp-go { min-width: 76px; }
.exp-backdrop:focus { outline: none; }
.exp-body {
  display: flex;
  gap: 36px;
  padding: 18px 0;
}

.exp-col {
  flex: 1;
  min-width: 0;
}

.exp-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--md-muted);
  margin-bottom: 10px;
}

.exp-label.second {
  margin-top: 22px;
}

.exp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
}

.exp-item input {
  accent-color: var(--md-accent);
}

.exp-item-name {
  flex: 1;
}

.exp-item-ext {
  color: var(--md-muted);
  font-size: 11px;
}

.exp-opt {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
}

.exp-opt-label {
  color: var(--md-muted);
}

.exp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--md-line);
  padding-top: 14px;
}

.exp-size {
  color: var(--md-muted);
  font-size: 11px;
}

.exp-actions {
  display: flex;
  gap: 10px;
}

.exp-cancel {
  background: none;
  border: 0;
  color: var(--md-muted);
  font-size: 13px;
  cursor: pointer;
}

.exp-go {
  background: var(--md-accent);
  border: 0;
  color: #17130D;
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
}

/* ── 반응형 ─────────────────────────── */
@media (max-width: 560px) {
  .exp {
    padding: 16px;
  }

  .exp-body {
    flex-direction: column;
    gap: 18px;
    max-height: 60vh;
    overflow-y: auto;
  }

  .exp-foot {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* 2026-10-13 — 도면/3D 모드 전환 + 빈 상태·오류 */
.exp-modes {
  display: flex;
  gap: 8px;
  padding: 0 22px 14px;
}
.exp-mode {
  flex: 1;
  padding: 9px 0;
  background: transparent;
  border: 1px solid #3A3630;
  border-radius: 4px;
  color: #8F8778;
  font-size: 12px;
  letter-spacing: 0.6px;
  cursor: pointer;
}
.exp-mode.on {
  border-color: #EDEAE4;
  color: #EDEAE4;
}
.exp-empty {
  padding: 26px 4px;
  color: #8F8778;
  font-size: 13px;
  line-height: 1.7;
}
.exp-err {
  color: #E8963C;
}
.exp-go[disabled] {
  opacity: 0.45;
  cursor: default;
}

/* ===== Upload.css ===== */
.up {
  min-height: 100vh;
  background: var(--md-bg);
  color: var(--text, #e7ecf3);
  padding: 0 var(--md-gutter) 80px;
  box-sizing: border-box;
}

.up-head {
  max-width: 720px;
  margin: clamp(24px, 6vw, 72px) 0 32px;
}
.up-eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--muted, #8b95a5);
  margin-bottom: 14px;
}
.up-head h1 {
  font-family: var(--md-serif);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 500;
  margin: 0 0 18px;
  line-height: 1.05; 
  color: var(--md-text);

}
.up-head p {
  color: var(--muted, #8b95a5);
  line-height: 1.7;
  font-size: 15px;
  max-width: 640px;
}

.up-drop {
  border: 1.5px dashed color-mix(in srgb, var(--text, #e7ecf3) 22%, transparent);
  border-radius: 14px;
  padding: clamp(36px, 8vw, 72px);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--muted, #8b95a5);
}
.up-drop:hover,
.up-drop.is-over {
  border-color: var(--accent, #e0703a);
  background: color-mix(in srgb, var(--accent, #e0703a) 6%, transparent);
  color: var(--text, #e7ecf3);
}
.up-plus {
  font-size: 34px;
  margin-bottom: 12px;
  opacity: 0.7;
}
.up-hint {
  font-size: 12px;
  margin-top: 8px;
  letter-spacing: 0.14em;
  opacity: 0.6;
}

.up-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 6px;
  flex-wrap: wrap;
  color: var(--muted, #8b95a5);
  font-size: 14px;
}
.up-learn-btn {
  background: var(--accent, #e0703a);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
.up-learn-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.up-error-hint {
  color: #e0703a;
  font-size: 13px;
  margin: 8px 0 0;
}

.up-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.up-card {
  position: relative;
  background: var(--panel, #161b22);
  border: 1px solid color-mix(in srgb, var(--text, #e7ecf3) 10%, transparent);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 카드 삭제(✕) */
.up-card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
}
.up-card:hover .up-card-remove {
  opacity: 1;
}
.up-card-remove:hover {
  background: #e0703a;
}

/* 학습된 선례 라이브러리 */
.up-lib {
  margin-top: 56px;
}
.up-lib-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  border-top: 1px solid color-mix(in srgb, var(--text, #e7ecf3) 10%, transparent);
  padding-top: 28px;
}
.up-lib-head h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}
.up-lib-count {
  font-size: 13px;
  color: var(--muted, #8b95a5);
}

/* 라이브러리 그리드 — 파르티 문장이 들어가므로 업로드 그리드보다 넓게 */
.up-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.up-lib-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}
.up-lib-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.up-lib-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e7ecf3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.up-lib-tension {
  color: var(--md-accent, #e0703a);
  flex-shrink: 0;
}
.up-lib-meta {
  font-size: 12px;
  color: var(--muted, #8b95a5);
}
.up-lib-read {
  margin-top: 2px;
}
.up-lib-read-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--md-accent, #e0703a) 85%, transparent);
  margin-bottom: 4px;
}
.up-lib-parti {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--text, #e7ecf3) 82%, transparent);
}
.up-lib-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.up-lib-mat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text, #e7ecf3) 16%, transparent);
  color: var(--muted, #8b95a5);
}
.up-card img,
.up-noimg {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0a0d12;
  display: block;
}
.up-card.is-learning {
  animation: up-pulse 1.4s ease-in-out infinite;
}
@keyframes up-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.up-card.is-error {
  border-color: color-mix(in srgb, #e0703a 55%, transparent);
}
.up-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.up-name {
  font-size: 12px;
  color: var(--muted, #8b95a5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.up-badge {
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.up-badge.is-learned {
  color: #5fbf7f;
}
.up-badge.is-error {
  color: #e0703a;
}
.up-badge.is-learning {
  color: var(--accent, #e0703a);
}
.up-note {
  font-size: 11px;
  color: #e0703a;
  padding: 0 12px 10px;
  line-height: 1.4;
}

/* 공용 헤더(.hd) — .up 컨테이너가 이미 좌우 거터를 주므로 여기선 상하만.
   상하 값은 랜딩과 같은 토큰(--md-header-y)을 그대로 쓴다. */
.hd.up-header {
  padding-left: 0;
  padding-right: 0;
}

/* ── 학습 탭 (2026-07-31) — TEACH THE AI / MATERIAL UPLOAD ──────────────── */
.up-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--md-line);
  margin-top: 8px;
}

.up-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--md-muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2.5px;
  padding: 0 0 12px;
  margin-bottom: -1px; /* 밑줄이 탭바 경계선 위에 겹치게 */
  cursor: pointer;
}

.up-tab:hover {
  color: var(--md-text);
}

.up-tab.is-active {
  color: var(--md-accent);
  border-bottom-color: var(--md-accent);
}

/* 탭 전환 — 상태(업로드 큐)를 살리려고 언마운트 대신 감춘다 */
.up-hidden {
  display: none;
}

/* ── 재질 카드 — 색 견본과 용도 한 줄 ─────────────────────────────────── */
.up-mat-swatches {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.up-mat-swatch {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 56px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid var(--md-line);
  overflow: hidden;
}

.up-mat-hex {
  font-size: 9px;
  letter-spacing: 0.3px;
  padding: 1px 3px;
  border-radius: 3px 3px 0 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.up-mat-usage {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--md-muted);
}

@media (max-width: 560px) {
  .up-tabs {
    gap: 16px;
  }

  .up-tab {
    font-size: 11px;
    letter-spacing: 1.5px;
  }
}


/* maplibre 가 컨테이너에 .maplibregl-map{position:relative} 를 얹는다 — 절대배치 유지 (2026-10-15) */
/* 네이버 지도(2D)도 같은 컨테이너를 쓴다 — 높이 0 방지 (2026-10-15) */
.mls > .mls-map { position: absolute; inset: 0; width: auto; height: auto; }
/* 네이버 지도 API 가 컨테이너에 인라인 position:relative 를 써서 absolute 가 무효 → 부모(.mls) 높이를 100% 로 채운다 */
.mls > .mls-map.naver-map { position: relative; width: 100%; height: 100%; }


/* ── 매스 단계 · 스터디 뷰 (2026-10-16): 회색 박스 3개 + 아래 흰 설명 영역 ── */
.std { padding: 28px 40px 40px; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.std-head { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: start; }
.std-title { font-family: var(--md-serif); font-size: 26px; grid-column: 1; }
.std-sub { color: var(--md-muted); font-size: 13px; grid-column: 1; max-width: 720px; }
.std-actions { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 10px; align-items: center; } /* 위치는 원래대로 헤더 오른쪽 — 주인님이 말한 '중앙 정렬'은 버튼 위치가 아니라 화살표·글자의 수직 정렬(2026-10-20) */
/* 세 버튼의 글자·화살표가 한 수평선에 오도록 — 같은 높이(36px) 안에서 수직 중앙, line-height 1 (주인님 2026-10-20) */
.std-actions > button { height: 36px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; padding-top: 0; padding-bottom: 0; }
.std-actions .mas5-cta { border-bottom: none; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.std-actions .mas5-ghost:disabled, .std-actions .mas5-cta:disabled { opacity: 0.45; cursor: default; }
.std-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
/* 3D 박스는 낮게(3:2), 정사각 썸네일은 cover로 위아래 여백을 잘라낸다(주인님 2026-10-19) */
.std-box { position: relative; aspect-ratio: 3 / 2; background: #F5F4F1; border: 1px solid var(--md-line); border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
/* 생성 전·생성 중 박스(주인님 2026-10-19 "보기 싫다") — 종이 위 모눈 바탕 + 쓸어내리는 빛 + 하단 진행 바 */
.std-box:not(.has-spec) {
  background-color: var(--md-bg-raised);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 23px, color-mix(in srgb, var(--md-line) 45%, transparent) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, color-mix(in srgb, var(--md-line) 45%, transparent) 23px 24px);
  border-style: dashed;
}
.std-box:has(.std-box-elapsed)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%); transform: translateX(-100%); animation: std-sweep 2.6s ease-in-out infinite; pointer-events: none; }
.std-box:has(.std-box-elapsed)::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--md-accent), transparent); background-size: 45% 100%; background-repeat: no-repeat; animation: std-bar 1.8s ease-in-out infinite; }
@keyframes std-sweep { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes std-bar { 0% { background-position: -45% 0; } 100% { background-position: 145% 0; } }
.std-box.has-spec { background: #F5F4F1; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.std-box.has-spec:hover { border-color: var(--md-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-accent) 35%, transparent); }
.std-thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.std-box-tag { position: absolute; top: 10px; left: 12px; font-size: 12px; letter-spacing: 0.1em; color: #444; }
.std-box-wait { position: relative; z-index: 1; text-align: center; color: var(--md-muted); font-size: 13px; display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 18px 22px; background: color-mix(in srgb, var(--md-bg-raised) 82%, transparent); border-radius: 12px; backdrop-filter: blur(2px); }
.std-box-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--md-muted); }
.std-box-elapsed { font-family: var(--md-serif); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--md-text); }
.std-box-phase { font-size: 12px; color: var(--md-muted); }
.std-box-err { font-size: 12px; color: #b3261e; word-break: keep-all; max-width: 260px; line-height: 1.5; }
.std-box-wait .pp-dots { margin-top: 2px; }
/* 설명은 안마다 별도 카드(주인님 2026-10-19) — 위 박스와 같은 3열·간격으로 맞춰 세로로 길게 */
.std-desc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; color: #1f1f1f; }
.std-col { display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.65; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; padding: 22px 24px 18px; height: 460px; min-height: 0; box-shadow: 0 1px 0 rgba(27, 25, 23, 0.03); }
/* 빈 설명 카드 — 점선 테두리, 스켈레톤 줄(생성 중일 때만 반짝임) */
.std-col.is-empty { border-style: dashed; background: color-mix(in srgb, var(--md-bg-raised) 55%, transparent); box-shadow: none; }
.std-col-empty { color: var(--md-muted); font-size: 12.5px; }
.std-skel { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.std-skel i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--md-line) 55%, transparent) 0%, color-mix(in srgb, var(--md-line) 25%, transparent) 50%, color-mix(in srgb, var(--md-line) 55%, transparent) 100%); background-size: 200% 100%; animation: std-skel 1.8s ease-in-out infinite; }
.std-skel i:nth-child(1) { width: 62%; height: 16px; margin-bottom: 4px; }
.std-skel i:nth-child(2) { width: 100%; }
.std-skel i:nth-child(3) { width: 92%; }
.std-skel i:nth-child(4) { width: 97%; }
.std-skel i:nth-child(5) { width: 48%; }
@keyframes std-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
/* 본문만 내부 스크롤(주인님 2026-10-19) — 라벨·버튼은 고정 */
.std-col-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 6px; overscroll-behavior: contain; }
.std-col-label { font-size: 11px; letter-spacing: 0.12em; color: var(--md-accent); }
.std-col-name { font-family: var(--md-serif); font-size: 18px; color: #111; }
.std-col-parti { color: #333; word-break: keep-all; }
.std-col-stats { color: #666; font-size: 12px; }
.std-open { align-self: flex-start; margin-top: auto; background: none; border: 1px solid var(--md-accent); color: var(--md-accent); border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.std-open:hover { background: var(--md-accent); color: #fff; }
.std-back { font-size: 12px; margin-right: 10px; }
@media (max-width: 900px) { .std { padding: 20px 16px; } .std-grid, .std-desc { grid-template-columns: 1fr; } .std-head { grid-template-columns: 1fr; } .std-actions { grid-column: 1; grid-row: auto; flex-wrap: wrap; } }

/* 스터디 뷰 — 선택·법규 배지·근거 (2026-10-19) */
.std-box-selected { position: absolute; top: 10px; right: 12px; font-size: 11px; background: var(--md-accent); color: #fff; border-radius: 999px; padding: 3px 9px; }
.std-box-law { position: absolute; bottom: 10px; left: 12px; font-size: 11px; border-radius: 999px; padding: 3px 9px; background: #e8f5e9; color: #1b5e20; }
.std-box-law.bad { background: #fdecea; color: #b3261e; }
.std-col-law { font-size: 11.5px; color: #b3261e; line-height: 1.5; }
/* 판정서 카드(2026-10-26) — 검사관 여섯 줄 + 합계·통과 + 지적 펼침 */
.std-verdict { margin-top: 6px; padding: 8px 10px; border: 1px solid #e3ded4; border-radius: 10px; background: #fbfaf7; font-size: 11.5px; }
.std-verdict.bad { border-color: #f0c9c4; background: #fff8f7; }
.std-verdict-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.std-verdict-total { font-weight: 700; font-size: 12.5px; color: #2a2724; }
.std-verdict-pass { font-size: 10.5px; border-radius: 999px; padding: 2px 8px; background: #e8f5e9; color: #1b5e20; }
.std-verdict-pass.bad { background: #fdecea; color: #b3261e; }
.std-verdict-retry { margin-left: auto; color: var(--md-muted); font-size: 10.5px; }
.std-verdict-rows { display: grid; gap: 3px; }
.std-verdict-row { display: grid; grid-template-columns: minmax(34px, max-content) 1fr; align-items: center; gap: 8px; } /* 영문 라벨(Structure·Coherence)이 잘리지 않게 */
.std-verdict-row.is-skip { opacity: 0.55; }
.std-verdict-label { color: #555; }
.std-verdict-score { display: flex; align-items: center; gap: 6px; color: #2a2724; font-variant-numeric: tabular-nums; }
.std-verdict-score.bad { color: #b3261e; }
.std-verdict-bar { flex: 1; height: 6px; border-radius: 3px; background: #ece8e0; overflow: hidden; }
.std-verdict-bar i { display: block; height: 100%; background: #6f8f6a; border-radius: 3px; }
.std-verdict-score.bad .std-verdict-bar i { background: #c96b60; }
.std-verdict-law { font-weight: 700; } .std-verdict-law.ok { color: #1b5e20; } .std-verdict-law.bad { color: #b3261e; }
.std-verdict-skip { color: var(--md-muted); }
.std-verdict-basis { grid-column: 2; color: var(--md-muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.std-verdict-more { margin-top: 6px; } .std-verdict-more summary { cursor: pointer; color: #6b6459; font-size: 11px; }
.std-verdict-issues { margin-top: 4px; color: #6b6459; line-height: 1.5; }
.std-verdict-issues div { padding-left: 8px; text-indent: -8px; }
.std-col-learned { font-size: 11px; color: #777; }
.std-col-actions { margin-top: 4px; flex: 0 0 auto; display: flex; gap: 8px; flex-wrap: wrap; }
.std-select { background: var(--md-accent); border: 1px solid var(--md-accent); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.std-select.on { background: #1b5e20; border-color: #1b5e20; }
.std-open { margin-top: 0; }

/* 내러티브 대화 템플릿(2026-10-19) */
.nar-tpl { margin-top: 26px; max-width: 640px; border: 1px dashed var(--md-line, rgba(127,127,127,.35)); border-radius: 12px; padding: 16px 18px 14px; }
.nar-tpl-title { font-size: 11px; letter-spacing: 1px; color: var(--md-muted); margin-bottom: 10px; }
.nar-tpl-sec { margin-top: 10px; }
.nar-tpl-step { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.nar-tpl-ex { display: block; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid var(--md-accent); border-radius: 0 6px 6px 0; padding: 5px 10px; margin: 3px 0; font: inherit; font-size: 12.5px; line-height: 1.55; color: inherit; cursor: pointer; }
.nar-tpl-ex:hover { background: color-mix(in srgb, var(--md-accent) 10%, transparent); }
.nar-tpl-tips { margin: 12px 0 0; padding-left: 16px; color: var(--md-muted); font-size: 12px; line-height: 1.7; }

/* ── 평면 단계(2026-10-19 A) — 2D 편집기 ── */
.pln { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 22px 36px 16px; gap: 12px; background: var(--md-bg); color: var(--md-text); }
.pln-empty { padding: 60px; color: var(--md-muted); }
.pln-head { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; }
.pln-eyebrow { font-size: 11px; letter-spacing: 0.14em; color: var(--md-muted); margin-bottom: 4px; }
.pln-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.pln-sub { font-size: 12px; color: var(--md-muted); }
.pln-tabs { display: inline-flex; gap: 4px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 999px; padding: 3px; }
.pln-tabs button { background: none; border: 0; border-radius: 999px; min-width: 42px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--md-muted); cursor: pointer; }
.pln-tabs button.on { background: var(--md-accent); color: #fff; }
.pln-actions { display: flex; gap: 14px; align-items: center; }
.pln-ghost { background: none; border: 0; color: var(--md-muted); font-size: 13px; cursor: pointer; }
.pln-cta { background: none; border: 0; color: var(--md-accent); font-size: 14px; font-weight: 700; border-bottom: 1.5px solid var(--md-accent); cursor: pointer; padding-bottom: 2px; }
.pln-body { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 230px 1fr 260px; gap: 18px; }
.pln-params, .pln-metrics { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; padding-right: 4px; }
/* 지표 패널: 위(지표·방·선택)는 내용만큼, 아래 버전 목록이 남는 높이를 차지하고 안에서 스크롤 */
.pln-metrics { overflow: hidden; }
.pln-mtop { flex: 0 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.pln-versions { flex: 1 1 0; min-height: 120px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--md-line); padding-top: 8px; }
.pln-versions-head { display: flex; justify-content: space-between; align-items: center; }
.pln-versions-head .pln-btn { margin-top: 0; }
.pln-vlist { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.pln-vchip { display: flex; gap: 8px; align-items: center; width: 100%; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 8px; padding: 5px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.pln-vchip:hover { border-color: var(--md-accent); } .pln-vchip.on { border-color: var(--md-accent); background: color-mix(in srgb, var(--md-accent) 10%, transparent); }
.pln-vthumb { width: 64px; height: 44px; flex: none; background: #F5F4F1; border-radius: 4px; overflow: hidden; } .pln-vthumb svg { width: 100%; height: 100%; display: block; }
.pln-vmeta { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; } .pln-vmeta b { font-size: 12px; } .pln-vmeta span { color: var(--md-muted); }
.pln-label { font-size: 10.5px; letter-spacing: 0.16em; color: var(--md-muted); margin-top: 6px; }
.pln-field { display: grid; grid-template-columns: 1fr 84px 18px; gap: 6px; align-items: center; }
.pln-field span { color: var(--md-muted); }
.pln-field i { color: var(--md-muted); font-style: normal; font-size: 11px; }
.pln-field input, .pln-field select { width: 100%; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; color: var(--md-text); }
.pln-field input[type=text] { grid-column: 2 / span 2; }
.pln-field-wide { grid-template-columns: 1fr 2fr; }
.pln-field-wide select { min-width: 0; }
/* 외벽 구성(층 조합, 2026-10-29) */
.pln-asm { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; padding: 8px; border: 1px solid var(--md-line); border-radius: 8px; background: color-mix(in srgb, var(--md-bg-raised) 70%, transparent); }
.pln-asm-sum { font-size: 12px; color: var(--md-text); font-variant-numeric: tabular-nums; }
.pln-layers { display: flex; flex-direction: column; gap: 4px; }
.pln-layer { display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px 24px 24px; grid-template-areas: 'role sel sel sel sel' '. t up dn x'; gap: 3px 4px; align-items: center; padding-bottom: 4px; border-bottom: 1px dashed var(--md-line); }
.pln-layer > .pln-layer-role { grid-area: role; }
.pln-layer > select { grid-area: sel; }
.pln-layer > input { grid-area: t; }
.pln-layer > .pln-layer-btn:nth-of-type(1) { grid-area: up; }
.pln-layer > .pln-layer-btn:nth-of-type(2) { grid-area: dn; }
.pln-layer > .pln-layer-btn:nth-of-type(3) { grid-area: x; }
.pln-layer-role { font-size: 11px; color: var(--md-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pln-layer select, .pln-layer input { width: 100%; min-width: 0; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 6px; padding: 4px 5px; font: inherit; font-size: 12px; color: var(--md-text); }
.pln-layer input { text-align: right; font-variant-numeric: tabular-nums; }
.pln-layer-btn { border: 1px solid var(--md-line); background: none; color: var(--md-text); border-radius: 5px; font-size: 11px; line-height: 1; padding: 4px 0; cursor: pointer; }
.pln-layer-btn:disabled { opacity: 0.35; cursor: default; }
.pln-layer-btn:hover:not(:disabled) { border-color: var(--md-accent); color: var(--md-accent); }
.pln-btn { align-self: flex-start; margin-top: 6px; background: none; border: 1px solid var(--md-line); border-radius: 999px; padding: 5px 10px; font-size: 11.5px; color: var(--md-muted); cursor: pointer; }
.pln-btn:hover { border-color: var(--md-accent); color: var(--md-accent); }
.pln-stage { position: relative; min-height: 0; background: #F5F4F1; border: 1px solid var(--md-line); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pln-stage.busy::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--md-accent), transparent); background-size: 45% 100%; background-repeat: no-repeat; animation: std-bar 1.6s ease-in-out infinite; }
.pln-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.pln-slab { fill: #FBF9F5; stroke: none; }
.pln-hole { fill: #E9E4DA; stroke: #B4ADA3; stroke-width: 0.06; }
.pln-void { pointer-events: none; }
.pln-void-fill { fill: #F5F4F1; stroke: #6B655C; stroke-width: 0.12; stroke-dasharray: 0.6 0.35; }
.pln-corridor { fill: #DCE4EC; stroke: none; } /* 복도 색(2026-10-22) — 방(흰·조닝색)과 구분되는 옅은 청회색 */
.pln-corridor-edge { fill: none; stroke: #7D8A99; stroke-width: 0.12; pointer-events: none; } /* 복도 외곽선 — 다른 복도와 겹친·맞닿은 구간은 빼고 그린다(2026-10-26) */
.pln-room-fill { stroke: #3a3733; stroke-width: 0.2; stroke-linejoin: miter; opacity: 0.9; cursor: pointer; } /* 방 테두리 = 벽 */
.pln-room.corridor .pln-room-fill { fill: #DCE4EC; stroke: none; opacity: 1; } /* 방 추가의 복도 영역 칸(2026-10-27) — 복도와 같은 색, 테두리는 corridorEdges 로 */
.pln-room.corridor.on .pln-room-fill { stroke: #B5591B; stroke-width: 0.18; }
.pln-room.on .pln-room-fill { opacity: 1; stroke: #B5591B; stroke-width: 0.18; }
.pln-core-fill { fill: #8C857B; stroke: #1B1917; stroke-width: 0.06; }
.pln-esc-fill { fill: #D9D4CA; stroke: #1B1917; stroke-width: 0.06; }
.pln-part { stroke: #1B1917; stroke-width: 0.05; }
.pln-part.stair { fill: #6E6861; } .pln-part.ev { fill: #4a463f; } .pln-part.wc_m { fill: #7E8C9C; } .pln-part.wc_f { fill: #A07E8C; } .pln-part.esc { fill: #B8B2A8; }
.pln-tread { stroke: #F5F4F1; stroke-width: 0.05; opacity: 0.8; }
.pln-core-outline { fill: rgba(110, 104, 97, 0.10); stroke: #8A847B; stroke-width: 0.08; stroke-dasharray: 0.4 0.25; pointer-events: all; }
.pln-coregrp:hover .pln-core-outline { stroke: #B5591B; }
.pln-coregrp.on .pln-core-outline { stroke: #B5591B; stroke-width: 0.2; stroke-dasharray: none; fill: rgba(181, 89, 27, 0.08); }
.pln-esc-outline { fill: none; stroke: none; }
.pln-el .pln-part { stroke-width: 0.06; }
.pln-el.on .pln-part { stroke: #B5591B; stroke-width: 0.2; }
.pln-el.fixed { cursor: pointer; }
.pln-part.door { fill: #F5F4F1; stroke: #1B1917; }
.pln-doorarc { fill: none; stroke: #6B6459; stroke-width: 0.08; }
.pln-doorarc.leaf { stroke-width: 0.1; }
.pln-door-hit { fill: rgba(181, 89, 27, 0.04); stroke: none; } /* 사용자가 놓은 문의 여닫이 자리 — 끌기 손잡이(2026-10-27) */
.pln-el.on .pln-door-hit { fill: rgba(181, 89, 27, 0.16); stroke: #B5591B; stroke-width: 0.06; stroke-dasharray: 0.2 0.15; }
.pln-el.door .pln-doorarc, .pln-el.door2 .pln-doorarc { stroke: #3a3733; }
.pln-room.empty .pln-room-fill { fill: transparent !important; stroke: #8A847B; stroke-dasharray: 0.5 0.35; stroke-width: 0.1; }
.pln-room.empty.on .pln-room-fill { stroke: #B5591B; }
.pln-room.free .pln-room-fill { stroke: #1B1917; stroke-width: 0.28; }
.pln-room.free.on .pln-room-fill { stroke: #B5591B; }
.pln-rot { display: flex; gap: 6px; align-items: center; }
.pln-rot input { width: 64px; }
.pln-room.lifting .pln-room-fill { stroke: #B5591B; stroke-width: 0.35; opacity: 1; } /* 필터(그림자)는 SVG 전체 리페인트를 유발해 드래그가 버벅여서 뺐다 */
.pln-room.lifting text { font-weight: 700; }
.pln-room.lifting { pointer-events: none; }
.pln-svg.dragging .pln-room:not(.lifting):not(.swapping) .pln-room-fill { opacity: 0.55; }
.pln-svg.dragging { cursor: grabbing; }
.pln-room.swapping .pln-room-fill { stroke: #B5591B; stroke-width: 0.25; }
.pln-flip-ghost { fill: rgba(181, 89, 27, 0.14); stroke: #B5591B; stroke-width: 0.12; stroke-dasharray: 0.4 0.3; pointer-events: none; } /* 벽에 붙여 방향을 바꿀 때 잡은 방이 놓일 자리 */

.pln-chips { display: flex; gap: 3px; flex-wrap: wrap; }
.pln-wall { stroke: #1B1917; stroke-linecap: square; }
.pln-wall.corridor { stroke: #3a3733; }
.pln-wall.partition { stroke: #4a463f; }
.pln-wall.zone { stroke: #8A847B; stroke-width: 0.08 !important; stroke-dasharray: 0.5 0.3; }
.pln-stepper { grid-template-columns: 1fr auto 40px; }
.pln-step { display: inline-flex; align-items: center; border: 1px solid var(--md-line); border-radius: 999px; background: var(--md-bg-raised); }
.pln-step button { background: none; border: 0; width: 26px; height: 26px; font-size: 15px; color: var(--md-text); cursor: pointer; }
.pln-step b { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.pln-hit { stroke: transparent; }
/* 벽 종류(2026-10-27) — 재료 색, 내력벽은 실두께·비내력벽은 70%. 선택한 벽은 주황 */
.pln-wtype { stroke-linecap: butt; pointer-events: none; opacity: 0.92; }
.pln-wtype.m-rc { stroke: #3F444A; } .pln-wtype.m-masonry { stroke: #A4512F; } .pln-wtype.m-dry { stroke: #A9B2BC; } .pln-wtype.m-wood { stroke: #8B6B3E; } .pln-wtype.m-glass { stroke: #6FA8D0; }
.pln-wtype.nonbearing { opacity: 0.8; }
.pln-wtype.sel { stroke: #B5591B; opacity: 1; }
.pln-hit-wall { stroke: transparent; cursor: pointer; }
.pln-hit-wall:hover { stroke: rgba(181, 89, 27, 0.25); }
.pln-boiler { pointer-events: none; } .pln-boiler rect { fill: #B5591B; } .pln-boiler text { fill: #FBF9F5; font-weight: 700; }
.pln-reco { border-color: #B5591B; color: #B5591B; }
/* 방 추가 팝업 — 종이 팔레트, 가운데 카드, 배경 클릭으로 닫힘 */
/* 버튼 아래 붙는 방 추가 패널 — 배경은 투명(바깥 클릭으로 닫힘) */
.pln-pop-bg { position: fixed; inset: 0; z-index: 60; background: transparent; }
.pln-popover { position: fixed; overflow: auto; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 12px; box-shadow: 0 14px 40px rgba(27, 25, 23, 0.18); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.pln-popover::before { content: ''; position: absolute; top: -6px; left: 22px; width: 10px; height: 10px; background: var(--md-bg-raised); border-left: 1px solid var(--md-line); border-top: 1px solid var(--md-line); transform: rotate(45deg); }
.pln-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.pln-popover .pln-field { grid-template-columns: 84px 1fr; }
.pln-popover .pln-seg button { padding: 6px 8px; font-size: 12.5px; }
.pln-popover .pln-chips { justify-content: flex-end; }
.pln-modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(27, 25, 23, 0.28); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pln-modal { width: min(440px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(27, 25, 23, 0.22); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.pln-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pln-modal-head h2 { margin: 2px 0 4px; font-family: var(--md-serif); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; }
.pln-modal-x { border: 0; background: transparent; font-size: 16px; color: var(--md-muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.pln-modal-x:hover { background: var(--md-accent-dim); color: var(--md-text); }
.pln-modal-body { display: flex; flex-direction: column; gap: 10px; }
.pln-modal .pln-field { grid-template-columns: 96px 1fr; }
.pln-modal .pln-seg button { padding: 7px 8px; font-size: 13px; }
.pln-modal .pln-chips { justify-content: flex-end; }
.pln-seg { display: flex; gap: 4px; }
.pln-seg button { flex: 1; font-size: 12px; padding: 4px 6px; border: 1px solid var(--md-line); background: transparent; border-radius: 6px; cursor: pointer; color: var(--md-muted); }
.pln-seg button.on { color: var(--md-text); border-color: var(--md-text); }
.pln-el.acc polygon { fill: #E6DFD0; stroke: #5B554C; stroke-width: 0.08; }
.pln-el.bathtub polygon, .pln-el.shower polygon, .pln-el.sink polygon, .pln-el.toilet polygon, .pln-el.kitchen polygon { fill: #FBF9F5; } /* 실내 설비(2026-10-27) — 흰 위생도기·조리대 */
.pln-fix { fill: none; stroke: #5B554C; stroke-width: 0.03; pointer-events: none; }
.pln-el.acc.on polygon { stroke: #B5591B; stroke-width: 0.16; }
.pln-reco:hover { background: rgba(181, 89, 27, 0.08); }
.pln-zonecut { stroke: rgba(181, 89, 27, 0.0); stroke-width: 0.9; }
.pln-zonecut:hover { stroke: rgba(181, 89, 27, 0.35); }
.pln-hit:hover { stroke: rgba(181, 89, 27, 0.25); }
.pln-door { stroke: #F5F4F1; }
.pln-txt { fill: #1B1917; font-family: var(--md-sans); pointer-events: none; }
.pln-txt.dim { fill: #6B6459; }
.pln-txt.inv { fill: #FBF9F5; }
.pln-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin: 0; }
.pln-kv dt { color: var(--md-muted); } .pln-kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pln-metrics dl { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.pln-warn { font-size: 11.5px; color: #b3261e; line-height: 1.5; }
.pln-rooms { display: flex; flex-direction: column; gap: 3px; }
.pln-roomrow { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 7px; padding: 4px 6px; font: inherit; font-size: 12px; color: inherit; cursor: pointer; }
.pln-roomrow i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.pln-roomrow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pln-roomrow b { font-weight: 500; color: var(--md-muted); font-variant-numeric: tabular-nums; }
.pln-roomrow:hover { border-color: var(--md-line); } .pln-roomrow.on { border-color: var(--md-accent); background: color-mix(in srgb, var(--md-accent) 10%, transparent); }
.pln-roomrow em { font-style: normal; font-size: 11px; opacity: 0.35; cursor: pointer; } .pln-roomrow em:hover, .pln-roomrow.locked em { opacity: 1; }
.pln-roomedit { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--md-line); }
.pln-hint { font-size: 11px; color: var(--md-muted); line-height: 1.5; }
.pln-chat { flex: none; display: flex; flex-direction: column; gap: 8px; }
.pln-chatlog { height: 110px; max-height: 110px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.pln-chatrow { display: flex; gap: 12px; line-height: 1.5; }
.pln-who { flex: none; width: 30px; font-size: 11px; letter-spacing: 0.08em; padding-top: 2px; color: var(--md-muted); } .pln-who.you { color: var(--md-accent); }
.pln-row { display: flex; align-items: flex-end; gap: 10px; border-top: 1px solid var(--md-line); padding-top: 8px; }
.pln-row textarea { flex: 1; min-width: 0; background: none; border: 0; outline: none; font: inherit; font-size: 13.5px; line-height: 1.5; resize: none; max-height: 120px; padding: 6px 0; color: var(--md-text); }
.pln-send { background: none; border: 0; color: var(--md-accent); font-size: 17px; cursor: pointer; padding: 0 6px; } .pln-send:disabled { opacity: 0.3; }
@media (max-width: 900px) { .pln { padding: 14px 12px; } .pln-body { grid-template-columns: 1fr; grid-auto-rows: auto; } .pln-stage { min-height: 320px; } .pln-head { grid-template-columns: 1fr; } }
/* v10 방 목록: 잠긴 방은 테두리 점선 없이 굵게, 목록의 빈 칸은 흐리게 */
.pln-room.locked .pln-room-fill { stroke: #1B1917; stroke-width: 0.14; }
.pln-roomrow.empty span { opacity: 0.5; font-style: italic; }

/* 선택한 블록 위 편집 툴바(2026-10-20) */
.pln-float { position: absolute; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(27, 25, 23, 0.18); white-space: nowrap; font-size: 12px; }
.pln-float::after { content: ''; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; background: var(--md-bg-raised); border-right: 1px solid var(--md-line); border-bottom: 1px solid var(--md-line); transform: rotate(45deg); }
.pln-float.below::after { bottom: auto; top: -6px; border: 0; border-left: 1px solid var(--md-line); border-top: 1px solid var(--md-line); }
.pln-float input, .pln-float select { background: var(--md-bg); border: 1px solid var(--md-line); border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 12px; color: var(--md-text); height: 30px; }
.pln-float .pln-ftext { width: auto; min-width: 70px; max-width: 150px; } .pln-float .pln-fsel { max-width: 120px; }
.pln-fbtn { height: 30px; padding: 0 9px; border: 1px solid var(--md-line); border-radius: 7px; background: var(--md-bg); color: var(--md-text); font: inherit; font-size: 12px; cursor: pointer; }
.pln-fbtn:hover { border-color: var(--md-accent); } .pln-fbtn.on { background: var(--md-accent); color: #fff; border-color: var(--md-accent); } .pln-fbtn.danger:hover { border-color: #B5591B; color: #B5591B; }
.pln-fsep { width: 1px; height: 20px; background: var(--md-line); margin: 0 2px; } .pln-fx { color: var(--md-muted); } .pln-flabel { font-weight: 600; padding: 0 4px; } .pln-fhint { color: var(--md-muted); }
.pln-stage:has(.pln-svg.dragging) .pln-float { display: none; }

/* 설비 요소(소환) — 종류별 색. 묶음은 점선 테두리 */
.pln-el.acc.stair polygon, .pln-el.acc.stair_straight polygon, .pln-el.acc.stair_spiral polygon { fill: #6E6861; } .pln-el.acc.ev polygon { fill: #4a463f; } .pln-el.acc.wc_m polygon { fill: #7E8C9C; } .pln-el.acc.wc_f polygon { fill: #A07E8C; } .pln-el.acc.esc polygon { fill: #8C857B; }
.pln-el.acc.stair .pln-tread, .pln-el.acc.stair_straight .pln-tread, .pln-el.acc.stair_spiral .pln-tread, .pln-el.acc.esc .pln-tread, .pln-el.acc.ev .pln-tread { stroke: #F5F4F1; }
.pln-el.grouped polygon { stroke-dasharray: 0.3 0.2; }
.pln-room.on .pln-room-fill, .pln-el.on .pln-part { stroke: #B5591B; }

/* 요소: 채움은 폴리곤, 선은 변마다(같은 종류끼리 맞붙은 변은 생략). 선택 시 테두리 강조 */
.pln-el .pln-part.nostroke { stroke: none; }
.pln-part-edge { stroke: #5B554C; stroke-width: 0.08; fill: none; }
.pln-el.on .pln-part.nostroke { stroke: #B5591B; stroke-width: 0.2; fill-opacity: 0.95; }

/* 빈 칸: 클릭·끌기 없음 */
.pln-room.empty { pointer-events: none; cursor: default; }

/* 3D 장면에 안이 없을 때 자리표시 */
.ms-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 14px; border: 1px dashed var(--md-line); border-radius: 10px; color: var(--md-muted); font-size: 13px; background: rgba(245, 244, 241, 0.7); pointer-events: none; white-space: nowrap; }

/* 단계 keep-alive 래퍼 — 레이아웃엔 없는 것처럼(display: contents), 숨기면 통째로 사라짐 */
.app-step-root { display: contents; }
.app-step-root[hidden] { display: none; }

/* 참고 이미지(내러티브) */
.nar-input .nar-attach { border: 1px solid var(--md-line); background: var(--md-bg-raised); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; flex: 0 0 auto; }
.nar-input.drop { outline: 2px dashed var(--md-accent); outline-offset: 2px; }
.nar-ref { border: 1px solid var(--md-line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--md-bg-raised); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.nar-ref.reading { opacity: 0.85; } .nar-ref.failed { border-color: #B5591B; }
.nar-ref-top { display: flex; gap: 10px; align-items: flex-start; }
.nar-ref-img { width: 88px; height: 66px; object-fit: cover; border-radius: 6px; border: 1px solid var(--md-line); flex: 0 0 auto; }
.nar-ref-meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.nar-ref-line { line-height: 1.4; }
.nar-ref-level { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--md-line); border-radius: 6px; background: var(--md-bg); color: var(--md-text); }
.nar-ref-hint { color: var(--md-muted); font-size: 11px; }
.nar-ref-aspects { display: flex; flex-wrap: wrap; gap: 4px; }
.nar-ref-aspects button { border: 1px solid var(--md-line); background: var(--md-bg); border-radius: 999px; padding: 2px 8px; font-size: 11px; color: var(--md-muted); cursor: pointer; }
.nar-ref-aspects button.on { background: var(--md-text); color: var(--md-bg); border-color: var(--md-text); }
.nar-ref-note { font: inherit; font-size: 12px; padding: 5px 7px; border: 1px solid var(--md-line); border-radius: 6px; background: var(--md-bg); color: var(--md-text); }
.nar-ref-detail summary { cursor: pointer; color: var(--md-muted); font-size: 11px; }
.nar-ref-row { margin: 3px 0; line-height: 1.4; } .nar-ref-row b { font-weight: 600; }
.nar-ref-actions { display: flex; justify-content: flex-end; }
.nar-ref-x { border: 0; background: none; color: var(--md-muted); cursor: pointer; font-size: 11px; }
.nar-side-empty.small { font-size: 12px; margin-bottom: 14px; }
/* 안 생성 중 — 상태·예상 시간 */
.std-box-eta { margin-top: 6px; font-size: 11px; color: var(--md-muted); opacity: 0.8; }

/* ── 선택 버튼 + 아래로 열리는 팝업(picker.js, 주인님 2026-10-21) ─────────────── */
.pk { position: relative; }
.pk-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; border-bottom: 1px solid var(--md-line); color: var(--md-text); font-size: 15px; padding: 4px 0 10px; cursor: pointer; text-align: left; transition: border-color 0.15s; }
.pk-btn:disabled { cursor: default; opacity: 0.5; }
.pk.is-open .pk-btn, .pk-btn:focus-visible { border-bottom-color: var(--md-accent); outline: none; }
.pk-btn-label { font-size: 11px; letter-spacing: 1.5px; color: var(--md-muted); min-width: 56px; }
.pk-btn-value { flex: 1; }
.pk-btn-value.is-empty { color: #5a5346; }
.pk-btn-caret { color: var(--md-muted); font-size: 12px; transition: transform 0.15s; }
.pk.is-open .pk-btn-caret { transform: rotate(180deg); }
.pk-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12); padding: 6px; }
.pk.is-open .pk-pop { display: block; }
.pk-search { width: 100%; box-sizing: border-box; background: var(--md-bg); border: 1px solid var(--md-line); border-radius: 8px; color: var(--md-text); font-size: 13px; padding: 8px 10px; margin-bottom: 6px; outline: none; }
.pk-search:focus { border-color: var(--md-accent); }
.pk-list { max-height: 264px; overflow: auto; }
.pk-item { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; border-radius: 8px; color: var(--md-text); font-size: 14px; padding: 8px 10px; cursor: pointer; text-align: left; }
.pk-item:hover, .pk-item:focus-visible { background: color-mix(in srgb, var(--md-accent) 10%, transparent); outline: none; }
.pk-item.is-on { color: var(--md-accent); font-weight: 600; }
.pk-item-sub { margin-left: auto; font-size: 11px; color: var(--md-muted); letter-spacing: 1px; }
.pk-empty { padding: 10px; font-size: 13px; color: var(--md-muted); }
.nat-pick { display: grid; gap: 14px; }
.lg-field-nat > span { margin-bottom: 4px; }

/* 국적 모달(nationality.js) — 구글 가입·옛 계정 첫 진입 */
.nat-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 17, 12, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.nat-card { width: min(440px, 100%); background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 18px; padding: 28px 28px 24px; display: grid; gap: 14px; }
.nat-eyebrow { font-size: 11px; letter-spacing: 1.5px; color: var(--md-accent); }
.nat-title { margin: 0; font-size: 22px; font-weight: 500; }
.nat-sub { margin: 0 0 6px; font-size: 13px; color: var(--md-muted); line-height: 1.6; }
.nat-msg { min-height: 18px; font-size: 12px; color: #b4452f; }
.nat-save { background: var(--md-accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.nat-save:disabled { opacity: 0.4; cursor: default; }

/* 대지 단계 — 국적 나라 칩 */
.site-country { position: absolute; z-index: 10; bottom: 44px; left: 20px; cursor: pointer; color: var(--md-text); display: flex; align-items: center; gap: 8px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 999px; padding: 7px 14px 7px 10px; font-size: 13px; }
.site-country-flag { font-size: 16px; }
.site-country-name { font-weight: 600; }
.site-country-law { color: var(--md-muted); font-size: 12px; }
.site-country-law::before { content: '·'; margin-right: 6px; }
.site-country.is-nodata .site-country-law { color: #b4452f; }
@media (max-width: 680px) { .site-country { bottom: 64px; left: 12px; } }
/* 대지 단계 — 이 나라 건축 선례(2026-10-22) */
.site-prec-btn { position: absolute; z-index: 10; bottom: 88px; left: 20px; cursor: pointer; color: var(--md-text); background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; }
.site-prec-btn.on { border-color: var(--md-text); }
.site-prec-btn:disabled { opacity: .55; cursor: default; }
.site-prec { position: absolute; z-index: 11; bottom: 128px; left: 20px; width: min(560px, calc(100vw - 40px)); max-height: min(62vh, 620px); display: flex; flex-direction: column; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); overflow: hidden; }
.site-prec-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; font-size: 14px; }
.std-col-plan { margin-top: 6px; color: var(--md-muted); font-size: 11.5px; }
.std-col-basis { margin-top: 6px; color: var(--md-muted); font-size: 11.5px; line-height: 1.45; }
.site-prec-near { color: var(--md-muted); font-size: 11.5px; margin-top: 3px; }
.site-prec-x { background: none; border: 0; color: var(--md-muted); cursor: pointer; font-size: 14px; }
.site-prec-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; border-bottom: 1px solid var(--md-line); }
.site-prec-tabs button { border: 1px solid var(--md-line); background: transparent; color: var(--md-text); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.site-prec-tabs button.active { background: var(--md-text); color: var(--md-bg); border-color: var(--md-text); }
.site-prec-tabs button:disabled { opacity: .4; cursor: default; }
.site-prec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 12px 14px; overflow-y: auto; }
.site-prec-item { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; line-height: 1.35; }
.site-prec-item img, .site-prec-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--md-line); display: grid; place-items: center; color: var(--md-muted); }
.site-prec-item figcaption { display: flex; flex-direction: column; gap: 2px; }
.site-prec-item figcaption b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-prec-item figcaption span { color: var(--md-muted); }
.site-prec-item figcaption em { font-style: normal; color: var(--md-text); opacity: .85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.site-prec-empty { padding: 24px 14px; color: var(--md-muted); font-size: 13px; }
.site-prec-foot { padding: 8px 14px 12px; color: var(--md-muted); font-size: 11.5px; border-top: 1px solid var(--md-line); }
@media (max-width: 680px) { .site-prec-btn { bottom: 108px; left: 12px; } .site-prec { bottom: 148px; left: 12px; width: calc(100vw - 24px); } }

/* ── 마당 어드민(admin.js, 2026-10-21) ─────────────────────────────────────── */
.app-admin-link { display: block; text-align: center; font-size: 12px; color: var(--md-accent); text-decoration: none; margin-bottom: 8px; }
.adm { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--md-bg); color: var(--md-text); } /* body 가 overflow:hidden(base.css) 이라 어드민은 자기 안에서 스크롤 — 주인님 2026-10-21 '스크롤 왜 안돼' */
.adm-top { display: flex; align-items: center; gap: 18px; padding: 14px 28px; border-bottom: 1px solid var(--md-line); position: sticky; top: 0; background: var(--md-bg); z-index: 5; }
.adm-title { font-size: 13px; letter-spacing: 1.5px; color: var(--md-muted); }
.adm-tabs { display: flex; gap: 4px; }
.adm-tabs button { background: none; border: 1px solid transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--md-muted); cursor: pointer; }
.adm-tabs button.active { background: var(--md-bg-raised); color: var(--md-text); border-color: var(--md-line); }
.adm-top-spacer { flex: 1; }
.adm-ghost { background: none; border: 1px solid var(--md-line); border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--md-text); cursor: pointer; text-decoration: none; }
.adm-main { max-width: 1180px; margin: 0 auto; padding: 24px 28px 60px; }
.adm-err { background: #fbe9e4; color: #b4452f; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.adm-loading, .adm-empty { color: var(--md-muted); font-size: 13px; padding: 16px 0; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.adm-card { background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; padding: 14px 16px; }
.adm-card-label { font-size: 11px; letter-spacing: 1.2px; color: var(--md-muted); margin-bottom: 8px; }
.adm-card-value { font-size: 26px; font-weight: 600; line-height: 1.1; }
.adm-card-sub { font-size: 11.5px; color: var(--md-muted); margin-top: 6px; }
.adm-sec { margin-bottom: 28px; }
.adm-h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.adm-h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--md-muted); }
.adm-chart { background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; padding: 10px 8px 4px; }
.adm-chart svg { display: block; height: auto; }
.adm-legend { display: flex; gap: 14px; font-size: 12px; color: var(--md-muted); margin-bottom: 6px; }
.adm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.adm-roles { display: grid; gap: 8px; }
.adm-role { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: 12px; font-size: 13px; }
.adm-role-bar { height: 8px; background: var(--md-line); border-radius: 999px; overflow: hidden; }
.adm-role-bar i { display: block; height: 100%; background: var(--md-accent); }
.adm-role-count { text-align: right; }
.adm-online, .adm-countries { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 999px; padding: 5px 11px; font-size: 12px; }
.adm-chip small { color: var(--md-muted); }
.adm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2f9d5b; box-shadow: 0 0 0 3px rgba(47, 157, 91, 0.18); }
.adm-foot, .adm-note { font-size: 11.5px; color: var(--md-muted); }
.adm-note { margin: 0 0 8px; }
.adm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.adm-search { flex: 1; max-width: 360px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--md-text); outline: none; }
.adm-count { font-size: 12px; color: var(--md-muted); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; overflow: hidden; }
.adm-table th, .adm-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--md-line); white-space: nowrap; }
.adm-table th { font-size: 11px; letter-spacing: 1px; color: var(--md-muted); font-weight: 500; }
.adm-table tbody tr { cursor: pointer; }
.adm-table tbody tr:hover { background: color-mix(in srgb, var(--md-accent) 6%, transparent); }
.adm-table tbody tr.is-sel { background: color-mix(in srgb, var(--md-accent) 12%, transparent); }
.adm-email small { color: var(--md-muted); }
.adm-role-sel { background: var(--md-bg); border: 1px solid var(--md-line); border-radius: 8px; padding: 3px 6px; font-size: 12px; color: var(--md-text); }
.adm-detail { margin-top: 16px; background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; padding: 16px; }
.adm-detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.adm-detail-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; }
.adm-list { display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.adm-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--md-text); }
.adm-row:hover { background: color-mix(in srgb, var(--md-accent) 6%, transparent); }
.adm-row.is-sel { border-color: var(--md-accent); }
.adm-row-title { font-size: 13px; font-weight: 600; }
.adm-row-sub { font-size: 11.5px; color: var(--md-muted); }
.adm-tl { display: grid; grid-template-columns: 70px 150px 1fr; gap: 10px; font-size: 12px; padding: 5px 6px; border-left: 3px solid var(--md-line); }
.adm-tl.t-job { border-left-color: var(--md-accent); }
.adm-tl.t-chat { border-left-color: #3b6fb6; }
.adm-tl-when { color: var(--md-muted); }
.adm-tl-kind { font-weight: 600; }
.adm-tl-detail { color: var(--md-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-chats { margin-top: 16px; border-top: 1px solid var(--md-line); padding-top: 14px; }
.adm-msgs { display: grid; gap: 8px; max-height: 480px; overflow: auto; }
.adm-msg { border-radius: 12px; padding: 8px 12px; background: var(--md-bg); border: 1px solid var(--md-line); font-size: 13px; }
.adm-msg.r-user { border-color: color-mix(in srgb, var(--md-accent) 40%, var(--md-line)); }
.adm-msg-meta { display: block; font-size: 11px; color: var(--md-muted); margin-bottom: 4px; }
.adm-msg-text { white-space: pre-wrap; line-height: 1.5; }
.adm-data { display: grid; gap: 6px; }
.adm-data-row { display: grid; grid-template-columns: 260px 1fr 110px; align-items: center; gap: 12px; font-size: 12.5px; }
.adm-data-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-data-name small { display: block; font-family: inherit; color: var(--md-muted); font-size: 11px; }
.adm-data-bar { height: 8px; background: var(--md-line); border-radius: 999px; overflow: hidden; }
.adm-data-bar i { display: block; height: 100%; background: var(--md-accent); opacity: 0.8; }
.adm-data-rows { text-align: right; color: var(--md-muted); }
@media (max-width: 760px) { .adm-detail-grid { grid-template-columns: 1fr; } .adm-data-row { grid-template-columns: 1fr 80px; } .adm-data-bar { display: none; } .adm-main { padding: 16px; } .adm-top { flex-wrap: wrap; } }

/* 대지 단계 — 세션별 대륙·나라 선택 카드(주인님 2026-10-21) */
.site-country-edit { color: var(--md-muted); font-size: 12px; margin-left: 2px; }
.site-region { position: absolute; z-index: 12; top: 62px; left: 50%; transform: translateX(-50%); width: min(380px, calc(100% - 32px)); background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 16px; padding: 16px 18px 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12); display: grid; gap: 10px; }
.site-region-title { font-size: 15px; font-weight: 600; }
.site-region-sub { font-size: 12px; color: var(--md-muted); line-height: 1.5; margin-bottom: 4px; }
.site-region .nat-pick { gap: 10px; }
.site-region-close { justify-self: end; background: none; border: 0; color: var(--md-muted); font-size: 12px; cursor: pointer; }

/* 어드민 — 나라 칩 팝업(보유 법령 제목, 주인님 2026-10-21) */
.adm-chipwrap { position: relative; }
.adm-chip-btn { cursor: pointer; color: var(--md-text); font: inherit; }
.adm-chipwrap.is-open .adm-chip-btn { border-color: var(--md-accent); color: var(--md-accent); }
.adm-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(460px, 86vw); background: var(--md-bg-raised); border: 1px solid var(--md-line); border-radius: 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14); padding: 12px 14px; }
.adm-chipwrap.is-open .adm-pop { display: block; }
.adm-pop-head { font-size: 12px; letter-spacing: 1px; color: var(--md-muted); margin-bottom: 8px; }
.adm-pop-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; }
.adm-pop-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: start; border-top: 1px solid var(--md-line); padding-top: 8px; }
.adm-pop-item:first-child { border-top: 0; padding-top: 0; }
.adm-pop-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.adm-pop-sub { grid-column: 1; font-size: 11.5px; color: var(--md-muted); }
.adm-pop-src { grid-column: 2; grid-row: 1 / span 2; font-size: 11.5px; color: var(--md-accent); text-decoration: none; white-space: nowrap; }
.pln-corridor-txt { fill: #5D6B7A; font-weight: 600; letter-spacing: 0.08em; pointer-events: none; }
.pln-span { display: inline-flex; align-items: center; gap: 4px; }

/* 계단 기호(2026-10-23) — 박스 대신 실제 도면 표기: 밝은 바탕 + 디딤판 선 + 오름 화살표 + 절단선 */
.pln-el.acc.stair polygon, .pln-el.acc.stair_straight polygon, .pln-el.acc.stair_spiral polygon, .pln-el.acc.esc polygon { fill: #FBF9F5; }
.pln-part.stair, .pln-part.esc { fill: #FBF9F5; }
.pln-el.acc.stair .pln-tread, .pln-el.acc.stair_straight .pln-tread, .pln-el.acc.stair_spiral .pln-tread, .pln-el.acc.esc .pln-tread { stroke: #5B554C; stroke-width: 0.035; opacity: 1; }
.pln-stair-wall { stroke: #1B1917; stroke-width: 0.07; }
.pln-stair-cut { stroke: #1B1917; stroke-width: 0.05; stroke-dasharray: 0.25 0.12; }
.pln-stair-arrow { fill: none; stroke: #1B1917; stroke-width: 0.06; stroke-linejoin: round; }
.pln-stair-head, .pln-stair-dot { fill: #1B1917; stroke: none; }
.pln-stair-label { fill: #B5591B; font-weight: 600; paint-order: stroke; stroke: #FBF9F5; stroke-width: 0.12; }
.pln-el polygon.pln-stair-void, .pln-el.acc polygon.pln-stair-void { fill: #FBF9F5; stroke: #1B1917; stroke-width: 0.08; } /* 도착층 계단 = 바닥 구멍 테두리 */

/* 내레티브 수정 팝업(2026-10-29) — 형태 제작 중 '지금 상태' / '처음부터' */
.nar-redo { width: 480px; }
.nar-redo .exp-x { margin-left: auto; }
.nar-redo-q { margin: 16px 0 18px; font-size: 14px; line-height: 1.6; color: var(--md-text); }
.nar-redo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nar-redo-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--md-line); background: transparent; color: var(--md-text); cursor: pointer; text-align: left; }
.nar-redo-btn b { font-size: 14px; font-weight: 600; }
.nar-redo-btn span { font-size: 12px; color: var(--md-muted); line-height: 1.45; }
.nar-redo-btn:hover { border-color: var(--md-accent); }
.nar-redo-btn.go { background: var(--md-accent); border-color: var(--md-accent); color: #17130D; }
.nar-redo-btn.go span { color: rgba(23, 19, 13, 0.72); }
@media (max-width: 560px) { .nar-redo-row { grid-template-columns: 1fr; } }

/* 지하주차장 평면(2026-10-29) */
.pln-park-aisle { fill: #E9E6DF; stroke: none; }
.pln-park-access { fill: #D8CFC0; stroke: #8C7F6C; stroke-width: 0.06; stroke-dasharray: 0.3 0.2; }
.pln-park-core { fill: #6E6861; fill-opacity: 0.25; stroke: #6E6861; stroke-width: 0.06; }
.pln-park-stall polygon { fill: #FFFFFF; stroke: #3B3F45; stroke-width: 0.06; }
.pln-park-stall.accessible polygon { fill: #DCE8F7; stroke: #2F6FB7; }
.pln-park-stall.parallel polygon { fill: #F7F5F0; }
.pln-park-stall.removed polygon { fill: none; stroke: #B44; stroke-dasharray: 0.25 0.2; }
.pln-park-stall:hover polygon { stroke: var(--md-accent); stroke-width: 0.12; }
.pln-park-no { fill: #3B3F45; font-weight: 600; pointer-events: none; }
.pln-park-stall.removed .pln-park-no { fill: #B44; }

.nst-gfafit { margin-top: 8px; font-size: 11px; line-height: 1.5; color: #8a5a2b; } /* 기획 연면적을 법정 한도 안에서 다 못 채운 안 — 이유 표시(2026-11-04) */

.site-ctx { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; }
.site-ctx-credit { font-size: 10px; color: #FBF9F5; background: rgba(27, 25, 23, 0.55); padding: 2px 6px; border-radius: 4px; }
.site-ctx-btn { padding: 7px 12px; border: 1px solid rgba(26, 25, 83, 0.25); border-radius: 18px; background: rgba(251, 249, 245, 0.92); color: #1B1917; font-size: 12px; cursor: pointer; }
.site-ctx-btn.on { background: #1B1917; color: #FBF9F5; border-color: #1B1917; }
.nst-wrap { display: contents; }
.nst-wrap > .nst { top: 50px; } /* 위 칸에 도로·보행로 버튼 */
.nst-tools { position: absolute; top: 12px; right: 20px; z-index: 3; }
.nst-tools .site-ctx { position: static; }
.pln-lot { fill: none; stroke: #8C867C; stroke-width: 0.06; stroke-dasharray: 0.5 0.35; pointer-events: none; } /* 대지 경계 */
.pln-flip-ghost.pln-flip-cor { fill: rgba(140, 134, 124, 0.32); } /* 벽에 붙일 때 복도가 옮겨 갈 자리 */
.pln-svg.docking .pln-corridor, .pln-svg.docking .pln-corridor-edge, .pln-svg.docking .pln-corridor-txt { opacity: 0; }
.pln-funit { display: inline-flex; margin-left: 4px; }
.pln-unit-scroll { overflow-x: auto; margin: 6px 0; }
.pln-unit-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.pln-unit-table th { font-weight: 500; opacity: 0.65; text-align: right; vertical-align: bottom; padding: 3px 3px; white-space: normal; word-break: keep-all; line-height: 1.2; border-bottom: 1px solid rgba(26, 25, 83, 0.15); }
.pln-unit-table td { text-align: right; padding: 3px 3px; font-variant-numeric: tabular-nums; }
.pln-unit-table th:first-child, .pln-unit-table td:first-child { text-align: left; }
.pln-unit-table tr.total td { font-weight: 600; border-top: 1px solid rgba(26, 25, 83, 0.15); }
.pln-label-top { pointer-events: none; } /* 선택한 방 이름 — 요소 위에(눌러도 아래 요소를 막지 않는다) */
.pln-svg.dragging .pln-label-top { display: none; }
