/* =================================================================== */
/* 🎨 Indicator Creator Section - Presentation Style */
/* =================================================================== */

/* =================================================================== */
/* IC 프레젠테이션 스타일 CSS 변수 */
/* =================================================================== */
#indicator-creator-section {
    --ic-primary: #5B4FCF;
    --ic-primary-light: #E8E5FF;
    --ic-primary-hover: #4a3fb8;
    --ic-primary-rgb: 91, 79, 207;
    --ic-secondary: #C9A227;
    --ic-secondary-light: #FFF8E1;
    --ic-dark: #1a1a2e;
    --ic-text: #333333;
    --ic-text-light: #666666;
    --ic-bg: #ffffff;
    --ic-bg-light: #f8f9fa;
    --ic-border: #e0e0e0;
    --ic-card-yellow: #FFFBEB;
    --ic-card-gray: #F5F5F7;
    --ic-success: #10b981;
    --ic-danger: #ef4444;
    --ic-warning: #f59e0b;
}

/* =================================================================== */
/* IC 히어로 섹션 - 애니메이션 배경 */
/* =================================================================== */
.ic-hero {
    position: relative;
    padding: 40px 0 30px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 50%, #f5f3ff 100%);
    border-radius: 0 0 20px 20px;
    margin-bottom: 1.5rem;
}

/* 애니메이션 배경 컨테이너 */
.ic-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

/* 그라데이션 애니메이션 */
.ic-bg-gradient {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(91, 79, 207, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(201, 162, 39, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(91, 79, 207, 0.04) 0%, transparent 70%);
    animation: icGradientMove 20s ease-in-out infinite;
}

@keyframes icGradientMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(-1%, 3%) rotate(-1deg); }
    75% { transform: translate(3%, -2%) rotate(0.5deg); }
}

/* 파티클 애니메이션 */
.ic-bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.ic-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: icParticleFloat 15s ease-in-out infinite;
}

.ic-particle-1 {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(91, 79, 207, 0.15), rgba(91, 79, 207, 0.05));
    top: 15%;
    left: 8%;
    animation-delay: 0s;
}

.ic-particle-2 {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(201, 162, 39, 0.03));
    top: 55%;
    right: 12%;
    animation-delay: -3s;
}

.ic-particle-3 {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(91, 79, 207, 0.1), rgba(91, 79, 207, 0.02));
    bottom: 25%;
    left: 15%;
    animation-delay: -6s;
}

.ic-particle-4 {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(91, 79, 207, 0.08), transparent);
    top: 8%;
    right: 25%;
    animation-delay: -9s;
}

.ic-particle-5 {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.05));
    top: 45%;
    left: 3%;
    animation-delay: -12s;
}

.ic-particle-6 {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(91, 79, 207, 0.12), transparent);
    bottom: 8%;
    right: 8%;
    animation-delay: -4s;
}

@keyframes icParticleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -15px) scale(1.05); }
    50% { transform: translate(-15px, 20px) scale(0.95); }
    75% { transform: translate(15px, 15px) scale(1.02); }
}

/* 그리드 패턴 */
.ic-bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(91, 79, 207, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 79, 207, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: icGridMove 30s linear infinite;
}

@keyframes icGridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* 글로우 효과 */
.ic-bg-glow {
    position: absolute;
    top: 50%;
    right: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(91, 79, 207, 0.15) 0%, transparent 70%);
    transform: translate(50%, -50%);
    animation: icGlowPulse 4s ease-in-out infinite;
}

@keyframes icGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(50%, -50%) scale(1.1); }
}

/* 히어로 컨텐츠 */
.ic-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 1rem;
}

.ic-badge {
    display: inline-block;
    background: var(--ic-primary-light);
    color: var(--ic-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.ic-hero-title {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--ic-dark);
    line-height: 1.3;
    margin-bottom: 16px;
}

.ic-hero-title .highlight {
    color: var(--ic-primary);
    text-decoration: underline;
    text-decoration-color: var(--ic-secondary);
    text-underline-offset: 6px;
    text-decoration-thickness: 3px;
}

.ic-hero-desc {
    font-size: 1rem;
    color: var(--ic-text-light);
    line-height: 1.7;
    margin: 0;
}

/* 결과가 표시될 때 hero 숨기기 */
body:has(.results-container.show) .ic-hero,
.results-container.show ~ .ic-hero,
.main-content:has(.results-container.show) .ic-hero,
body:has(.results-container.show) .hub-header,
.results-container.show ~ .hub-header,
.main-content:has(.results-container.show) .hub-header {
    display: none !important;
}

/* 백테스팅 결과 요약 카드 스타일 */
.backtest-summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.backtest-summary-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ===== 백테스팅 결과 테이블 스타일 ===== */
.backtest-summary-table-wrapper {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.backtest-table-section {
    padding: 0;
}

.backtest-table-section:first-child {
    border-bottom: 1px solid #e2e8f0;
}

.backtest-table-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e2e8f0;
}

.backtest-table-header i {
    color: #667eea;
    font-size: 0.75rem;
}

.backtest-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.backtest-summary-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.backtest-summary-table tr:last-child td {
    border-bottom: none;
}

.backtest-summary-table .bt-label {
    width: 25%;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.backtest-summary-table .bt-label i {
    margin-right: 6px;
    font-size: 0.7rem;
    opacity: 0.7;
}

.backtest-summary-table .bt-value {
    width: 25%;
    color: #1e293b;
    font-weight: 600;
    font-size: 0.85rem;
}

.backtest-summary-table .bt-value.bt-primary {
    font-size: 1rem;
    font-weight: 700;
}

.backtest-summary-table .bt-highlight-row {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.backtest-summary-table .bt-highlight-row.bt-positive {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.backtest-summary-table .bt-highlight-row.bt-negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

/* Desktop only - mobile table styles are in indicator-creator-mobile.css */

/* 백테스팅 조건 섹션 */
.backtest-conditions-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.backtest-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.backtest-section-header i {
    font-size: 0.875rem;
    opacity: 0.7;
}

.backtest-conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.backtest-condition-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.backtest-condition-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.condition-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.condition-content {
    flex: 1;
    min-width: 0;
}

.condition-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.condition-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    word-break: break-word;
}

/* 백테스팅 결과 지표 섹션 */
.backtest-metrics-section {
    padding: 1.5rem;
    background: #ffffff;
}

.backtest-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.backtest-metric-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.backtest-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.backtest-metric-card:hover {
    background: #ffffff;
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.backtest-metric-card:hover::before {
    background: #3b82f6;
    width: 4px;
}

.backtest-metric-card.metric-primary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.backtest-metric-card.metric-primary::before {
    background: #3b82f6;
    width: 4px;
}

.backtest-metric-card.metric-positive {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

.backtest-metric-card.metric-positive::before {
    background: #22c55e;
}

.backtest-metric-card.metric-negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.backtest-metric-card.metric-negative::before {
    background: #ef4444;
}

.backtest-metric-card.metric-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

.backtest-metric-card.metric-warning::before {
    background: #f59e0b;
}

.backtest-metric-card.metric-secondary {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.metric-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 10px;
    color: #3b82f6;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.backtest-metric-card.metric-primary .metric-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

.backtest-metric-card.metric-positive .metric-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
}

.backtest-metric-card.metric-negative .metric-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
}

.backtest-metric-card.metric-warning .metric-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
}

.metric-content {
    flex: 1;
    min-width: 0;
}

.metric-label {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    word-break: break-word;
}

.metric-value.text-success {
    color: #22c55e;
}

.metric-value.text-danger {
    color: #ef4444;
}

/* 반응형 디자인 */
/* Desktop only - mobile backtest grid styles are in indicator-creator-mobile.css */

/* =================================================================== */

/* Root variables are inherited from base.css */

/* indicator-creator-section 전용 스타일 - main_chart.css의 .section-container.active보다 우선순위 높임 */
/* 더 구체적인 선택자 사용으로 CSS 우선순위 확보 */
#indicator-creator-section.section-container.active {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* min-height 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
    min-height: auto !important;
    height: auto !important;
    background-color: var(--surface-bg) !important;
    box-sizing: border-box !important;
    gap: 0 !important;
    align-items: flex-start !important;
    overflow: visible !important;
}

/* 추가 우선순위 확보를 위한 중복 정의 */
div#indicator-creator-section.section-container.active {
    display: flex !important;
    flex-direction: row !important;
}

/* 히스토리 사이드바 */
#indicator-creator-section .indicator-generator-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    width: 100%;
    align-items: stretch;
}

#indicator-creator-section .history-sidebar {
    width: 320px !important;
    min-width: 320px !important;
    flex-shrink: 0 !important;
    background: var(--ic-bg) !important;
    border-radius: 0 !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05) !important;
    border-right: 1px solid var(--ic-border) !important;
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - var(--navbar-height, 60px)) !important;
    overflow: hidden !important;
    position: fixed !important;
    left: 0 !important;
    top: var(--navbar-height, 60px) !important;
    z-index: 100 !important;
    transition: top 0.2s ease, height 0.2s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ic-border);
    background: var(--ic-bg-light);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.history-close-btn {
    border: none;
    background: transparent;
    color: var(--slate-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
}

.history-close-btn:hover {
    background: var(--slate-100);
    color: var(--primary-600);
}

.history-close-btn:active {
    background: var(--slate-200);
    transform: scale(0.95);
}

.history-close-btn i {
    font-size: 1.1rem;
}

.mobile-history-toggle {
    display: none;
    margin-bottom: 1.5rem;
}

.mobile-history-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.history-overlay {
    position: fixed;
    top: var(--navbar-height, 60px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.48);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease, top 0.2s ease;
}

.history-overlay.visible {
    display: block;
    opacity: 1;
}

#indicator-creator-section .history-sidebar {
    transition: transform 0.3s ease;
}
.history-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ic-dark);
    margin: 0;
    display: flex;
    align-items: center;
}

.btn-clear-history {
    background: none;
    border: none;
    color: var(--slate-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-clear-history:hover {
    background: var(--slate-100);
    color: var(--danger-500, #ef4444);
}

.btn-clear-history i {
    font-size: 0.9rem;
}

.btn-refresh-history {
    background: none;
    border: none;
    color: var(--slate-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-refresh-history:hover {
    background: var(--slate-100);
    color: var(--primary-500);
}

.btn-refresh-history i {
    font-size: 0.9rem;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    box-sizing: border-box !important;
    /* 스크롤바 공간 미리 확보 - 카드 넓이 유지 */
    scrollbar-gutter: stable !important;
    /* Firefox에서 스크롤바 공간 확보 - 항상 thin으로 유지하되 투명하게 */
    scrollbar-width: auto !important;
    scrollbar-color: transparent transparent !important; /* 기본: 투명 */
    -ms-overflow-style: auto !important; /* IE and Edge */
    /* 웹킷 브라우저: 스크롤바가 항상 공간을 차지하도록 */
    padding-right: 0.5rem !important; /* 기본 padding 유지 */
    width: 100% !important;
}

/* 웹킷 브라우저용 - 스크롤바는 항상 공간을 차지하되 투명하게 */
#indicator-creator-section .history-sidebar .history-list::-webkit-scrollbar {
    width: 8px !important;
    background: transparent !important;
}

#indicator-creator-section .history-sidebar .history-list::-webkit-scrollbar-track {
    background: transparent !important;
}

#indicator-creator-section .history-sidebar .history-list::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: 4px !important;
}

#indicator-creator-section .history-sidebar .history-list::-webkit-scrollbar-thumb:hover {
    background: transparent !important;
}

/* 호버 시 스크롤바 표시 - 연한 회색 */
#indicator-creator-section .history-sidebar:hover .history-list {
    scrollbar-width: auto !important; /* Firefox */
    scrollbar-color: var(--slate-200) var(--slate-50) !important; /* Firefox: thumb track - 연한 회색 */
    -ms-overflow-style: auto !important; /* IE and Edge */
}

