#detailPane { width: calc(100% - 650px - 12px); }
#mainPane   { width: 650px; }
.chart-box  { height: 260px; }

#finto-error {
  position: fixed;
  left: 16px;
  bottom: 16px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 4000;
  display: none;
  font-size: 12px;
}
#finto-error.show { display: block; }

/* ===== 기업검색 패널(사이드바 우측 고정) 설정 ===== */
:root{
  --topbar-h: 70px;   /* topnav 높이 */
  --cs-width: 360px;  /* 패널 폭 */
}

/* 오버레이 완전 비활성화 */
#corpsearch-overlay{ display:none !important; }

/* 패널 본체: 사이드바 바로 오른쪽 고정(기본값: 와이드 사이드바 기준) */
.cs-pad{
  position: fixed;
  top: var(--topbar-h);
  left: 16rem;                         /* 기본: 와이드 사이드바 폭 기준 */
  width: var(--cs-width);
  height: calc(100vh - var(--topbar-h));
  background: #fff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  display: none;                        /* 기본 숨김 */
  flex-direction: column;
  z-index: 1000;
  transform: none !important;           /* 기존 translateX 애니메이션 제거 */
}
.cs-pad.show{ display:flex; }

/* 패널 내부 구성 */
.cs-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 14px;
  border-bottom:1px solid #e5e7eb;
}
.cs-title{font-weight:700;}
.cs-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}
.cs-search{display:flex;gap:8px;}
.cs-search input{
  flex:1;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:8px;
}
.cs-search button{
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:8px 12px;
  cursor:pointer;
  background:#f5f7f9;
}
.cs-result{
  flex:1;
  overflow:auto;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:8px;
  background:#fff;
}
.cs-item{
  padding:6px 8px;
  border-bottom:1px solid #f3f4f6;
  cursor:pointer;
}
.cs-item:hover{background:#f3f4f6;}
.cs-note{
  border:1px solid #e5e7eb;
  border-radius:8px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:#fff;
}
.cs-note label{
  padding:8px;
  background:#f9fafb;
  border-bottom:1px solid #e5e7eb;
  font-size:0.85rem;
  color:#6b7280;
}
.cs-note textarea{
  flex:1;
  border:none;
  padding:8px;
  resize:none;
  outline:none;
}

/* 태블릿 이하: 패널을 전체폭으로 */
@media(max-width:1024px){
  .cs-pad{ left: 0; width: 100vw; }
  body.with-cs-open #detailPane{ width: 100% !important; }
}
