/**
 * Theme Configuration - Based on Combined Theme from theme-data.json
 *
 * This file defines CSS custom properties for the design system
 * combining professional B2B aesthetics with vibrant, friendly elements
 *
 * Color Guide:
 *
 * 분석완료페이지 차트에서
 * - Fluorescent Green: #00ff00
 * - Success Green: #22c55e
 * - Secondary Dark: #09090b
 *
 * 컴포넌트에서
 *
 * 보라색 (Primary - Purple)
 * - Main: #8b5cf6 (메인 보라색)
 * - Dark: #7c3aed (진한 보라색)
 * - Light: #c4b5fd (연한 보라색)
 *
 * 라임색 (Accent - Lime)
 * - Main: #dfff32 (메인 라임색)
 * - Dark: #c4e619 (진한 라임색)
 * - Light: #f0ff8a (연한 라임색)
 *
 * Warning: 빨간색은 꼭 필요한 상황에서만 사용 (에러, 삭제 등)
 */

:root {
  /* Modern Color Palette - Primary (Purple) */
  --color-primary-main: #8b5cf6;
  --color-primary-dark: #7c3aed;
  --color-primary-light: #c4b5fd;

  /* Modern Color Palette - Secondary (Dark) */
  --color-secondary-main: #18181b;
  --color-secondary-dark: #09090b;
  --color-secondary-light: #3f3f46;

  /* Modern Color Palette - Accent (Lime) */
  --color-accent-main: #dfff32;
  --color-accent-dark: #c4e619;
  --color-accent-light: #f0ff8a;

  /* Modern Color Palette - Success (Green) */
  --color-success-main: #22c55e;
  --color-success-dark: #16a34a;
  --color-success-light: #86efac;

  /* Modern Color Palette - Danger (Red) - Use sparingly for errors and destructive actions only */
  --color-danger-main: #dc2626;
  --color-danger-dark: #b91c1c;
  --color-danger-light: #fca5a5;

  /* Modern Color Palette - Fluorescent (Bright Green) */
  --color-fluorescent-main: #00ff00;
  --color-fluorescent-dark: #00cc00;
  --color-fluorescent-light: #7fff7f;

  /* Color Palette - Neutral */
  --color-neutral-black: #09090b;
  --color-neutral-dark-gray: #27272a;
  --color-neutral-gray: #d4d4d8;
  --color-neutral-light-gray: #f4f4f5;
  --color-neutral-white: #ffffff;

  /* Color Palette - Text */
  --color-text-primary: #09090b;
  --color-text-secondary: #71717a;
  --color-text-inverse: #ffffff;

  /* Typography - Font Families */
  --font-primary: 'Geist', 'Pretendard', -apple-system, 'system-ui', 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'Geist Mono', monospace;

  /* Typography - Font Sizes (Responsive) */
  --font-size-h1: clamp(48px, 8vw, 88px);
  --font-size-h2: clamp(32px, 5vw, 40px);
  --font-size-h3: clamp(24px, 4vw, 36px);
  --font-size-body: 16px;

  /* Typography - Font Weights */
  --font-weight-normal: 400;
  --font-weight-semibold: 600;

  /* Typography - Line Heights */
  --line-height-tight: 1.1;
  --line-height-normal: 1.25;
  --line-height-relaxed: 1.3;
  --line-height-loose: 1.5;

  /* Spacing Scale */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Border Radius */
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 30px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 20px rgba(27, 37, 40, 0.05);
  --shadow-xl: 0 20px 40px rgba(27, 37, 40, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 200ms ease-in-out;
  --transition-slow: 300ms ease-in-out;

  /* Layout */
  --layout-max-width: 1280px;
  --layout-container-padding: 24px;
  --layout-section-spacing: 80px;
}

/* Base Typography Styles */
body {
  font-family: var(--font-primary);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-loose);
  color: var(--color-text-primary);
  background-color: var(--color-neutral-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-normal);
}

h3 {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-relaxed);
}

/* Utility Classes for Theme */
.container {
  max-width: var(--layout-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--layout-container-padding);
  padding-right: var(--layout-container-padding);
}

.section-spacing {
  padding-top: var(--layout-section-spacing);
  padding-bottom: var(--layout-section-spacing);
}

