/* Topnav 레이아웃 조정 */
.top-navbar__container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0 !important;
}

.top-navbar__logo {
  flex-shrink: 0 !important;
  margin-right: 32px !important;
}

.top-navbar__actions {
  flex-shrink: 0 !important;
  margin-left: 32px !important;
}

/* Topnav 검색창 - 로고와 알림 사이 중앙 배치 */
.top-navbar__search {
  flex: 1 !important;
  max-width: 650px !important;
  display: block !important;
  visibility: visible !important;
  margin: 0 auto !important;
}

.topnav-search-wrap {
  position: relative;
  width: 100%;
}

.topnav-search {
  position: relative;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border: 1px solid #dfe1e5;
  border-radius: 56px;
  padding: 8px 60px 8px 50px;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(32, 33, 36, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 8px;
}

.topnav-search:hover {
  box-shadow: 0 3px 14px rgba(32, 33, 36, 0.16);
  border-color: #c6c9cc;
  transform: translateY(-1px);
}

.topnav-search:focus-within {
  box-shadow: 0 6px 24px rgba(30, 58, 138, 0.25);
  border-color: #1E3A8A;
  transform: translateY(-2px);
}

.topnav-search__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa0a6;
  font-size: 18px;
  pointer-events: none;
}

.topnav-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* topnav 검색창 안의 tag-chip (index.html과 동일한 스타일) */
.top-navbar__search .tag-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 10px !important;
  background: transparent !important;
  border: 1.5px solid #1E3A8A !important;
  border-radius: 16px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1E3A8A !important;
  animation: popIn 0.2s ease;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
  position: relative !important;
}

.top-navbar__search .tag-chip:hover {
  background: linear-gradient(135deg, rgba(27, 116, 55, 0.2), rgba(21, 54, 107, 0.2)) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.top-navbar__search .tag-chip__name {
  pointer-events: none !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.top-navbar__search .tag-chip__remove {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  color: #333 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  transition: color 0.2s ease;
  opacity: 1 !important;
  pointer-events: auto !important;
  flex-shrink: 0 !important;
}

.top-navbar__search .tag-chip__remove:hover {
  color: #ef4444 !important;
}

.top-navbar__search .tag-chip__remove-text {
  font-size: 18px !important;
  line-height: 1 !important;
  color: #333 !important;
  font-weight: bold !important;
  display: block !important;
}

.topnav-tag-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(27, 116, 55, 0.1), rgba(21, 54, 107, 0.1));
  border: 1.5px solid #1E3A8A;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1E3A8A;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: popIn 0.3s ease;
  position: relative;
  min-width: fit-content;
}

.topnav-tag-chip:hover {
  background: linear-gradient(135deg, rgba(27, 116, 55, 0.2), rgba(21, 54, 107, 0.2));
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.2);
}

.topnav-tag-chip__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  flex: 1;
  min-width: 0;
}

.topnav-tag-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  font-size: 14px;
  line-height: 1;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: 0;
  transition: color 0.2s ease;
  opacity: 1;
  pointer-events: auto;
  flex-shrink: 0;
}

.topnav-tag-chip__remove:hover {
  color: #ef4444;
}

.topnav-tag-chip__remove i {
  font-size: 14px;
  line-height: 1;
  display: block;
  color: inherit;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.topnav-search__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #202124;
  min-width: 180px;
  padding: 0;
  height: auto;
}

.topnav-search__input::placeholder {
  color: #9aa0a6;
  font-size: 15px;
}

.topnav-search__btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #1b7437, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.topnav-search__btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.topnav-search__btn:active {
  opacity: 0.8;
}

.topnav-search__btn i {
  font-size: 16px;
  line-height: 1;
  color: #fff !important;
}

/* 자동완성 리스트 */
.topnav-ac-list {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  border: 1px solid #e0e0e0;
}

.topnav-ac-item {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid #f1f3f4;
  animation: slideInItem 0.3s ease forwards;
  opacity: 0;
}

.topnav-ac-item:last-child {
  border-bottom: none;
  border-radius: 0 0 24px 24px;
}

.topnav-ac-item:first-child {
  border-radius: 24px 24px 0 0;
}

.topnav-ac-item:hover,
.topnav-ac-item.active {
  background: #f8f9fa;
  transform: translateX(4px) scale(1.01);
}