#indicator-creator-section .history-sidebar:hover .history-list::-webkit-scrollbar {
    width: 8px !important;
    background: var(--slate-50) !important;
}

#indicator-creator-section .history-sidebar:hover .history-list::-webkit-scrollbar-track {
    background: var(--slate-50) !important;
    border-radius: 4px !important;
}

#indicator-creator-section .history-sidebar:hover .history-list::-webkit-scrollbar-thumb {
    /* background: var(--slate-200) !important; */
    background: #828282 !important;
    border-radius: 4px !important;
}

#indicator-creator-section .history-sidebar:hover .history-list::-webkit-scrollbar-thumb:hover {
    background: #d4dfe8 !important; /* slate-200과 slate-300 사이의 연한 색상 */
}

.history-loading {
    padding: 2rem 1rem;
}

.history-item {
    transition: all 0.3s ease;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--ic-border);
    background: var(--ic-bg-light);
    cursor: pointer;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}

.history-item:hover {
    background: var(--ic-primary-light);
    border-color: var(--ic-primary);
    transform: translateX(4px);
}

.history-item.active {
    background: var(--ic-primary-light);
    border-color: var(--ic-primary);
    border-left: 4px solid var(--ic-primary);
    box-shadow: 0 2px 8px rgba(91, 79, 207, 0.2);
}

.history-description {
    font-size: 0.95rem;
    color: var(--slate-700);
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.history-meta .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
}

.history-date {
    color: var(--slate-500);
    font-size: 0.8rem;
}

.history-item .fa-robot {
    color: var(--primary-500);
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

/* 메인 컨텐츠 영역 */
#indicator-creator-section .main-content {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 2rem !important;
    overflow-y: visible !important;
    /* min-height 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
    min-height: auto !important;
    height: auto !important;
    max-width: calc(100vw - 320px) !important;
    margin-left: 320px !important;
    display: block !important;
    position: relative !important;
}

/* Hero Section */
.hub-header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1
    rem 0;
    animation: fadeInDown 0.8s ease-out;
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    animation: fadeInDown 0.8s ease-out;
}

/* hero-title, hero-subtitle은 common-components.css의 hub-title, hub-subtitle로 대체됨 */
.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--slate-500);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Input Section - 프레젠테이션 스타일 */
.input-card {
    background: var(--ic-bg);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--ic-border);
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    transition: all 0.3s ease;
    min-height: auto;
    height: auto;
    max-height: none;
    resize: none;
    display: block;

    /* 초기 애니메이션 상태 */
    opacity: 0;
    transform: translateY(20px);
}

/* 상단 악센트 라인 */
.input-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--ic-secondary);
    border-radius: 12px 12px 0 0;
}

/* 호버 효과 */
.input-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--ic-primary-light);
}

/* 카드 등장 애니메이션 */
@keyframes icCardEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 섹션이 활성화될 때 애니메이션 재생 */
#indicator-creator-section.active .input-card:not(.animated) {
    animation: icCardEntrance 0.6s ease-out forwards;
    animation-delay: 0.1s;
}

/* 애니메이션 클래스 (JavaScript로 트리거) */
.input-card.gamma-animate {
    animation: icCardEntrance 0.6s ease-out forwards !important;
}

/* 이미 애니메이션이 완료된 경우 (재진입 방지) */
.input-card.animated {
    opacity: 1;
    transform: translateY(0);
    animation: none !important;
}

/* 고급모드일 때 높이 제한 완화 */
.input-card.mode-advanced {
    max-height: none !important; /* 고급모드: 최대 높이 제한 없음 (자동으로 늘어남) */
    min-height: auto !important; /* 콘텐츠에 따라 최소 높이 자동 결정 */
    padding-bottom: 120px !important; /* 초기부터 하단 여백 확보 (버튼 하단 패딩과 동일) */
}

/* 고급모드에서 LLM 선택기 영역이 잘리지 않도록 */
.input-card.mode-advanced .llm-selector {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

/* 고급모드에서 버튼 영역이 항상 보이도록 */
.input-card.mode-advanced #action-buttons-bottom {
    position: relative; /* sticky 제거 */
    background: var(--surface-card);
    padding-top: 1rem;
    padding-bottom: 0.5rem; /* 기본 하단 패딩 */
    margin-top: 0.75rem; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
    z-index: 6000 !important; /* 하단 네비게이션(5999)보다 높게, 상단 네비게이션(6000)과 같은 레벨 */
}

/* Desktop only - mobile styles are in indicator-creator-mobile.css */

/* 하단 고정 모드에서 리사이즈 핸들 공간 확보 */
.input-card.moved-to-bottom {
    padding-top: calc(1.25rem + 12px); /* 리사이즈 핸들 공간 확보 */
}

/* 카드가 하단으로 이동한 상태 */
.input-card.moved-to-bottom {
    position: fixed !important;
    bottom: 2rem !important;
    left: calc(320px + 2rem) !important;
    right: 2rem !important;
    top: auto !important;
    transform: translateY(0) !important;
    padding: 1.25rem 2rem !important;
    border-radius: var(--radius-lg) !important;
    width: auto !important;
    max-width: calc(100vw - 320px - 4rem) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    z-index: 150 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    background: white !important;
    border: 1px solid var(--slate-100) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 모드 설명 스타일 */
.mode-description {
    background: linear-gradient(135deg, var(--slate-50) 0%, rgba(255, 255, 255, 0.8) 100%);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: var(--transition-base);
}

.mode-description:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, var(--slate-50) 100%);
    border-color: var(--slate-300);
}

/* 툴팁 스타일 개선 */
.tooltip-inner {
    max-width: 300px !important;
    text-align: left !important;
    white-space: pre-line !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    padding: 0.75rem !important;
}

/* 드로어 숨김 상태: 아래로 내려가서 핫존만 보임 */
.input-card.moved-to-bottom.drawer-hidden {
    transform: translateY(calc(100% - 60px)) !important; /* 더 많이 튀어나오도록 60px로 증가 */
}

/* 드로어 열린 상태: 완전히 위로 올라옴 */
.input-card.moved-to-bottom.drawer-open {
    transform: translateY(0) !important;
}

/* 드로어 열린 상태에서 LLM 그리드 레이아웃 강제 적용 */
.input-card.moved-to-bottom.drawer-open .llm-radio-group,
.input-card.moved-to-bottom .llm-radio-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    justify-content: center !important;
    width: 100% !important;
}

/* 드로어 열린 상태에서 LLM 카드 겹침 방지 */
.input-card.moved-to-bottom.drawer-open .llm-option,
.input-card.moved-to-bottom .llm-option {
    position: relative !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: 280px !important;
}

/* 하단 터치 핫존 (드로어 열기용) */
.ic-bottom-hotzone {
    position: fixed;
    left: 320px;
    right: 0;
    bottom: 0;
    height: 18px;
    z-index: 200;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: none; /* 기본적으로 숨김 */
}

/* 드로어가 하단 고정 모드이고 숨겨져 있을 때만 핫존 표시 */
#indicator-creator-section:has(.input-card.moved-to-bottom.drawer-hidden) .ic-bottom-hotzone,
#indicator-creator-section:has(.input-card.moved-to-bottom:not(.drawer-open):not(.drawer-hidden)) .ic-bottom-hotzone {
    display: block;
}

/* 핫존에 마우스 호버 시 시각적 피드백 */
.ic-bottom-hotzone:hover {
    background: rgba(79, 70, 229, 0.1);
}

/* 드로어가 열려있을 때는 핫존 숨김 */
#indicator-creator-section:has(.input-card.moved-to-bottom.drawer-open) .ic-bottom-hotzone {
    display: none;
}

/* 입력폼 축소 상태 */
.input-card.compact .strategy-textarea {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    resize: none !important;
    overflow: hidden !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.input-card.compact .mb-4 {
    margin-bottom: 1rem !important;
}

/* compact 상태에서 탭은 보이지만 레이아웃 조정 */
.input-card.compact .d-flex.justify-content-between.align-items-center.mb-4 {
    margin-bottom: 1rem !important;
    position: relative;
    justify-content: flex-start !important;
}

/* compact 상태에서 버튼 영역을 relative로 설정 */
.input-card.compact .d-flex.justify-content-center.align-items-center.gap-3 {
    margin-top: 0.5rem !important;
    position: relative;
}

/* 리사이즈 핸들 스타일 (상단 위치) - 하단 고정 모드에서만 표시 */
.resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(to bottom, 
        rgba(99, 102, 241, 0.15), 
        rgba(99, 102, 241, 0.05));
    cursor: ns-resize;
    display: none; /* 기본적으로 숨김 */
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: 2px solid rgba(99, 102, 241, 0.2);
}

/* 하단 고정 모드에서만 리사이즈 핸들 표시 */
.input-card.moved-to-bottom .resize-handle {
    display: flex;
}

.resize-handle:hover {
    background: linear-gradient(to bottom, 
        rgba(99, 102, 241, 0.25), 
        rgba(99, 102, 241, 0.1));
    border-bottom-color: rgba(99, 102, 241, 0.4);
    height: 14px;
}

.resize-handle i {
    color: rgba(99, 102, 241, 0.6);
    font-size: 0.875rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.resize-handle:hover i {
    opacity: 1;
    color: rgba(99, 102, 241, 0.9);
}

/* 리사이즈 중일 때 스타일 */
.input-card.resizing {
    user-select: none;
    transition: none !important;
}

.input-card.resizing .resize-handle {
    background: linear-gradient(to bottom, 
        rgba(99, 102, 241, 0.3), 
        transparent);
}

/* 라벨 액션 영역 스타일 (버튼들이 여기에 위치) */
.label-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.label-actions .btn {
    white-space: nowrap;
}

/* 깔끔한 라벨 액션 버튼 스타일 - 프레젠테이션 스타일 */
.label-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ic-primary);
    background: rgba(91, 79, 207, 0.08);
    border: 1px solid rgba(91, 79, 207, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.label-action-btn:hover {
    color: var(--ic-primary-hover);
    background: rgba(91, 79, 207, 0.15);
    border-color: rgba(91, 79, 207, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(91, 79, 207, 0.15);
}

.label-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.label-action-btn i {
    font-size: 0.8rem;
    color: var(--ic-primary);
    transition: color 0.2s ease;
}

.label-action-btn:hover i {
    color: var(--ic-primary-hover);
}

.label-action-btn span {
    font-size: 0.8rem;
}

/* 라벨 액션 버튼 컨테이너 (기본 숨김) */
#label-action-buttons {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 하단 버튼 컨테이너 (기본 표시) */
#action-buttons-bottom {
    display: flex;
    opacity: 1;
    visibility: visible;
    margin-top: 0.75rem; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex-shrink: 0 !important; /* 버튼 영역이 잘리지 않도록 */
    padding-bottom: 0.5rem; /* 기본 하단 여백 */
    position: relative;
    z-index: 6000 !important; /* 하단 네비게이션(5999)보다 높게, 상단 네비게이션(6000)과 같은 레벨 */
}

/* Desktop only - mobile styles are in indicator-creator-mobile.css */

/* 하단 고정 모드이고 높이가 줄어들면 라벨 버튼 표시, 하단 버튼 숨김 */
.input-card.moved-to-bottom.compact #label-action-buttons {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.input-card.moved-to-bottom.compact #action-buttons-bottom {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 하단 드로어 열린 상태에서는 하단 버튼 숨기고 라벨 버튼 표시 */
.input-card.moved-to-bottom.drawer-open #action-buttons-bottom,
.input-card.moved-to-bottom #action-buttons-bottom {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.input-card.moved-to-bottom.drawer-open #label-action-buttons {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    gap: 0.5rem !important;
}

