
                

                /* ============================================================
                   로컬 폰트 (한글 및 영문 알파벳만 적용)
                   ============================================================ */

                /* 한글 + 영문 알파벳 */
                @font-face {
                    font-family: 'NotoSansKREmbedded';
                    src: url('../fonts/NotoSansKR.ttf') format('truetype');
                    font-weight: 100 900;
                    font-style: normal;
                    font-display: swap;
                    unicode-range:
                        U+0041-005A,
                        U+0061-007A,
                        U+00C0-00D6,
                        U+00D8-00F6,
                        U+00F8-024F,
                        U+1E00-1EFF,
                        U+1100-11FF,
                        U+3130-318F,
                        U+A960-A97F,
                        U+AC00-D7A3,
                        U+D7B0-D7FF,
                        U+FFA0-FFDC;
                }

                @font-face {
                    font-family: 'D2CodingEmbedded';
                    src: url('../fonts/D2Coding.ttf') format('truetype');
                    font-weight: 400;
                    font-style: normal;
                    font-display: swap;
                    unicode-range:
                        U+0041-005A,
                        U+0061-007A,
                        U+00C0-00D6,
                        U+00D8-00F6,
                        U+00F8-024F,
                        U+1E00-1EFF,
                        U+1100-11FF,
                        U+3130-318F,
                        U+A960-A97F,
                        U+AC00-D7A3,
                        U+D7B0-D7FF,
                        U+FFA0-FFDC;
                }

                @font-face {
                    font-family: 'D2CodingEmbedded';
                    src: url('../fonts/D2Coding-Bold.ttf') format('truetype');
                    font-weight: 700;
                    font-style: normal;
                    font-display: swap;
                    unicode-range:
                        U+0041-005A,
                        U+0061-007A,
                        U+00C0-00D6,
                        U+00D8-00F6,
                        U+00F8-024F,
                        U+1E00-1EFF,
                        U+3130-318F,
                        U+A960-A97F,
                        U+AC00-D7A3,
                        U+D7B0-D7FF,
                        U+FFA0-FFDC;
                }

                @font-face {
                    font-family: 'NotoColorEmojiEmbedded';
                    src: url('../fonts/NotoColorEmoji.ttf') format('truetype');
                    font-weight: 400;
                    font-style: normal;
                    font-display: swap;
                }

                @font-face {
                    font-family: 'NotoColorEmojiIOSEmbedded';
                    src: url('../fonts/NotoColorEmoji_iOS.ttf') format('truetype');
                    font-weight: 400;
                    font-style: normal;
                    font-display: swap;
                }

                :root {
                    --emoji-font-family: 'NotoColorEmojiEmbedded';
                }

                .flag-emoji {
                    font-family: var(--emoji-font-family, 'NotoColorEmojiEmbedded'), 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif !important;
                    -webkit-text-fill-color: initial !important;
                }

                .general-emoji {
                    font-family: var(--emoji-font-family, 'NotoColorEmojiEmbedded'), 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif !important;
                    -webkit-text-fill-color: initial !important;
                }

                * { 
                    box-sizing: border-box; 
                    touch-action: manipulation;
                }

                button, input, select, textarea, optgroup, option {
                    font-family: inherit;
                }

                html {
                    overflow-x: hidden;
                    width: 100%;
                }

                body { 
                    font-family: 'NotoSansKREmbedded', 'D2CodingEmbedded', sans-serif; 
                    margin: 0; 
                    padding: 0 0 90px 0;
                    background-color: #f4f6f8; 
                    color: #333; 
                    transition: background-color 0.3s, color 0.3s;
                    overflow-x: hidden;
                    width: 100%;
                    max-width: 100vw;
                    --cy-zoom: 1;
                }

                body.font-d2coding {
                    font-family: 'D2CodingEmbedded', 'NotoSansKREmbedded', monospace;
                }
                
                .sticky-navbar {
                    position: sticky;
                    top: 0;
                    z-index: 1000;
                    background: rgba(255, 255, 255, 0.95);
                    backdrop-filter: blur(8px);
                    border-bottom: 1px solid #e0e0e0;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
                    padding: 14px 20px;
                    transition: background-color 0.3s, border-color 0.3s;
                }
                
                .nav-container {
                    max-width: 1500px;
                    margin: 0 auto;
                    display: flex;
                    flex-direction: column;
                    gap: 12px;
                    min-width: 0;
                }
                
                .header-title {
                    font-size: 25px;
                    font-weight: 800;
                    letter-spacing: -0.5px;
                    margin: 0;
                    display: flex;
                    align-items: center;
                    gap: 6px;
                    flex-wrap: wrap;
                    word-break: keep-all;
                }

                .title-text {
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }
                
                .controls {
                    position: relative;
                    display: flex;
                    gap: 10px;
                    align-items: center;
                    flex-wrap: wrap;
                    min-width: 0;
                }

                .search-country-wrapper {
                    position: relative;
                    flex: none;
                }

                #searchCountryBtn {
                    padding: 12px 14px;
                    white-space: nowrap;
                }

                .search-input-wrapper {
                    position: relative;
                    flex: 1 1 180px;
                    min-width: 0;
                }

                .search-input-wrapper input {
                    width: 100%;
                }
                
                input {
                    flex: 1;
                    padding: 12px 16px;
                    font-size: 18px;
                    font-weight: 500;
                    font-family: inherit;
                    border-radius: 10px;
                    border: 2px solid #007bff;
                    outline: none;
                    background-color: #ffffff;
                    color: #111;
                    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
                    transition: background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
                    min-width: 0;
                }
                
                input:focus {
                    border-color: #0056b3;
                    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.3);
                }

                .search-results-list {
                    position: absolute;
                    top: calc(100% + 6px);
                    left: 0;
                    width: max-content;
                    max-width: calc(90vw / var(--cy-zoom, 1));
                    background: #ffffff;
                    border: 1px solid #007bff;
                    border-radius: 10px;
                    max-height: 280px;
                    overflow-y: auto;
                    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
                    z-index: 2000;
                    display: none;
                }

                .search-result-item {
                    padding: 12px 16px;
                    cursor: pointer;
                    border-bottom: 1px solid #f0f0f0;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    font-size: 17px;
                    transition: background-color 0.2s;
                    gap: 20px;
                    white-space: nowrap;
                }

                .search-result-item:last-child {
                    border-bottom: none;
                }

                .search-result-item:hover {
                    background-color: #eef6ff;
                }

                .search-result-item .item-name {
                    font-weight: 600;
                    color: #333;
                }

                .search-result-item .item-ticker {
                    font-size: 0.85em;
                    color: #007bff;
                    font-weight: 700;
                }
                
                button {
                    padding: 12px 20px;
                    font-size: 17px;
                    font-weight: 700;
                    font-family: inherit;
                    border-radius: 10px;
                    border: none;
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: white;
                    cursor: pointer;
                    white-space: nowrap;
                    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
                    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
                    touch-action: manipulation;
                }
                
                button:hover { 
                    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
                    transform: translateY(-1px);
                    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
                }

                .welcome-box {
                    text-align: center;
                    padding: 50px 24px;
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 16px;
                    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
                    margin-top: 20px;
                    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
                    max-width: 100%;
                    overflow-wrap: break-word;
                    word-break: keep-all;
                }

                .welcome-icon {
                    font-size: 66px;
                    margin-bottom: 12px;
                    display: inline-block;
                    animation: pulse 2s infinite ease-in-out;
                }

                .welcome-title {
                    font-size: 37px;
                    font-weight: 900;
                    margin: 0 0 10px 0;
                    letter-spacing: -1px;
                    background: linear-gradient(135deg, #007bff 0%, #00d2ff 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                    line-height: 1.2;
                }

                .welcome-subtitle {
                    font-size: 18px;
                    color: #666;
                    margin: 0 0 28px 0;
                    font-weight: 500;
                    transition: color 0.3s;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                }

                .btn-start-view {
                    font-size: 18px;
                    font-weight: 700;
                    font-family: inherit;
                    padding: 14px 28px;
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: #ffffff;
                    border-radius: 30px;
                    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.35);
                    border: none;
                    cursor: pointer;
                    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
                    max-width: 100%;
                }
                
                .btn-start-view:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.45);
                    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
                }

                /* ★ 환영 페이지 버튼 가로 배치 (전체 리스트 / 최근 업데이트) */
                .welcome-btn-row {
                    display: flex;
                    flex-wrap: wrap;
                    gap: 12px;
                    justify-content: center;
                    align-items: center;
                    margin: 0;
                }

                /* ★ 첫 화면 버튼 색상 (하단 목록 버튼과 동일): 전체=초록 / 최신=파랑 / 관심=노랑 */
                .btn-start-view.btn-start-all {
                    background: #28a745;
                    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
                }

                .btn-start-view.btn-start-all:hover {
                    background: #218838;
                    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.45);
                }

                .btn-start-view.btn-start-recent {
                    background: #007bff;
                    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.35);
                }

                .btn-start-view.btn-start-recent:hover {
                    background: #0056b3;
                    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.45);
                }

                .btn-start-view.btn-start-favorite {
                    background: #ffc107;
                    color: #212529;
                    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
                }

                .btn-start-view.btn-start-favorite:hover {
                    background: #e0a800;
                    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
                }

                body.dark-mode .btn-start-view.btn-start-all {
                    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
                    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
                }

                body.dark-mode .btn-start-view.btn-start-all:hover {
                    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
                }

                body.dark-mode .btn-start-view.btn-start-recent {
                    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
                }

                body.dark-mode .btn-start-view.btn-start-recent:hover {
                    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
                }

                body.dark-mode .btn-start-view.btn-start-favorite {
                    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
                    color: #1f2937;
                    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.35);
                }

                body.dark-mode .btn-start-view.btn-start-favorite:hover {
                    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
                }

                @media (max-width: 640px) {
                    .welcome-btn-row {
                        flex-direction: column;
                        width: 100%;
                    }
                    .welcome-btn-row .btn-start-view {
                        width: 100%;
                    }
                }

                .welcome-generated-at {
                    margin-top: 14px;
                    font-size: 16px;
                    color: #888;
                    font-weight: 500;
                    letter-spacing: -0.2px;
                    font-family: inherit;
                    transition: color 0.3s;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                }

                body.dark-mode .welcome-generated-at {
                    color: #94a3b8;
                }

                .btn-view-log {
                    display: inline-block;
                    margin-top: 28px;
                    padding: 10px 22px;
                    font-size: 16px;
                    font-weight: 600;
                    font-family: inherit;
                    background: #f1f3f5 !important;
                    color: #495057 !important;
                    border: 1px solid #ced4da !important;
                    border-radius: 8px;
                    cursor: pointer;
                    box-shadow: none !important;
                    transition: background-color 0.2s, color 0.2s;
                    background-image: none !important;
                }

                .btn-view-log:hover {
                    background: #e9ecef !important;
                    color: #212529 !important;
                    transform: none !important;
                    box-shadow: none !important;
                }

                body.dark-mode .btn-view-log {
                    background: #1e293b !important;
                    color: #cbd5e1 !important;
                    border-color: #334155 !important;
                }

                body.dark-mode .btn-view-log:hover {
                    background: #334155 !important;
                    color: #f1f5f9 !important;
                }

                @keyframes pulse {
                    0% { transform: scale(1); }
                    50% { transform: scale(1.05); }
                    100% { transform: scale(1); }
                }

                .welcome-chart-container {
                    margin-top: 32px;
                    padding: 16px 4px 4px 4px;
                    border-top: 1px dashed #e0e0e0;
                    width: 100%;
                    height: 440px;
                    min-height: 260px;
                    max-height: 560px;
                    position: relative;
                    transition: border-color 0.3s;
                }

                @media (max-width: 640px) {
                    .welcome-chart-container {
                        height: 340px;
                        min-height: 220px;
                        max-height: 440px;
                    }
                }

                body.dark-mode .welcome-chart-container {
                    border-top-color: #334155;
                }

                .progress-chart-container {
                    margin-top: 32px;
                    padding: 22px 16px 12px 16px;
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 10px;
                    transition: background-color 0.3s, border-color 0.3s;
                    max-width: 100%;
                    overflow: hidden;
                }

                body.dark-mode .progress-chart-container {
                    background: #0f172a;
                    border-color: #334155;
                }

                .progress-chart-title {
                    font-size: 20px;
                    font-weight: 800;
                    margin: 0 0 18px 0;
                    color: #1a1a1a;
                    text-align: center;
                    letter-spacing: -0.3px;
                    font-family: inherit;
                    word-break: keep-all;
                }

                body.dark-mode .progress-chart-title {
                    color: #f8fafc;
                }

                .progress-charts-row {
                    display: flex;
                    flex-wrap: nowrap;
                    gap: 10px;
                    justify-content: center;
                    align-items: stretch;
                    width: 100%;
                }

                .progress-chart-item {
                    flex: 1 1 0;
                    min-width: 0;
                    width: 0;
                    aspect-ratio: 1 / 1.15;
                    min-height: 160px;
                    max-height: 320px;
                    position: relative;
                }

                .progress-chart-center-emoji {
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    transform: translate(-50%, -50%);
                    font-size: 18pt;
                    line-height: 1;
                    pointer-events: none;
                    z-index: 5;
                    white-space: nowrap;
                    text-align: center;
                    -webkit-text-fill-color: initial !important;
                }

                @media (max-width: 640px) {
                    .progress-charts-row {
                        gap: 4px;
                    }
                    .progress-chart-title {
                        font-size: 16px;
                        margin-bottom: 10px;
                    }
                    .progress-chart-container {
                        padding: 12px 6px 6px 6px;
                        margin-top: 20px;
                    }
                    .progress-chart-item {
                        min-height: 110px;
                    }
                }

                @media (max-width: 400px) {
                    .progress-charts-row {
                        gap: 2px;
                    }
                    .progress-chart-container {
                        padding: 10px 4px 4px 4px;
                    }
                }

                .rating-criteria-container {
                    margin-top: 32px;
                    padding: 20px;
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 10px;
                    text-align: left;
                    transition: background-color 0.3s, border-color 0.3s;
                    max-width: 100%;
                    overflow: hidden;
                }

                body.dark-mode .rating-criteria-container {
                    background: #0f172a;
                    border-color: #334155;
                }

                .rating-criteria-title {
                    font-size: 20px;
                    font-weight: 800;
                    margin: 0 0 14px 0;
                    color: #1a1a1a;
                    text-align: center;
                    letter-spacing: -0.3px;
                    font-family: inherit;
                }

                body.dark-mode .rating-criteria-title {
                    color: #f8fafc;
                }

                .rating-criteria-table {
                    width: 100%;
                    border-collapse: collapse;
                    font-size: 17px;
                    font-family: inherit;
                    table-layout: fixed;
                }

                .rating-criteria-table th,
                .rating-criteria-table td {
                    border: 1px solid #dee2e6;
                    padding: 10px 12px;
                    text-align: center;
                    vertical-align: middle;
                    font-family: inherit;
                    word-break: keep-all;
                }

                .rating-criteria-table th {
                    background: #f0f6ff;
                    color: #0056b3;
                    font-weight: 700;
                    font-size: 17px;
                }

                .rating-criteria-table td {
                    color: #333;
                    font-weight: 500;
                }

                .rating-criteria-table .rating-cell {
                    font-weight: 800;
                    color: #007bff;
                    width: 18%;
                    white-space: nowrap;
                    font-size: 18px;
                }
                
                .rating-criteria-table .rating-cell.low {
                    color: #f83838;
                }

                .rating-criteria-table .rating-cell.top {
                    color: #16a34a;
                }

                .rating-criteria-table .rating-cell.zero {
                    color: #000000;
                }

                .rating-criteria-table tbody tr.rating-row-top {
                    background: #ecfdf5;
                }
                .rating-criteria-table tbody tr.rating-row-mid {
                    background: #fefce8;
                }
                .rating-criteria-table tbody tr.rating-row-low {
                    background: #fef2f2;
                }
                .rating-criteria-table tbody tr.rating-row-none {
                    background: #f1f5f9;
                }

                .rating-criteria-table tbody tr.group-start td {
                    border-top: 3px solid #334155;
                }
                .rating-criteria-table tbody tr.group-end td {
                    border-bottom: 3px solid #334155;
                }

                .rating-criteria-table tbody tr.rating-row-top td:first-child {
                    border-left: 6px solid #16a34a;
                }
                .rating-criteria-table tbody tr.rating-row-mid td:first-child {
                    border-left: 6px solid #ca8a04;
                }
                .rating-criteria-table tbody tr.rating-row-low td:first-child {
                    border-left: 6px solid #dc2626;
                }
                .rating-criteria-table tbody tr.rating-row-none td:first-child {
                    border-left: 6px solid #64748b;
                }

                body.dark-mode .rating-criteria-table tbody tr.rating-row-top {
                    background: rgba(22, 163, 74, 0.14);
                }
                body.dark-mode .rating-criteria-table tbody tr.rating-row-mid {
                    background: rgba(202, 138, 4, 0.14);
                }
                body.dark-mode .rating-criteria-table tbody tr.rating-row-low {
                    background: rgba(220, 38, 38, 0.14);
                }
                body.dark-mode .rating-criteria-table tbody tr.rating-row-none {
                    background: rgba(100, 116, 139, 0.12);
                }

                body.dark-mode .rating-criteria-table tbody tr.group-start td {
                    border-top-color: #64748b;
                }
                body.dark-mode .rating-criteria-table tbody tr.group-end td {
                    border-bottom-color: #64748b;
                }

                body.dark-mode .rating-criteria-table th,
                body.dark-mode .rating-criteria-table td {
                    border-color: #334155;
                }

                body.dark-mode .rating-criteria-table th {
                    background: #1e3a5f;
                    color: #38bdf8;
                }

                body.dark-mode .rating-criteria-table td {
                    color: #e2e8f0;
                }

                body.dark-mode .rating-criteria-table .rating-cell {
                    color: #f8b238;
                }
                
                body.dark-mode .rating-criteria-table .rating-cell.low {
                    color: #f83838;
                }

                body.dark-mode .rating-criteria-table .rating-cell.top {
                    color: #4ade80;
                }

                body.dark-mode .rating-criteria-table .rating-cell.zero {
                    color: #ffffff;
                }

                /* ★ 평점 버튼 클릭 시: 기준표에서 해당 종목의 평점 셀 하이라이트 */
                .rating-criteria-table tbody tr td.rating-cell.rating-cell-active {
                    color: #ffffff;
                    background: #2563eb;
                    font-weight: 900;
                    outline: 3px solid #0f172a;
                    outline-offset: -3px;
                    animation: ratingCellPulse 1s ease-in-out 3;
                }

                .rating-criteria-table tbody tr.rating-row-top td.rating-cell.rating-cell-active {
                    background: #16a34a;
                    color: #ffffff;
                }
                .rating-criteria-table tbody tr.rating-row-mid td.rating-cell.rating-cell-active {
                    background: #eab308;
                    color: #422006;
                }
                .rating-criteria-table tbody tr.rating-row-low td.rating-cell.rating-cell-active {
                    background: #dc2626;
                    color: #ffffff;
                }
                .rating-criteria-table tbody tr.rating-row-none td.rating-cell.rating-cell-active {
                    background: #475569;
                    color: #ffffff;
                }

                body.dark-mode .rating-criteria-table tbody tr td.rating-cell.rating-cell-active {
                    outline-color: #f8fafc;
                }

                @keyframes ratingCellPulse {
                    0%, 100% { filter: brightness(1); }
                    50% { filter: brightness(1.3); }
                }

                @media (max-width: 640px) {
                    .rating-criteria-table th,
                    .rating-criteria-table td {
                        padding: 8px 6px;
                        font-size: 15px;
                    }
                    .rating-criteria-table .rating-cell {
                        font-size: 16px;
                        width: 14%;
                    }
                    .rating-criteria-title {
                        font-size: 18px;
                    }
                    .rating-criteria-container {
                        padding: 14px 10px;
                        margin-top: 24px;
                    }
                }

                /* ============================================================
                   ★ 그룹 분류표 (그룹 기준표)
                   ============================================================ */
                .group-criteria-container {
                    margin-top: 32px;
                    padding: 20px;
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 10px;
                    text-align: left;
                    transition: background-color 0.3s, border-color 0.3s;
                    max-width: 100%;
                    overflow: hidden;
                }

                body.dark-mode .group-criteria-container {
                    background: #0f172a;
                    border-color: #334155;
                }

                .group-criteria-title {
                    font-size: 20px;
                    font-weight: 800;
                    margin: 0 0 14px 0;
                    color: #1a1a1a;
                    text-align: center;
                    letter-spacing: -0.3px;
                    font-family: inherit;
                }

                body.dark-mode .group-criteria-title {
                    color: #f8fafc;
                }

                .group-criteria-table {
                    width: 100%;
                    border-collapse: collapse;
                    font-size: 16px;
                    font-family: inherit;
                    table-layout: fixed;
                }

                .group-criteria-table th,
                .group-criteria-table td {
                    border: 1px solid #dee2e6;
                    padding: 10px 12px;
                    text-align: left;
                    vertical-align: middle;
                    font-family: inherit;
                    word-break: keep-all;
                }

                .group-criteria-table th {
                    background: #f0f6ff;
                    color: #0056b3;
                    font-weight: 700;
                    font-size: 16px;
                    text-align: center;
                }

                .group-criteria-table td {
                    color: #333;
                    font-weight: 500;
                    line-height: 1.55;
                }

                .group-criteria-table td.group-name-cell {
                    font-weight: 800;
                    color: #007bff;
                    width: 30%;
                    white-space: nowrap;
                    text-align: center;
                }

                body.dark-mode .group-criteria-table th,
                body.dark-mode .group-criteria-table td {
                    border-color: #334155;
                }

                body.dark-mode .group-criteria-table th {
                    background: #1e3a5f;
                    color: #38bdf8;
                }

                body.dark-mode .group-criteria-table td {
                    color: #e2e8f0;
                }

                body.dark-mode .group-criteria-table td.group-name-cell {
                    color: #f8b238;
                }

                /* ★ 그룹 셀 하이라이트 (해당 종목의 그룹) */
                .group-criteria-table tbody tr td.group-name-cell.group-cell-active {
                    color: #ffffff;
                    background: #2563eb;
                    font-weight: 900;
                    outline: 3px solid #0f172a;
                    outline-offset: -3px;
                    animation: ratingCellPulse 1s ease-in-out 3;
                }

                body.dark-mode .group-criteria-table tbody tr td.group-name-cell.group-cell-active {
                    outline-color: #f8fafc;
                }

                @media (max-width: 640px) {
                    .group-criteria-table th,
                    .group-criteria-table td {
                        padding: 8px 6px;
                        font-size: 14px;
                    }
                    .group-criteria-table td.group-name-cell {
                        width: 38%;
                        white-space: normal;
                    }
                    .group-criteria-title {
                        font-size: 18px;
                    }
                    .group-criteria-container {
                        padding: 14px 10px;
                        margin-top: 24px;
                    }
                }

                .bottom-navbar {
                    position: fixed;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    z-index: 1000;
                    background: rgba(255, 255, 255, 0.95);
                    backdrop-filter: blur(8px);
                    border-top: 1px solid #e0e0e0;
                    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
                    padding: 12px 20px;
                    transition: background-color 0.3s, border-color 0.3s;
                }

                .bottom-nav-container {
                    max-width: 1500px;
                    margin: 0 auto;
                    display: flex;
                    gap: 10px;
                    justify-content: space-between;
                    align-items: center;
                }

                .bottom-nav-container button {
                    padding: 12px 16px;
                    font-size: 17px;
                    font-family: inherit;
                }

                /* ★ 이전/다음 버튼만 남는 공간을 채움 */
                .bottom-nav-container button.nav-btn {
                    flex: 1;
                }

                /* ★ 목록 버튼 2개는 내용 크기만큼만 차지 */
                .bottom-nav-container button.list-btn {
                    flex: 0 0 auto;
                    padding: 12px 14px;
                    font-size: 15px;
                    white-space: nowrap;
                }

                button.nav-btn { background-color: #6c757d; }
                button.nav-btn:hover { background-color: #5a6268; }
                button.list-btn { background: #28a745; box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); }
                button.list-btn:hover { background: #218838; box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4); }

                /* ★ 이전/다음 버튼 비활성화 상태 (라이트 모드) */
                button.nav-btn:disabled,
                button.nav-btn:disabled:hover {
                    background: #adb5bd;
                    color: #f1f3f5;
                    cursor: not-allowed;
                    opacity: 0.55;
                    transform: none;
                    box-shadow: none;
                }

                /* ★ 최신 목록 버튼 - 파란색 */
                button.list-btn.recent-list-btn { background: #007bff; box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); }
                button.list-btn.recent-list-btn:hover { background: #0056b3; box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4); }

                /* ★ 관심 목록 버튼 - 노란색 */
                button.list-btn.favorite-list-btn { background: #ffc107; color: #212529; box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4); }
                button.list-btn.favorite-list-btn:hover { background: #e0a800; box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5); }

                @media (max-width: 640px) {
                    .bottom-navbar { padding: 10px 8px; }
                    .bottom-nav-container { gap: 4px; }
                    .bottom-nav-container button { padding: 10px 6px; font-size: 13px; }
                    .bottom-nav-container button.nav-btn { min-width: 0; }
                    .bottom-nav-container button.list-btn { padding: 10px 6px; font-size: 13px; }
                }

                @media (max-width: 340px) {
                    .bottom-nav-container button { padding: 10px 4px; font-size: 12px; }
                    .bottom-nav-container button.list-btn { padding: 10px 4px; font-size: 12px; }
                }

                .container {
                    max-width: 1500px;
                    margin: 20px auto;
                    padding: 0 20px 20px;
                    width: 100%;
                }
                
                .card {
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 8px;
                    padding: 15px;
                    margin-bottom: 12px;
                    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
                    transition: background-color 0.3s, border-color 0.3s;
                }

                .inline-group-card {
                    display: flex;
                    flex-wrap: nowrap;
                    gap: 12px;
                    align-items: stretch;
                    margin-bottom: 12px;
                }

                .inline-field-item {
                    display: flex;
                    flex-direction: column;
                    flex: 1 1 0px;
                    width: 0;
                    min-width: 0;
                    background: #f8f9fa;
                    border: 1px solid #e9ecef;
                    border-radius: 6px;
                    padding: 10px 12px;
                    transition: background-color 0.3s, border-color 0.3s;
                }
                
                .card.highlight-card {
                    background-color: #eef6ff;
                    border: 1px solid #e0e0e0;
                    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
                }
                
                .card.highlight-card .field-title {
                    color: #0056b3;
                    font-size: 0.95em;
                }
                
                .card.highlight-card .field-value {
                    font-weight: bold;
                    font-size: 1.15em;
                    color: #004085;
                }

                .inline-field-item.highlight-item {
                    background: #e6f0ff;
                    border-color: #e9ecef;
                }

                .inline-field-item.highlight-item .field-title {
                    color: #0056b3;
                    font-size: 0.95em;
                }

                .inline-field-item.highlight-item .field-value {
                    font-weight: bold;
                    font-size: 1.15em;
                    color: #004085;
                }

                .card.has-focus-toggle {
                    background-color: #eef6ff;
                    border: 1px solid #e0e0e0;
                    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
                }

                .card.has-focus-toggle .field-title {
                    color: #0056b3;
                    font-size: 0.95em;
                    font-weight: bold;
                }

                .inline-field-item.has-focus-toggle {
                    background: #e6f0ff;
                    border-color: #e9ecef;
                }

                .inline-field-item.has-focus-toggle .field-title {
                    color: #0056b3;
                    font-size: 0.95em;
                    font-weight: bold;
                }

                .focus-toggle-trigger {
                    display: block;
                    transition: color 0.2s, transform 0.2s;
                    position: relative;
                    padding-right: 18px;
                }

                .focus-toggle-trigger::after {
                    content: '⤢';
                    position: absolute;
                    right: 0;
                    top: 50%;
                    transform: translateY(-50%);
                    font-size: 0.85em;
                    opacity: 0.55;
                    font-weight: 700;
                }

                .focus-toggle-trigger:hover {
                    color: #004085 !important;
                    text-decoration: underline;
                }

                body.dark-mode .card.has-focus-toggle {
                    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
                    border: 1px solid #334155;
                    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
                }

                body.dark-mode .card.has-focus-toggle .field-title { color: #38bdf8; }

                body.dark-mode .inline-field-item.has-focus-toggle {
                    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
                    border: 1px solid #334155;
                }

                body.dark-mode .inline-field-item.has-focus-toggle .field-title { color: #38bdf8; }

                .field-title { font-weight: bold; color: #666; font-size: 0.85em; transition: color 0.3s; font-family: inherit; }
                .field-value { font-size: 1.05em; margin-top: 6px; word-break: break-all; white-space: pre-wrap; color: #222; transition: color 0.3s; font-family: inherit; }

                .field-value.markdown-value {
                    font-weight: normal;
                    font-size: 1em;
                    line-height: 1.65;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                    white-space: normal;
                }

                .card.highlight-card .field-value.markdown-value,
                .inline-field-item.highlight-item .field-value.markdown-value {
                    font-weight: normal;
                    font-size: 1em;
                }

                .card.highlight-card:has(> .field-value.markdown-value) {
                    padding: 0;
                    overflow: hidden;
                }

                .card.highlight-card:has(> .field-value.markdown-value) > .field-title {
                    margin: 0;
                    padding: 12px 16px;
                    background: linear-gradient(135deg, #eaf2ff 0%, #dbe9ff 100%);
                    border-bottom: 1px solid #cfe0f5;
                    color: #0056b3;
                    font-size: 0.85em;
                    letter-spacing: 0.2px;
                }

                .card.highlight-card:has(> .field-value.markdown-value) > .field-value.markdown-value {
                    margin: 0;
                    padding: 16px;
                    background: #ffffff;
                    border-radius: 0 0 8px 8px;
                }

                .markdown-body {
                    white-space: normal !important;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                    line-height: 1.65;
                    font-family: inherit;
                }
                .markdown-body > *:first-child { margin-top: 0 !important; }
                .markdown-body > *:last-child { margin-bottom: 0 !important; }
                .markdown-body h1, .markdown-body h2, .markdown-body h3,
                .markdown-body h4, .markdown-body h5, .markdown-body h6 {
                    margin: 14px 0 6px 0;
                    font-weight: 700;
                    line-height: 1.4;
                    color: #1a1a1a;
                    font-family: inherit;
                }
                .markdown-body h1 { font-size: 1.3em; }
                .markdown-body h2 { font-size: 1.2em; }
                .markdown-body h3 { font-size: 1.1em; }
                .markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1.02em; }
                .markdown-body p { margin: 0 0 8px 0; font-weight: normal; }
                .markdown-body p:last-child { margin-bottom: 0; }
                .markdown-body strong, .markdown-body b { font-weight: 700; }
                .markdown-body em, .markdown-body i { font-style: italic; font-weight: normal; }
                .markdown-body ul, .markdown-body ol { padding-left: 22px; margin: 4px 0 10px 0; }
                .markdown-body li { margin: 3px 0; font-weight: normal; }
                .markdown-body li > ul, .markdown-body li > ol { margin: 3px 0; }
                .markdown-body hr { border: none; border-top: 1px solid #dee2e6; margin: 12px 0; }
                .markdown-body a { color: #0056b3; text-decoration: underline; word-break: break-all; }
                .markdown-body code {
                    background: rgba(0, 0, 0, 0.06);
                    border-radius: 4px;
                    padding: 1px 5px;
                    font-family: 'D2CodingEmbedded';
                    font-size: 0.9em;
                    font-weight: normal;
                    word-break: break-word;
                }
                .markdown-body pre {
                    background: rgba(0, 0, 0, 0.06);
                    border-radius: 6px;
                    padding: 10px 12px;
                    overflow-x: auto;
                    margin: 6px 0 10px 0;
                    font-family: 'D2CodingEmbedded';
                }
                .markdown-body pre code { background: none; padding: 0; font-family: inherit; }
                .markdown-body table { border-collapse: collapse; width: 100%; margin: 6px 0 10px 0; font-size: 0.95em; font-family: inherit; }
                .markdown-body th, .markdown-body td {
                    border: 1px solid #dee2e6;
                    padding: 6px 8px;
                    text-align: left;
                    font-weight: normal;
                    font-family: inherit;
                }
                .markdown-body th { background: rgba(0, 0, 0, 0.04); font-weight: 700; }
                .markdown-body blockquote {
                    margin: 8px 0;
                    padding-left: 12px;
                    border-left: 4px solid #007bff;
                    color: #666;
                    font-weight: normal;
                }
                .markdown-body blockquote p { margin-bottom: 4px; }

                /* ★ KaTeX 오버플로우/레이아웃 보정 */
                .markdown-body .katex-display {
                    overflow-x: auto;
                    overflow-y: hidden;
                    padding: 4px 0;
                    margin: 10px 0;
                }
                .markdown-body .katex {
                    font-size: 1.05em;
                }

                .list-view-container {
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 12px;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
                    overflow: hidden;
                    container-type: inline-size;
                    width: 100%;
                }

                .list-table-wrapper {
                    overflow-x: hidden;
                    position: relative;
                    width: 100%;
                }

                .header-scroll-container {
                    display: flex;
                    overflow: hidden;
                    background: #f8f9fa;
                    border-bottom: 2px solid #dee2e6;
                    width: 100%;
                }

                .header-scrollbar-dummy {
                    overflow-y: scroll;
                    visibility: hidden;
                    pointer-events: none;
                    flex-shrink: 0;
                }

                .list-table {
                    width: 100%;
                    margin: 0;
                    padding: 0;
                    border-collapse: collapse;
                    border-spacing: 0;
                    font-size: clamp(10px, 1.1cqi, 16px);
                    white-space: nowrap;
                    table-layout: fixed;
                    min-width: 0;
                    font-family: inherit;
                }

                .list-table th {
                    position: sticky;
                    top: 0;
                    background: #f8f9fa;
                    color: #495057;
                    font-weight: 700;
                    padding: clamp(2px, 0.8cqi, 12px) clamp(2px, 0.8cqi, 14px);
                    text-align: center;
                    z-index: 100;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    user-select: none;
                    min-width: 0 !important;
                    font-family: inherit;
                }

                .group-filter-container, .market-filter-container {
                    position: relative;
                    display: inline-block;
                    width: 100%;
                }

                .filter-dropdown-wrapper {
                    position: fixed;
                    z-index: 3000;
                    display: none;
                    flex-direction: column;
                    background: #ffffff;
                    border: 1px solid #007bff;
                    border-radius: 8px;
                    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
                    width: max-content;
                    max-width: calc(90vw / var(--cy-zoom, 1));
                }

                .group-filter-dropdown, .market-filter-dropdown {
                    min-width: max-content;
                    max-height: 250px;
                    overflow-y: auto;
                    text-align: left;
                    padding: 6px 0;
                    font-size: 15px;
                    font-weight: normal;
                    font-family: inherit;
                    -webkit-text-fill-color: initial !important;
                    color: #333333 !important;
                }

                .dropdown-action-btn {
                    display: block;
                    width: 100%;
                    padding: 6px 12px;
                    margin: 0;
                    font-size: 14px;
                    font-weight: bold;
                    font-family: inherit;
                    color: #1e40af;
                    background-color: #f8f9fa;
                    border: none;
                    border-top: 1px solid #e0e0e0;
                    border-radius: 0;
                    cursor: pointer;
                    text-align: center;
                    box-shadow: none;
                }

                .dropdown-action-btn:hover {
                    color: #1d4ed8;
                    background-color: #eef6ff;
                    transform: none;
                    box-shadow: none;
                }

                .dropdown-close-btn {
                    display: block;
                    width: 100%;
                    padding: 6px 12px;
                    margin: 0;
                    font-size: 14px;
                    font-weight: bold;
                    font-family: inherit;
                    color: white;
                    background: #007bff;
                    border: none;
                    border-top: 1px solid #0056b3;
                    border-radius: 0 0 7px 7px;
                    cursor: pointer;
                    text-align: center;
                    box-shadow: none;
                }

                .dropdown-close-btn:hover {
                    background: #0056b3;
                    transform: none;
                    box-shadow: none;
                }

                .group-filter-item, .market-filter-item {
                    padding: 6px 12px;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    cursor: pointer;
                    user-select: none;
                    color: #333333;
                    white-space: nowrap;
                    font-family: inherit;
                }

                .group-filter-item:hover, .market-filter-item:hover {
                    background-color: #eef6ff;
                }

                .group-filter-item input[type="checkbox"] {
                    flex: none;
                    cursor: pointer;
                    width: 16px;
                    height: 16px;
                }

                .search-country-filter-dropdown {
                    min-width: max-content;
                    text-align: left;
                    padding: 6px 0;
                    font-size: 15px;
                    font-weight: normal;
                    font-family: inherit;
                    -webkit-text-fill-color: initial !important;
                    color: #333333 !important;
                }

                .search-country-filter-item {
                    padding: 8px 14px;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    cursor: pointer;
                    user-select: none;
                    color: #333333;
                    white-space: nowrap;
                    font-weight: 600;
                    font-family: inherit;
                }

                .search-country-filter-item:hover {
                    background-color: #eef6ff;
                }

                .search-country-filter-item.active {
                    color: #007bff;
                    background-color: #eef6ff;
                }

                .search-country-filter-item .check-mark {
                    display: inline-block;
                    width: 14px;
                    color: #007bff;
                }

                .resizer {
                    position: absolute;
                    right: 0;
                    top: 0;
                    height: 100%;
                    width: 16px;
                    background: transparent;
                    cursor: col-resize;
                    user-select: none;
                    touch-action: none;
                }

                .resizer:hover, .resizing {
                    background: #007bff;
                }

                .list-table td {
                    padding: clamp(2px, 0.8cqi, 10px) clamp(2px, 0.8cqi, 14px);
                    border-bottom: 1px solid #e9ecef;
                    border-right: 1px solid #e9ecef;
                    color: #333;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    text-align: center;
                    min-width: 0 !important;
                    font-family: inherit;
                }

                .list-table td:last-child { border-right: none; }
                .list-table th { border-right: 1px solid #dee2e6; }
                .list-table th:last-child { border-right: none; }

                .col-name { text-align: left !important; }
                .col-market { text-align: center; }

                .list-table tr {
                    height: 48px;
                    cursor: pointer;
                    transition: background-color 0.15s;
                }

                .list-table tr.odd-rank-row {
                    background-color: #f8f9fa;
                }

                .list-table tr:hover {
                    background-color: #eef6ff !important;
                }

                .list-table tr.active-row {
                    background-color: #e6f0ff !important;
                    font-weight: bold;
                }

                .list-table th.sort-active {
                    background: #dbeafe !important;
                    color: #0056b3 !important;
                    box-shadow: inset 0 -3px 0 0 #007bff;
                }

                .list-table td.sort-active {
                    background-color: #eff6ff !important;
                    color: #004085 !important;
                    font-weight: 700;
                }

                .list-table td.col-rating.rating-bg-top {
                    background-color: #22c55e !important;
                    color: #ffffff !important;
                    font-weight: 800;
                }
                .list-table td.col-rating.rating-bg-mid {
                    background-color: #fde047 !important;
                    color: #422006 !important;
                    font-weight: 800;
                }
                .list-table td.col-rating.rating-bg-low {
                    background-color: #ef4444 !important;
                    color: #ffffff !important;
                    font-weight: 800;
                }
                .list-table td.col-rating.rating-bg-zero {
                    background-color: #94a3b8 !important;
                    color: #ffffff !important;
                    font-weight: 800;
                }

                body.dark-mode .list-table th.sort-active {
                    background: #1e3a5f !important;
                    color: #38bdf8 !important;
                    box-shadow: inset 0 -3px 0 0 #38bdf8;
                }

                body.dark-mode .list-table td.sort-active {
                    background-color: rgba(56, 189, 248, 0.14) !important;
                    color: #7dd3fc !important;
                    font-weight: 700;
                }

                body.dark-mode .list-table td.col-rating.rating-bg-top {
                    background-color: #16a34a !important;
                    color: #ffffff !important;
                }
                body.dark-mode .list-table td.col-rating.rating-bg-mid {
                    background-color: #eab308 !important;
                    color: #1c1917 !important;
                }
                body.dark-mode .list-table td.col-rating.rating-bg-low {
                    background-color: #dc2626 !important;
                    color: #ffffff !important;
                }
                body.dark-mode .list-table td.col-rating.rating-bg-zero {
                    background-color: #64748b !important;
                    color: #ffffff !important;
                }

                .virtual-scroll-viewport {
                    height: 65vh;
                    overflow-y: auto;
                    position: relative;
                }

                .virtual-scroll-spacer { width: 100%; }

                .virtual-scroll-content {
                    position: absolute;
                    top: 0;
                    left: 0;
                    right: 0;
                }

                /* ============================================================
                   ★ 폰트 컨트롤 (A 버튼 + 상단 3버튼 패널)
                   ============================================================ */
                .font-controls-wrapper {
                    position: fixed;
                    right: 84px;
                    bottom: 80px;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    gap: 10px;
                    z-index: 2001;
                    pointer-events: none;
                }

                .font-controls-wrapper > * {
                    pointer-events: auto;
                }

                .font-control-panel {
                    display: none;
                    gap: 8px;
                    background: rgba(255, 255, 255, 0.96);
                    padding: 8px;
                    border-radius: 30px;
                    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
                    border: 1px solid #e0e0e0;
                    backdrop-filter: blur(8px);
                    transition: background-color 0.3s, border-color 0.3s;
                }

                .font-control-panel.active {
                    display: flex;
                    animation: fontPanelIn 0.18s ease-out;
                }

                @keyframes fontPanelIn {
                    from { opacity: 0; transform: translateY(6px) scale(0.96); }
                    to   { opacity: 1; transform: translateY(0) scale(1); }
                }

                .font-control-btn {
                    width: 46px;
                    height: 46px;
                    border-radius: 50%;
                    border: none;
                    cursor: pointer;
                    font-size: 22px;
                    font-weight: 800;
                    display: grid;
                    place-items: center;
                    padding: 0;
                    line-height: 1;
                    transition: transform 0.15s, background-color 0.2s;
                    touch-action: manipulation;
                    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
                    font-family: inherit;
                    -webkit-text-fill-color: currentColor;
                }

                .font-control-btn:hover {
                    transform: scale(1.08);
                }

                .font-control-btn:active {
                    transform: scale(0.96);
                }

                .font-control-btn.font-size-decrease,
                .font-control-btn.font-size-increase {
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: #ffffff;
                }

                .font-control-btn.font-mode-btn {
                    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
                    color: #ffffff;
                    font-size: 19px;
                }

                .font-main-btn {
                    width: 50px;
                    height: 50px;
                    border-radius: 50%;
                    border: none;
                    background: #007bff;
                    color: #ffffff;
                    font-size: 24px;
                    font-weight: 800;
                    cursor: pointer;
                    display: grid;
                    place-items: center;
                    line-height: 1;
                    padding: 0;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
                    transition: transform 0.2s, background-color 0.3s, color 0.3s, border 0.3s;
                    font-family: inherit;
                    touch-action: manipulation;
                    -webkit-text-fill-color: currentColor;
                }

                .font-main-btn:hover { transform: scale(1.1); }

                .font-main-btn.panel-open {
                    background: #0056b3;
                    box-shadow: 0 6px 16px rgba(0, 86, 179, 0.5);
                }

                body.dark-mode .font-control-panel {
                    background: rgba(15, 23, 42, 0.96);
                    border-color: #334155;
                    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
                }

                body.dark-mode .font-control-btn.font-size-decrease,
                body.dark-mode .font-control-btn.font-size-increase {
                    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                }

                body.dark-mode .font-control-btn.font-mode-btn {
                    background: linear-gradient(135deg, #475569 0%, #334155 100%);
                    color: #38bdf8;
                }

                body.dark-mode .font-main-btn {
                    background: #38bdf8;
                    color: #0f172a;
                    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
                }

                body.dark-mode .font-main-btn.panel-open {
                    background: #0ea5e9;
                }

                body.font-d2coding .font-main-btn {
                    background: #ffffff;
                    color: #007bff;
                    border: 2px solid #007bff;
                    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.35);
                }

                body.dark-mode.font-d2coding .font-main-btn {
                    background-color: #0f172a;
                    color: #38bdf8;
                    border: 2px solid #38bdf8;
                    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
                }

                .theme-toggle-btn,
                .home-toggle-btn {
                    position: fixed;
                    bottom: 80px;
                    width: 50px;
                    height: 50px;
                    border-radius: 50%;
                    border: none;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
                    cursor: pointer;
                    display: grid;
                    place-items: center;
                    line-height: 1;
                    text-align: center;
                    text-indent: 0;
                    z-index: 2000;
                    transition: transform 0.2s, background-color 0.3s, color 0.3s;
                    touch-action: manipulation;
                    padding: 0;
                }

                .theme-toggle-btn:hover,
                .home-toggle-btn:hover { transform: scale(1.1); }

                .home-toggle-btn {
                    right: 144px;
                    background-color: #28a745;
                    color: #ffffff;
                    font-size: 25px;
                }

                .theme-toggle-btn {
                    right: 24px;
                    background-color: #1e1e1e;
                    color: #ffffff;
                    font-size: 25px;
                }

                /* ★ 수정: 포커스 박스 오버레이 - 배경 스크롤 차단 */
                .focus-box-overlay {
                    position: fixed;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    background: rgba(0, 0, 0, 0.78);
                    z-index: 9000;
                    display: none;
                    align-items: center;
                    justify-content: center;
                    padding: 24px;
                    box-sizing: border-box;
                    overscroll-behavior: contain;   /* ★ 추가: 스크롤 체이닝 방지 */
                }

                .focus-box-overlay.active {
                    display: flex;
                }

                .focus-box {
                    background: #ffffff;
                    border-radius: 12px;
                    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55);
                    max-width: calc(90vw / var(--cy-zoom, 1));
                    max-height: calc(90vh / var(--cy-zoom, 1));
                    min-width: 260px;
                    display: flex;
                    flex-direction: column;
                    overflow: hidden;
                    animation: focusBoxIn 0.18s ease-out;
                }

                @keyframes focusBoxIn {
                    from { opacity: 0; transform: scale(0.96); }
                    to   { opacity: 1; transform: scale(1); }
                }

                .focus-box-title {
                    padding: 14px 20px;
                    font-weight: 700;
                    color: #0056b3;
                    background: linear-gradient(135deg, #eaf2ff 0%, #dbe9ff 100%);
                    border-bottom: 1px solid #cfe0f5;
                    font-size: 18px;
                    font-family: inherit;
                    flex: 0 0 auto;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                }

                /* ★ 수정: focus-box-body - 스크롤 체이닝 방지 + iOS 관성 스크롤 */
                .focus-box-body {
                    padding: 18px 20px;
                    overflow: auto;
                    flex: 1 1 auto;
                    min-height: 0;
                    color: #222222;
                    font-family: inherit;
                    font-size: 1.05em;
                    line-height: 1.65;
                    white-space: pre-wrap;
                    word-break: break-word;
                    overscroll-behavior: contain;      /* ★ 추가 */
                    -webkit-overflow-scrolling: touch; /* ★ 추가 */
                }

                .focus-box-body .markdown-body {
                    white-space: normal;
                }

                /* ★ 포커스 박스 내부의 평점/그룹 기준표 스타일 보정 */
                .focus-box-body .rating-criteria-container,
                .focus-box-body .group-criteria-container {
                    margin-top: 0;
                    padding: 0;
                    background: transparent;
                    border: none;
                    box-shadow: none;
                }

                body.dark-mode .focus-box-body .rating-criteria-container,
                body.dark-mode .focus-box-body .group-criteria-container {
                    background: transparent;
                    border: none;
                }

                /* ★ 재무 지표 설명(포커스 박스 내부) 스타일 */
                .focus-box-body.metric-explanation-body {
                    padding: 18px 20px;
                    box-sizing: border-box;
                }

                .metric-explanation {
                    white-space: normal;
                }

                .metric-explanation h4 {
                    margin: 18px 0 8px 0;
                    font-size: 16px;
                    font-weight: 800;
                    color: #0056b3;
                    display: flex;
                    align-items: center;
                    gap: 6px;
                    letter-spacing: -0.2px;
                }
                .metric-explanation h3 + h4 {
                    margin-top: 0 !important;
                }
                .metric-explanation p {
                    margin: 0 0 10px 0;
                    line-height: 1.75;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                    color: #333;
                }
                .metric-explanation code {
                    display: block;
                    background: #f1f5f9;
                    border: 1px solid #e2e8f0;
                    padding: 12px 14px;
                    border-radius: 8px;
                    font-family: 'D2CodingEmbedded';
                    font-size: 14px;
                    color: #0f172a;
                    margin: 6px 0 12px 0;
                    white-space: pre-wrap;
                    word-break: break-all;
                    line-height: 1.55;
                }
                body.dark-mode .metric-explanation h4 { color: #38bdf8; }
                body.dark-mode .metric-explanation p { color: #e2e8f0; }
                body.dark-mode .metric-explanation code {
                    background: #0f172a;
                    border-color: #334155;
                    color: #7dd3fc;
                }

                .focus-box-footer {
                    display: flex;
                    justify-content: flex-end;
                    padding: 10px 16px;
                    border-top: 1px solid #e0e0e0;
                    background: #f8f9fa;
                    flex: 0 0 auto;
                }

                .focus-box-close-btn {
                    padding: 8px 22px;
                    font-size: 16px;
                    font-weight: 700;
                    font-family: inherit;
                    border-radius: 8px;
                    border: none;
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: #ffffff;
                    cursor: pointer;
                    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
                    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
                }

                .focus-box-close-btn:hover {
                    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
                    transform: translateY(-1px);
                    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
                }

                body.dark-mode .focus-box {
                    background: #1e293b;
                    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
                }

                body.dark-mode .focus-box-title {
                    background: linear-gradient(135deg, #1e3a5f 0%, #0f2942 100%);
                    border-bottom-color: #334155;
                    color: #38bdf8;
                }

                body.dark-mode .focus-box-body {
                    color: #e2e8f0;
                }

                body.dark-mode .focus-box-footer {
                    background: #0f172a;
                    border-top-color: #334155;
                }

                body.dark-mode .focus-box-close-btn {
                    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                }

                body.dark-mode .focus-box-close-btn:hover {
                    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
                }

                .log-viewer-overlay {
                    position: fixed;
                    top: 0;
                    left: 0;
                    right: 0;
                    bottom: 0;
                    background: rgba(0, 0, 0, 0.85);
                    z-index: 9500;
                    display: none;
                    align-items: center;
                    justify-content: center;
                    padding: 16px;
                    box-sizing: border-box;
                }

                .log-viewer-overlay.active {
                    display: flex;
                }

                .log-viewer-box {
                    background: #0d1117;
                    color: #c9d1d9;
                    border-radius: 12px;
                    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75);
                    width: 900px;
                    max-width: calc(95vw / var(--cy-zoom, 1));
                    max-height: calc(90vh / var(--cy-zoom, 1));
                    display: flex;
                    flex-direction: column;
                    overflow: hidden;
                    animation: focusBoxIn 0.18s ease-out;
                }

                .log-viewer-header {
                    padding: 12px 16px;
                    background: #161b22;
                    border-bottom: 1px solid #30363d;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    gap: 10px;
                    flex-wrap: wrap;
                }

                .log-viewer-header .log-title {
                    font-weight: 700;
                    color: #58a6ff;
                    font-size: 18px;
                    font-family: inherit;
                }

                .log-viewer-actions {
                    display: flex;
                    gap: 6px;
                }

                .log-viewer-actions button {
                    padding: 6px 12px;
                    font-size: 14px;
                    font-weight: 600;
                    font-family: inherit;
                    border-radius: 6px;
                    border: 1px solid #30363d;
                    background: #21262d;
                    color: #c9d1d9;
                    box-shadow: none;
                    cursor: pointer;
                    transition: background-color 0.2s;
                }

                .log-viewer-actions button:hover {
                    background: #30363d;
                    color: #f0f6fc;
                    transform: none;
                    box-shadow: none;
                }

                .log-viewer-body {
                    padding: 12px 16px;
                    overflow-y: auto;
                    flex: 1 1 auto;
                    min-height: 200px;
                    background: #0d1117;
                    font-family: 'D2CodingEmbedded';
                    font-size: 14px;
                    line-height: 1.55;
                    white-space: pre-wrap;
                    word-break: break-all;
                }

                .log-entry {
                    padding: 3px 0;
                    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
                }

                .log-entry .log-time { color: #8b949e; }
                .log-entry .log-cat { color: #58a6ff; font-weight: 700; margin-right: 4px; }
                .log-entry.log-error { color: #f85149; }
                .log-entry.log-warn { color: #d29922; }
                .log-entry.log-info { color: #c9d1d9; }
                .log-entry.log-success { color: #3fb950; }

                .log-viewer-footer {
                    padding: 10px 16px;
                    background: #161b22;
                    border-top: 1px solid #30363d;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    gap: 10px;
                }

                .log-viewer-footer .log-count {
                    font-size: 14px;
                    color: #8b949e;
                    font-family: inherit;
                }

                .log-viewer-footer .log-footer-btns {
                    display: flex;
                    gap: 8px;
                }

                .log-viewer-footer button {
                    padding: 8px 18px;
                    font-size: 15px;
                    font-weight: 700;
                    font-family: inherit;
                    border-radius: 8px;
                    border: none;
                    cursor: pointer;
                    transition: background-color 0.2s;
                }

                .log-viewer-footer .log-refresh-btn {
                    background: #21262d;
                    color: #c9d1d9;
                    border: 1px solid #30363d;
                    box-shadow: none;
                }

                .log-viewer-footer .log-refresh-btn:hover {
                    background: #30363d;
                    transform: none;
                    box-shadow: none;
                }

                .log-viewer-footer .log-close-btn {
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: #ffffff;
                    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
                }

                .log-viewer-footer .log-close-btn:hover {
                    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
                    transform: translateY(-1px);
                    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
                }

                @media (max-width: 640px) {
                    .focus-box {
                        max-width: calc(90vw / var(--cy-zoom, 1));
                        max-height: calc(85vh / var(--cy-zoom, 1));
                    }
                    .focus-box-title {
                        padding: 12px 16px;
                        font-size: 17px;
                    }
                    .focus-box-body {
                        padding: 14px 16px;
                        font-size: 1em;
                    }

                    .log-viewer-box {
                        max-width: calc(96vw / var(--cy-zoom, 1));
                        max-height: calc(88vh / var(--cy-zoom, 1));
                    }
                    .log-viewer-header .log-title {
                        font-size: 16px;
                    }
                    .log-viewer-body {
                        font-size: 13px;
                        padding: 10px 12px;
                    }
                    .log-viewer-footer button {
                        padding: 7px 14px;
                        font-size: 14px;
                    }
                }

                /* ============================================================
                   ★ 종목 상세 페이지 (기획안 반영)
                   ============================================================ */
                .stock-detail {
                    display: flex;
                    flex-direction: column;
                    gap: 16px;
                }

                .stock-header-card {
                    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
                    border: 1px solid #e0e0e0;
                    border-radius: 16px;
                    padding: 22px 24px;
                    box-shadow: 0 8px 24px rgba(0, 123, 255, 0.08);
                    display: flex;
                    gap: 22px;
                    align-items: stretch;
                    flex-wrap: wrap;
                }

                .stock-header-main {
                    flex: 1 1 300px;
                    min-width: 0;
                    display: flex;
                    flex-direction: column;
                    gap: 10px;
                }

                .stock-title-row {
                    display: flex;
                    align-items: center;
                    flex-wrap: wrap;
                    gap: 10px;
                }

                .stock-name {
                    font-size: 30px;
                    font-weight: 900;
                    margin: 0;
                    color: #0f172a;
                    letter-spacing: -0.6px;
                    word-break: keep-all;
                    line-height: 1.2;
                }

                .stock-ticker {
                    font-size: 16px;
                    font-weight: 800;
                    color: #007bff;
                    background: #eef6ff;
                    border: 1px solid #cfe0f5;
                    padding: 4px 10px;
                    border-radius: 6px;
                    font-family: 'D2CodingEmbedded';
                    letter-spacing: 0.3px;
                    white-space: nowrap;
                }

                /* ★ 관심종목 토글 버튼 (별표) */
                .btn-favorite-toggle {
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    flex: 0 0 auto;
                    width: 38px;
                    height: 38px;
                    padding: 0;
                    background: #fff8e1;
                    border: 1px solid #ffe08a;
                    border-radius: 50%;
                    box-shadow: none;
                    cursor: pointer;
                    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
                }

                .btn-favorite-toggle svg {
                    width: 22px;
                    height: 22px;
                    fill: none;
                    stroke: #f59e0b;
                    stroke-width: 2;
                    stroke-linejoin: round;
                    transition: fill 0.2s;
                }

                .btn-favorite-toggle:hover {
                    background: #ffecb3;
                    box-shadow: none;
                    transform: scale(1.08);
                }

                .btn-favorite-toggle.active svg {
                    fill: #fbbf24;
                }

                body.dark-mode .btn-favorite-toggle {
                    background: #1e293b;
                    border-color: #334155;
                }

                body.dark-mode .btn-favorite-toggle:hover {
                    background: #334155;
                }

                body.dark-mode .btn-favorite-toggle svg {
                    stroke: #fbbf24;
                }

                /* ★ 종목 데이터 편집 버튼 */
                .btn-sheet-edit {
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    height: 38px;
                    padding: 0 16px;
                    flex: 0 0 auto;
                    background: #2563eb;
                    color: #ffffff;
                    border: 1px solid #2563eb;
                    border-radius: 9px;
                    font-size: 14px;
                    font-weight: 800;
                    box-shadow: none;
                }

                .btn-sheet-edit:hover {
                    background: #1d4ed8;
                    border-color: #1d4ed8;
                    box-shadow: none;
                    transform: translateY(-1px);
                }

                body.dark-mode .btn-sheet-edit {
                    background: #2563eb;
                    border-color: #3b82f6;
                    color: #ffffff;
                }

                /* ★ 구글 시트 편집창 */
                .sheet-edit-overlay {
                    position: fixed;
                    inset: 0;
                    z-index: 3000;
                    display: none;
                    align-items: center;
                    justify-content: center;
                    padding: 16px;
                    background: rgba(0, 0, 0, 0.65);
                }

                .sheet-edit-overlay.active {
                    display: flex;
                }

                .sheet-edit-dialog {
                    display: flex;
                    flex-direction: column;
                    width: min(1000px, 96vw);
                    max-height: 90vh;
                    background: #ffffff;
                    color: #1e293b;
                    border-radius: 14px;
                    overflow: hidden;
                    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
                }

                .sheet-edit-header {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    gap: 12px;
                    padding: 18px 20px;
                    border-bottom: 1px solid #dbe3ed;
                    background: #f8fafc;
                }

                .sheet-edit-header h2 {
                    margin: 0;
                    font-size: 20px;
                    font-weight: 900;
                    color: #1e293b;
                }

                .sheet-edit-subtitle {
                    margin-top: 5px;
                    font-size: 13px;
                    color: #64748b;
                }

                .sheet-edit-table-wrap {
                    flex: 1;
                    min-height: 0;
                    overflow: auto;
                    padding: 0 12px;
                    -webkit-overflow-scrolling: touch;
                }

                .sheet-edit-table {
                    width: 100%;
                    min-width: 560px;
                    border-collapse: separate;
                    border-spacing: 0;
                    table-layout: fixed;
                    font-size: 14px;
                }

                .sheet-edit-table th,
                .sheet-edit-table td {
                    padding: 8px 10px;
                    border-right: 1px solid #dbe3ed;
                    border-bottom: 1px solid #dbe3ed;
                    vertical-align: middle;
                }

                .sheet-edit-table thead th {
                    position: sticky;
                    top: 0;
                    z-index: 2;
                    background: #e8f1fb;
                    color: #1e40af;
                    font-weight: 800;
                    text-align: center;
                }

                .sheet-edit-table tbody tr:nth-child(even) {
                    background: #f8fafc;
                }

                .sheet-edit-table tbody tr:hover {
                    background: #eff6ff;
                }

                .sheet-edit-table .sheet-edit-save-cell {
                    width: 90px;
                    text-align: center;
                }

                .sheet-edit-row-save-btn {
                    min-width: 64px;
                    padding: 8px 10px;
                    font-size: 13px;
                    background: #16a34a;
                    box-shadow: none;
                }

                .sheet-edit-row-save-btn:hover {
                    background: #15803d;
                    box-shadow: none;
                    transform: none;
                }

                .sheet-edit-table .sheet-edit-label {
                    width: 230px;
                    color: #334155;
                    font-weight: 700;
                    word-break: break-word;
                }

                .sheet-edit-table textarea {
                    display: block;
                    width: 100%;
                    min-height: 42px;
                    padding: 9px 10px;
                    border: 1px solid #cbd5e1;
                    border-radius: 5px;
                    background: #ffffff;
                    color: #111827;
                    font-size: 14px;
                    font-weight: 500;
                    line-height: 1.5;
                    font-family: inherit;
                    resize: vertical;
                    outline: none;
                    box-shadow: none;
                }

                .sheet-edit-table textarea:focus {
                    border-color: #2563eb;
                    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
                }

                .sheet-edit-footer {
                    display: flex;
                    justify-content: flex-end;
                    gap: 10px;
                    padding: 14px 20px;
                    border-top: 1px solid #dbe3ed;
                    background: #f8fafc;
                }

                .sheet-edit-footer button {
                    min-width: 90px;
                    padding: 11px 18px;
                    font-size: 15px;
                }

                .sheet-edit-cancel-btn {
                    background: #64748b !important;
                    box-shadow: none !important;
                }

                .sheet-edit-cancel-btn:hover {
                    background: #475569 !important;
                    box-shadow: none !important;
                }

                .sheet-edit-row-save-btn:disabled {
                    opacity: 0.55;
                    cursor: wait;
                    transform: none;
                }

                body.dark-mode .sheet-edit-dialog {
                    background: #0f172a;
                    color: #e2e8f0;
                }

                body.dark-mode .sheet-edit-header,
                body.dark-mode .sheet-edit-footer {
                    background: #1e293b;
                    border-color: #334155;
                }

                body.dark-mode .sheet-edit-header h2 {
                    color: #f8fafc;
                }

                body.dark-mode .sheet-edit-subtitle {
                    color: #94a3b8;
                }

                body.dark-mode .sheet-edit-table th,
                body.dark-mode .sheet-edit-table td {
                    border-color: #334155;
                }

                body.dark-mode .sheet-edit-table thead th {
                    background: #1e3a5f;
                    color: #93c5fd;
                }

                body.dark-mode .sheet-edit-table tbody tr:nth-child(even) {
                    background: #1e293b;
                }

                body.dark-mode .sheet-edit-table tbody tr:hover {
                    background: #243b53;
                }

                body.dark-mode .sheet-edit-table .sheet-edit-label {
                    color: #e2e8f0;
                }

                body.dark-mode .sheet-edit-table textarea {
                    background: #0f172a;
                    color: #f8fafc;
                    border-color: #475569;
                }

                @media (max-width: 640px) {
                    .sheet-edit-overlay {
                        padding: 6px;
                    }

                    .sheet-edit-dialog {
                        width: 100%;
                        max-height: 94vh;
                    }

                    .sheet-edit-header {
                        padding: 14px;
                    }

                    .sheet-edit-header h2 {
                        font-size: 17px;
                    }

                    .sheet-edit-footer {
                        padding: 12px;
                    }

                    .sheet-edit-table .sheet-edit-label {
                        width: 180px;
                    }
                }

                .stock-meta-chips {
                    display: flex;
                    flex-wrap: wrap;
                    gap: 8px;
                }

                .meta-chip {
                    display: inline-flex;
                    align-items: center;
                    gap: 6px;
                    font-size: 15px;
                    font-weight: 600;
                    color: #495057;
                    background: #f1f3f5;
                    padding: 6px 12px;
                    border-radius: 20px;
                    border: 1px solid #e9ecef;
                    line-height: 1.3;
                    word-break: keep-all;
                }

                /* ★ 그룹 태그(클릭 가능한 메타 칩) 스타일 */
                .meta-chip.meta-chip-clickable {
                    cursor: pointer;
                    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
                }

                .meta-chip.meta-chip-clickable:hover {
                    background: #eef6ff;
                    border-color: #007bff;
                    transform: translateY(-1px);
                }

                body.dark-mode .meta-chip.meta-chip-clickable:hover {
                    background: #1e3a5f;
                    border-color: #38bdf8;
                }

                .meta-info-icon {
                    display: inline-block;
                    margin-left: 4px;
                    font-size: 12px;
                    color: #007bff;
                    opacity: 0.75;
                    font-weight: 700;
                    vertical-align: middle;
                }

                body.dark-mode .meta-info-icon {
                    color: #38bdf8;
                }

                .stock-badges {
                    display: flex;
                    flex-wrap: wrap;
                    gap: 8px;
                    margin-top: 2px;
                }

                .stock-badge {
                    display: inline-flex;
                    align-items: center;
                    gap: 5px;
                    font-size: 14px;
                    font-weight: 800;
                    padding: 6px 14px;
                    border-radius: 20px;
                    letter-spacing: -0.2px;
                }

                .stock-badge.badge-foreign {
                    background: #dbeafe;
                    color: #1e40af;
                    border: 1px solid #93c5fd;
                }

                .stock-badge.badge-incomplete {
                    background: #fef3c7;
                    color: #92400e;
                    border: 1px solid #fcd34d;
                }

                .stock-rating-block {
                    flex: 0 0 auto;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
                    color: #ffffff;
                    padding: 20px 32px;
                    border-radius: 14px;
                    min-width: 130px;
                    box-shadow: 0 8px 22px rgba(0, 123, 255, 0.35);
                    transition: background 0.3s, box-shadow 0.3s, color 0.3s, transform 0.2s;
                }

                /* ★ 평점 박스 클릭 가능 표시 */
                .stock-rating-block.stock-rating-clickable {
                    cursor: pointer;
                    position: relative;
                }

                .stock-rating-block.stock-rating-clickable::after {
                    content: 'ⓘ';
                    position: absolute;
                    top: 8px;
                    right: 10px;
                    font-size: 13px;
                    font-weight: 800;
                    opacity: 0.65;
                    color: currentColor;
                    line-height: 1;
                }

                .stock-rating-block.stock-rating-clickable:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 12px 28px rgba(0, 123, 255, 0.45);
                }

                .stock-rating-block.rating-top {
                    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
                    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.42);
                    color: #ffffff;
                }

                .stock-rating-block.rating-mid {
                    background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
                    box-shadow: 0 8px 22px rgba(234, 179, 8, 0.42);
                    color: #422006;
                }

                .stock-rating-block.rating-low {
                    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
                    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.42);
                    color: #ffffff;
                }

                .stock-rating-block.rating-zero,
                .stock-rating-block.pending {
                    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
                    box-shadow: 0 8px 22px rgba(100, 116, 139, 0.35);
                    color: #ffffff;
                }

                .stock-rating-value {
                    font-size: 44px;
                    font-weight: 900;
                    line-height: 1;
                    letter-spacing: -1.5px;
                }

                .stock-rating-label {
                    font-size: 14px;
                    font-weight: 800;
                    letter-spacing: 1.2px;
                    opacity: 0.92;
                    margin-top: 8px;
                    text-transform: uppercase;
                }

                .detail-section {
                    background: #ffffff;
                    border: 1px solid #e0e0e0;
                    border-radius: 14px;
                    padding: 20px 22px;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
                }

                .detail-section-title {
                    font-size: 17px;
                    font-weight: 800;
                    color: #0056b3;
                    margin: 0 0 16px 0;
                    padding-bottom: 10px;
                    border-bottom: 2px solid #eaf2ff;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    letter-spacing: -0.3px;
                    word-break: keep-all;
                }

                .metric-groups {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
                    gap: 14px;
                }

                .metric-group {
                    background: #f8f9fa;
                    border: 1px solid #e9ecef;
                    border-radius: 10px;
                    padding: 14px;
                }

                .metric-group-title {
                    font-size: 15px;
                    font-weight: 800;
                    color: #495057;
                    margin: 0 0 12px 0;
                    padding-bottom: 8px;
                    border-bottom: 1px dashed #dee2e6;
                    letter-spacing: 0.3px;
                    display: flex;
                    align-items: center;
                    gap: 6px;
                }

                .metric-grid {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
                    gap: 8px;
                }

                .metric-cell {
                    background: #ffffff;
                    border: 1px solid #e9ecef;
                    border-radius: 8px;
                    padding: 10px 12px;
                    min-width: 0;
                    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
                }

                /* ★ 지표 클릭 가능 상태 */
                .metric-cell.metric-cell-clickable {
                    cursor: pointer;
                }

                .metric-cell.metric-cell-clickable:hover {
                    background: #eef6ff;
                    border-color: #007bff;
                    transform: translateY(-1px);
                }

                .metric-cell-title {
                    font-size: 13px;
                    font-weight: 700;
                    color: #6c757d;
                    margin-bottom: 5px;
                    letter-spacing: -0.2px;
                    word-break: keep-all;
                    line-height: 1.35;
                }

                .metric-info-icon {
                    display: inline-block;
                    margin-left: 4px;
                    font-size: 12px;
                    color: #007bff;
                    opacity: 0.65;
                    font-weight: 700;
                    vertical-align: middle;
                }

                .metric-cell-value {
                    font-size: 17px;
                    font-weight: 800;
                    color: #0f172a;
                    word-break: break-all;
                    line-height: 1.35;
                }

                .report-group {
                    margin-bottom: 18px;
                }
                .report-group:last-child {
                    margin-bottom: 0;
                }

                .report-group-title {
                    font-size: 15px;
                    font-weight: 800;
                    color: #495057;
                    margin-bottom: 10px;
                    letter-spacing: -0.2px;
                    display: flex;
                    align-items: center;
                    gap: 6px;
                }

                .report-block {
                    background: #ffffff;
                    border: 1px solid #e9ecef;
                    border-left: 4px solid #007bff;
                    border-radius: 10px;
                    margin-bottom: 12px;
                    overflow: hidden;
                    transition: box-shadow 0.2s, transform 0.2s;
                }

                .report-block:hover {
                    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.12);
                }

                .report-block-header {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding: 12px 18px;
                    background: linear-gradient(135deg, #eaf2ff 0%, #dbe9ff 100%);
                    border-bottom: 1px solid #cfe0f5;
                    cursor: pointer;
                    user-select: none;
                    transition: background 0.2s;
                }

                .report-block-header:hover {
                    background: linear-gradient(135deg, #dbe9ff 0%, #cfe0f5 100%);
                }

                .report-block-title {
                    font-size: 16px;
                    font-weight: 800;
                    color: #0056b3;
                    letter-spacing: -0.3px;
                    display: flex;
                    align-items: center;
                    gap: 8px;
                    word-break: keep-all;
                }

                .report-block-expand-icon {
                    font-size: 15px;
                    color: #0056b3;
                    opacity: 0.7;
                    font-weight: 800;
                    flex: 0 0 auto;
                }

                .report-block-preview {
                    padding: 12px 18px;
                    font-size: 15px;
                    color: #6c757d;
                    line-height: 1.6;
                    background: #ffffff;
                    word-break: keep-all;
                    overflow-wrap: break-word;
                }

                body.dark-mode .stock-header-card {
                    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
                    border-color: #334155;
                    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
                }

                body.dark-mode .stock-name { color: #f8fafc; }

                body.dark-mode .stock-ticker {
                    background: #1e3a5f;
                    color: #38bdf8;
                    border-color: #334155;
                }

                body.dark-mode .meta-chip {
                    background: #0f172a;
                    color: #cbd5e1;
                    border-color: #334155;
                }

                body.dark-mode .stock-badge.badge-foreign {
                    background: #1e3a5f;
                    color: #93c5fd;
                    border-color: #3b82f6;
                }

                body.dark-mode .stock-badge.badge-incomplete {
                    background: #422006;
                    color: #fcd34d;
                    border-color: #92400e;
                }

                body.dark-mode .detail-section {
                    background: #1e293b;
                    border-color: #334155;
                    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
                }

                body.dark-mode .detail-section-title {
                    color: #38bdf8;
                    border-bottom-color: #1e3a5f;
                }

                body.dark-mode .metric-group {
                    background: #0f172a;
                    border-color: #334155;
                }

                body.dark-mode .metric-group-title {
                    color: #cbd5e1;
                    border-bottom-color: #334155;
                }

                body.dark-mode .metric-cell {
                    background: #1e293b;
                    border-color: #334155;
                }

                body.dark-mode .metric-cell.metric-cell-clickable:hover {
                    background: #1e3a5f;
                    border-color: #38bdf8;
                }

                body.dark-mode .metric-cell-title { color: #94a3b8; }
                body.dark-mode .metric-cell-value { color: #f8fafc; }
                body.dark-mode .metric-info-icon { color: #38bdf8; }

                body.dark-mode .report-group-title { color: #cbd5e1; }

                body.dark-mode .report-block {
                    background: #0f172a;
                    border-color: #334155;
                    border-left-color: #38bdf8;
                }

                body.dark-mode .report-block-header {
                    background: linear-gradient(135deg, #1e3a5f 0%, #0f2942 100%);
                    border-bottom-color: #334155;
                }

                body.dark-mode .report-block-header:hover {
                    background: linear-gradient(135deg, #16304e 0%, #0a1e34 100%);
                }

                body.dark-mode .report-block-title { color: #38bdf8; }
                body.dark-mode .report-block-expand-icon { color: #38bdf8; }

                body.dark-mode .report-block-preview {
                    background: #0f172a;
                    color: #94a3b8;
                }

                @media (max-width: 640px) {
                    .stock-header-card {
                        padding: 16px;
                        gap: 14px;
                        flex-direction: column;
                    }
                    .stock-name { font-size: 24px; }
                    .stock-rating-block {
                        flex-direction: row;
                        width: 100%;
                        padding: 14px 20px;
                        gap: 14px;
                        min-width: 0;
                    }
                    .stock-rating-value { font-size: 34px; }
                    .stock-rating-label { margin-top: 0; }
                    .detail-section { padding: 16px 14px; }
                    .metric-groups { grid-template-columns: 1fr; }
                }

                body.dark-mode {
                    background-color: #0f172a;
                    color: #f1f5f9;
                }

                body.dark-mode .sticky-navbar {
                    background: rgba(15, 23, 42, 0.88);
                    border-bottom: 1px solid #1e293b;
                    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
                }

                body.dark-mode .bottom-navbar {
                    background: rgba(15, 23, 42, 0.88);
                    border-top: 1px solid #1e293b;
                    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
                }

                body.dark-mode .title-text {
                    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }

                body.dark-mode input {
                    background-color: #1e293b;
                    border-color: #3b82f6;
                    color: #f8fafc;
                    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.2);
                    font-family: inherit;
                }

                body.dark-mode input:focus {
                    border-color: #60a5fa;
                    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
                }

                body.dark-mode button {
                    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
                    font-family: inherit;
                }

                body.dark-mode button:hover {
                    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
                    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
                }

                body.dark-mode button.nav-btn {
                    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
                    color: #38bdf8;
                    border: 1px solid #3b82f6;
                    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
                }

                body.dark-mode button.nav-btn:hover {
                    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
                    color: #ffffff;
                    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
                }

                /* ★ 이전/다음 버튼 비활성화 상태 (다크 모드) */
                body.dark-mode button.nav-btn:disabled,
                body.dark-mode button.nav-btn:disabled:hover {
                    background: #334155;
                    color: #64748b;
                    border: 1px solid #475569;
                    cursor: not-allowed;
                    opacity: 0.55;
                    transform: none;
                    box-shadow: none;
                }

                body.dark-mode button.list-btn {
                    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
                    color: #ffffff;
                    border: 1px solid #34d399;
                    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
                }

                body.dark-mode button.list-btn:hover {
                    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
                    box-shadow: 0 6px 16px rgba(52, 211, 153, 0.5);
                }

                /* ★ 최신 목록 버튼 (다크모드) - 파란색 */
                body.dark-mode button.list-btn.recent-list-btn {
                    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                    color: #ffffff;
                    border: 1px solid #60a5fa;
                    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
                }
                body.dark-mode button.list-btn.recent-list-btn:hover {
                    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
                    box-shadow: 0 6px 16px rgba(96, 165, 250, 0.5);
                }

                /* ★ 관심 목록 버튼 (다크모드) - 노란색 */
                body.dark-mode button.list-btn.favorite-list-btn {
                    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
                    color: #1f2937;
                    border: 1px solid #fcd34d;
                    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
                }
                body.dark-mode button.list-btn.favorite-list-btn:hover {
                    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
                    box-shadow: 0 6px 16px rgba(252, 211, 77, 0.5);
                }

                body.dark-mode .search-results-list {
                    background-color: #1e293b;
                    border-color: #3b82f6;
                    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
                }

                body.dark-mode .search-result-item { border-bottom: 1px solid #334155; }
                body.dark-mode .search-result-item:hover { background-color: #334155; }
                body.dark-mode .search-result-item .item-name { color: #f1f5f9; }
                body.dark-mode .search-result-item .item-ticker { color: #38bdf8; }

                body.dark-mode .welcome-box {
                    background: #1e293b;
                    border: 1px solid #334155;
                    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
                }

                body.dark-mode .welcome-title {
                    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                }

                body.dark-mode .welcome-subtitle { color: #94a3b8; }

                body.dark-mode .btn-start-view {
                    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
                    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
                }

                body.dark-mode .btn-start-view:hover {
                    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
                }

                body.dark-mode .card {
                    background: #1e293b;
                    border: 1px solid #334155;
                    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
                }

                body.dark-mode .inline-field-item {
                    background: #0f172a;
                    border: 1px solid #334155;
                }

                body.dark-mode .card.highlight-card {
                    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
                    border: 1px solid #334155;
                    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
                }

                body.dark-mode .card.highlight-card .field-title { color: #38bdf8; }
                body.dark-mode .card.highlight-card .field-value { color: #f8fafc; }

                body.dark-mode .inline-field-item.highlight-item {
                    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
                    border: 1px solid #334155;
                }

                body.dark-mode .inline-field-item.highlight-item .field-title { color: #38bdf8; }
                body.dark-mode .inline-field-item.highlight-item .field-value { color: #f8fafc; }

                body.dark-mode .field-title { color: #94a3b8; }
                body.dark-mode .field-value { color: #e2e8f0; }

                body.dark-mode .card.highlight-card .field-value.markdown-value,
                body.dark-mode .inline-field-item.highlight-item .field-value.markdown-value {
                    font-weight: normal;
                }

                body.dark-mode .card.highlight-card:has(> .field-value.markdown-value) > .field-title {
                    background: linear-gradient(135deg, #1e3a5f 0%, #0f2942 100%);
                    border-bottom: 1px solid #334155;
                    color: #38bdf8;
                }

                body.dark-mode .card.highlight-card:has(> .field-value.markdown-value) > .field-value.markdown-value {
                    background: #0f172a;
                }

                body.dark-mode .markdown-body h1, body.dark-mode .markdown-body h2, body.dark-mode .markdown-body h3,
                body.dark-mode .markdown-body h4, body.dark-mode .markdown-body h5, body.dark-mode .markdown-body h6 {
                    color: #f8fafc;
                }

                body.dark-mode .markdown-body blockquote { color: #94a3b8; border-left-color: #38bdf8; }
                body.dark-mode .markdown-body code { background: rgba(255, 255, 255, 0.08); }
                body.dark-mode .markdown-body pre { background: rgba(255, 255, 255, 0.06); }
                /* ★ 추가: 다크 모드에서 pre 내부 code는 배경 제거 (이중 하이라이트 방지) */
                body.dark-mode .markdown-body pre code { background: none; }
                body.dark-mode .markdown-body a { color: #38bdf8; }
                body.dark-mode .markdown-body hr { border-top-color: #334155; }
                body.dark-mode .markdown-body th, body.dark-mode .markdown-body td { border-color: #334155; }
                body.dark-mode .markdown-body th { background: rgba(255, 255, 255, 0.05); }

                body.dark-mode .list-view-container {
                    background: #1e293b;
                    border-color: #334155;
                }

                body.dark-mode .header-scroll-container {
                    background: #0f172a;
                    border-bottom-color: #334155;
                }

                body.dark-mode .list-table th {
                    background: #0f172a;
                    color: #cbd5e1;
                    border-bottom-color: #334155;
                    border-right-color: #334155;
                }

                body.dark-mode .filter-dropdown-wrapper {
                    background: #1e293b;
                    border-color: #3b82f6;
                    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
                }

                body.dark-mode .dropdown-action-btn {
                    color: #f8fafc;
                    background-color: #0f172a;
                    border-top-color: #334155;
                }

                body.dark-mode .dropdown-action-btn:hover {
                    color: #ffffff;
                    background-color: #1e293b;
                }

                body.dark-mode .dropdown-close-btn {
                    background: #3b82f6;
                    border-top-color: #1d4ed8;
                }

                body.dark-mode .dropdown-close-btn:hover { background: #2563eb; }

                body.dark-mode .group-filter-dropdown, body.dark-mode .market-filter-dropdown {
                    color: #f1f5f9 !important;
                }

                body.dark-mode .group-filter-item, body.dark-mode .market-filter-item { color: #f1f5f9; }
                body.dark-mode .group-filter-item:hover, body.dark-mode .market-filter-item:hover { background-color: #334155; }

                body.dark-mode .search-country-filter-dropdown { color: #f1f5f9 !important; }
                body.dark-mode .search-country-filter-item { color: #f1f5f9; }
                body.dark-mode .search-country-filter-item:hover { background-color: #334155; }
                body.dark-mode .search-country-filter-item.active { color: #38bdf8; background-color: #334155; }
                body.dark-mode .search-country-filter-item .check-mark { color: #38bdf8; }

                body.dark-mode .list-table td {
                    border-bottom-color: #334155;
                    border-right-color: #334155;
                    color: #e2e8f0;
                }

                body.dark-mode .list-table tr.odd-rank-row { background-color: #162032; }
                body.dark-mode .list-table tr:hover { background-color: #334155 !important; }
                body.dark-mode .list-table tr.active-row { background-color: #1e3a8a !important; }

                body.dark-mode .theme-toggle-btn {
                    background: #38bdf8;
                    color: #0f172a;
                    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
                }

                body.dark-mode .home-toggle-btn {
                    background: #10b981;
                    color: #0f172a;
                    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
                }

                /* ★ KaTeX (다크 모드) */
                body.dark-mode .katex { color: #f1f5f9; }
            

/* ============================================================
   Flask API 프런트엔드 추가 스타일
   기존 백업 HTML의 디자인을 유지하면서 페이지네이션 UI를 추가합니다.
   ============================================================ */

.search-results-list { display: none; }
.search-results-list.active { display: block; }
.search-result-item { cursor: pointer; }

.api-status-strip {
    max-width: 1500px;
    margin: 12px auto 0;
    padding: 0 20px;
    color: #64748b;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.api-page-summary {
    max-width: 1500px;
    margin: 12px auto;
    padding: 0 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 14px;
}

.api-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 10px 24px;
}

.api-pagination button {
    min-width: 42px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    box-shadow: none;
    font-size: 14px;
}

.api-pagination button:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.api-pagination button.page-current {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.api-page-info {
    min-width: 110px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.api-empty-state, .api-loading-state, .api-error-state {
    margin: 22px 0;
    padding: 38px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    line-height: 1.7;
}

.api-error-state {
    color: #b91c1c;
}

/* 로딩 애니메이션 */
.api-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.loading-spinner {
    display: inline-block;
    width: 38px;
    height: 38px;
    border: 4px solid rgba(0, 123, 255, 0.18);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: stock-list-spin 0.8s linear infinite;
}

.loading-message {
    font-size: 15px;
    font-weight: 700;
}

@keyframes stock-list-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
    }
}

/* 공통 하단 저작권 표시 */
.site-footer {
    width: 100%;
    margin: 28px auto 18px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    line-height: 1.6;
}

/* 모든 목록 열의 정렬 가능 표시 */
.list-table th[onclick] {
    cursor: pointer;
}

.list-table th[onclick]:hover {
    background-color: #e9f2ff;
}

/* 그룹·시장 필터 버튼 */
.list-table th .column-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent !important;
    color: inherit;
    font-size: 12px;
    line-height: 1;
    box-shadow: none !important;
    vertical-align: middle;
}

.list-table th .column-filter-btn:hover {
    transform: none;
    background: rgba(0, 123, 255, 0.12) !important;
    box-shadow: none !important;
}

body.dark-mode .site-footer {
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .list-table th[onclick]:hover {
    background-color: #1e3a5f;
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.home-summary-card {
    min-width: 0;
    padding: 16px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.home-summary-label { color: #64748b; font-size: 13px; font-weight: 700; }
.home-summary-value { margin-top: 5px; color: #0f172a; font-size: 22px; font-weight: 900; overflow-wrap: anywhere; }
.home-summary-sub { margin-top: 3px; color: #94a3b8; font-size: 11px; }

.home-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.home-chart-card {
    min-width: 0;
    padding: 16px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.home-chart-card h3 {
    margin: 0 0 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}

.home-chart-canvas { position: relative; height: 220px; max-height: 260px; }
.home-chart-note { margin-top: 8px; text-align: center; color: #94a3b8; font-size: 11px; }

.list-view-container { min-width: 0; }
.list-table-wrapper { overflow-x: auto; }
.header-scroll-container { min-width: 1100px; }
.list-table { min-width: 1100px; }
.virtual-scroll-viewport { height: auto !important; overflow: visible !important; }
.virtual-scroll-content { position: static !important; transform: none !important; }
.virtual-scroll-spacer { display: none !important; }

.list-page-toolbar {
    max-width: 1500px;
    margin: 10px auto 0;
    padding: 0 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 13px;
}

.list-page-toolbar .filter-reset-btn {
    padding: 7px 12px;
    font-size: 13px;
    background: #64748b;
    box-shadow: none;
}

.list-page-toolbar .filter-reset-btn:hover { background: #475569; }

.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover { background: #eef6ff; }
.list-table tbody tr td { height: 48px; }

.detail-load-indicator {
    margin: 16px auto;
    max-width: 1500px;
    color: #64748b;
    text-align: center;
}

.stock-ticker { user-select: all; }
.metric-cell-clickable { cursor: pointer; }
.metric-cell-clickable:hover { outline: 2px solid #007bff; outline-offset: -2px; }

body.dark-mode .home-summary-card,
body.dark-mode .home-chart-card,
body.dark-mode .api-empty-state,
body.dark-mode .api-loading-state,
body.dark-mode .api-error-state {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .home-summary-label,
body.dark-mode .home-summary-sub,
body.dark-mode .home-chart-note,
body.dark-mode .api-page-summary,
body.dark-mode .list-page-toolbar { color: #94a3b8; }
body.dark-mode .home-summary-value,
body.dark-mode .home-chart-card h3 { color: #f8fafc; }
body.dark-mode .api-pagination button { background: #1e293b; color: #cbd5e1; border-color: #475569; }
body.dark-mode .api-pagination button.page-current { background: #2563eb; color: #fff; border-color: #2563eb; }
body.dark-mode .list-table tbody tr:hover { background: rgba(56, 189, 248, .10); }

@media (max-width: 700px) {
    .home-summary-grid { grid-template-columns: 1fr; }
    .home-chart-grid { grid-template-columns: 1fr; }
    .home-chart-canvas { height: 200px; }
    .api-status-strip { padding: 0 12px; }
    .list-page-toolbar { padding: 0 8px; }
}

/* 표의 컬럼 너비: 서버가 보내는 현재 페이지 데이터와 헤더 정렬 */
.list-table th.col-ticker, .list-table td.col-ticker { width: 90px; }
.list-table th.col-name, .list-table td.col-name { width: 180px; }
.list-table th.col-date, .list-table td.col-date { width: 115px; }
.list-table th.col-rating, .list-table td.col-rating { width: 72px; }
.list-table th.col-per, .list-table td.col-per { width: 78px; }
.list-table th.col-sales, .list-table td.col-sales { width: 125px; }
.list-table th.col-margin, .list-table td.col-margin { width: 115px; }
.list-table th.col-debt, .list-table td.col-debt { width: 100px; }
.list-table th.col-group, .list-table td.col-group { width: 145px; }
.list-table th.col-marketcap, .list-table td.col-marketcap { width: 125px; }
.list-table th.col-market, .list-table td.col-market { width: 90px; }

#searchCountryDropdownWrapper { min-width: 130px; }
.nav-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.metric-explanation h3 { margin: 0 0 4px; color: #0056b3; font-size: 20px; }
body.dark-mode .metric-explanation h3 { color: #38bdf8; }