/* Text Utilities */
.text-primary {
  color: var(--color-text-primary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-inverse {
  color: var(--color-text-inverse);
}

/* Background Utilities */
.bg-white {
  background-color: var(--color-neutral-white);
}

.bg-light {
  background-color: var(--color-neutral-light-gray);
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* Carousel Styles */
.carousel-track {
  display: flex;
  transition: transform 500ms ease-in-out;
}

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  height: 400px;
}

@media (min-width: 768px) {
  .carousel-slide {
    height: 500px;
  }
}

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

.animate-fade-in {
  animation: fadeIn 200ms ease-out;
}

/* Modal Animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-modal-in {
  animation: modalFadeIn 200ms ease-out;
}

/* Custom Scrollbar Styles for Sidebar */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f3f4f6;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ChatGPT 3패널 Layout System - Fixed Positioning */

/* 좌측 사이드바 - Fixed */
.sidebar-panel-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 256px;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  transition: transform 0.3s ease-in-out;
}

.sidebar-panel-fixed.hidden {
  transform: translateX(-100%);
}

/* 우측 챗봇 패널 - Fixed */
.chatbot-panel-fixed {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  transition: transform 0.3s ease-in-out;
}

.chatbot-panel-fixed.hidden {
  transform: translateX(100%);
}

/* 메인 콘텐츠 - 중앙 정렬 with Inset */
.main-content-center {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 256px; /* 사이드바 너비 */
  right: 320px; /* 챗봇 패널 너비 */
  overflow-y: auto;
  transition: left 0.3s ease-in-out, right 0.3s ease-in-out;
}

/* 사이드바 숨김 시 (모바일/태블릿) */
.main-content-center.sidebar-hidden {
  left: 0;
}

/* 사이드바 접힘 시 (PC - collapsed 48px) */
.main-content-center.sidebar-collapsed {
  left: 48px;
}

/* 챗봇 패널 숨김 시 */
.main-content-center.chatbot-hidden {
  right: 0;
}

/* 둘 다 숨김 시 */
.main-content-center.sidebar-hidden.chatbot-hidden {
  left: 0;
  right: 0;
}

/* 고정 헤더 (선택사항) */
.fixed-header {
  position: fixed;
  top: 0;
  left: 256px;
  right: 320px;
  height: 60px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  z-index: 30;
  transition: left 0.3s ease-in-out, right 0.3s ease-in-out;
}

.fixed-header.sidebar-hidden {
  left: 0;
}

.fixed-header.chatbot-hidden {
  right: 0;
}

/* 모바일에서 사이드바 숨김 */
@media (max-width: 768px) {
  .sidebar-responsive {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
  }

  .sidebar-responsive.open {
    transform: translateX(0);
  }
}

/* Viewport Harmony - 동적 뷰포트 전체 맞춤 (모바일 브라우저 호환) */
.viewport-layout {
  height: 100vh; /* fallback for older browsers */
  height: 100dvh; /* 동적 뷰포트 높이 - 모바일 주소창 등 고려 */
  width: 100vw;
  overflow: hidden;
}

/* 메인 컨텐츠 반응형 조정 */
.main-content-responsive {
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .main-content-responsive {
    max-width: 100%;
    margin: 0;
  }
}

/* ============================================
   ChatGPT Style Sidebar
   ============================================ */

/* Sidebar - Main Container */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 256px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--color-neutral-light-gray);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition-base), transform var(--transition-base);
}

.sidebar.collapsed {
  width: 48px;
}

/* Sidebar - Logo Bar */
.sidebar-logo-bar {
  flex-shrink: 0;
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--color-neutral-gray);
}