/* 리사이즈 중에는 transition 비활성화 */
.input-card.resizing #label-action-buttons,
.input-card.resizing #action-buttons-bottom {
    transition: none !important;
}

/* 하단 고정 모드에서 버튼 위치 조정 활성화 */
/* margin-top은 JS에서 동적으로 설정되므로 CSS에서는 제거됨 */

/* compact 상태일 때 버튼 위치 조정 */
.input-card.compact #action-buttons-container {
    margin-top: 0.5rem;
}

/* label-action 영역 */
.label-actions {
    display: flex;
    gap: 0.5rem;
}

.input-card.compact .label-actions {
    gap: 0.35rem;
}

/* LLM 선택기는 compact 모드에서도 표시 (고급모드 선택 시) */
.input-card.compact .llm-selector {
    display: none;
}

/* 고급모드가 활성화되면 LLM 선택기 표시 */
.input-card.compact.mode-advanced .llm-selector.show {
    display: block !important;
    margin-top: 0.75rem;
    padding: 1rem !important;
    border-top: 1px solid var(--slate-200);
    animation: fadeIn 0.3s ease-in;
}

/* compact 모드에서 LLM 카드 그리드 조정 */
.input-card.compact.mode-advanced .llm-radio-group {
    grid-template-columns: repeat(auto-fit, minmax(200px, 200px)) !important;
    gap: 0.25rem !important; /* 0.75rem의 1/3로 감소 (0.75rem → 0.25rem) */
    justify-content: center !important;
}

/* compact 모드에서 LLM 카드 패딩 조정 */
.input-card.compact.mode-advanced .llm-card {
    padding: 0.75rem !important;
    gap: 0.75rem !important;
}

.input-card.compact.mode-advanced .llm-name {
    font-size: 0.9rem !important;
}

.input-card.compact.mode-advanced .llm-description {
    font-size: 0.8rem !important;
}

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

.input-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.strategy-textarea {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    font-size: 1.1rem;
    resize: none;
    min-height: 280px; /* 충분한 높이로 스크롤바 기본 생성 방지 */
    max-height: 280px; /* 최대 높이 제한 */
    height: 280px; /* 고정 높이 설정 */
    transition: var(--transition-base),
                height 0.4s ease,
                min-height 0.4s ease,
                max-height 0.4s ease,
                padding 0.4s ease;
    background-color: var(--slate-50);
    line-height: 1.6;
    color: var(--slate-800);
    font-family: 'Inter', sans-serif;
    overflow-y: auto; /* 내용이 많을 때만 스크롤 */
}

.strategy-textarea:focus {
    border-color: var(--ic-primary);
    box-shadow: 0 0 0 4px rgba(91, 79, 207, 0.1);
    background-color: white;
    outline: none;
}

/* Buttons - 프레젠테이션 스타일 */
.btn-analyze {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ic-primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.25);
    cursor: pointer;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    color: white;
    background: var(--ic-primary-hover);
    box-shadow: 0 8px 20px rgba(91, 79, 207, 0.35);
}

.btn-analyze:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(91, 79, 207, 0.2);
}

/* 초기화 버튼 스타일 오버라이드 - 프레젠테이션 스타일 */
#action-buttons-bottom .btn-secondary,
#action-buttons-bottom .base-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--ic-primary);
    border: 2px solid var(--ic-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

#action-buttons-bottom .btn-secondary:hover,
#action-buttons-bottom .base-btn-secondary:hover {
    background: var(--ic-primary-light);
    border-color: var(--ic-primary);
    color: var(--ic-primary);
}

.btn-example {
    background: white;
    color: var(--primary-600);
    border: 1px solid var(--slate-200);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-base);
}

.btn-example:hover {
    background: var(--slate-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
    transform: translateY(-2px);
}

/* Results Section */
.results-container {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    width: 100%;
    max-height: calc(100vh - 200px); /* 상단 네비게이션과 여유 공간 고려 */
    overflow: hidden !important;
    margin-top: 0 !important; /* 추가 */
    padding-top: 0 !important; /* 추가 */
}

.results-container.show {
    display: block !important;
    opacity: 1;
    margin-top: 0 !important; /* 추가 */
    padding-top: 0 !important; /* 추가 */
}

/* 결과가 표시될 때 hero-section 완전히 숨기기 */
body:has(.results-container.show) .hero-section,
.results-container.show ~ .hero-section,
.main-content:has(.results-container.show) .hero-section {
    display: none !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* 결과가 표시될 때 hero-section 완전히 숨기기 */
body:has(.results-container.show) .hero-section,
.results-container.show ~ .hero-section,
.main-content:has(.results-container.show) .hero-section {
    display: none !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* 결과가 표시될 때 main-content의 상단 패딩도 제거 */
.results-container.show ~ *,
.main-content:has(.results-container.show) {
    padding-top: 0 !important;
}

/* 더 강력한 방법: results-container가 표시되면 main-content 상단 패딩 제거 */
body:has(.results-container.show) #indicator-creator-section .main-content {
    padding-top: 0 !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Desktop only - mobile results container styles are in indicator-creator-mobile.css */


/* 데스크톱 탭 모드 스타일 */
@media (min-width: 992px) {
    /* 탭 콘텐츠 영역 */
    #result-tab-content {
        height: calc(100vh - 250px);
        max-height: calc(100vh - 250px);
    }

    /* 데스크톱에서 결과 카드 높이 제한 */
    .result-card .result-body {
        min-height: auto !important;
        max-height: calc(100vh - 350px) !important;
        overflow-y: auto !important;
    }

    #monaco-editor-host {
        min-height: 500px !important;
        max-height: calc(100vh - 350px) !important;
    }
}

/* ===== 결과 탭 스타일 (데스크톱 & 모바일 공통) - 프레젠테이션 스타일 ===== */
.tab-container {
    margin-bottom: 1rem;
}

.result-tabs-desktop {
    display: flex;
    gap: 0;
    background: var(--ic-card-gray);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--ic-border);
    width: fit-content;
}

.result-tabs-desktop .nav-item {
    list-style: none;
}

.result-tabs-desktop .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ic-text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.result-tabs-desktop .nav-link:hover {
    color: var(--ic-text);
    background: rgba(255, 255, 255, 0.7);
}

.result-tabs-desktop .nav-link.active {
    background: var(--ic-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.3);
}

.result-tabs-desktop .nav-link i {
    font-size: 0.85rem;
}

/* 탭 콘텐츠 */
#result-tab-content {
    position: relative;
}

/* Bootstrap 탭 기본 동작 유지 */
#result-tab-content .tab-pane {
    display: none;
}

#result-tab-content .tab-pane.active {
    display: flex;
    flex-direction: column;
}

#result-tab-content .tab-pane.show.active {
    display: flex;
    flex-direction: column;
}

/* 결과 카드 탭 모드 스타일 */
#result-tab-content .result-card {
    border-radius: var(--radius-xl);
    max-height: calc(100vh - 300px);
}

/* 코드 패널 (탭 모드) - Monaco Editor를 위한 특수 스타일 */
#code-pane.tab-pane.show.active {
    display: flex !important;
    flex-direction: column !important;
    min-height: 600px;
}

#code-pane .result-body {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
}

#code-pane #monaco-editor-host {
    flex: 1 1 auto;
    min-height: 550px !important;
}

/* 코드 패널 헤더 */
.code-pane-header {
    background: var(--slate-50);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--ic-border);
    height: 100%;
    max-height: calc(100vh - 200px);
    overflow: auto !important;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;

    /* 스크롤바 기본 숨김 - 호버 시에만 표시 */
    scrollbar-width: thin !important;
    scrollbar-color: transparent transparent !important;
}

.result-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* result-card 스크롤바 스타일 - Webkit (Chrome, Safari, Edge) */
.result-card::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

.result-card::-webkit-scrollbar-track {
    background: transparent !important;
}

.result-card::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: 3px !important;
}

/* 호버 시에만 스크롤바 표시 (50% 투명) */
.result-card:hover {
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent !important; /* Firefox */
}

.result-card:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5) !important; /* 50% 투명한 slate-400 */
}

.result-card:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7) !important; /* 호버 시 조금 더 진하게 */
}

.result-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--slate-50);
    flex-shrink: 0; /* 헤더가 줄어들지 않도록 */
}

/* Desktop only - mobile result-header styles are in indicator-creator-mobile.css */

.result-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.result-body {
    padding: 1.5rem;
    flex: 1 1 auto; /* flex-grow: 1, flex-shrink: 1, flex-basis: auto */
    overflow-y: auto !important;
    overflow-x: auto;
    min-height: 0 !important; /* flexbox에서 스크롤이 작동하도록 필수 */
    box-sizing: border-box; /* padding 포함 높이 계산 */

    /* 스크롤바 기본 숨김 - 호버 시에만 표시 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: transparent transparent; /* Firefox: 기본 투명 */
}

/* 스크롤바 스타일 - Webkit (Chrome, Safari, Edge) */
.result-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.result-body::-webkit-scrollbar-track {
    background: transparent;
}

.result-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.3s ease;
}

/* 호버 시에만 스크롤바 표시 (50% 투명) */
.result-body:hover {
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent; /* Firefox */
}

.result-body:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5); /* 50% 투명한 slate-400 */
}

.result-body:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7); /* 호버 시 조금 더 진하게 */
}

/* result-card 스크롤바 스타일은 위에서 정의됨 (.result-card 선언부) */

/* #analysis-pane 스크롤바 스타일 (전략 분석 결과 카드) */
#analysis-pane {
    scrollbar-width: thin !important;
    scrollbar-color: transparent transparent !important;
}

#analysis-pane::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

#analysis-pane::-webkit-scrollbar-track {
    background: transparent !important;
}

#analysis-pane::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: 3px !important;
}

#analysis-pane:hover {
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent !important;
}

#analysis-pane:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5) !important;
}

#analysis-pane:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7) !important;
}

/* #code-pane 스크롤바 스타일 (파이썬 코드 카드) */
#code-pane {
    scrollbar-width: thin !important;
    scrollbar-color: transparent transparent !important;
}

#code-pane::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

#code-pane::-webkit-scrollbar-track {
    background: transparent !important;
}

#code-pane::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: 3px !important;
}

#code-pane:hover {
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent !important;
}

#code-pane:hover::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5) !important;
}

#code-pane:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7) !important;
}

/* #analysis-result-body 스크롤바 스타일 */
#analysis-result-body {
    scrollbar-width: thin !important;
    scrollbar-color: transparent transparent !important;
}

#analysis-result-body::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

#analysis-result-body::-webkit-scrollbar-track {
    background: transparent !important;
}

#analysis-result-body::-webkit-scrollbar-thumb {
    background: transparent !important;
    border-radius: 3px !important;
}

#analysis-result-body:hover,
.result-card:hover #analysis-result-body {
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent !important;
}

#analysis-result-body:hover::-webkit-scrollbar-thumb,
.result-card:hover #analysis-result-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5) !important;
}

