:root {
    --bg-0: #07080c;
    --bg-1: #0c0f17;
    --text-primary: #eef2f8;
    --text-secondary: #97a3b6;
    --text-muted: #5f6b80;

    --glass-bg: rgba(255, 255, 255, 0.035);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-strong: rgba(255, 255, 255, 0.16);

    --accent: #6366f1;
    --accent-2: #22d3ee;
    --accent-glow: rgba(99, 102, 241, 0.45);

    --positive: #34d399;
    --negative: #fb7185;

    --radius: 18px;
    --radius-sm: 11px;
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-0);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
    position: relative;
    overflow-x: clip;
}

/* Ambient animated background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(50rem 50rem at 12% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(45rem 45rem at 95% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
        radial-gradient(60rem 50rem at 50% 120%, rgba(124, 58, 237, 0.12), transparent 60%),
        linear-gradient(180deg, var(--bg-1), var(--bg-0));
    animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(0, -2%, 0) scale(1.05); }
}

a {
    color: var(--accent-2);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}
a:hover { color: #67e8f9; }

.app-container {
    width: 100%;
    margin: 0;
    padding: 5rem 1.4rem 4rem;   /* 상단 고정바 높이만큼 여백 */
}

/* page-level 2-column layout: big analysis area + right search/history rail */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 1.5rem;
    align-items: start;
}
.layout-main { min-width: 0; }
.layout-rail {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: calc(100vh - 6rem);
}
.layout-rail .search-main { padding: 1.3rem 1.4rem; }
.layout-rail .search-history { padding: 1.3rem 1.4rem; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .layout-rail { position: static; max-height: none; }
}

/* ---------- Glass panel ---------- */
.glass-panel {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
/* subtle top highlight */
.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ---------- Header (floating top bar) ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
    padding: 0.8rem 1.5rem;
    position: fixed;
    top: 0.9rem;
    left: 1.4rem;
    right: 1.4rem;
    z-index: 200;
    margin: 0;
    border-radius: 16px;
    border: 1px solid var(--glass-border-strong);
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.85);
    background: rgba(12, 15, 23, 0.72);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
}

header h1 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.logo-icon {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.45));
    animation: logoFloat 4s var(--ease) infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-2px) rotate(-3deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
header h1 span {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav a {
    margin-left: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    transition: all 0.2s var(--ease);
}
nav a.active, nav a:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover);
}

/* ---------- Section headings ---------- */
section > h2,
.stocks-overview h2,
.recent-posts h2,
.search-main h2,
.search-history h2 {
    margin-top: 0;
    margin-bottom: 1.4rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.stocks-overview > h2::before,
.recent-posts > h2::before {
    content: "";
    width: 4px;
    height: 1.05em;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

/* ---------- Grids ---------- */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

/* ---------- Cards ---------- */
.stat-card {
    padding: 1.6rem 1.6rem 1.75rem;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--glass-border-strong);
    box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.85);
}

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-card .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* glow accents */
.positive-glow {
    border-color: rgba(52, 211, 153, 0.28);
    box-shadow: 0 18px 50px -24px rgba(52, 211, 153, 0.35);
}
.negative-glow {
    border-color: rgba(251, 113, 133, 0.28);
    box-shadow: 0 18px 50px -24px rgba(251, 113, 133, 0.35);
}

.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.positive-glow .value,
.negative-glow .value {
    background: none;
    -webkit-text-fill-color: initial;
}
.positive-glow .value { color: var(--positive); }
.negative-glow .value { color: var(--negative); }