.sidebar-logo-expanded {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo-expanded.hidden {
  display: none;
}

.logo-wrapper {
  display: flex;
  align-items: center;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:active {
  background: var(--color-neutral-gray);
  color: var(--color-text-primary);
}

.sidebar-toggle-btn i {
  font-size: 20px;
}

/* Sidebar - Collapsed Logo (펼침 상태에서는 숨김) */
.sidebar-logo-collapsed {
  display: none;
}

/* 접힘 상태: expanded 숨기고 collapsed 표시 */
.sidebar.collapsed .sidebar-logo-expanded {
  display: none;
}

.sidebar.collapsed .sidebar-logo-collapsed {
  display: block;
}

.logo-collapsed-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  position: relative;
}

.sidebar-logo-collapsed .logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* 열기 버튼: 기본 숨김, hover시 표시 */
.logo-expand-btn {
  display: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.logo-collapsed-wrapper:hover .logo-icon {
  display: none;
}

.logo-collapsed-wrapper:hover .logo-expand-btn {
  display: flex;
}

.logo-expand-btn:hover {
  background: var(--color-neutral-gray);
  color: var(--color-text-primary);
}

.logo-expand-btn i {
  font-size: 20px;
}

/* Sidebar - Menu Bar */
.sidebar-menu-bar {
  flex-shrink: 0;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--font-weight-normal);
  transition: background var(--transition-fast);
  width: 100%;
  text-align: left;
}

.sidebar-menu-item:hover,
.sidebar-menu-item:active {
  background: var(--color-neutral-gray);
}

.menu-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-shortcut {
  display: flex;
  gap: 2px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.menu-shortcut kbd {
  padding: 2px 4px;
  background: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-gray);
  border-radius: 3px;
  font-family: var(--font-primary);
  font-size: 10px;
}

/* Sidebar Collapsed - Menu */
.sidebar.collapsed .sidebar-menu-item {
  justify-content: center;
  padding: var(--spacing-sm);
}

.sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-shortcut {
  display: none;
}

/* Sidebar Collapsed - History */
.sidebar.collapsed .sidebar-history {
  display: none;
}

/* Sidebar - History Section */
.sidebar-history {
  flex: 1;
  overflow: hidden;
  padding: var(--spacing-sm) 0;
}

.sidebar-history.hidden {
  display: none;
}

.sidebar-history-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 0 var(--spacing-sm);
}

/* Sidebar - History Item */
.sidebar-history-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.sidebar-history-item:hover {
  background: var(--color-neutral-gray);
}

.history-item-link {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-sm);
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 14px;
  overflow: hidden;
}

.history-item-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-more {
  position: absolute;
  right: var(--spacing-xs);
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-history-item:hover .history-item-more {
  display: flex;
}

.history-item-more:hover {
  background: var(--color-neutral-dark-gray);
  color: var(--color-text-inverse);
}

.history-item-more i {
  font-size: 16px;
}

/* Context Menu */
.context-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-gray);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: var(--spacing-xs) 0;
  animation: fadeIn 150ms ease-out;
}

.context-menu.hidden {
  display: none;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 14px;
  text-align: left;
  transition: background var(--transition-fast);
}

.context-menu-item:hover {
  background: var(--color-neutral-light-gray);
}

.context-menu-item i {
  font-size: 16px;
  color: var(--color-text-secondary);
}

.context-menu-item--danger {
  color: var(--color-danger-main);
}

.context-menu-item--danger i {
  color: var(--color-danger-main);
}

.context-menu-divider {
  height: 1px;
  background: var(--color-neutral-gray);
  margin: var(--spacing-xs) 0;
}

/* Sidebar - Profile Bar */
.sidebar-profile-bar {
  flex-shrink: 0;
  padding: var(--spacing-sm);
  border-top: 1px solid var(--color-neutral-gray);
  position: relative;
}

.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-profile-btn:hover,
.sidebar-profile-btn:active {
  background: var(--color-neutral-gray);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary-main);
}

.avatar-placeholder i {
  font-size: 18px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.profile-info.hidden {
  display: none;
}

.profile-name {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-plan {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Sidebar Collapsed - Profile */
.sidebar.collapsed .sidebar-profile-bar {
  margin-top: auto;
}

.sidebar.collapsed .sidebar-profile-btn {
  justify-content: center;
  padding: var(--spacing-sm);
}

.sidebar.collapsed .profile-info {
  display: none;
}

.sidebar.collapsed .profile-menu {
  left: var(--spacing-xs);
  right: auto;
  min-width: 200px;
}

/* Profile Menu */
.profile-menu {
  position: absolute;
  bottom: 100%;
  left: var(--spacing-md);
  right: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  background: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-gray);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: var(--spacing-sm) 0;
  animation: fadeIn 150ms ease-out;
}

.profile-menu.hidden {
  display: none;
}

.profile-menu-email {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 14px;
  text-decoration: none;
  text-align: left;
  transition: background var(--transition-fast);
}

.profile-menu-item:hover {
  background: var(--color-neutral-light-gray);
}

.profile-menu-item i {
  font-size: 16px;
  color: var(--color-text-secondary);
}

.profile-menu-item--logout {
  color: var(--color-text-primary);
}

.profile-menu-divider {
  height: 1px;
  background: var(--color-neutral-gray);
  margin: var(--spacing-xs) 0;
}

/* Sidebar Backdrop (Mobile) */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 35;
  transition: opacity var(--transition-base);
}

.sidebar-backdrop.hidden {
  display: none;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-neutral-white);
  border-bottom: 1px solid var(--color-neutral-gray);
  padding: 0 var(--spacing-md);
  align-items: center;
  justify-content: space-between;
  z-index: 30;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-primary);
}