#analysis-result-body:hover::-webkit-scrollbar-thumb:hover,
.result-card:hover #analysis-result-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7) !important;
}

    /* 파이썬 코드 카드의 result-body (p-0 클래스) - 모바일 최적화 */
    .result-body.p-0 {
        padding: 0 !important;
        flex: 1 1 auto !important; /* 전략 분석 결과와 동일한 flex 설정 */
        min-height: 0 !important; /* flexbox에서 높이를 자동으로 맞춤 */
        position: relative !important; /* Monaco Editor 호스트의 positioning을 위한 기준 */
        display: flex !important; /* flexbox로 Monaco Editor 호스트를 채움 */
        flex-direction: column !important;
        overflow: hidden !important; /* Monaco Editor가 넘치지 않도록 */
        width: 100% !important;
        height: 100% !important;
    }

/* Monaco Editor 호스트 스타일 */
#monaco-editor-host {
    display: block !important;
    width: 100% !important;
    flex: 1 1 auto; /* 부모의 남은 공간을 모두 차지 */
    min-height: 700px !important; /* Monaco Editor가 렌더링되기 위한 최소 높이 */
    position: relative; /* 상대 위치 */
}

/* 전략 분석 결과 카드 내부 버튼 영역 */
#strategy-action-buttons {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: auto !important;
    min-height: fit-content !important;
    overflow: visible !important;
    box-sizing: border-box;
}

#strategy-action-buttons .d-flex {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-height: fit-content !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ========================================
   전략 액션 버튼 스타일 (Strategy Action Buttons)
   ======================================== */

/* 액션 버튼 컨테이너 */
#strategy-action-buttons {
    margin: 16px 0;
    padding: 0;
    background: transparent;
    border: none !important;
}

#strategy-action-buttons .d-flex {
    display: flex !important;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
}

/* 개별 액션 버튼 기본 스타일 */
.strategy-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    min-width: 80px;
    border: none;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.strategy-action-btn i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.strategy-action-btn span {
    letter-spacing: 0.3px;
}

.strategy-action-btn:active {
    transform: scale(0.95);
}

/* 수정 버튼 */
.strategy-action-btn.action-edit {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.15);
}

.strategy-action-btn.action-edit:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.2);
}

.strategy-action-btn.action-edit:hover i {
    transform: rotate(-10deg);
}

/* 재실행 버튼 */
.strategy-action-btn.action-rerun {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.35);
}

.strategy-action-btn.action-rerun:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.45);
}

.strategy-action-btn.action-rerun:hover i {
    transform: rotate(180deg);
}

/* 저장 버튼 */
.strategy-action-btn.action-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.strategy-action-btn.action-save:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
}

.strategy-action-btn.action-save:hover i {
    transform: scale(1.15);
}

/* Desktop only - mobile strategy action button styles are in indicator-creator-mobile.css */

/* ========================================
   모바일 카드 나타나기 애니메이션
   ======================================== */

/* 카드 나타나기 애니메이션 정의 - 빠른 버전 */
@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Desktop only - mobile card animations are in indicator-creator-mobile.css */

/* Analysis Items */
.analysis-item {
    background: var(--slate-50);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--slate-300);
    transition: var(--transition-base);
}

.analysis-item:hover {
    transform: translateX(4px);
    background: white;
    box-shadow: var(--shadow-sm);
}

.analysis-item.indicator { border-left-color: var(--primary-500); }
.analysis-item.buy { border-left-color: var(--success); }
.analysis-item.sell { border-left-color: var(--danger); }

/* Mode Tabs - 프레젠테이션 스타일 */
.mode-tabs {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 1.5rem;
    padding: 0.25rem;
    background: var(--ic-card-gray);
    border-radius: 12px;
    width: fit-content;
    border: 1px solid var(--ic-border);
}

.mode-tab {
    padding: 0.625rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--ic-text-light);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
    white-space: nowrap;
}

.mode-tab:hover {
    color: var(--ic-text);
    background: rgba(255, 255, 255, 0.7);
}

.mode-tab i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.mode-tab:hover i {
    transform: scale(1.1);
}

.mode-tab.active {
    background: var(--ic-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 79, 207, 0.3);
}

.mode-tab.active .text-warning {
    color: var(--ic-secondary) !important;
    filter: drop-shadow(0 0 4px rgba(201, 162, 39, 0.6));
}

.mode-tab.active::before {
    opacity: 0;
}

.mode-tab.active i {
    color: white;
    transform: scale(1.1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.mode-tab.active .text-warning {
    color: #fbbf24 !important;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

.mode-tab span {
    position: relative;
    z-index: 1;
}

/* LLM Selector - 프레젠테이션 스타일 */
.llm-selector {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--ic-bg-light);
    border-radius: 12px;
    border: 1px solid var(--ic-border);
}

.llm-selector.show {
    display: block;
    animation: icFadeIn 0.3s ease-out;
}

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

.llm-radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    justify-content: center;
}

.llm-option {
    position: relative;
    min-width: 240px;
    max-width: 100%;
}

.llm-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.llm-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.llm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(91, 79, 207, 0.12);
    border-color: var(--ic-primary-light);
}

.llm-option input[type="radio"]:checked + .llm-card {
    border-color: var(--ic-primary);
    background: var(--ic-primary-light);
    box-shadow: 0 0 0 2px rgba(91, 79, 207, 0.1);
}

.llm-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 4px;
    box-shadow: var(--shadow-sm);
}

.llm-info {
    flex-grow: 1;
}

.llm-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ic-dark);
    margin-bottom: 0.1rem;
}

.llm-description {
    font-size: 0.75rem;
    color: var(--ic-text-light);
}

.llm-check {
    display: none;
    width: 22px;
    height: 22px;
    background: var(--ic-primary);
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.llm-option input[type="radio"]:checked ~ .llm-card .llm-check {
    display: flex;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(4px);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Section Header, Step Indicator, Step Content 스타일 */
#indicator-creator-section .section-header {
    margin-bottom: 5px; 
    padding: 8px 20px;
}

#indicator-creator-section .section-header {
    margin-bottom: 0 !important;
    padding-bottom: 5px !important;
}

#indicator-creator-section .step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem 0; 
}

#indicator-creator-section .step-content:first-of-type .card {
    margin-top: 0;
}

#indicator-creator-section .step-content {
    margin: 0.5rem 0;
}

#indicator-creator-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#indicator-creator-section .section-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding: 0 20px;
    margin-top: -10px;
}

/* Step 스타일 */
.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
    font-weight: bold;
    position: relative;
    font-size: 1rem;
    transition: all 0.3s ease;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Parsing Result 스타일 */
.parsing-result {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #3b82f6;
    margin: 1rem 0;
}

/* Badge 스타일 */
.indicator-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.2rem;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.condition-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.2rem;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.action-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.2rem;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Code Preview 스타일 */
.code-preview {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    font-family: 'Monaco', 'Consolas', 'SF Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.code-preview::-webkit-scrollbar {
    width: 8px;
}

.code-preview::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}

.code-preview::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

.code-preview::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Example Card 스타일 */
.example-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.example-card h6 {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.example-card p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* 모바일에서 예시 카드 선택 버튼 스타일 */
@media (max-width: 991.98px) {
    .example-select-button {
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid #e5e7eb !important;
    }
    
    .example-select-button button {
        width: 100% !important;
        padding: 0.875rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        border: none !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
        transition: all 0.3s ease !important;
    }
    
    .example-select-button button:active {
        transform: scale(0.98) !important;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
    }
    
    .example-card.selected {
        padding-bottom: 1.5rem !important;
    }
}

/* Test Results 스타일 */
.test-results {
    background: linear-gradient(135deg, #fef3c7, #fed7aa);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #f59e0b;
    margin: 1rem 0;
}

.test-results.success {
    background: linear-gradient(135deg, #d1fae5, #bbf7d0);
    border-left-color: #10b981;
}

.test-results.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left-color: #ef4444;
}

/* Top Controls 관련 스타일 */
#indicator-creator-section.active ~ * #top-controls,
body:has(#indicator-creator-section.active) #top-controls {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* AI지표생성 섹션이 활성화일 때 전체 레이아웃 조정 */
#indicator-creator-section.active {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* AI지표생성 섹션 전용 - 네비게이션 바 직후 즉시 컨텐츠 시작 */
body:has(#indicator-creator-section.active) #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* indicator-creator-section 자체의 상단 패딩/마진 제거 */
#indicator-creator-section.section-container.active {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 반응형: 모바일에서는 히스토리 사이드바 숨김 또는 토글 */
@media (max-width: 992px) {
    /* 🔥 모바일에서 AI전략 생성 섹션일 때 네비게이션 스크롤과 함께 움직임 */
    body:has(#indicator-creator-section.section-container.active) .navbar,
    body:has(#indicator-creator-section.section-container.active) nav.navbar {
        position: relative !important;
        top: auto !important;
    }
    
    #indicator-creator-section.section-container.active {
        flex-direction: column;
    }
    
    #indicator-creator-section .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;        
        width: 100% !important;
        padding: 0 !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        height: auto;
        min-height: auto !important; /* 콘텐츠에 맞춤 */        
        max-width: 100% !important;
        box-sizing: border-box;
    }

    #indicator-creator-section .indicator-generator-layout {
        width: 100% !important;
        gap: 0 !important;
        flex-direction: column !important;
        /* 높이 고정 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important; /* 레이아웃은 숨기고, main-content에서만 스크롤 */
    }

    #indicator-creator-section .main-content {
        max-width: 100% !important;
        /* 🔥 핵심: main-content가 레이아웃 높이를 모두 사용하고 스크롤 */
        flex: 1 !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    #indicator-creator-section .history-sidebar {
        position: fixed !important;
        top: var(--navbar-height, 60px) !important;
        left: 0 !important;
        height: calc(100vh - var(--navbar-height, 60px)) !important;
        transform: translateX(-100%);
        width: min(280px, 80vw) !important;
        z-index: 95 !important;
        border-right: none;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
        border-bottom: none;
        background-color: #ffffff !important;
        background: #ffffff !important;
        transition: transform 0.3s ease, top 0.2s ease, height 0.2s ease;
    }

    #indicator-creator-section .history-sidebar.mobile-open {
        transform: translateX(0);
    }

    #creator-history-overlay {
        display: block !important;
        opacity: 0;
        pointer-events: none;
        position: fixed !important;
        top: var(--navbar-height, 60px) !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: calc(100vh - var(--navbar-height, 60px)) !important;
        z-index: 90 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        backdrop-filter: blur(2px);
        transition: opacity 0.3s ease, top 0.2s ease;
        cursor: pointer;
    }

    #creator-history-overlay.visible {
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
    }

    .mobile-history-toggle {
        position: absolute !important; /* absolute로 변경하여 hero 위에 오버레이 */
        top: 0.5rem !important; /* hero-section 상단에서 약간 떨어뜨림 */
        left: 1rem !important; /* 왼쪽 정렬 */
        z-index: 10 !important; /* hero-section보다 위에 표시 */
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        background: transparent !important; /* 배경 투명 */
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
    }
    
    .mobile-history-toggle .btn {
        width: auto !important;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 0.75rem !important;
        font-size: 0 !important; /* 텍스트 숨기기 */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px;
    }
    
    .mobile-history-toggle .btn i {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }
    
    .input-card {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        /* max-width: 100% !important; */
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .input-card.moved-to-bottom {
        position: fixed !important;
        bottom: 1rem !important;
        left: 1rem !important;
        right: 1rem !important;
        top: auto !important;
        transform: none !important;
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        box-sizing: border-box !important;
        padding: 1rem 1.25rem !important;
    }
}