@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.topnav-ac-item:nth-child(1) { animation-delay: 0.05s; }
.topnav-ac-item:nth-child(2) { animation-delay: 0.08s; }
.topnav-ac-item:nth-child(3) { animation-delay: 0.11s; }
.topnav-ac-item:nth-child(4) { animation-delay: 0.14s; }
.topnav-ac-item:nth-child(5) { animation-delay: 0.17s; }

.topnav-ac-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topnav-ac-name {
  font-weight: 600;
  font-size: 15px;
  color: #202124;
  letter-spacing: -0.3px;
}

.topnav-ac-code {
  font-size: 13px;
  color: #5f6368;
  font-family: 'SF Mono', 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* 제목 스타일 */
.heading-sm {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

/* 심플하고 깔끔한 재무제표 */
#fin-table,
#fin-table-year,
#fin-table-quarter {
  width: 100% !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* 통합된 재무제표 테이블 스타일 */
#fin-table {
  width: 100% !important;
  min-width: 600px !important;
}

/* 헤더 - 중앙 정렬 */
#fin-table thead th {
  background: #f8fafc !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 12px 12px !important;
  text-align: center !important;
  border-bottom: 2px solid #e2e8f0 !important;
  height: 48px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

#fin-table thead th:first-child {
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 12px !important;
}

/* 바디 - 중앙 정렬 */
#fin-table tbody td {
  padding: 12px 12px !important;
  text-align: center !important;
  font-size: 13px !important;
  color: #475569 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  background: #fff !important;
  height: auto !important;
  min-height: 44px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

#fin-table tbody td:first-child {
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 12px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

/* t-right 클래스 오버라이드 (중앙 정렬 강제) */
#fin-table .t-right {
  text-align: center !important;
}

/* 분기 테이블은 컬럼이 더 많으므로 최소 너비 보장 */
#fin-table-quarter {
  min-width: 500px !important;
}

#fin-table-year {
  min-width: 400px !important;
}

/* 테이블 행 높이 맞추기 */
#fin-table-year,
#fin-table-quarter {
  margin-top: 0 !important;
}

#fin-table-year thead,
#fin-table-quarter thead {
  position: relative;
}

#fin-table-year tbody tr,
#fin-table-quarter tbody tr {
  height: auto;
}

#fin-table-year tbody tr td,
#fin-table-quarter tbody tr td {
  height: auto !important;
  min-height: 48px !important;
  vertical-align: middle !important;
  padding: 12px 16px !important;
  box-sizing: border-box !important;
}

/* 테이블 행 높이 동기화 */
#fin-table-year tbody tr,
#fin-table-quarter tbody tr {
  height: auto !important;
  min-height: 48px !important;
}

/* 헤더 - 심플하게 */
#fin-table-year thead th,
#fin-table-quarter thead th {
  background: #f8fafc !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 12px 12px !important;
  text-align: center !important;
  border-bottom: 2px solid #e2e8f0 !important;
  height: 48px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* 헤더 행 높이 동기화 */
#fin-table-year thead tr,
#fin-table-quarter thead tr {
  height: 48px !important;
}

#fin-table-year thead th:first-child,
#fin-table-quarter thead th:first-child {
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 12px !important;
}

/* 바디 스타일 */
#fin-table-year tbody td,
#fin-table-quarter tbody td {
  padding: 12px 12px !important;
  text-align: center !important;
  font-size: 13px !important;
  color: #475569 !important;
  border-bottom: 1px solid #f1f5f9 !important;
  background: #fff !important;
  height: auto !important;
  min-height: 44px !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

#fin-table-year tbody td:first-child,
#fin-table-quarter tbody td:first-child {
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 12px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

/* 중요 항목만 살짝 강조 */
#fin-table-year tbody tr:nth-child(1) td:first-child,
#fin-table-year tbody tr:nth-child(3) td:first-child,
#fin-table-year tbody tr:nth-child(4) td:first-child,
#fin-table-quarter tbody tr:nth-child(1) td:first-child,
#fin-table-quarter tbody tr:nth-child(3) td:first-child,
#fin-table-quarter tbody tr:nth-child(4) td:first-child {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* 손익 구분선 */
#fin-table-year tbody tr:nth-child(4) td,
#fin-table-quarter tbody tr:nth-child(4) td {
  border-bottom: 1.5px solid #e2e8f0 !important;
}