.mobile-menu-btn:hover {
  background: var(--color-neutral-light-gray);
}

.mobile-menu-btn i {
  font-size: 24px;
}

.mobile-logo {
  display: flex;
  align-items: center;
}

.mobile-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.mobile-spacer {
  width: 40px;
}

/* Mobile & Tablet Responsive - 1024px 이하에서 햄버거 메뉴 사용 */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    width: 256px;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 256px;
  }

  .mobile-header {
    display: flex;
  }

  /* 모바일/태블릿에서는 항상 펼침 상태 UI */
  .sidebar .sidebar-logo-expanded {
    display: flex !important;
  }

  .sidebar .sidebar-logo-collapsed {
    display: none !important;
  }

  .sidebar .sidebar-history {
    display: block !important;
  }

  .sidebar .profile-info {
    display: flex !important;
  }

  .sidebar .menu-text,
  .sidebar .menu-shortcut {
    display: flex !important;
  }

  .sidebar .sidebar-menu-item {
    justify-content: flex-start !important;
  }

  .sidebar .sidebar-profile-btn {
    justify-content: flex-start !important;
  }
}

/* ============================================
   Analysis Page Layout System
   ============================================ */

/* Analysis Navbar - Sticky at top (48px) */
.analysis-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  background: var(--color-neutral-white);
  border-bottom: 1px solid var(--color-neutral-gray);
}

.analysis-navbar__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.analysis-navbar__logo-text {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.analysis-navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.analysis-navbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.analysis-navbar__btn:hover {
  background: var(--color-neutral-light-gray);
  color: var(--color-text-primary);
}

.analysis-navbar__btn i {
  font-size: 18px;
}

/* Analysis Title Bar - Scrollable */
.analysis-title-bar {
  position: relative;
  z-index: 1;
  padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
  background: var(--color-neutral-white);
}

.analysis-title-bar__title {
  font-size: 24px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-sm) 0;
  line-height: var(--line-height-tight);
}

.analysis-title-bar__date {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
}

.analysis-title-bar__date i {
  font-size: 16px;
}

.analysis-title-bar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.analysis-title-bar__tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-neutral-light-gray);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Analysis Tabs - Sticky below navbar (44px) */
.analysis-tabs {
  position: sticky;
  top: 48px;
  z-index: 100;
  height: 44px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  background: var(--color-neutral-white);
  border-bottom: 1px solid var(--color-neutral-gray);
}

.analysis-tabs__list {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  overflow-x: auto;
  flex: 1;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.analysis-tabs__list::-webkit-scrollbar {
  display: none;
}

.analysis-tabs__tab {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 0 var(--spacing-md);
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.analysis-tabs__tab:hover {
  background: var(--color-neutral-light-gray);
  color: var(--color-text-primary);
}

.analysis-tab--active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 500;
}

.analysis-tab--active:hover {
  background: var(--color-primary-light);
}

.analysis-tabs__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: 4px;
  font-size: 12px;
}

.analysis-tabs__close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.analysis-tabs__add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-left: var(--spacing-sm);
  background: transparent;
  border: 1px dashed var(--color-neutral-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.analysis-tabs__add:hover {
  background: var(--color-neutral-light-gray);
  border-color: var(--color-primary-main);
  color: var(--color-primary-main);
}

.analysis-tabs__add i {
  font-size: 16px;
}

/* Analysis Content - Main scrollable area */
.analysis-content {
  padding: var(--spacing-lg);
  min-height: calc(100vh - 48px - 44px - 100px);
}

.analysis-content__wrapper {
  max-width: 800px;
  margin: 0 auto;
}

/* 둘 다 닫힘 시 가운데 정렬 강화 */
.main-content-center.sidebar-hidden.chatbot-hidden .analysis-content__wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

/* Prose styles for markdown content */
.prose h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--color-text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-neutral-gray);
}

.prose h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--color-text-primary);
}

.prose h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--color-text-primary);
}

.prose p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}

.prose ul, .prose ol {
  margin: 16px 0;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.prose th, .prose td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-neutral-gray);
}

.prose th {
  font-weight: 600;
  background: var(--color-neutral-light-gray);
}

.prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--color-neutral-light-gray);
  border-left: 4px solid var(--color-primary-main);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose blockquote p {
  margin: 0;
  color: var(--color-text-secondary);
}