/* ==========================================================================
   Indicator Creator Section Additional Styles
   ========================================================================== */

.indicator-creator-section .card {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.indicator-creator-section .card-header {
    border: none;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.indicator-creator-section .btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.indicator-creator-section .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.indicator-creator-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

.indicator-creator-section .btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.indicator-creator-section .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.indicator-creator-section .btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.indicator-creator-section .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}

.indicator-creator-section .form-control {
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

.indicator-creator-section .form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.completion-animation {
    text-align: center;
    padding: 2rem;
}

.completion-animation i {
    animation: bounce 1s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
}

.my-indicators-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

.indicator-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.indicator-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.indicator-item h6 {
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.indicator-item p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.indicator-item small {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .step {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        margin: 0 0.25rem;
    }
    
    .step:not(:last-child)::after {
        width: 1.5rem;
    }
    
    .nlp-input-area {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .magic-wand {
        font-size: 2rem;
    }
    
    .code-preview {
        font-size: 0.8rem;
        max-height: 300px;
    }
    
    .indicator-creator-section .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .step-indicator {
        margin: 1rem 0;
    }
    
    .step {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
        margin: 0 0.2rem;
    }
    
    .step:not(:last-child)::after {
        width: 1rem;
    }
}

/* =================================================================== */
/* 🔥 SECTION: 모바일 반응형 개선 (UI/UX 최적화) START */
/* =================================================================== */

/* 작은 모바일 (575px 이하) */
@media (max-width: 575.98px) {
    /* Hero Section 모바일 최적화 - 전체 화면 활용 */
    .hero-section {
        padding: 0.5rem 1rem !important; /* 좌우 패딩 유지 */
        padding-top: 1rem !important; /* 상단 패딩을 하단과 유사하게 (margin-bottom: 1rem과 유사) */
        padding-bottom: 0.5rem !important; /* 하단 패딩 */
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-bottom: 1rem !important;
        width: 100% !important;
        box-sizing: border-box;
        position: relative !important;
        z-index: 1 !important; /* 히스토리 토글 버튼보다 낮은 z-index */
    }
    
    /* 사이드바 토글 버튼을 hero 위에 오버레이 */
    .mobile-history-toggle {
        position: absolute !important; /* absolute로 변경하여 오버레이 */
        top: 0.5rem !important; /* hero-section 상단에서 약간 떨어뜨림 */
        left: 1rem !important; /* 왼쪽 정렬 */
        z-index: 10 !important; /* hero-section보다 위에 표시 */
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
        margin-bottom: 6px !important;
        line-height: 1.2 !important;
        padding: 0 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        padding: 0 0.5rem;
    }
    
    .hero-subtitle br {
        display: none; /* 모바일에서 줄바꿈 제거 */
    }
    
    /* indicator-creator-section 자체의 상단 패딩/마진 제거 */
    #indicator-creator-section.section-container.active {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* content의 상단 패딩/마진 제거 */
    body:has(#indicator-creator-section.active) #content {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        /* 높이 고정 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* indicator-generator-layout 높이 고정 제거 */
    #indicator-creator-section .indicator-generator-layout {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 메인 컨텐츠 패딩 최소화 (전체 화면 활용) */
    #indicator-creator-section .main-content {
        padding: 0 !important; /* 모든 패딩 제거 */
        padding-top: 0 !important; /* 상단 패딩 제거 */
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 60px !important; /* 하단 사이드바 높이만큼 여백 추가 (버튼 가림 방지) - 높이 감소에 맞춰 조정 */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-left: 0 !important;
        margin-right: 0 !important;
        /* 🔥 핵심: flex: 1로 남은 공간 모두 차지, 고정 높이 대신 */
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important; /* flex 컨테이너에서 스크롤 작동을 위해 필수 */
        overflow-y: auto !important; /* 세로 스크롤 활성화 (스크롤바는 숨김) */
        overflow-x: hidden !important; /* 가로 스크롤 방지 */
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
        touch-action: pan-y !important; /* 세로 스크롤만 허용 */
        overscroll-behavior: contain !important; /* 스크롤이 부모로 전파되지 않도록 */
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 */
    #indicator-creator-section .main-content::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 모바일에서 indicator-creator-section 활성화 시 body 스크롤 제거 */
    body:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 - main-content에서만 스크롤 제어 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important; /* 고정 높이 제거 */
        max-height: none !important; /* 최대 높이 제한 제거 */
        position: relative !important;
        width: 100% !important;
        /* touch-action 제거 - main-content에서만 제어 */
        touch-action: auto !important; /* none 대신 auto */
    }
    
    html:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important;
        max-height: none !important;
        touch-action: auto !important; /* none 대신 auto */
    }
    
    /* 탭 컨테이너 전체 너비 */
    .tab-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .tab-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* 탭 컨텐츠 내부 row도 전체 너비 */
    .tab-content .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 히스토리 토글 버튼 - hero 위에 오버레이 */
    .mobile-history-toggle {
        position: absolute !important; /* absolute로 변경하여 hero 위에 오버레이 */
        top: 0.5rem !important; /* hero-section 상단에서 약간 떨어뜨림 */
        left: 1rem !important; /* 왼쪽 정렬 */
        z-index: 10 !important; /* hero-section보다 위에 표시 */
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        background: transparent !important; /* 배경 투명 */
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
    }
    
    /* main-content에 position: relative 추가 (absolute positioning 기준) */
    #indicator-creator-section .main-content {
        position: relative !important;
    }
    
    .mobile-history-toggle .btn {
        width: auto !important;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 0.75rem !important;
        font-size: 0 !important; /* 텍스트 숨기기 */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 8px;
    }
    
    .mobile-history-toggle .btn i {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }
    
    /* Input Card 모바일 최적화 - 전체 화면 활용 */
    .input-card {
        padding: 1rem !important;
        margin: 0 !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important; /* 스크롤바 없음 - 콘텐츠에 맞게 자동 확장 */
        min-height: auto !important; /* 최소 높이 제거 */
        height: auto !important;
        box-shadow: none !important;
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid var(--slate-200) !important;
        border-bottom: 1px solid var(--slate-200) !important;
        overflow: visible !important; /* 스크롤바 제거 - 전체 화면 스크롤 사용 */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 모바일에서 입력카드 상단 보라색 줄 숨김 */
    .input-card::before {
        display: none !important;
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 (input-card) */
    .input-card::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 고급모드에서도 스크롤바 없음 */
    .input-card.mode-advanced {
        max-height: none !important; /* 콘텐츠에 맞게 자동 확장 */
        min-height: auto !important;
        padding-bottom: 120px !important; /* 초기부터 하단 여백 확보 (버튼 하단 패딩과 동일) */
    }
    
    /* 액션 버튼 - 일반 플로우로 변경 (스크롤과 함께 움직임) */
    #action-buttons-bottom {
        position: relative !important; /* sticky 제거 */
        background: var(--surface-card) !important;
        padding: 1rem 0 70px 0 !important; /* 하단 패딩 추가 (하단 사이드바 높이만큼) */
        margin-top: 0.75rem !important; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
        z-index: 6000 !important; /* 하단 네비게이션(5999)보다 높게, 상단 네비게이션(6000)과 같은 레벨 */
        border-top: none !important; /* 상단 줄 제거 */
    }
    
    /* 모드 탭 버튼 모바일 최적화 - 전체 너비 활용 */
    .mode-tabs {
        flex-direction: column;
        gap: 0.25rem;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .mode-tab {
        width: 100% !important;
        padding: 0.625rem 1rem !important;
        font-size: 0.875rem !important;
        justify-content: center;
        margin: 0 !important;
        box-sizing: border-box;
        gap: 0.5rem !important;
    }
    
    .mode-tab i {
        margin-right: 0 !important;
        font-size: 1rem !important;
    }
    
    .mode-tab.active {
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35), 
                    0 1px 3px rgba(102, 126, 234, 0.2) !important;
    }
    
    /* LLM 선택기 모바일 최적화 - 전체 너비 활용 */
    .llm-selector {
        margin-bottom: 1rem !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .llm-radio-group {
        flex-direction: column;
        gap: 0.25rem; /* 0.75rem의 1/3로 감소 (0.75rem → 0.25rem) */
        width: 100% !important;
    }
    
    .llm-card {
        padding: 0.875rem !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .llm-logo {
        width: 32px !important;
        height: 32px !important;
    }
    
    .llm-name {
        font-size: 0.875rem !important;
    }
    
    .llm-description {
        font-size: 0.75rem !important;
    }
    
    /* 전략 설명 섹션 - 전체 너비 활용 */
    .input-section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
        margin-bottom: 1rem !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .input-section-header .form-label {
        font-size: 1rem !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }
    
    .input-helper-buttons {
        width: 100% !important;
        display: flex;
        gap: 0.5rem;
        box-sizing: border-box;
    }
    
    .input-helper-buttons .btn {
        flex: 1;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        box-sizing: border-box;
    }
    
    /* 모바일에서 라벨 액션 버튼 스타일 */
    .label-action-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        gap: 0.375rem !important;
    }
    
    .label-action-btn i {
        font-size: 0.8rem !important;
    }
    
    .label-action-btn span {
        font-size: 0.8rem !important;
    }
    
    /* Textarea 모바일 최적화 - 전체 너비 활용 */
    #strategy-description {
        font-size: 0.9rem !important;
        padding: 0.875rem !important;
        min-height: 120px !important;
        line-height: 1.6 !important;
        width: 100% !important;
        box-sizing: border-box;
        border-radius: 8px !important;
    }
    
    /* 액션 버튼 모바일 최적화 - 가로 2열 배치 */
    #action-buttons-bottom {
        flex-direction: row !important; /* 가로 배치 (2열) */
        gap: 0.75rem !important;
        margin-top: 0.75rem !important; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
        width: 100% !important;
        box-sizing: border-box;
        padding: 0 !important;
    }
    
    #action-buttons-bottom .btn {
        flex: 1 !important; /* 각 버튼이 동일한 너비로 배치 */
        padding: 0.875rem 1rem !important; /* 좌우 패딩 조정 */
        font-size: 0.9rem !important; /* 폰트 크기 약간 감소 */
        font-weight: 600;
        box-sizing: border-box;
        margin: 0 !important;
        min-width: 0 !important; /* flex 아이템이 줄어들 수 있도록 */
    }
    
    /* 결과 탭 네비게이션 모바일 스타일 */
    .result-tabs {
        background: white;
        border-bottom: 2px solid var(--slate-200);
        margin: 0 !important;
        padding: 0 1rem;
    }
    
    .result-tabs .nav-link {
        color: var(--slate-600);
        border: none !important;
        border-bottom: 3px solid transparent !important;
        padding: 0.75rem 1rem !important;
        font-weight: 500;
        font-size: 0.9rem;
    }
    
    .result-tabs .nav-link.active {
        color: var(--primary-600);
        border-bottom-color: var(--primary-600) !important;
        background: transparent !important;
    }
    
    .result-tabs .nav-link i {
        font-size: 1rem;
    }
    
    /* 결과 카드 모바일 최적화 - 전체 화면 활용 */
    .results-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important; /* 외부 스크롤 제거 */
    }
    
    .results-container .row.g-4 {
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        --bs-gutter-x: 0 !important;
        --bs-gutter-y: 0 !important;
    }
    
    .results-container .row > * {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .results-container .col-12.col-lg-6 {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
    }
    
    .result-card-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
    }
    
    .result-card {
        padding: 0 !important; /* 패딩 완전 제거 - 시원하게 넓게 */
        margin: 0 !important;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        box-shadow: none !important;
        border: none !important;
        border-top: 1px solid var(--slate-200) !important;
        height: calc(100vh - 45px - 55px) !important; /* 상단 네비 45px + 하단 네비 55px 제외한 전체 높이 */
        max-height: calc(100vh - 45px - 55px) !important;
        left: 0 !important;
        right: 0 !important;
        position: relative !important;
        overflow: hidden !important; /* 외부 스크롤 제거 - 내부에서만 스크롤 */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 탭 패널도 전체 너비 */
    .result-card.tab-pane {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* 결과 카드 내부 컨테이너도 100% - 패딩 최소화 */
    .result-card .result-body {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 0 !important; /* 패딩 완전 제거 - 시원하게 넓게 */
        flex: 1 1 auto !important; /* 남은 공간 모두 사용 */
        min-height: 0 !important; /* flexbox 스크롤 작동을 위해 필수 */
        overflow-y: auto !important; /* 단일 스크롤만 유지 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 */
    .result-card .result-body::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 분석 결과 body에도 하단 패딩 추가 */
    #analysis-result-body {
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        max-height: calc(100vh - 215px) !important; /* 하단 네비게이션 바 고려한 최대 높이 (상단 네비 45px + 하단 네비 70px + 탭 50px + 여백 50px) */
        -webkit-overflow-scrolling: touch;
    }
    
    /* 백테스팅 결과 요약 카드 하단 패딩 */
    .backtest-summary-card {
        margin-bottom: 1rem !important;
    }
    
    /* 액션 버튼 영역 - 하단 고정 스타일은 기본 스타일에서 처리 */
    
    /* results-container 하단 패딩 제거 (내부에서 처리) */
    .results-container {
        padding-bottom: 0 !important;
    }
    
    /* 모바일에서 탭 전환 */
    .tab-content {
        width: 100%;
    }
    
    .result-card.tab-pane:not(.show):not(.active) {
        display: none !important;
    }
    
    .result-card.tab-pane.show.active,
    .result-card.tab-pane.active {
        display: block !important;
        opacity: 1 !important;
    }
    
    .result-card-header {
        padding: 0.75rem 0 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .result-card-title {
        font-size: 1.25rem !important;
    }
    
    /* 코드 에디터 호스트 모바일 최적화 - 전체 높이 활용 */
    #monaco-editor-host {
        width: 100% !important;
        height: 100% !important;
        min-height: calc(100vh - 45px - 55px - 80px) !important; /* 상단 네비 45px + 하단 네비 55px + 헤더 80px 제외 */
        max-height: none !important;
        flex: 1 1 auto !important; /* 남은 공간 모두 사용 */
        position: relative !important;
    }
    
    /* 코드 에디터 모바일 최적화 */
    #strategy-code-editor {
        border-radius: 8px !important;
    }
    
    /* 백테스트 결과 카드 모바일 최적화 - 전체 화면 활용 */
    .backtest-summary-card {
        margin: 0 !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid var(--slate-200) !important;
        border-bottom: 1px solid var(--slate-200) !important;
        box-shadow: none !important;
    }
    
    /* 백테스팅 조건 섹션 모바일 최적화 */
    .backtest-conditions-section {
        padding: 1rem !important;
        background: var(--slate-50) !important;
        border-bottom: 1px solid var(--slate-200) !important;
    }
    
    .backtest-section-header {
        font-size: 0.75rem !important;
        margin-bottom: 0.875rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid var(--slate-200) !important;
    }
    
    .backtest-section-header i {
        font-size: 0.7rem !important;
    }
    
    .backtest-conditions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .backtest-condition-item {
        padding: 0.75rem 0.625rem !important;
        border-radius: 8px !important;
        background: #ffffff !important;
        border: 1px solid var(--slate-200) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
    }
    
    .condition-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
    }
    
    .condition-content {
        flex: 1;
        width: 100%;
    }
    
    .condition-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
        color: var(--slate-500) !important;
    }
    
    .condition-value {
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        color: var(--slate-900) !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }
    
    /* 백테스팅 성과 지표 섹션 모바일 최적화 */
    .backtest-metrics-section {
        padding: 1rem !important;
        background: #ffffff !important;
    }
    
    .backtest-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .backtest-metric-card {
        padding: 0.875rem 0.625rem !important;
        border-radius: 10px !important;
        border: 1px solid var(--slate-200) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
        background: var(--slate-50) !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
    }
    
    .backtest-metric-card::before {
        width: 3px !important;
    }
    
    .metric-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
    
    .metric-content {
        flex: 1;
        width: 100%;
    }
    
    .metric-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.375rem !important;
        color: var(--slate-500) !important;
    }
    
    .metric-value {
        font-size: 1rem !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }
    
    .metric-value.text-success {
        color: #22c55e !important;
    }
    
    .metric-value.text-danger {
        color: #ef4444 !important;
    }
    
    /* 버튼 그룹 모바일 최적화 */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 하단 고정 모드 모바일 최적화 */
    .input-card.moved-to-bottom {
        left: 0.5rem !important;
        right: 0.5rem !important;
        bottom: 0.5rem !important;
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* 닫기 버튼 모바일 최적화 */
    .history-close-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        background: var(--slate-100) !important;
        border: 1px solid var(--slate-200) !important;
    }
    
    .history-close-btn i {
        font-size: 1.2rem !important;
    }
    
    .history-close-btn:hover {
        background: var(--slate-200) !important;
        border-color: var(--primary-300) !important;
        color: var(--primary-600) !important;
    }
}

