:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #111827;
    --sub: #6b7280;
    --line: #e5e7eb;
    --blue: #3182f6;
    --blue-soft: #eaf2ff;
    --green: #16a34a;
    --red: #dc2626;
    --orange: #f59e0b;
    --shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #f6f8fb 100%);
    color: var(--text);
}

.page {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 60px;
}

.hero {
    padding: 28px 8px 18px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hero h1 {
    margin: 18px 0 8px;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.subtitle {
    margin: 0;
    font-size: 20px;
    color: var(--text);
    font-weight: 700;
}

.hero-desc {
    margin-top: 14px;
    max-width: 720px;
    color: var(--sub);
    line-height: 1.7;
    font-size: 16px;
}

.search-card,
.metric-card,
.reason-card,
.chart-card,
.indicator-item {
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-card {
    padding: 18px;
    margin: 10px 0 24px;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-row input {
    flex: 1;
    height: 56px;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 0 18px;
    font-size: 18px;
    outline: none;
    background: #fbfcfe;
}

.search-row input:focus {
    border-color: rgba(49, 130, 246, 0.5);
    box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.08);
}

.search-row button {
    min-width: 140px;
    border: none;
    border-radius: 16px;
    background: var(--blue);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.search-row button:hover {
    transform: translateY(-1px);
}

.search-row button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.status-text {
    margin: 12px 4px 0;
    color: var(--sub);
    font-size: 14px;
}

.status-text.error {
    color: var(--red);
    font-weight: 600;
}

.hidden {
    display: none;
}

.result-section {
    margin-top: 10px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 20px;
    min-height: 132px;
}

.label {
    color: var(--sub);
    font-size: 14px;
    margin-bottom: 12px;
}

.value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.value.large {
    font-size: 24px;
    line-height: 1.35;
}

.subvalue {
    margin-top: 10px;
    color: var(--sub);
    font-size: 14px;
    line-height: 1.5;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    background: #eef2ff;
    color: #3730a3;
}

.grade-strong-buy {
    background: #e8fff1;
    color: #0f9f4f;
}

.grade-buy {
    background: #eff8ff;
    color: #1767d1;
}

.grade-hold {
    background: #fff8e8;
    color: #b7791f;
}

.grade-sell {
    background: #fff1f2;
    color: #e11d48;
}

.grade-strong-sell {
    background: #fee2e2;
    color: #b91c1c;
}

.reason-card,
.chart-card {
    padding: 20px;
    margin-bottom: 16px;
}

.reason-card h3,
.chart-card h3,
.section-title {
    margin: 0 0 14px;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.reason-card ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
    line-height: 1.8;
}

.chart-box {
    width: 100%;
    height: 440px;
}

.chart-box.small {
    height: 320px;
}

.dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.indicator-item {
    padding: 18px;
}

.indicator-name {
    font-size: 14px;
    color: var(--sub);
    margin-bottom: 10px;
}

.indicator-value {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.indicator-note {
    margin-top: 8px;
    font-size: 13px;
    color: var(--sub);
}

.disclaimer {
    margin: 18px 6px 0;
    color: var(--sub);
    font-size: 13px;
    line-height: 1.7;
}

.site-footer {
    margin-top: 40px;
    padding: 24px 8px 10px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.8;
}

.site-footer small {
    display: block;
}

.site-footer a {
    color: #6b7280;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* recent */
.recent-section {
    margin: 0 0 24px;
}

.recent-card {
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.recent-header h3 {
    margin: 0;
    font-size: 17px;
}

.clear-btn {
    display: inline-block;
    visibility: visible;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--sub);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 38px;
}

.ticker-chip-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fbff;
    border: 1px solid #dbe2ea;
    border-radius: 999px;
    padding: 6px 8px 6px 12px;
}

.ticker-chip {
    border: none;
    background: transparent;
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.ticker-delete-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 4px;
}

.empty-chip {
    color: var(--sub);
    font-size: 14px;
}

/* top10 */
.top10-section {
    display: block;
    visibility: visible;
    margin: 0 0 24px;
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.top10-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.top10-header h3 {
    margin: 0;
    font-size: 18px;
}

.top10-btn {
    display: inline-block;
    visibility: visible;
    border: none;
    background: var(--blue);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.top10-btn:hover {
    transform: translateY(-1px);
    background: #1d4ed8;
}

.top10-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.top10-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.top10-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.top10-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.top10-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.top10-ticker {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.top10-score {
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
}

.top10-name {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 10px;
}

.top10-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 8px;
}

.top10-comment {
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .indicator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page {
        width: min(100% - 20px, 1200px);
        padding-top: 24px;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row button {
        height: 54px;
        width: 100%;
    }

    .summary-grid,
    .dual-grid,
    .indicator-grid,
    .top10-grid {
        grid-template-columns: 1fr;
    }

    .chart-box {
        height: 320px;
    }

    .chart-box.small {
        height: 280px;
    }

    .value {
        font-size: 26px;
    }

    .recent-header,
    .top10-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 4px;
}

.nav-logo {
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--sub);
    font-weight: 700;
}

.nav-links a.active {
    background: var(--blue-soft);
    color: var(--blue);
}

.hero.inner {
    padding-top: 12px;
}

.coupang-section {
    display: flex;
    justify-content: center;
    margin: 0 0 24px;
}

.market-home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
}

.market-home-card {
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.market-home-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.09);
}

.market-home-card h2 {
    margin: 12px 0 8px;
    font-size: 28px;
}

.market-home-card p {
    margin: 0 0 14px;
    color: var(--sub);
    line-height: 1.7;
}

.market-badge {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.market-badge.kr {
    background: #ecfeff;
    color: #0891b2;
}

.market-link {
    display: inline-block;
    font-weight: 800;
    color: var(--blue);
}

.market-select {
    min-width: 150px;
    height: 56px;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 0 14px;
    font-size: 15px;
    background: #fbfcfe;
    outline: none;
}

.kr-suggest-list {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.kr-suggest-list.active {
    display: flex;
}

.kr-suggest-btn {
    border: 1px solid #dbe2ea;
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    text-align: left;
    min-width: 180px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.kr-suggest-btn:hover {
    transform: translateY(-1px);
}

.kr-suggest-name {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.kr-suggest-meta {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.top10-btn {
    border: none;
    background: var(--blue);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 760px) {
    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .market-home-grid {
        grid-template-columns: 1fr;
    }

    .coupang-section iframe {
        width: 100%;
        max-width: 680px;
    }

    .market-select {
        width: 100%;
    }
}

.top-visit-counter {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.home-today-section {
    margin-top: 28px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
    font-size: 24px;
    color: #0f172a;
}

.section-head p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}

.home-market-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.home-market-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.home-market-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-market-head h3 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}

.home-market-head a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.mini-today-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-today-item {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
}

.home-today-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.home-today-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.home-today-mid {
    margin-top: 6px;
    font-size: 13px;
    color: #475569;
}

.home-today-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.tiny-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
}

.empty-box {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    border-radius: 14px;
    padding: 14px;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 768px) {
    .home-market-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== US/KR dashboard sidebar ===== */

.insight-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.insight-main {
    min-width: 0;
}

.insight-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
}


.insight-card {
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.insight-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.insight-card-head h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.stack-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-action-btn {
    border: none;
    background: var(--blue);
    color: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.mini-action-btn:hover {
    transform: translateY(-1px);
    background: #1d4ed8;
}

.mini-stock-btn,
.chip-stock-btn,
.watchlist-main {
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #f8fbff;
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mini-stock-btn:hover,
.chip-stock-btn:hover,
.watchlist-main:hover {
    transform: translateY(-1px);
    background: #eff6ff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.mini-stock-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.mini-stock-mid {
    margin-top: 6px;
    font-size: 13px;
    color: #475569;
}

.mini-stock-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.mini-stock-reason {
    margin-top: 8px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.chip-stock-btn {
    display: block;
}

.chip-stock-btn span {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.chip-stock-btn small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.watchlist-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.watchlist-main strong {
    display: block;
    font-size: 14px;
    color: #111827;
}

.watchlist-main small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.remove-watch-btn {
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.remove-watch-btn:hover {
    background: #fecaca;
}

.alert-item {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-item.good {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-item.warn {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.alert-item.info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.news-item {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px;
    background: #ffffff;
}

.news-link {
    display: block;
    color: #111827;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.45;
}

.news-link:hover {
    color: var(--blue);
}

.news-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.news-item p {
    margin: 8px 0 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .insight-layout {
        grid-template-columns: 1fr;
    }

    .insight-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .insight-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .watchlist-item {
        grid-template-columns: 1fr;
    }

    .remove-watch-btn {
        width: 100%;
    }

    .mini-stock-top,
    .mini-stock-meta,
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
html {
    -webkit-text-size-adjust: 100%;
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

.search-row input,
.market-select,
.search-row button {
    font-size: 16px;
}

.coupang-section iframe {
    width: min(100%, 680px);
    max-width: 100%;
}

@media (max-width: 760px) {
    .page {
        width: min(100% - 16px, 1200px);
    }

    .top-visit-counter {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .subtitle {
        font-size: 17px;
    }

    .hero-desc {
        font-size: 14px;
    }

    .search-row input,
    .market-select {
        height: 52px;
        font-size: 16px;
    }

    .search-row button {
        height: 52px;
        font-size: 16px;
    }

    .insight-sidebar {
        position: static;
    }
}

.analysis-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.analysis-main {
    flex: 1 1 auto;
    min-width: 0;
}

.insight-sidebar {
    flex: 0 0 340px;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: static;
    z-index: 3;
}

.chart-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.chart-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.chart-card h3 {
    margin: 0 0 14px 0;
}

#priceChart,
#macdChart,
#oscillatorChart {
    width: 100%;
    min-height: 360px;
}

.js-plotly-plot,
.plot-container,
.plotly,
.plotly-graph-div {
    width: 100% !important;
    max-width: 100% !important;
}

.insight-card,
.sidebar-card,
.news-card {
    position: relative;
    z-index: 4;
}

@media (max-width: 980px) {
    .analysis-layout {
        flex-direction: column;
    }

    .analysis-main,
    .insight-sidebar {
        width: 100%;
        flex: 1 1 auto;
    }

    .insight-sidebar {
        order: 2;
    }

    .chart-stack {
        order: 1;
    }

    #priceChart,
    #macdChart,
    #oscillatorChart {
        min-height: 300px;
    }
}

.chart-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.insight-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.insight-main {
    flex: 1 1 auto;
    min-width: 0;
}

.insight-sidebar {
    width: 340px;
    flex: 0 0 340px;
    position: static;
    z-index: 3;
}

.chart-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

#priceChart,
#macdChart,
#oscillatorChart {
    width: 100%;
    min-height: 360px;
}

.js-plotly-plot,
.plot-container,
.plotly,
.plotly-graph-div {
    width: 100% !important;
    max-width: 100% !important;
}

.insight-card {
    position: relative;
    z-index: 4;
}

@media (max-width: 980px) {
    .insight-layout {
        flex-direction: column;
    }

    .insight-main,
    .insight-sidebar {
        width: 100%;
        flex: 1 1 auto;
    }

    #priceChart,
    #macdChart,
    #oscillatorChart {
        min-height: 300px;
    }
}
.visit-strip {
    width: min(1120px, calc(100% - 32px));
    margin: 14px auto 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.visit-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.visit-label {
    color: #64748b;
    font-weight: 600;
}

.visit-pill strong {
    color: #111827;
    font-size: 15px;
}

@media (max-width: 640px) {
    .visit-strip {
        gap: 8px;
    }

    .visit-pill {
        padding: 9px 13px;
        font-size: 13px;
    }

    .visit-pill strong {
        font-size: 14px;
    }
}

/* =========================
   Compare / Top10 Add-on
========================= */

.nav-links a.active,
.nav-links a:hover {
    color: #111827;
    background: #e5f0ff;
    border-radius: 10px;
    padding: 8px 12px;
}

.top10-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.top10-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.top10-header h3 {
    margin: 0;
    font-size: 22px;
    color: #111827;
}

.top10-btn {
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.top10-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.top10-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.top10-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.top10-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.top10-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.15);
}

.top10-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.top10-ticker {
    font-size: 14px;
    font-weight: 800;
    color: #2563eb;
}

.top10-score {
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.top10-name {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
    line-height: 1.35;
}

.top10-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.top10-comment {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.55;
}

.status-text.error {
    color: #dc2626;
    font-weight: 600;
}

.empty-chip,
.empty-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    border-radius: 14px;
    padding: 14px 16px;
}

.kr-suggest-list {
    display: none;
    margin-top: 12px;
    gap: 10px;
    flex-direction: column;
}

.kr-suggest-list.active {
    display: flex;
}

.kr-suggest-btn {
    width: 100%;
    text-align: left;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.kr-suggest-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.kr-suggest-name {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.kr-suggest-meta {
    display: block;
    font-size: 13px;
    color: #6b7280;
}

.compare-link-btn,
.market-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.compare-link-btn:hover,
.market-link-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.market-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.market-home-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.market-home-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.market-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 10px;
    margin-bottom: 12px;
}

.market-badge.kr {
    background: #dcfce7;
    color: #166534;
}

.market-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: 700;
    color: #2563eb;
}

.grade-badge.grade-strong-buy {
    background: #166534;
    color: #ffffff;
}

.grade-badge.grade-buy {
    background: #15803d;
    color: #ffffff;
}

.grade-badge.grade-hold {
    background: #a16207;
    color: #ffffff;
}

.grade-badge.grade-sell {
    background: #dc2626;
    color: #ffffff;
}

.grade-badge.grade-strong-sell {
    background: #7f1d1d;
    color: #ffffff;
}

@media (max-width: 1024px) {
    .top10-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .top10-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .top10-btn {
        width: 100%;
    }

    .top10-grid {
        grid-template-columns: 1fr;
    }

    .market-home-grid {
        grid-template-columns: 1fr;
    }

    .top10-name {
        font-size: 17px;
    }
}