/* 마지막 행 */
#fin-table-year tbody tr:last-child td,
#fin-table-quarter tbody tr:last-child td {
  border-bottom: none !important;
}

/* 기업정보 더보기 */
.info-row--hidden {
  display: none;
  animation: fadeOut 0.3s ease;
}

.info-row--visible {
  display: grid;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.btn-more {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-more:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.btn-more i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

/* 차트 기간 선택 버튼 */
.chart-period-group {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
}

.period-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

.period-btn.active {
  background: #fff;
  color: #1b7437;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 재무제표 기간 선택 버튼 */
.fin-period-group {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
}

.fin-period-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fin-period-btn:hover {
  color: #374151;
  background: rgba(255, 255, 255, 0.5);
}

.fin-period-btn.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#fin-year-select {
  min-width: 120px;
}

/* 포스트잇 스타일 탭 (UI만) */
.fin-postit-tabs {
  position: relative;
  display: inline-flex;
  margin-left: 0;
  margin-top: -8px;
  margin-bottom: 0;
  padding: 0;
  z-index: 10;
  gap: 0;
}

.fin-postit-tab {
  position: relative;
  padding: 12px 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  margin: 0;
  margin-right: 0;
}

.fin-postit-tab:not(:first-child) {
  border-left: none;
  border-radius: 0 8px 0 0;
}

.fin-postit-tab:first-child {
  border-radius: 8px 0 0 0;
}

.fin-postit-tab:only-child {
  border-radius: 8px 8px 0 0;
}

.fin-postit-tab:hover {
  color: #374151;
  box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.1);
}

.fin-postit-tab:active {
  transform: translateY(-3px);
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.15);
}

.fin-postit-tab.active {
  color: #1e3a8a;
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #fff;
}

.fin-postit-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: #fff;
}

/* app.html 챗봇 스타일 (정돈된 버전) */
#mainPane .chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  overflow: hidden;
}

/* 헤더 스타일 개선 */
#mainPane .chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-bottom: 2px solid #e5e7eb;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  flex-direction: column;
  gap: 12px;
}

#mainPane .chat__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

#mainPane .chat__title-main {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

#mainPane .chat__title-main i {
  color: #10b981;
  font-size: 1.25rem;
}

#mainPane .chat__title-sub {
  font-size: .875rem;
  color: #64748b;
  line-height: 1.5;
}

/* 베타 뱃지 스타일 */
#mainPane .chat__header .meta--light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(251, 146, 60, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
  color: #dc2626;
  width: fit-content;
}

#mainPane .chat__header .meta--light::before {
  content: '⚠';
  font-size: .875rem;
}

/* 메시지 영역 개선 */
#mainPane .chat__messages {
  overflow-y: auto;
  padding: 32px;
  background: #f8f9fa;
  flex: 1;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 빈 상태 스타일 */
#mainPane .chat__messages:empty {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#mainPane .chat__messages:empty::after {
  content: '메시지를 입력하여 대화를 시작하세요.';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9ca3af;
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

/* 커스텀 스크롤바 */
#mainPane .chat__messages::-webkit-scrollbar {
  width: 8px;
}

#mainPane .chat__messages::-webkit-scrollbar-track {
  background: transparent;
}

#mainPane .chat__messages::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 4px;
  transition: background 0.2s ease;
}

#mainPane .chat__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.6);
}

/* 입력창 영역 개선 */
#mainPane .chat__inputbar {
  display: flex;
  gap: 12px;
  padding: 24px 32px;
  border-top: 2px solid #e5e7eb;
  background: #ffffff;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  align-items: center;
}

#mainPane #chatInput {
  flex: 1;
  padding: 14px 20px;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  font-size: .95rem;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

#mainPane #chatInput::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

#mainPane #chatInput:focus {
  border-color: #1e293b;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(30, 41, 59, 0.1);
  transform: translateY(-1px);
}

#mainPane #sendButton {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
}

#mainPane #sendButton:hover {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

#mainPane #sendButton:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(30, 41, 59, 0.2);
}

#mainPane #sendButton i {
  font-size: 1rem;
}