/* 중간 모바일 (576px ~ 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* indicator-creator-section 자체의 상단 패딩/마진 제거 */
    #indicator-creator-section.section-container.active {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* content의 상단 패딩/마진 제거 */
    body:has(#indicator-creator-section.active) #content {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        /* 높이 고정 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* indicator-generator-layout 높이 고정 제거 */
    #indicator-creator-section .indicator-generator-layout {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .hero-section {
        padding: 0.5rem 0 !important; /* 좌우 패딩 */
        padding-top: 1.5rem !important; /* 상단 패딩을 하단과 유사하게 (margin-bottom: 1.5rem과 유사) */
        padding-bottom: 0.5rem !important; /* 하단 패딩 */
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-bottom: 1.5rem !important;
        position: relative !important;
        z-index: 1 !important; /* 히스토리 토글 버튼보다 낮은 z-index */
        flex-shrink: 0 !important; /* flex 컨테이너에서 크기 유지 */
    }
    
    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 8px !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
    }
    
    /* 메인 컨텐츠 패딩 완전 제거 */
    #indicator-creator-section .main-content {
        padding: 0 !important; /* 모든 패딩 제거 */
        padding-top: 0 !important; /* 상단 패딩 제거 */
        padding-bottom: 60px !important; /* 하단 사이드바 높이만큼 여백 추가 (버튼 가림 방지) - 높이 감소에 맞춰 조정 */
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        /* 🔥 핵심: flex: 1로 남은 공간 모두 차지 */
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important; /* flex 컨테이너에서 스크롤 작동을 위해 필수 */
        overflow-y: auto !important; /* 세로 스크롤 활성화 (스크롤바는 숨김) */
        overflow-x: hidden !important; /* 가로 스크롤 방지 */
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
        touch-action: pan-y !important; /* 세로 스크롤만 허용 */
        overscroll-behavior: contain !important; /* 스크롤이 부모로 전파되지 않도록 */
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 (중간 모바일) */
    #indicator-creator-section .main-content::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 모바일에서 indicator-creator-section 활성화 시 body 스크롤 제거 */
    body:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 - main-content에서만 스크롤 제어 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important; /* 고정 높이 제거 */
        max-height: none !important; /* 최대 높이 제한 제거 */
        position: relative !important;
        width: 100% !important;
        /* touch-action 제거 - main-content에서만 제어 */
        touch-action: auto !important; /* none 대신 auto */
    }
    
    html:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important;
        max-height: none !important;
        touch-action: auto !important; /* none 대신 auto */
    }
    
    /* 모바일에서 indicator-creator-section 활성화 시 body 스크롤 제거 */
    body:has(#indicator-creator-section.active) {
        overflow: hidden !important;
        height: 100vh !important;
        max-height: 100vh !important;
        position: relative !important; /* fixed 제거 - 터치 스크롤 활성화 */
        width: 100% !important;
        touch-action: auto !important; /* none → auto로 변경 (크롬 대응) */
    }
    
    html:has(#indicator-creator-section.active) {
        overflow: hidden !important;
        height: 100vh !important;
        max-height: 100vh !important;
        touch-action: auto !important; /* none → auto로 변경 (크롬 대응) */
    }
    
    /* Input Card 전체 화면 활용 */
    .input-card {
        padding: 1.25rem 1rem !important;
        margin: 0 !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 160px) !important; /* 버튼이 보이도록 높이 제한 */
        min-height: auto !important; /* 최소 높이 제거 */
        height: auto !important;
        box-shadow: none !important;
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid var(--slate-200) !important;
        border-bottom: 1px solid var(--slate-200) !important;
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 모바일에서 입력카드 상단 보라색 줄 숨김 */
    .input-card::before {
        display: none !important;
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 (input-card - 중간 모바일) */
    .input-card::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 고급모드에서도 스크롤바 없음 */
    .input-card.mode-advanced {
        max-height: none !important; /* 콘텐츠에 맞게 자동 확장 */
        min-height: auto !important;
        padding-bottom: 120px !important; /* 초기부터 하단 여백 확보 (버튼 하단 패딩과 동일) */
    }
    
    /* 액션 버튼 - 일반 플로우로 변경 (중간 모바일) */
    #action-buttons-bottom {
        position: relative !important; /* sticky 제거 */
        background: var(--surface-card) !important;
        padding: 1rem 0 70px 0 !important; /* 하단 패딩 추가 (하단 사이드바 높이만큼) */
        margin-top: 0.75rem !important; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
        z-index: 6000 !important; /* 하단 네비게이션(5999)보다 높게, 상단 네비게이션(6000)과 같은 레벨 */
        border-top: none !important; /* 상단 줄 제거 */
    }
    
    /* 중간 모바일에서도 히스토리 토글 버튼을 hero 위에 오버레이 */
    .mobile-history-toggle {
        position: absolute !important; /* absolute로 변경하여 hero 위에 오버레이 */
        top: 0.5rem !important; /* hero-section 상단에서 약간 떨어뜨림 */
        left: 1rem !important; /* 왼쪽 정렬 */
        z-index: 10 !important; /* hero-section보다 위에 표시 */
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        background: transparent !important; /* 배경 투명 */
    }
    
    /* main-content에 position: relative 추가 (absolute positioning 기준) */
    #indicator-creator-section .main-content {
        position: relative !important;
    }
    
    /* 결과 탭 네비게이션 */
    .result-tabs {
        background: white;
        border-bottom: 2px solid var(--slate-200);
        margin: 0 !important;
        padding: 0 1rem;
    }
    
    .result-tabs .nav-link {
        color: var(--slate-600);
        border: none !important;
        border-bottom: 3px solid transparent !important;
        padding: 0.75rem 1rem !important;
        font-weight: 500;
        font-size: 0.95rem;
    }
    
    .result-tabs .nav-link.active {
        color: var(--primary-600);
        border-bottom-color: var(--primary-600) !important;
        background: transparent !important;
    }
    
    /* 결과 카드 전체 화면 활용 */
    .results-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .results-container .row.g-4 {
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        --bs-gutter-x: 0 !important;
        --bs-gutter-y: 0 !important;
    }
    
    .results-container .row > * {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* 백테스팅 결과 요약 모바일 최적화 (중간 모바일) */
    .backtest-summary-card {
        margin: 0 !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid var(--slate-200) !important;
        border-bottom: 1px solid var(--slate-200) !important;
        box-shadow: none !important;
    }
    
    .backtest-conditions-section {
        padding: 1.125rem !important;
        background: var(--slate-50) !important;
    }
    
    .backtest-section-header {
        font-size: 0.8rem !important;
        margin-bottom: 1rem !important;
    }
    
    .backtest-conditions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .backtest-condition-item {
        padding: 0.875rem !important;
        border-radius: 8px !important;
    }
    
    .condition-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.8rem !important;
    }
    
    .condition-label {
        font-size: 0.75rem !important;
    }
    
    .condition-value {
        font-size: 0.9rem !important;
    }
    
    .backtest-metrics-section {
        padding: 1.125rem !important;
    }
    
    .backtest-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .backtest-metric-card {
        padding: 1rem !important;
        border-radius: 10px !important;
    }
    
    .metric-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.8rem !important;
    }
    
    .metric-label {
        font-size: 0.75rem !important;
    }
    
    .metric-value {
        font-size: 1.125rem !important;
    }
    
    .results-container .col-12.col-lg-6 {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
    }
    
    .result-card-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        left: 0 !important;
        right: 0 !important;
    }
    
    .result-card {
        padding: 1.25rem 1rem !important;
        padding-bottom: calc(1.25rem + 150px) !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        margin: 0 !important;
        margin-bottom: 0 !important; /* 하단 마진 제거 (내부 스크롤 사용) */
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        box-shadow: none !important;
        border: none !important;
        border-top: 1px solid var(--slate-200) !important;
        height: calc(100vh - 200px) !important; /* 고정 높이 설정 (내부 스크롤 활성화) */
        max-height: calc(100vh - 200px) !important;
        left: 0 !important;
        right: 0 !important;
        position: relative !important;
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .result-card.tab-pane {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .result-card .result-body {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 분석 결과 body에도 하단 패딩 추가 */
    #analysis-result-body {
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        max-height: calc(100vh - 215px) !important; /* 하단 네비게이션 바 고려한 최대 높이 (상단 네비 45px + 하단 네비 70px + 탭 50px + 여백 50px) */
        -webkit-overflow-scrolling: touch;
    }
    
    /* 액션 버튼 영역 하단 패딩 */
    #strategy-action-buttons {
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
    }
    
    /* 모바일에서 탭 전환 */
    .result-card.tab-pane:not(.show):not(.active) {
        display: none !important;
    }
    
    .result-card.tab-pane.show.active,
    .result-card.tab-pane.active {
        display: block !important;
        opacity: 1 !important;
    }
    
    .result-card .result-body {
        min-height: calc(100vh - 280px) !important;
        max-height: none !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #monaco-editor-host {
        min-height: calc(100vh - 280px) !important;
        max-height: none !important;
    }
    
    .mode-tabs {
        gap: 0.125rem;
    }
    
    .mode-tab {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    .mode-tab.active {
        box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4), 
                    0 2px 6px rgba(102, 126, 234, 0.25) !important;
    }
    
    #action-buttons-bottom {
        flex-direction: row !important; /* 중간 모바일에서도 가로 배치 (2열) */
        gap: 0.75rem !important;
    }
    
    #action-buttons-bottom .btn {
        flex: 1 !important; /* 각 버튼이 동일한 너비로 배치 */
        min-width: 0 !important; /* flex 아이템이 줄어들 수 있도록 */
    }
}