/* The bullish/bearish stat cards (no price) get gradient numbers */
.stats-overview .stat-card:not(.positive-glow):not(.negative-glow) .value {
    background: linear-gradient(120deg, #fff, #97a3b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Badges ---------- */
.badge {
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid var(--glass-border);
}
.badge-damoang { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; border-color: rgba(99,102,241,0.35); }
.badge-clien { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border-color: rgba(52,211,153,0.32); }
.badge-bobaedream { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245,158,11,0.32); }

/* ---------- Finance details ---------- */
.finance-details {
    margin-top: 1.1rem;
    padding: 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem 1.25rem;
}
.finance-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.finance-details span { color: var(--text-muted); }
.finance-details strong {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ---------- OHLCV stats ---------- */
.ohlcv {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem 0.9rem;
    padding: 0.9rem 1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.ohlcv-item { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.ohlcv-item span { color: var(--text-muted); font-size: 0.8rem; }
.ohlcv-item strong { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; font-weight: 500; }

/* ---------- Chart period tabs ---------- */
.period-tabs { display: flex; gap: 0.4rem; margin-top: 1rem; }
.period-tab {
    flex: 1;
    padding: 0.45rem 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s var(--ease);
}
.period-tab:hover { color: var(--text-primary); border-color: var(--glass-border-strong); }
.period-tab.active {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px -8px var(--accent-glow);
}

/* ---------- Price chart (live) ---------- */
.chart-wrap {
    position: relative;
    height: 190px;
    margin-top: 1.2rem;
    padding: 0.6rem 0.2rem 0.2rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
/* sweeping "data collecting" shimmer */
.chart-scan {
    position: absolute;
    top: 0; bottom: 0;
    left: -20%;
    width: 20%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.10) 45%, rgba(34, 211, 238, 0.16) 50%, rgba(34, 211, 238, 0.10) 55%, transparent);
    animation: scan 3s linear infinite;
}
@keyframes scan { 0% { left: -20%; } 100% { left: 100%; } }

.live-badge {
    position: absolute;
    top: 8px; right: 11px;
    z-index: 2;
    display: flex; align-items: center; gap: 5px;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    pointer-events: none;
}
.live-badge::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--positive);
    box-shadow: 0 0 8px var(--positive);
    animation: blink 1.1s var(--ease) infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.25; transform: scale(0.7); } }

/* ---------- Watch board (left/right slots) ---------- */
.watch-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2.25rem;
    align-items: start;
}
.watch-slot { min-width: 0; }
.watch-slot .stat-card { text-align: left; }

.slot-empty {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2.5rem 1.5rem;
    border: 1.5px dashed var(--glass-border);
    border-radius: var(--radius);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.012);
}
.slot-empty-arrow {
    font-size: 1.6rem;
    color: var(--accent);
    opacity: 0.6;
}
.slot-empty-text { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); }
.slot-empty-text span { display: block; font-size: 0.82rem; font-weight: 400; color: var(--text-muted); margin-top: 0.2rem; }

.slot-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.slot-head h3 { margin: 0 0 0.6rem 0; }
.slot-remove {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.18s var(--ease);
}
.slot-remove:hover { color: var(--negative); border-color: rgba(251,113,133,0.4); background: rgba(251,113,133,0.1); }

.slot-change { font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; margin-top: 0.15rem; }
.slot-updated { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.45rem; }

