        :root {
            --bg:        #ffffff;
            --bg-2:      #f8f9fb;
            --bg-3:      #f0f2f5;
            --border:    #e4e7ed;
            --text-1:    #0d1117;
            --text-2:    #4b5263;
            --text-3:    #8b92a5;
            --accent:    #2962ff;
            --accent-bg: #eef1ff;
            --green:     #089981;
            --green-bg:  #e6f4f1;
            --red:       #f23645;
            --gold:      #f5a623;
            --purple:    #7c3aed;
            --purple-bg: #f5f3ff;
            --orange:    #ea580c;
            --orange-bg: #fff7ed;
            --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
            --radius:    10px;
            --radius-sm: 6px;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'DM Sans', sans-serif;
            background: var(--bg-2);
            color: var(--text-1);
            min-height: 100vh;
            font-size: 15px;
        }

        /* ── HEADER ── */
        header {
            background: var(--bg); border-bottom: 1px solid var(--border);
            padding: 0 32px; height: 60px;
            display: flex; align-items: center; justify-content: space-between;
            position: sticky; top: 0; z-index: 100;
        }

        .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -0.3px; }

        .logo-icon {
            width: 32px; height: 32px; background: var(--accent);
            border-radius: 8px; display: flex; align-items: center; justify-content: center;
        }

        .market-badge { font-family: 'DM Mono', monospace; font-size: 12px; padding: 4px 10px; border-radius: 5px; font-weight: 500; }
        .market-switch { display: flex; gap: 4px; }
        .market-btn {
            padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border);
            background: var(--bg); cursor: pointer; font-weight: 500; font-size: 13px;
            color: var(--text-2); font-family: 'DM Sans', sans-serif; transition: all 0.15s;
        }
        .market-btn:hover { border-color: var(--text-3); color: var(--text-1); }
        .market-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
        @media (max-width: 480px) { .btn-label { display: none; } }
        .badge-green  { background: var(--green-bg); color: var(--green); }
        .badge-time   { background: var(--bg-3); color: var(--text-3); }

        /* ── SEARCH BAR (헤더 내) ── */
        .search-wrap {
            position: relative;
            width: 200px;
            box-sizing: border-box;
            background: var(--bg-2);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 3px 5px;
            display: flex;
            align-items: center;
        }

        .search-input {
            width: 100%;
            height: 30px;
            padding: 0 32px 0 10px;
            border: none;
            border-radius: var(--radius-sm);
            font-family: 'DM Sans', sans-serif;
            font-size: 13px; color: var(--text-1);
            background: transparent;
            outline: none;
        }

        .search-wrap:focus-within {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(41,98,255,0.1);
        }

        .search-input::placeholder { color: var(--text-3); }

        .search-icon {
            position: absolute; right: 8px; top: 50%;
            transform: translateY(-50%);
            color: var(--text-3); pointer-events: none; font-size: 13px;
        }

        /* 자동완성 드롭다운 */
        .search-dropdown {
            position: absolute; top: calc(100% + 6px); left: 0; right: 0;
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.12));
            z-index: 200; overflow: hidden; display: none;
            min-width: 260px;
        }

        .search-dropdown.open { display: block; }

        .search-item {
            padding: 10px 14px; cursor: pointer;
            display: flex; align-items: center; gap: 10px;
            border-bottom: 1px solid var(--border);
            transition: background 0.1s;
        }

        .search-item:last-child { border-bottom: none; }
        .search-item:hover { background: var(--accent-bg); }

        .search-item-ticker {
            font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500;
            background: var(--bg-3); border: 1px solid var(--border);
            padding: 2px 8px; border-radius: 4px; min-width: 56px; text-align: center;
        }

        .search-item-info { flex: 1; min-width: 0; }

        .search-item-name {
            font-size: 13px; font-weight: 500; color: var(--text-1);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }

        .search-item-sub {
            font-size: 11px; color: var(--text-3); margin-top: 1px;
            display: flex; gap: 8px;
        }

        .search-item-mcap { font-family: 'DM Mono', monospace; }

        .search-empty {
            padding: 16px 14px; text-align: center;
            font-size: 13px; color: var(--text-3);
        }

        .search-loading {
            padding: 14px; text-align: center;
            font-size: 12px; color: var(--text-3);
        }

        /* 검색 결과 모달 오버레이 - 비활성화 */
        .search-modal-overlay {
            display: none !important;
        }

        /* ── MAIN ── */
        main { max-width: 1400px; margin: 0 auto; padding: 28px 32px; }

        /* ── TABS ── */
        .tab-section { margin-bottom: 24px; }

    /* ── 메인 탭 (투자전략/시황분석) - 같은 그룹 pill 스타일 ── */
    .main-tab-bar {
        display: flex; gap: 0; margin-bottom: 0;
        background: var(--bg); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 4px;
        width: fit-content; box-shadow: var(--shadow);
    }
    .main-tab-btn {
        padding: 8px 18px; border-radius: var(--radius-sm); border: none;
        background: transparent; cursor: pointer; font-size: 13px; font-weight: 500;
        color: var(--text-2); font-family: 'DM Sans', sans-serif; transition: all 0.15s;
        display: flex; align-items: center; gap: 6px; white-space: nowrap;
    }
    .main-tab-btn:hover { background: var(--bg-3); color: var(--text-1); }
    .main-tab-btn.active { background: var(--accent); color: white; box-shadow: 0 2px 8px rgba(41,98,255,0.25); }
    .main-tab-btn#main-tab-strategy.active::after { content: ' ▾'; font-size: 10px; }

    /* ── 메인탭 + 서브탭 감싸는 래퍼 ── */
    .main-tab-wrap { margin-bottom: 20px; }

    /* ── 서브 전략 탭 (인라인 슬라이드다운) ── */
    .strategy-sub-section { display: none; margin-top: 6px; }
    .strategy-sub-section.visible { display: block; }

    /* 서브 탭바: 연한 파란 배경 */
    .tab-bar-sub {
        display: flex; gap: 4px; flex-wrap: wrap;
        background: #ffffff; border: 1px solid #c7d4ff;
        border-radius: var(--radius); padding: 4px;
        width: fit-content;
    }
    .tab-btn-sub {
        padding: 7px 14px; border: none; background: transparent;
        border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif;
        font-size: 12px; font-weight: 500; color: #4a6bcc;
        cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
        display: flex; align-items: center; gap: 5px;
    }
    .tab-btn-sub:hover { background: #dce8ff; color: #2962ff; }
    .tab-btn-sub.active { background: #5585ff; color: white; box-shadow: 0 1px 6px rgba(41,98,255,0.25); }
    /* ── 시황분석 탭 ── */
    .market-report-wrap { padding: 8px 0; }
    .report-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
    .report-type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; font-family: 'DM Sans', sans-serif; }
    .report-type-morning { background: #fff7ed; color: #c2410c; }
    .report-type-evening { background: #eef1ff; color: #2962ff; }
    .report-refresh-btn { padding: 5px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-2); font-family: 'DM Sans', sans-serif; transition: all 0.15s; display: flex; align-items: center; gap: 5px; }
    .report-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
    .report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
    .report-card { background: var(--bg); border: 1px solid var(--accent-bg); border-radius: 12px; overflow: hidden; }
    .report-card-full { grid-column: 1 / -1; }
    .report-card-header { padding: 14px 18px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
    .report-card-title { font-size: 13px; font-weight: 700; color: var(--text-1); }
    .report-card-body { padding: 16px 18px; }
    .report-section { margin-bottom: 16px; }
    .report-section:last-child { margin-bottom: 0; }
    .report-section-title { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
    .report-section-text { font-size: 13px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; }
    .report-loading { text-align: center; padding: 60px 0; color: var(--text-3); }
    .report-loading-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
    .report-empty { text-align: center; padding: 60px 0; color: var(--text-3); }
    .report-date { font-size: 11px; color: var(--text-3); font-family: 'DM Mono', monospace; }
    @media (max-width: 640px) { .report-grid { grid-template-columns: 1fr; } }

    /* ── 시황 메인 탭 (미국/매크로/섹터별) ── */
    .report-main-tabs {
        display: flex; gap: 4px; margin-bottom: 14px;
        border-bottom: 1px solid var(--border); padding-bottom: 0;
    }
    .report-main-tab {
        padding: 8px 16px; border: none; background: transparent;
        font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
        color: var(--text-2); cursor: pointer; border-radius: 6px 6px 0 0;
        border-bottom: 2px solid transparent; margin-bottom: -1px;
        transition: all 0.15s; display: flex; align-items: center; gap: 5px;
    }
    .report-main-tab:hover { color: var(--accent); background: var(--accent-bg); }
    .report-main-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

    /* ── 탭 패널 표시/숨김 ── */
    .report-tab-panel { display: block; }
    .report-tab-panel.hidden { display: none; }

    /* ── 섹터별 하위 탭 ── */
    .sector-report-tabs {
        display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px;
    }
    .sector-report-tab {
        padding: 5px 12px; border: 1px solid var(--border);
        background: var(--bg-2); border-radius: 20px;
        font-size: 12px; font-weight: 500; color: var(--text-2);
        cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
        white-space: nowrap;
    }
    .sector-report-tab:hover { border-color: var(--accent); color: var(--accent); }
    .sector-report-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
    .sector-report-panel { display: block; }
    .sector-report-panel.hidden { display: none; }
    .sector-report-body { padding-top: 4px; }

        .tab-label { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; display: block; }

        .tab-bar {
            display: flex; gap: 6px; flex-wrap: wrap;
            background: var(--bg); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 5px;
            width: fit-content; box-shadow: var(--shadow);
            margin-bottom: 0;
        }

        .tab-btn {
            padding: 9px 18px; border: none; background: transparent;
            border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif;
            font-size: 13px; font-weight: 500; color: var(--text-2);
            cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
            display: flex; align-items: center; gap: 6px;
        }

        .tab-btn:hover { background: var(--bg-3); color: var(--text-1); }

        .tab-btn.active { background: var(--accent); color: white; box-shadow: 0 2px 8px rgba(41,98,255,0.28); }

        /* 신규 탭 강조 */
        .tab-btn .new-badge {
            font-size: 9px; font-weight: 700; background: var(--red);
            color: white; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.3px;
        }

        /* ── STRATEGY DESC ── */
        .strategy-desc {
            margin-top: 14px; padding: 16px 20px;
            border-radius: var(--radius); display: flex;
            align-items: flex-start; gap: 14px;
        }

        .strategy-desc.blue   { background: #ffffff; border: 1px solid #c7d4ff; }
        .strategy-desc.green  { background: #ffffff; border: 1px solid #a7f3d0; }
        .strategy-desc.purple { background: #ffffff; border: 1px solid #ddd6fe; }
        .strategy-desc.orange { background: #ffffff; border: 1px solid #fed7aa; }

        .strategy-desc-icon { font-size: 24px; line-height: 1; margin-top: 1px; }

        .strategy-desc-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
        .strategy-desc.blue   .strategy-desc-title { color: var(--accent); }
        .strategy-desc.green  .strategy-desc-title { color: var(--green); }
        .strategy-desc.purple .strategy-desc-title { color: var(--purple); }
        .strategy-desc.orange .strategy-desc-title { color: var(--orange); }

        .strategy-desc-text { font-size: 14px; color: var(--text-2); line-height: 1.65; }

        /* 전략 태그 */
        .strategy-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

        .strategy-tag {
            font-size: 11px; font-weight: 600; padding: 2px 8px;
            border-radius: 4px; letter-spacing: 0.3px;
        }

        .tag-blue   { background: #dbeafe; color: #1d4ed8; }
        .tag-green  { background: #dcfce7; color: #15803d; }
        .tag-purple { background: #ede9fe; color: #6d28d9; }
        .tag-orange { background: #ffedd5; color: #c2410c; }
        .tag-gray   { background: var(--bg-3); color: var(--text-2); }

        /* ── GRID ── */
        .content-grid {
            display: flex;
            flex-direction: column;
            gap: 18px;
        }

        /* ── DETAIL PANEL (인라인, 리스트 위) ── */
        .detail-inline {
            display: none;
            gap: 0;
            border: 1px solid var(--accent-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
            background: var(--bg);
        }
        .detail-inline.open { display: flex; flex-direction: row; }

        /* ════════════════════════════════════════
           왼쪽: 종목 기본 정보
           ════════════════════════════════════════ */
        .detail-main {
            width: 300px;
            flex-shrink: 0;
            border-right: 1px solid var(--border);
            /* 내부 요소들이 세로로 꽉 채우도록 */
            display: flex;
            flex-direction: column;
        }

        /* ════════════════════════════════════════
           오른쪽: 가격 차트
           핵심 수정: flex column + min-height:0 으로
           부모 높이를 정확히 상속받게 함
           ════════════════════════════════════════ */
        .detail-chart-side {
            flex: 1;
            min-width: 0;
            min-height: 0;          /* ← 추가: flex 자식이 수축 가능하게 */
            display: flex;
            flex-direction: column;
        }

        @media (max-width: 800px) {
            .detail-inline.open { flex-direction: column; }
            .detail-chart-side { width: 100%; border-top: 1px solid var(--border); min-height: 280px; }
            .detail-main { border-right: none; }
        }

        /* ── CARD ── */
        .card { background: var(--bg); border: 1px solid var(--accent-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

        .card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

        .card-title { font-size: 14px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 8px; }

        .card-dot       { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
        .card-dot.green  { background: var(--green); }
        .card-dot.purple { background: var(--purple); }
        .card-dot.orange { background: var(--orange); }

        .card-meta { font-size: 13px; color: var(--text-3); font-family: 'DM Mono', monospace; }

        .bar-chart-wrap { padding: 20px 22px 22px; }

        /* ── TABLE ── */
        .table-wrap { overflow-x: auto; }
        table { width: 100%; border-collapse: collapse; }

        thead th {
            padding: 12px 18px; text-align: right;
            font-size: 12px; font-weight: 600; color: var(--text-3);
            background: var(--bg-2); border-bottom: 1px solid var(--border);
            white-space: nowrap; letter-spacing: 0.3px;
        }

        thead th:first-child,
        thead th:nth-child(2),
        thead th:nth-child(3),
        thead th:nth-child(4) { text-align: left; }

        tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
        tbody tr:last-child { border-bottom: none; }
        tbody tr:hover    { background: var(--accent-bg); }
        tbody tr.selected { background: var(--accent-bg); }

        td { padding: 13px 18px; text-align: right; font-size: 14px; }
        td:first-child  { text-align: center; width: 44px; }
        td:nth-child(2) { text-align: left; }
        td:nth-child(3) { text-align: left; }
        td:nth-child(4) { text-align: left; }

        .ticker-chip { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; background: var(--bg-3); border: 1px solid var(--border); padding: 3px 9px; border-radius: 5px; display: inline-block; }

        .company-name { font-size: 13px; color: var(--text-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

        .score-bar-wrap { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
        .score-bar { width: 72px; height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
        .score-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); }
        .score-num { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; color: var(--accent); min-width: 28px; }

        .val-pos { color: var(--green); font-family: 'DM Mono', monospace; font-size: 13px; }
        .val-neg { color: var(--red);   font-family: 'DM Mono', monospace; font-size: 13px; }
        .val-num { font-family: 'DM Mono', monospace; font-size: 13px; color: var(--text-2); }

        .rank-badge { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-3); }
        .rank-badge.top3 { color: var(--gold); font-weight: 600; }

        /* 비중 표시 */
        .weight-bar-wrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
        .weight-bar { width: 48px; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
        .weight-bar-fill { height: 100%; border-radius: 2px; background: var(--purple); }
        .weight-num { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--purple); min-width: 38px; }

        /* RSI 표시 */
        .rsi-chip {
            font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500;
            padding: 0 8px; border-radius: 4px;
            display: inline-block; line-height: 24px;
            vertical-align: middle;
        }
        .rsi-low  { background: #dcfce7; color: #15803d; }
        .rsi-mid  { background: #fef9c3; color: #854d0e; }
        .rsi-high { background: #fee2e2; color: #b91c1c; }

        /* ── SECTOR BADGE ── */
        .sector-badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
        .sec-technology         { background: #e8f0fe; color: #1a56db; }
        .sec-healthcare         { background: #e6f4f1; color: #047857; }
        .sec-financials         { background: #fef3c7; color: #92400e; }
        .sec-consumer-cyclical  { background: #fce7f3; color: #9d174d; }
        .sec-consumer-defensive { background: #f0fdf4; color: #166534; }
        .sec-industrials        { background: #f1f5f9; color: #334155; }
        .sec-energy             { background: #fff7ed; color: #c2410c; }
        .sec-communication      { background: #f5f3ff; color: #6d28d9; }
        .sec-real-estate        { background: #fdf4ff; color: #86198f; }
        .sec-utilities          { background: #ecfdf5; color: #065f46; }
        .sec-materials          { background: #fefce8; color: #854d0e; }
        .sec-unknown            { background: var(--bg-3); color: var(--text-3); }

        /* ── SECTOR FILTER ── */
        .filter-bar { padding: 12px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-2); }
        .filter-label { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; }
        .sector-filter-btn { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg); font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: 'DM Sans', sans-serif; }
        .sector-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
        .sector-filter-btn.active { border-color: var(--accent); background: var(--accent); color: white; }

        .detail-placeholder { padding: 56px 20px; text-align: center; color: var(--text-3); font-size: 14px; line-height: 1.9; }
        .detail-placeholder-icon { font-size: 38px; display: block; margin-bottom: 10px; }

        .detail-ticker-header { padding: 22px 22px 18px; }
        .detail-ticker-name { font-family: 'DM Mono', monospace; font-size: 28px; font-weight: 500; letter-spacing: -0.5px; }
        .detail-company { font-size: 14px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

        .detail-score-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
        .detail-score-big { font-family: 'DM Mono', monospace; font-size: 40px; font-weight: 500; color: var(--accent); line-height: 1; }
        .detail-score-label { font-size: 13px; color: var(--text-3); line-height: 1.6; }

        /* 메트릭 그리드 - 균일하게 */
        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1px;
            background: var(--border);
            border-top: 1px solid var(--border);
        }

        .metric-item {
            background: var(--bg);
            padding: 16px 18px;
            min-width: 0;
        }

        .metric-item-label {
            font-size: 11px; font-weight: 600; color: var(--text-3);
            letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px;
            white-space: nowrap;
        }

        .metric-item-value {
            font-family: 'DM Mono', monospace;
            font-size: 18px; font-weight: 500; color: var(--text-1);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            height: 28px;
            line-height: 28px;
        }

        /* 비중 패널 */
        .weight-panel { padding: 16px 22px; border-top: 1px solid var(--border); }
        .weight-panel-title { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 12px; }
        .weight-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
        .weight-row-label { font-size: 13px; color: var(--text-2); }
        .weight-row-val { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; }
        .weight-row-val.eq  { color: var(--accent); }
        .weight-row-val.cap { color: var(--purple); }

        /* ════════════════════════════════════════
           ── PRICE CHART (ECharts)
           ════════════════════════════════════════ */
        .chart-wrap {
            padding: 12px 16px 16px;
            position: relative; flex: 1; min-height: 0;
            display: flex; flex-direction: column; gap: 0;
        }
        .chart-controls {
            display: flex; align-items: center; gap: 10px;
            flex-wrap: wrap; margin-bottom: 10px;
        }
        .chart-btn-group { display: flex; gap: 3px; }
        .chart-btn {
            padding: 4px 10px; border: 1px solid var(--border);
            background: var(--bg-2); border-radius: 5px;
            font-family: 'DM Mono', monospace; font-size: 11px;
            font-weight: 500; color: var(--text-3);
            cursor: pointer; transition: all 0.12s;
        }
        .chart-btn:hover  { border-color: var(--accent); color: var(--accent); }
        .chart-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
        .ma-btn { font-size: 11px; padding: 4px 9px; border-radius: 5px; border: 1px solid; cursor: pointer; font-family: 'DM Mono', monospace; font-weight: 500; transition: all 0.12s; opacity: 0.4; }
        .ma-btn.active { opacity: 1; }
        .ma-5   { border-color:#f59e0b; color:#f59e0b; }   .ma-5.active   { background:#fef3c7; }
        .ma-20  { border-color:#3b82f6; color:#3b82f6; }   .ma-20.active  { background:#dbeafe; }
        .ma-60  { border-color:#8b5cf6; color:#8b5cf6; }   .ma-60.active  { background:#ede9fe; }
        .ma-120 { border-color:#ec4899; color:#ec4899; }   .ma-120.active { background:#fce7f3; }
        .ma-200 { border-color:#10b981; color:#10b981; }   .ma-200.active { background:#d1fae5; }
        .price-chart-container { position: relative; width: 100%; height: 300px; }
        .rsi-chart-container   { position: relative; width: 100%; height: 110px; margin-top: 4px; border-top: 1px solid var(--border); }
        .rsi-label { position: absolute; top: 6px; left: 6px; font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 600; color: var(--text-3); z-index: 2; pointer-events: none; }
        .chart-loading {
            display: flex; align-items: center; justify-content: center;
            height: 300px; gap: 10px; color: var(--text-3); font-size: 13px;
        }
        .spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }

        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
        tbody tr { animation: fadeIn 0.15s ease forwards; }

        @media (max-width: 500px) {
            .search-wrap { width: 120px; }
            .search-input::placeholder { opacity: 0; }
        }
        @media (max-width: 600px)  { main { padding: 12px; } .tab-bar { width: 100%; } }
        @media (max-width: 480px) {
            header { padding: 0 16px; height: 52px; }
            main { padding: 10px; }
            .tab-bar { gap: 4px; }
            .tab-btn { padding: 6px 10px; font-size: 12px; }
            .card-header { padding: 14px; }
            .search-wrap { width: 140px; }
        }

        /* ── INDEX TICKER STRIP ── */
        .index-strip {
            background: #ffffff; border: 1px solid var(--border);
            padding: 0 24px; height: 40px;
            display: flex; align-items: center;
            overflow-x: auto; overflow-y: hidden;
            -webkit-overflow-scrolling: touch; scrollbar-width: none;
            border-radius: 10px; margin-bottom: 16px;
        }
        .index-strip::-webkit-scrollbar { display: none; }
        .index-item {
            display: flex; align-items: center; gap: 7px;
            padding: 0 18px; border-right: 1px solid var(--border);
            white-space: nowrap; font-family: 'DM Mono', monospace; font-size: 12px;
            flex-shrink: 0;
        }
        .index-item:first-child { padding-left: 0; }
        .index-item:last-child  { border-right: none; }
        .index-label { color: var(--text-3); font-size: 11px; font-family: 'DM Sans', sans-serif; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
        .index-price { color: var(--text-1); font-weight: 600; }
        .index-chg.up   { color: var(--green); }
        .index-chg.down { color: var(--red); }
        .index-chg.flat { color: var(--text-3); }
        .fg-badge {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 2px 8px; border-radius: 20px;
            font-size: 11px; font-weight: 600; font-family: 'DM Sans', sans-serif;
        }
        .fg-extreme-fear  { background: #fee2e2; color: #b91c1c; }
        .fg-fear          { background: #ffedd5; color: #c2410c; }
        .fg-neutral       { background: #fef9c3; color: #854d0e; }
        .fg-greed         { background: #dcfce7; color: #15803d; }
        .fg-extreme-greed { background: #bbf7d0; color: #166534; }

        /* ── 차트 탭 + 토글 ── */
        .chart-tabs { display:flex; border-bottom:1px solid var(--border); margin-bottom:0; }
        .chart-tab { padding:10px 18px; border:none; background:transparent; font-family:'DM Sans',sans-serif; font-size:13px; font-weight:500; color:var(--text-3); cursor:pointer; border-bottom:2px solid transparent; transition:all 0.15s; }
        .chart-tab:hover { color:var(--text-1); }
        .chart-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
        .chart-toggle-bar { display:flex; gap:6px; padding:6px 14px; flex-wrap:wrap; border-bottom:1px solid var(--border); }
        .chart-toggle-btn { font-size:11px; font-family:'DM Sans',sans-serif; font-weight:600; padding:3px 10px; border-radius:20px; border:1.5px solid var(--border); cursor:pointer; background:var(--bg); color:var(--text-2); transition:all 0.15s; }
        .chart-toggle-btn.on  { background:var(--accent); color:#fff; border-color:var(--accent); }
        .chart-toggle-btn.off { background:var(--bg); color:var(--text-3); border-color:var(--border); }
        .chart-panel-extra { display:none; padding:8px 0; }
        .chart-panel-extra.active { display:block; }

        /* 재무제표 탭 버튼 */
        .fin-type-btn, .fin-sheet-btn {
            padding: 3px 10px; font-size: 11px; font-weight: 600;
            border: none; background: transparent; cursor: pointer;
            border-radius: 4px; color: var(--text-3); transition: all .15s;
        }
        .fin-type-btn.active, .fin-sheet-btn.active {
            background: #fff; color: var(--text-1);
            box-shadow: 0 1px 3px rgba(0,0,0,.1);
        }
        th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
        th.sortable:hover { color: var(--accent); }
        th.sortable .sort-icon { margin-left: 4px; font-size: 9px; opacity: 0.4; }
        th.sortable.asc  .sort-icon::after { content: '▲'; opacity: 1; color: var(--accent); }
        th.sortable.desc .sort-icon::after { content: '▼'; opacity: 1; color: var(--accent); }
        th.sortable:not(.asc):not(.desc) .sort-icon::after { content: '⇅'; }

/* ═══════════════════════════════════════════════════════════════════════
   쿠팡 파트너스 추천 도서 섹션 (2026-04-22)
   - content-grid 최하단에 자연스럽게 삽입
   - dim 톤 + 우상단 AD 레이블 + 공정위 고지 필수
   - 4열 그리드 (1024px 이하 2열, 600px 이하 숨김)
   ═══════════════════════════════════════════════════════════════════════ */
.affiliate-section {
    margin: 24px 22px 32px;
    padding: 20px 22px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
}
.affiliate-section::before {
    content: "AD";
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-3);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
}
.affiliate-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.8px;
    margin: 0 0 14px 0;
}
.affiliate-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.affiliate-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.affiliate-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.affiliate-card-icon {
    font-size: 22px;
    line-height: 1;
    opacity: 0.75;
    margin-bottom: 2px;
}
.affiliate-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.35;
}
.affiliate-card-meta {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
}
.affiliate-disclosure {
    margin: 14px 0 0 0;
    font-size: 10px;
    color: var(--text-3);
    line-height: 1.5;
}
@media (max-width: 1024px) {
    .affiliate-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .affiliate-section { display: none; }
}


/* 쿠팡 파트너스 공식 배너 컨테이너 (640x140 carousel) */
.affiliate-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 140px;
    overflow: hidden;
}
.affiliate-banner iframe {
    max-width: 100%;
    border-radius: 6px;
}