/* 태블릿 (768px ~ 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* indicator-creator-section 자체의 상단 패딩/마진 제거 */
    #indicator-creator-section.section-container.active {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* content의 상단 패딩/마진 제거 */
    body:has(#indicator-creator-section.active) #content {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        /* 높이 고정 제거: 콘텐츠가 없을 때 불필요한 스크롤바 방지 */
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* indicator-generator-layout 높이 고정 제거 */
    #indicator-creator-section .indicator-generator-layout {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .hero-section {
        padding: 0.5rem 0 !important; /* 좌우 패딩 */
        padding-top: 1.5rem !important; /* 상단 패딩을 하단과 유사하게 (margin-bottom: 1.5rem과 유사) */
        padding-bottom: 0.5rem !important; /* 하단 패딩 */
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-bottom: 1.5rem !important;
        position: relative !important;
        z-index: 1 !important; /* 히스토리 토글 버튼보다 낮은 z-index */
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    /* 메인 컨텐츠 패딩 완전 제거 */
    #indicator-creator-section .main-content {
        padding: 0 !important; /* 모든 패딩 제거 */
        padding-top: 0 !important; /* 상단 패딩 제거 */
        padding-bottom: 60px !important; /* 하단 사이드바 높이만큼 여백 추가 (버튼 가림 방지) - 높이 감소에 맞춰 조정 */
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        margin-top: 0 !important; /* 상단 마진 제거 */
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
        /* 🔥 핵심: flex: 1로 남은 공간 모두 차지 */
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important; /* flex 컨테이너에서 스크롤 작동을 위해 필수 */
        overflow-y: auto !important; /* 세로 스크롤 활성화 (스크롤바는 숨김) */
        overflow-x: hidden !important; /* 가로 스크롤 방지 */
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
        touch-action: pan-y !important; /* 세로 스크롤만 허용 */
        overscroll-behavior: contain !important; /* 스크롤이 부모로 전파되지 않도록 */
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 (태블릿) */
    #indicator-creator-section .main-content::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 모바일에서 indicator-creator-section 활성화 시 body 스크롤 제거 */
    body:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 - main-content에서만 스크롤 제어 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important; /* 고정 높이 제거 */
        max-height: none !important; /* 최대 높이 제한 제거 */
        position: relative !important;
        width: 100% !important;
        /* touch-action 제거 - main-content에서만 제어 */
        touch-action: auto !important; /* none 대신 auto */
    }
    
    html:has(#indicator-creator-section.active) {
        /* overflow: hidden 제거 */
        overflow: visible !important; /* hidden 대신 visible */
        height: auto !important;
        max-height: none !important;
        touch-action: auto !important; /* none 대신 auto */
    }
    
    /* 모바일에서 indicator-creator-section 활성화 시 body 스크롤 제거 */
    body:has(#indicator-creator-section.active) {
        overflow: hidden !important;
        height: 100vh !important;
        max-height: 100vh !important;
        position: relative !important; /* fixed 제거 - 터치 스크롤 활성화 */
        width: 100% !important;
        touch-action: auto !important; /* none → auto로 변경 (크롬 대응) */
    }
    
    html:has(#indicator-creator-section.active) {
        overflow: hidden !important;
        height: 100vh !important;
        max-height: 100vh !important;
        touch-action: auto !important; /* none → auto로 변경 (크롬 대응) */
    }
    
    /* Input Card 전체 화면 활용 */
    .input-card {
        padding: 1.5rem 1.25rem !important;
        margin: 0 !important;
        margin-bottom: 1.5rem !important;
        border-radius: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 180px) !important; /* 버튼이 보이도록 높이 제한 */
        min-height: auto !important; /* 최소 높이 제거 */
        height: auto !important;
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        scrollbar-width: none !important; /* Firefox 스크롤바 숨김 */
        -ms-overflow-style: none !important; /* IE/Edge 스크롤바 숨김 */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 모바일에서 입력카드 상단 보라색 줄 숨김 */
    .input-card::before {
        display: none !important;
    }
    
    /* 웹킷 브라우저 스크롤바 숨김 (input-card - 태블릿) */
    .input-card::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 고급모드에서도 높이 제한 */
    .input-card.mode-advanced {
        max-height: calc(100vh - 180px) !important;
        min-height: auto !important;
        padding-bottom: 120px !important; /* 초기부터 하단 여백 확보 (버튼 하단 패딩과 동일) */
    }
    
    /* 액션 버튼 항상 보이도록 (태블릿) */
    #action-buttons-bottom {
        position: relative !important; /* sticky 제거 - 스크롤과 함께 움직임 */
        background: var(--surface-card) !important;
        padding: 1rem 0 70px 0 !important; /* 하단 패딩 추가 (하단 사이드바 높이만큼) */
        margin-top: 0.75rem !important; /* 상단 여백 절반으로 감소 (1.5rem → 0.75rem) */
        z-index: 6000 !important; /* 하단 네비게이션(5999)보다 높게, 상단 네비게이션(6000)과 같은 레벨 */
        border-top: none !important; /* 상단 줄 제거 */
    }
    
    /* 태블릿에서도 히스토리 토글 버튼을 hero 위에 오버레이 */
    .mobile-history-toggle {
        position: absolute !important; /* absolute로 변경하여 hero 위에 오버레이 */
        top: 0.5rem !important; /* hero-section 상단에서 약간 떨어뜨림 */
        left: 1rem !important; /* 왼쪽 정렬 */
        z-index: 10 !important; /* hero-section보다 위에 표시 */
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        background: transparent !important; /* 배경 투명 */
    }
    
    /* 백테스팅 결과 요약 태블릿 최적화 */
    .backtest-summary-card {
        margin: 0 !important;
        margin-bottom: 1.25rem !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    .backtest-conditions-section {
        padding: 1.25rem !important;
    }
    
    .backtest-section-header {
        font-size: 0.85rem !important;
        margin-bottom: 1.125rem !important;
    }
    
    .backtest-conditions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.875rem !important;
    }
    
    .backtest-condition-item {
        padding: 1rem !important;
    }
    
    .condition-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .backtest-metrics-section {
        padding: 1.25rem !important;
    }
    
    .backtest-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.875rem !important;
    }
    
    .backtest-metric-card {
        padding: 1.125rem !important;
    }
    
    .metric-value {
        font-size: 1.375rem !important;
    }
    
    /* 결과 탭 네비게이션 */
    .result-tabs {
        background: white;
        border-bottom: 2px solid var(--slate-200);
        margin: 0 !important;
        padding: 0 1.25rem;
    }
    
    .result-tabs .nav-link {
        color: var(--slate-600);
        border: none !important;
        border-bottom: 3px solid transparent !important;
        padding: 0.875rem 1.25rem !important;
        font-weight: 500;
        font-size: 1rem;
    }
    
    .result-tabs .nav-link.active {
        color: var(--primary-600);
        border-bottom-color: var(--primary-600) !important;
        background: transparent !important;
    }
    
    /* 결과 카드 전체 화면 활용 */
    .results-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .results-container .row {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .results-container .col-12.col-lg-6 {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        box-sizing: border-box;
    }
    
    .result-card-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .result-card {
        padding: 1.5rem 1.25rem !important;
        padding-bottom: calc(1.5rem + 150px) !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        margin: 0 !important;
        margin-bottom: 0 !important; /* 하단 마진 제거 (내부 스크롤 사용) */
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        box-shadow: none !important;
        border: none !important;
        border-top: 1px solid var(--slate-200) !important;
        height: calc(100vh - 220px) !important; /* 고정 높이 설정 (내부 스크롤 활성화) */
        max-height: calc(100vh - 220px) !important;
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .result-card .result-body {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 분석 결과 body에도 하단 패딩 추가 */
    #analysis-result-body {
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        max-height: calc(100vh - 215px) !important; /* 하단 네비게이션 바 고려한 최대 높이 (상단 네비 45px + 하단 네비 70px + 탭 50px + 여백 50px) */
        -webkit-overflow-scrolling: touch;
    }
    
    /* 액션 버튼 영역 하단 패딩 */
    #strategy-action-buttons {
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
    }
    
    /* 모바일에서 탭 전환 */
    .result-card.tab-pane:not(.show):not(.active) {
        display: none !important;
    }
    
    .result-card.tab-pane.show.active,
    .result-card.tab-pane.active {
        display: block !important;
        opacity: 1 !important;
    }
    
    .result-card .result-body {
        min-height: calc(100vh - 300px) !important;
        max-height: none !important;
        overflow-y: auto !important; /* 내부 스크롤 활성화 */
        overflow-x: hidden !important;
        padding-bottom: 150px !important; /* 하단 네비게이션 바 공간 확보 (더 큰 여유 공간) */
        -webkit-overflow-scrolling: touch;
    }
    
    #monaco-editor-host {
        min-height: calc(100vh - 300px) !important;
        max-height: none !important;
    }
}