.prose code {
  padding: 2px 6px;
  background: var(--color-neutral-light-gray);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
}

.prose pre {
  margin: 16px 0;
  padding: 16px;
  background: var(--color-secondary-main);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: transparent;
  color: var(--color-text-inverse);
}

.prose strong {
  font-weight: 600;
  color: var(--color-text-primary);
}

.prose a {
  color: var(--color-primary-main);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--color-primary-dark);
}

/* Chatbot toggle button for analysis page */
.chatbot-toggle-btn {
  position: absolute;
  top: var(--spacing-md);
  left: var(--spacing-md);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-neutral-light-gray);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.chatbot-toggle-btn:hover {
  background: var(--color-neutral-gray);
  color: var(--color-text-primary);
}

/* ============================================
   PDF Download Toast Notification
   ============================================ */
.pdf-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-secondary-main);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.pdf-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pdf-toast--error {
  background: var(--color-error);
}

.pdf-toast--success {
  background: var(--color-success);
}

.pdf-toast i {
  font-size: 18px;
}

/* ============================================
   Inline Editor Styles
   ============================================ */
.inline-editor-toolbar {
  position: fixed;
  top: 60px;
  right: 340px;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-gray);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.inline-editor-toolbar--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sidebar-hidden .inline-editor-toolbar {
  right: 340px;
}

.chatbot-hidden .inline-editor-toolbar {
  right: 24px;
}

.sidebar-hidden.chatbot-hidden .inline-editor-toolbar {
  right: 24px;
}

.inline-editor-toolbar__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--color-neutral-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.inline-editor-toolbar__btn:hover {
  background: var(--color-neutral-light-gray);
  color: var(--color-text-primary);
}

.inline-editor-toolbar__btn--primary {
  background: var(--color-primary-main);
  border-color: var(--color-primary-main);
  color: var(--color-text-inverse);
}

.inline-editor-toolbar__btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.inline-editor-toolbar__btn--danger {
  color: var(--color-error);
  border-color: var(--color-error);
}

.inline-editor-toolbar__btn--danger:hover {
  background: var(--color-error);
  color: var(--color-text-inverse);
}

.inline-editor-toolbar__btn i {
  font-size: 16px;
}

/* 편집 모드 콘텐츠 스타일 */
.analysis-content__wrapper[contenteditable="true"] {
  outline: 2px dashed var(--color-primary-light);
  outline-offset: 8px;
  border-radius: var(--radius-md);
}

.analysis-content__wrapper[contenteditable="true"]:focus {
  outline-color: var(--color-primary-main);
}

/* 편집 모드 인디케이터 */
.edit-mode-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-warning);
  color: var(--color-secondary-main);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.edit-mode-indicator i {
  font-size: 16px;
}

/* ============================================
   Fixed Tabs for Analysis (Financial, etc.)
   ============================================ */
.analysis-tabs__tab--fixed {
  position: relative;
}

.analysis-tabs__tab--fixed::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--color-primary-main);
  transition: width var(--transition-fast);
}

.analysis-tabs__tab--fixed.analysis-tab--active::after {
  width: 80%;
}

/* ============================================
   Inline Editor Toast & Restore Prompt
   ============================================ */
.inline-editor-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-secondary-main);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.inline-editor-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.inline-editor-toast--success {
  background: var(--color-success);
}

.inline-editor-toast--error {
  background: var(--color-error);
}

.inline-editor-toast--warning {
  background: var(--color-warning);
  color: var(--color-secondary-main);
}

.inline-editor-toast i {
  font-size: 18px;
}

/* 복원 프롬프트 */
.inline-editor-restore-prompt {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.inline-editor-restore-prompt.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.restore-prompt-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-gray);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.restore-prompt-content > i {
  font-size: 24px;
  color: var(--color-primary-main);
}

.restore-prompt-text {
  flex: 1;
}

.restore-prompt-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0;
}

.restore-prompt-date {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 4px 0 0;
}

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

.restore-prompt-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.restore-prompt-btn--restore {
  background: var(--color-primary-main);
  color: var(--color-text-inverse);
  border: none;
}

.restore-prompt-btn--restore:hover {
  background: var(--color-primary-dark);
}

.restore-prompt-btn--discard {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-neutral-gray);
}

.restore-prompt-btn--discard:hover {
  background: var(--color-neutral-light-gray);
  color: var(--color-text-primary);
}