.value.flash { animation: priceFlash 0.9s var(--ease); }
@keyframes priceFlash {
    0% { background: rgba(99,130,246,0); }
    25% { color: #fff; text-shadow: 0 0 18px var(--accent-glow); }
    100% { text-shadow: none; }
}

.slot-actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.slot-actions .ai-button { margin-top: 0; flex: 1; }
.ai-button.alt {
    background: linear-gradient(135deg, #16a34a, #0ea5e9);
}
.ai-button.tg {
    background: linear-gradient(135deg, #2AABEE, #229ED2);
}
.ai-button.news {
    background: linear-gradient(135deg, #f59e0b, #ef6c00);
}
.slot-actions .ai-button { font-size: 0.86rem; padding: 0.7rem 0.4rem; }

.cmt-link { text-decoration: none; transition: color 0.15s var(--ease); }
.cmt-link:hover { color: var(--accent-2); text-decoration: underline; }

@media (max-width: 880px) {
    .watch-board { grid-template-columns: 1fr; }
}

/* ---------- Community sentiment ---------- */
.community-box {
    margin-top: 1.1rem;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    animation: fadeUp 0.4s var(--ease);
}
.community-head {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.community-src { font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }

.gauge-row {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}
.gauge-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}
.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.gauge-signal {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
}
.gauge-signal.buy { color: var(--positive); }
.gauge-signal.sell { color: var(--negative); }
.gauge-signal.neutral { color: var(--text-secondary); }
.gauge-score { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.2rem; }
.gauge-score span { color: var(--text-muted); font-size: 0.7rem; }

.gauge-legend { display: flex; flex-direction: column; gap: 0.55rem; }
.leg {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.leg strong { margin-left: auto; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }
.leg .dot { width: 10px; height: 10px; border-radius: 50%; }
.leg.buy .dot { background: var(--positive); }
.leg.neutral .dot { background: #5f6b80; }
.leg.sell .dot { background: var(--negative); }

.community-summary {
    margin-top: 1.1rem;
    padding: 0.85rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e6e9f5;
}

.cmt-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.cmt-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.85rem;
}
.cmt-item:last-child { border-bottom: none; }
.cmt-tag {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.16rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid transparent;
}
.cmt-tag.buy { background: rgba(52,211,153,0.16); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
.cmt-tag.sell { background: rgba(251,113,133,0.16); color: #fda4af; border-color: rgba(251,113,133,0.3); }
.cmt-tag.neutral { background: rgba(148,163,184,0.12); color: #cbd5e1; border-color: rgba(148,163,184,0.25); }
.cmt-text { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- AI button + result ---------- */
.ai-button {
    margin-top: 1.2rem;
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--accent), #4f46e5 55%, var(--accent-2));
    background-size: 160% 160%;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-position 0.5s var(--ease);
    box-shadow: 0 10px 24px -12px var(--accent-glow);
}
.ai-button:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow: 0 16px 32px -12px var(--accent-glow);
}
.ai-button:active { transform: translateY(0); }
.ai-button:disabled {
    background: #2b3242;
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ai-result-box {
    margin-top: 1.1rem;
    padding: 1.1rem 1.2rem;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.65;
    color: #e6e9f5;
    animation: fadeUp 0.4s var(--ease);
}
.ai-result-box strong { color: #c7d2fe; }

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

/* loader shimmer */
.loader {
    display: inline-block;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.4rem;
}
.loader::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Market index bar ---------- */
.index-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}
.index-loading {
    grid-column: 1 / -1;
    padding: 1.2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.index-card {
    padding: 0.95rem 1.05rem 1rem;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.index-card:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); }

.idx-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.idx-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}
.idx-spark { width: 64px; height: 28px; flex-shrink: 0; }

.idx-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.32rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.idx-change {
    margin-top: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    font-weight: 500;
}
.index-card.up .idx-change, .index-card.up .idx-value { color: var(--positive); }
.index-card.down .idx-change, .index-card.down .idx-value { color: var(--negative); }
.index-card.up { border-color: rgba(52,211,153,0.22); }
.index-card.down { border-color: rgba(251,113,133,0.22); }

@media (max-width: 980px) {
    .index-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .index-bar { grid-template-columns: 1fr; }
}

/* ---------- Candidate selection ---------- */
.candidate-box { padding: 1.1rem 1.2rem; animation: fadeUp 0.35s var(--ease); }
.candidate-head {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 0.85rem;
}
.candidate-head strong { color: var(--accent-2); font-family: 'JetBrains Mono', monospace; }
.candidate-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 360px;
    overflow-y: auto;
}
.candidate-list::-webkit-scrollbar { width: 6px; }
.candidate-list::-webkit-scrollbar-thumb { background: var(--glass-border-strong); border-radius: 99px; }
.candidate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.94rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.16s var(--ease);
}
.candidate-item:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateX(3px);
    box-shadow: -3px 0 0 0 var(--accent);
}
.cand-name { font-weight: 600; }
.cand-meta { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.cand-market {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.16rem 0.5rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.16);
    color: #c7d2fe;
    border: 1px solid rgba(99,102,241,0.3);
}
.cand-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---------- Search section ---------- */
.search-section {
    margin-bottom: 2.25rem;
}
.search-main, .search-history { padding: 1.5rem 1.6rem; }

.search-bar {
    display: flex;
    gap: 0.7rem;
}
.search-bar input {
    flex: 1;
    padding: 0.95rem 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.search-bar input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}
.search-bar input::placeholder { color: var(--text-muted); }

.search-btn {
    padding: 0 1.15rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    background-size: 160% 160%;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-position 0.5s var(--ease);
    box-shadow: 0 10px 24px -12px var(--accent-glow);
}
.search-btn:hover {
    transform: translateY(-2px);
    background-position: 100% 0;
    box-shadow: 0 16px 30px -12px var(--accent-glow);
}
.search-btn:active { transform: translateY(0); }

#search-result { margin-top: 1.3rem; }
#search-result:empty { margin-top: 0; }
#search-result .stat-card { animation: fadeUp 0.4s var(--ease); }

.search-loading {
    padding: 1.6rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.search-error {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-sm);
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.32);
    color: #fda4af;
    font-size: 0.9rem;
    animation: fadeUp 0.35s var(--ease);
}

/* ---------- Search history ---------- */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}
.history-header h2 { margin: 0; }

.clear-history-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 9999px;
    padding: 0.32rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.clear-history-btn:hover {
    color: #fda4af;
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.08);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 0.2rem;
}
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-thumb {
    background: var(--glass-border-strong);
    border-radius: 99px;
}

.history-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 2rem 0.5rem;
    text-align: center;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-sm);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.72rem 0.9rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s var(--ease);
}
.history-item:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(3px);
    box-shadow: -3px 0 0 0 var(--accent);
}
.hist-name {
    font-weight: 600;
    font-size: 0.94rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}