/* 모바일 터치 친화적 개선 (모든 모바일) */
@media (max-width: 991.98px) {
    /* 터치 영역 최소 44px */
    .btn, .mode-tab, .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 스크롤 영역 최적화 */
    .input-card {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 히스토리 사이드바 모바일 개선 */
    #indicator-creator-section .history-sidebar {
        width: min(320px, 85vw) !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
    }
    
    /* 오버레이 개선 */
    #creator-history-overlay {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        transition: opacity 0.3s ease, top 0.2s ease;
        top: var(--navbar-height, 60px) !important;
        height: calc(100vh - var(--navbar-height, 60px)) !important;
    }
    
    #creator-history-overlay.visible {
        opacity: 1;
    }
    
    /* 닫기 버튼 터치 최적화 */
    .history-close-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 히스토리 헤더 모바일 개선 */
    .history-header {
        padding: 1rem 1.25rem !important;
    }
    
    .history-actions {
        gap: 0.5rem !important;
    }
}

/* =================================================================== */
/* 🔥 SECTION: 모바일 반응형 개선 (UI/UX 최적화) END */

/* =================================================================== */
/* 🔥 SECTION: Gemini 스타일 모바일 디자인 START */
/* =================================================================== */

/* 모바일에서 AI전략 생성 섹션 활성화 시 navbar 숨기기 */
/* JavaScript로 .creator-active 클래스를 body에 추가하여 처리 */
@media (max-width: 991.98px) {
    body.creator-section-active .navbar {
        display: none !important;
    }
    
    body.creator-section-active #content {
        padding-top: 0 !important;
    }
    
    body.creator-section-active #indicator-creator-section {
        padding-top: 0 !important;
    }
}

/* Gemini 스타일 모바일 헤더 */
.gemini-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    background: #ffffff;
    position: relative;
    z-index: 90;
    border-bottom: 1px solid #f1f5f9;
}

.gemini-header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #5f6368;
    font-size: 1.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.gemini-header-btn:hover,
.gemini-header-btn:active {
    background: rgba(0, 0, 0, 0.06);
}

.gemini-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.gemini-header-left .gemini-mode-btn {
    font-size: 0.75rem;
    padding: 6px 10px;
}

.gemini-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gemini-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.gemini-logo-fallback {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a73e8;
    letter-spacing: -0.5px;
}

.gemini-mode-selector {
    display: flex;
    align-items: center;
}

.gemini-mode-btn {
    background: #f1f3f4;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gemini-mode-btn:hover,
.gemini-mode-btn.active {
    background: #e8f0fe;
    color: #1a73e8;
}

.gemini-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Gemini 스타일 Hero (모바일) */
.gemini-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    text-align: center;
    min-height: 30vh;
}

.gemini-greeting {
    font-size: 2rem;
    font-weight: 400;
    background: linear-gradient(135deg, #1a73e8 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
    animation: fadeInUp 0.6s ease-out;
}

.gemini-subtitle {
    font-size: 1rem;
    color: #5f6368;
    margin: 0;
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모바일에서 input-card 스타일 조정 */
@media (max-width: 991.98px) {
    .gemini-mobile-header + .mobile-history-toggle {
        display: none !important;
    }
    
    #indicator-creator-section .input-card {
        margin: 0 16px 100px 16px;
        border-radius: 24px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
        border: 1px solid #e0e0e0;
    }
    
    #indicator-creator-section .mode-tabs {
        display: none;
    }
    
    /* 모바일에서 main-content 배경 */
    #indicator-creator-section .main-content {
        background: #ffffff;
        min-height: 100vh;
    }
}

/* 모드 선택 팝업 (Gemini 스타일) */
.gemini-mode-selector {
    position: relative;
}

.gemini-mode-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    transform: none;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    padding: 6px;
    min-width: 200px;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
}

.gemini-mode-dropdown.show {
    display: block;
    animation: geminiDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gemini-mode-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
    color: #475569;
    border-radius: 12px;
    margin: 2px 0;
    position: relative;
}

.gemini-mode-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 2px 2px 0;
    transition: height 0.15s ease;
}

.gemini-mode-option:hover {
    background: #f8fafc;
}

.gemini-mode-option:hover::before {
    height: 24px;
}

.gemini-mode-option i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.15s ease;
}

.gemini-mode-option:hover i {
    background: #e2e8f0;
    color: #475569;
}

.gemini-mode-option span {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.gemini-mode-option .mode-desc {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 2px;
}

.gemini-mode-option.active {
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
}

.gemini-mode-option.active::before {
    height: 24px;
}

.gemini-mode-option.active i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gemini-mode-option.active span {
    color: #1e293b;
    font-weight: 600;
}

/* 구분선 */
.gemini-mode-dropdown .mode-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 12px;
}


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

/* =================================================================== */
/* IC 히어로 섹션 - 모바일 반응형 */
/* =================================================================== */
@media (max-width: 991.98px) {
    .ic-hero {
        padding: 30px 0 20px;
        border-radius: 0;
        margin-bottom: 1rem;
    }

    .ic-hero-title {
        font-size: 1.75rem;
    }

    .ic-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .ic-bg-glow {
        width: 150px;
        height: 150px;
    }

    .ic-particle {
        transform: scale(0.7);
    }
}

@media (max-width: 767.98px) {
    .ic-hero {
        padding: 20px 0 15px;
    }

    .ic-hero-title {
        font-size: 1.5rem;
    }

    .ic-hero-desc {
        font-size: 0.9rem;
    }

    .ic-bg-glow {
        width: 100px;
        height: 100px;
    }

    .ic-particle {
        transform: scale(0.5);
    }

    /* 결과가 표시될 때 hero 완전히 숨기기 */
    body:has(.results-container.show) .ic-hero,
    .results-container.show ~ .ic-hero,
    .main-content:has(.results-container.show) .ic-hero,
    body:has(.results-container.show) .hub-header,
    .results-container.show ~ .hub-header,
    .main-content:has(.results-container.show) .hub-header {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .ic-hero {
        padding: 15px 0 10px;
    }

    .ic-hero-title {
        font-size: 1.35rem;
    }

    .ic-badge {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .ic-bg-particles {
        display: none;
    }

    .ic-bg-glow {
        display: none;
    }
}

/* =================================================================== */
/* 🔥 SECTION: Gemini 스타일 모바일 디자인 END */

/* =================================================================== */
/* 🔥 SECTION: 분석 결과 요약 그리드 START */
/* =================================================================== */

.analysis-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .analysis-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.analysis-summary-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.analysis-summary-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-card-header i {
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-card-body {
    padding: 16px;
}

/* 지표 칩 스타일 */
.indicator-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.indicator-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.indicator-chip:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.indicator-chip .chip-name {
    font-weight: 600;
    color: #334155;
}

.indicator-chip .chip-period {
    font-size: 0.7rem;
    color: #667eea;
    background: #ede9fe;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

/* 매매 조건 리스트 스타일 */
.condition-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.condition-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border-left: 3px solid #94a3b8;
    transition: all 0.2s ease;
}

.condition-item:hover {
    transform: translateX(4px);
}

.condition-item.condition-buy {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.condition-item.condition-sell {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.condition-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.condition-buy .condition-badge {
    background: #10b981;
    color: white;
}

.condition-sell .condition-badge {
    background: #ef4444;
    color: white;
}

.condition-badge i {
    font-size: 0.65rem;
}

.condition-text {
    flex: 1;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}

/* 빈 상태 스타일 */
.summary-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.85rem;
}

.summary-empty i {
    opacity: 0.7;
}

/* 모바일 최적화 */
@media (max-width: 576px) {
    .analysis-summary-card {
        border-radius: 10px;
    }
    
    .summary-card-header {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .summary-card-body {
        padding: 12px;
    }
    
    .indicator-chip {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .indicator-chip .chip-period {
        font-size: 0.65rem;
        padding: 1px 5px;
    }
    
    .condition-item {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .condition-badge {
        align-self: flex-start;
    }
    
    .condition-text {
        font-size: 0.8rem;
    }
}

/* =================================================================== */
/* 🔥 SECTION: 분석 결과 요약 그리드 END */
/* =================================================================== */

/* =================================================================== */
/* 🔥 SECTION: IC 백테스팅 차트 탭 */
/* =================================================================== */

/* 차트 탭 컨테이너 */
.ic-chart-tabs-container {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

/* 차트 탭 네비게이션 */
.ic-backtest-chart-tabs {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 0;
    gap: 4px;
}

.ic-backtest-chart-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ic-backtest-chart-tabs .nav-link:hover {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
}

.ic-backtest-chart-tabs .nav-link.active {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.12);
    border-bottom: 3px solid #0d6efd;
    margin-bottom: -2px;
}

.ic-backtest-chart-tabs .nav-link i {
    font-size: 14px;
}

/* 차트 탭 콘텐츠 */
.ic-backtest-chart-content {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    min-height: 380px;
}

.ic-backtest-chart-content .tab-pane {
    padding: 16px;
}

/* 차트 컨테이너 */
.ic-chart-container {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ic-candle-chart,
.ic-equity-chart {
    width: 100%;
    height: 350px;
    min-height: 300px;
}

/* 탭 애니메이션 */
.ic-backtest-chart-content .tab-pane.fade {
    transition: opacity 0.15s ease-in-out;
}

.ic-backtest-chart-content .tab-pane.show {
    opacity: 1;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .ic-backtest-chart-tabs .nav-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ic-backtest-chart-tabs .nav-link i {
        font-size: 12px;
    }

    .ic-candle-chart,
    .ic-equity-chart {
        height: 280px;
        min-height: 250px;
    }

    .ic-backtest-chart-content {
        min-height: 320px;
    }

    .ic-backtest-chart-content .tab-pane {
        padding: 12px;
    }
}

/* 다크모드 지원 */
.dark-mode .ic-chart-tabs-container {
    border-top-color: #374151;
}

.dark-mode .ic-backtest-chart-tabs {
    border-bottom-color: #374151;
}

.dark-mode .ic-backtest-chart-tabs .nav-link {
    color: #9ca3af;
    background: #1f2937;
}

.dark-mode .ic-backtest-chart-tabs .nav-link:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.dark-mode .ic-backtest-chart-tabs .nav-link.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    border-bottom-color: #60a5fa;
}

.dark-mode .ic-backtest-chart-content {
    background: #111827;
    border-color: #374151;
}

.dark-mode .ic-chart-container {
    background: #1f2937;
}

/* =================================================================== */
/* 🔥 SECTION: IC 백테스팅 차트 탭 END */
/* =================================================================== */