/* finder.php 레이어팝업의 위치/크기와 동일하게 */
#chat-layer-overlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: normal;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.35);
  z-index: 9999;
  overflow: hidden; /* ← 바깥 스크롤 방지 */
}

/* 카드: 최대 600px, 뷰포트 작으면 92vh로 */
#chat-layer-card{
  width: min(95vw, 520px);
  height: min(92vh, 720px);   /* ← 높이 상한 600px */
  max-height: 600px;          /* ← 안전망 */
  background: #fff;
  border-radius: 12px;
  overflow: hidden;           /* ← 카드 자체 스크롤 금지 */
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
}

#chat-layer-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0px 12px;
    position:relative;
    z-index:99;
/*
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
    */
    
}
#chat-layer-title{
    display:none;
  font-weight: 700;
  color: #111827;
  font-size: 15px;
}
#chat-layer-close{
  border: 0;
  background: transparent;
  width: 36px; height: 36px;
  font-size: 20px; color: #333;
  cursor: pointer;
    position:absolute;
    top:10px;
    right:12px;
}

/* 본문: 내부 컨텐츠만 스크롤되도록 flex 컨테이너화 */
#chat-layer-body{
  flex: 1;
  min-height: 0;     /* ← 자식이 스크롤 먹도록 필수 */
  display: flex;
  background: #fff;
  overflow: hidden;  /* ← 본문 자체는 스크롤 감춤 */
}

/* 대화 iframe: 남은 높이를 꽉 채우고 스크롤은 iframe 내부(대화창)에서만 */
#chatlayerMemoFrame{
  display: none;     /* openMemo에서 보이게 */
  flex: 1;           /* ← 남은 공간 전부 차지 */
  width: 100%;
  height: 100%;
  border: 0;
}

/* 예비사업자 박스: 내용이 길어질 때만 내부 스크롤 */
#chatlayerPrebizBox{
  display: none;     /* openPrebiz에서 보이게 */
  flex: 1;
  min-height: 0;
  overflow: auto;    /* ← 컨텐츠 길 때에만 스크롤 */
}


/* ===== 예비사업자 뷰 ===== */
.chatlayer-prebiz-top{
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
}
.prebiz-logo{
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border:1px solid #e5e7eb;
}
.prebiz-title{ font-weight: 700; color:#111827; }
.prebiz-sub{ font-size: 12px; color:#6b7280; margin-top:2px; }

.prebiz-section{
  padding: 12px;
  border-top: 1px dashed #eef2f7;
}
.prebiz-section.note{
  background: #eff6ff; border-top-color:#dbeafe;
  color:#1e3a8a; font-weight:600;
}
.prebiz-actions{ display:flex; gap:8px; margin-top:8px; }

.btn, .btn-primary, .btn-ghost{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 12px; border-radius:10px; font-weight:700; cursor:pointer;
  border:1px solid #e5e7eb; background:#fff; color:#111827;
}
.btn-primary{ border-color:#2563eb; color:#fff; background:#2563eb; }
.btn-ghost{ border-color:#cbd5e1; background:#fff; color:#0f172a; }

.bizcert-status{ margin-top:6px; font-size:13px; color:#475569; }
.bizcert-status.ok{ color:#065f46; }
.bizcert-status.warn{ color:#b45309; }

/* 예약 리스트 */
.reserve-list-header, .reserve-item{
  display:grid;
  grid-template-columns: 56px 1fr 80px 110px;
  gap: 8px; align-items:center;
  padding:6px 4px;
}
.reserve-list-header{
  border-bottom:1px solid #e5e7eb; font-weight:700; color:#374151;
}
.reserve-item + .reserve-item{ border-top:1px dashed #e5e7eb; }
.reserve-num, .reserve-date{ color:#6b7280; font-size:12px; }
.reserve-thumb img{ width:42px; height:42px; border-radius:50%; object-fit:cover; border:1px solid #e5e7eb; }
.paging-center{ display:flex; align-items:center; justify-content:center; gap:10px; margin-top:8px; }
.muted{ color:#6b7280; font-size:12px; }

/* 반응형 */
@media (max-width: 380px){
  #chat-layer-card{ height: min(92vh, 620px); }
  .reserve-list-header, .reserve-item{
    grid-template-columns: 42px 1fr 60px 90px;
  }
}