.hist-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-code {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}
.hist-price {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- Recent posts table ---------- */
.recent-posts { padding: 1.75rem 1.85rem; }
.table-responsive { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
th {
    text-align: left;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.92rem;
    vertical-align: middle;
}
tbody tr { transition: background 0.18s var(--ease); }
tbody tr:hover td { background-color: rgba(99, 102, 241, 0.06); }
tbody tr:last-child td { border-bottom: none; }

.sentiment-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.26rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.sentiment-positive { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
.sentiment-negative { background: rgba(251, 113, 133, 0.14); color: #fda4af; border-color: rgba(251,113,133,0.3); }
.sentiment-neutral { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border-color: rgba(148,163,184,0.25); }

.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-semibold { font-family: 'JetBrains Mono', monospace; font-size: 0.88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .search-section { grid-template-columns: 1fr; }
    .app-container { padding: 4.5rem 1.1rem 3rem; }   /* 고정 헤더 높이만큼 여백 유지 */
    /* 헤더는 모바일에서도 상단 고정 유지 (sysmon/clock은 760px에서 숨김) */
}

/* ---------- Auto analysis panel ---------- */
.analysis-panel { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.analysis-panel:empty { display: none; }
.ana-section:empty { display: none; }
.ana-section {
    padding: 1.1rem 1.2rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.ana-head {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    margin-bottom: 0.9rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
}
.ana-src { font-family: 'Inter', sans-serif; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.ana-loading { padding: 0.6rem 0; color: var(--text-secondary); font-size: 0.88rem; }

@keyframes revealUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: revealUp 0.5s var(--ease) both; }

/* news regions */
.news-overall {
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.55;
    margin-bottom: 0.9rem;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--text-muted);
}
.news-overall.buy { border-left-color: var(--positive); }
.news-overall.sell { border-left-color: var(--negative); }
.news-overall strong { font-family: 'Space Grotesk', sans-serif; }
.news-overall.buy strong { color: var(--positive); }
.news-overall.sell strong { color: var(--negative); }

.region-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.region-card {
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--glass-border);
    border-left-width: 3px;
}
.region-card.buy { border-left-color: var(--positive); }
.region-card.sell { border-left-color: var(--negative); }
.region-card.neutral { border-left-color: #5f6b80; }
.region-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.region-name { font-weight: 700; font-size: 0.92rem; }
.region-tag {
    font-size: 0.66rem; font-weight: 700; padding: 0.14rem 0.5rem; border-radius: 9999px;
    border: 1px solid transparent;
}
.region-tag.buy { background: rgba(52,211,153,0.16); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }
.region-tag.sell { background: rgba(251,113,133,0.16); color: #fda4af; border-color: rgba(251,113,133,0.3); }
.region-tag.neutral { background: rgba(148,163,184,0.12); color: #cbd5e1; border-color: rgba(148,163,184,0.25); }
.region-count { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.region-summary { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.5rem; }
.region-titles { display: flex; flex-direction: column; gap: 0.25rem; }
.region-title { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
a.region-title { color: var(--text-secondary); }
a.region-title:hover { color: var(--accent-2); }
.news-src {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 700;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 5px;
    padding: 0.02rem 0.36rem;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* synthesis */
.synth-card {
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(99,102,241,0.04));
    border: 1px solid rgba(99,102,241,0.3);
}
.synth-card.pending { background: rgba(0,0,0,0.2); border-color: var(--glass-border); }
.synth-card.buy { background: linear-gradient(180deg, rgba(52,211,153,0.14), rgba(52,211,153,0.04)); border-color: rgba(52,211,153,0.35); }
.synth-card.sell { background: linear-gradient(180deg, rgba(251,113,133,0.14), rgba(251,113,133,0.04)); border-color: rgba(251,113,133,0.35); }
.synth-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.synth-label { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.02rem; }
.synth-label em { font-style: normal; font-size: 0.72rem; color: var(--text-muted); font-weight: 500; margin-left: 0.3rem; }
.synth-signal {
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.05rem;
    padding: 0.25rem 0.85rem; border-radius: 9999px;
}
.synth-signal b { font-family: 'JetBrains Mono', monospace; }
.synth-signal.buy { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.synth-signal.sell { background: rgba(251,113,133,0.18); color: #fda4af; }
.synth-signal.neutral { background: rgba(148,163,184,0.14); color: #cbd5e1; }
.synth-summary { font-size: 0.92rem; line-height: 1.65; color: #e6e9f5; }
.synth-action {
    margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px dashed var(--glass-border);
    font-size: 0.88rem; color: var(--text-secondary);
}

/* ---------- Daily fortune (fun) ---------- */
.fortune {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(120deg, rgba(124,58,237,0.14), rgba(34,211,238,0.08));
    border: 1px solid rgba(124,58,237,0.3);
    position: relative;
    overflow: hidden;
}
.fortune.buy { border-color: rgba(52,211,153,0.35); }
.fortune.sell { border-color: rgba(251,113,133,0.35); }
.fortune-emoji { font-size: 1.8rem; flex-shrink: 0; }
.fortune-body { min-width: 0; flex: 1; }
.fortune-top { font-size: 0.86rem; font-weight: 600; }
.fortune-top b { font-family: 'Space Grotesk', sans-serif; }
.fortune-score { font-size: 0.72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-left: 0.2rem; }
.fortune-msg { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.fortune-time { color: var(--text-muted); margin-left: 0.3rem; }
.fortune-tag {
    position: absolute; top: 6px; right: 8px;
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em;
    color: #c4b5fd; background: rgba(124,58,237,0.2);
    padding: 0.1rem 0.4rem; border-radius: 5px;
}

/* ---------- Short-term timing ---------- */
.synth-card.timing { margin-top: 0.8rem; }
.catalysts { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.catalyst {
    font-size: 0.76rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 7px;
    padding: 0.22rem 0.55rem;
}

/* ---------- News Korean / original lines ---------- */
.news-line { display: block; }
.news-date {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.news-date.fresh { color: #6ee7b7; }
.news-date.fresh::before { content: "● "; }
.news-orig {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.75;
    margin-top: 0.1rem;
    margin-left: 0.1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.region-title { white-space: normal; }

/* ---------- Auth panel ---------- */
.auth-panel { padding: 1.2rem 1.4rem; }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.auth-tab {
    flex: 1; padding: 0.5rem; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-family: inherit; font-weight: 600; font-size: 0.88rem;
    transition: all 0.18s var(--ease);
}
.auth-tab.active { background: linear-gradient(135deg, var(--accent), #4f46e5); color: #fff; border-color: transparent; }
.auth-form { display: flex; flex-direction: column; gap: 0.55rem; }
.auth-form input {
    padding: 0.7rem 0.9rem; background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border); border-radius: 8px;
    color: var(--text-primary); font-family: inherit; font-size: 0.92rem; outline: none;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.auth-btn {
    padding: 0.7rem; border: none; border-radius: 8px; cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    font-family: inherit; font-weight: 700; font-size: 0.92rem;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px var(--accent-glow); }
.auth-btn.ghost { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); padding: 0.4rem 0.8rem; font-weight: 600; font-size: 0.8rem; }
.auth-btn.ghost:hover { color: #fda4af; border-color: rgba(251,113,133,0.4); box-shadow: none; }
.auth-error { color: #fda4af; font-size: 0.8rem; min-height: 1em; }
.auth-logged { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.auth-user { font-size: 0.95rem; }
.auth-user b { font-family: 'Space Grotesk', sans-serif; }
.auth-birth { margin-top: 0.6rem; font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Slot star (watch) ---------- */
.slot-head-btns { display: flex; gap: 0.4rem; flex-shrink: 0; }
.slot-star {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
    color: var(--text-muted); cursor: pointer; font-size: 0.95rem; line-height: 1;
    transition: all 0.18s var(--ease);
}
.slot-star:hover { color: #fcd34d; border-color: rgba(245,158,11,0.4); }
.slot-star.on { color: #fcd34d; border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.1); }

.watch-del {
    background: transparent; border: none; color: #fcd34d; cursor: pointer;
    font-size: 0.95rem; padding: 0 0.2rem; flex-shrink: 0;
}
.watch-del:hover { color: #fda4af; }

/* ---------- Fortune extras ---------- */
.fortune-zodiac { font-size: 0.66rem; font-weight: 700; color: #c4b5fd; background: rgba(124,58,237,0.18); padding: 0.08rem 0.4rem; border-radius: 5px; margin-left: 0.2rem; }
.fortune-hint { font-size: 0.66rem; color: var(--text-muted); }

/* ---------- System monitor (header) ---------- */
.sysmon { display: flex; gap: 1.5rem; align-items: center; }
.sys-item { display: flex; align-items: center; gap: 0.55rem; }
.sys-label { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.sys-bar { width: 92px; height: 9px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sys-bar i { display: block; height: 100%; width: 2%; background: var(--positive); border-radius: 99px; transition: width 0.6s var(--ease), background 0.6s var(--ease); }
.sys-val { font-size: 0.85rem; font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); min-width: 42px; }
@media (max-width: 980px) { .sysmon { gap: 1rem; } .sys-bar { width: 64px; } }
@media (max-width: 760px) { .sysmon { display: none; } }

/* FX + commodity cards in the index bar */
.index-bar { grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); }
.index-card.fx .idx-name { color: #c4b5fd; }
.index-card.fx { background: rgba(124,58,237,0.04); }
.index-card.commodity .idx-name { color: #fcd34d; }
.index-card.commodity { background: rgba(245,158,11,0.04); }
@media (max-width: 760px) { .index-bar { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Defense sector valuation ---------- */
.defense-view { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.defense-tag {
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.05rem;
    padding: 0.25rem 0.9rem; border-radius: 9999px;
}
.defense-tag.buy { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.defense-tag.sell { background: rgba(251,113,133,0.18); color: #fda4af; }
.defense-tag.neutral { background: rgba(148,163,184,0.14); color: #cbd5e1; }
.defense-score { font-size: 0.82rem; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.defense-points { margin: 0.8rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.defense-points li { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.55; }

/* ---------- History individual delete ---------- */
.hist-right { display: flex; align-items: center; gap: 0.4rem; }
.hist-del {
    background: transparent; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 0.78rem; padding: 0 0.2rem; opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.history-item:hover .hist-del { opacity: 1; }
.hist-del:hover { color: var(--negative); }

/* ---------- My buy price / P&L ---------- */
.buyprice { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.buyprice label { font-size: 0.78rem; color: var(--text-muted); }
.buyprice input {
    width: 110px; padding: 0.35rem 0.6rem; background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border); border-radius: 7px; color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; outline: none;
}
.buyprice input:focus { border-color: var(--accent); }
.pl { font-size: 0.82rem; font-weight: 600; }
.pl b { font-family: 'JetBrains Mono', monospace; }

/* ---------- System monitor sparkline ---------- */
.sys-spark { width: 74px; height: 26px; display: inline-flex; }

/* ---------- KRX / 통합 market tabs ---------- */
.ohlcv-head { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; margin-bottom: 0.5rem; }
.ohlcv-title { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.market-tabs { display: flex; gap: 0.3rem; }
.market-tab {
    padding: 0.28rem 0.7rem; border-radius: 7px; cursor: pointer;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-family: inherit; font-weight: 600; font-size: 0.76rem;
    transition: all 0.16s var(--ease);
}
.market-tab small { font-size: 0.6rem; opacity: 0.7; }
.market-tab.active { background: linear-gradient(135deg, var(--accent), #4f46e5); color: #fff; border-color: transparent; }
.ohlcv { margin-top: 0; }

/* ---------- Today's issues → affected stocks ---------- */
.issues-section { padding: 1.5rem 1.6rem; margin-bottom: 1.5rem; }
.issues-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.issues-head h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 600; }
.issues-refresh {
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 1rem; transition: all 0.2s var(--ease);
}
.issues-refresh:hover { color: var(--text-primary); transform: rotate(90deg); }
.issues-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.issue-card {
    padding: 1.1rem 1.2rem; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border);
}
.issue-top { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.55rem; }
.issue-scope {
    font-size: 0.64rem; font-weight: 700; padding: 0.16rem 0.5rem; border-radius: 9999px; flex-shrink: 0;
}
.issue-scope.kr { background: rgba(52,211,153,0.16); color: #6ee7b7; }
.issue-scope.world { background: rgba(34,211,238,0.16); color: #67e8f9; }
.issue-title { font-weight: 700; font-size: 0.98rem; }
.issue-summary { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.85rem; }
.impact-chips { display: flex; flex-direction: column; gap: 0.45rem; }
.impact-chip {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.5rem 0.65rem; border-radius: 9px;
    background: rgba(255,255,255,0.025); border: 1px solid var(--glass-border); border-left-width: 3px;
}
.impact-chip.buy { border-left-color: var(--positive); }
.impact-chip.sell { border-left-color: var(--negative); }
.impact-chip.neutral { border-left-color: #fbbf24; }
.impact-tag { font-size: 0.66rem; font-weight: 700; padding: 0.12rem 0.45rem; border-radius: 9999px; flex-shrink: 0; }
.impact-tag.buy { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.impact-tag.sell { background: rgba(251,113,133,0.18); color: #fda4af; }
.impact-tag.neutral { background: rgba(245,158,11,0.16); color: #fcd34d; }
.impact-sector { font-weight: 600; font-size: 0.84rem; }
.impact-ex { font-size: 0.78rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ---------- Foreign/institutional flow table ---------- */
.flow-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.flow-table th {
    text-align: right; padding: 0.4rem 0.5rem; color: var(--text-muted);
    font-size: 0.72rem; font-weight: 600; border-bottom: 1px solid var(--glass-border);
    text-transform: none; letter-spacing: 0;
}
.flow-table th:first-child, .flow-table td:first-child { text-align: left; color: var(--text-secondary); }
.flow-table td { text-align: right; padding: 0.4rem 0.5rem; font-family: 'JetBrains Mono', monospace; border-bottom: 1px solid rgba(255,255,255,0.03); }
.flow-table tr:last-child td { border-bottom: none; }

/* ---------- Flow-based short-term timing ---------- */
.flow-timing {
    margin-top: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--glass-border);
    border-left-width: 3px;
}
.flow-timing.buy { border-left-color: var(--positive); }
.flow-timing.sell { border-left-color: var(--negative); }
.flow-timing.neutral { border-left-color: #fbbf24; }
.flow-timing-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.flow-timing-tag {
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 0.9rem;
    padding: 0.2rem 0.7rem; border-radius: 9999px;
}
.flow-timing-tag b { font-family: 'JetBrains Mono', monospace; }
.flow-timing-tag.buy { background: rgba(52,211,153,0.18); color: #6ee7b7; }
.flow-timing-tag.sell { background: rgba(251,113,133,0.18); color: #fda4af; }
.flow-timing-tag.neutral { background: rgba(245,158,11,0.16); color: #fcd34d; }
.flow-trend { font-size: 0.78rem; color: var(--text-secondary); }
.flow-timing-summary { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; }

/* ---------- Top bar clock ---------- */
.topclock {
    display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
    padding: 0 0.4rem; margin-left: auto;
}
.clock-date { font-size: 0.68rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.clock-time {
    font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.05rem;
    color: var(--text-primary); letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) { .topclock { display: none; } }

/* ---------- Version badge (캐시 확인용) ---------- */
.ver-badge {
    margin-left: 1rem; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em;
    color: #fff; background: linear-gradient(135deg, #f59e0b, #ef4444);
    padding: 0.18rem 0.55rem; border-radius: 9999px; vertical-align: middle;
}
