*, *::before, *::after { box-sizing: border-box; }

:root {
    color-scheme: dark;
    --bg: #070a0f;
    --surface: #0d121a;
    --surface-2: #111923;
    --surface-3: #17212d;
    --line: rgba(255,255,255,.08);
    --line-strong: rgba(255,255,255,.14);
    --text: #f4f7fb;
    --muted: #8793a4;
    --faint: #566273;
    --green: #2ce69b;
    --green-bg: rgba(44,230,155,.1);
    --red: #ff6174;
    --red-bg: rgba(255,97,116,.1);
    --amber: #f9c74f;
    --amber-bg: rgba(249,199,79,.1);
    --blue: #69a8ff;
    --blue-bg: rgba(105,168,255,.1);
    --radius: 16px;
    --mono: "Roboto Mono", monospace;
    --sans: "Noto Sans KR", "Inter", sans-serif;
}

html { background: var(--bg); }

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.shell {
    width: min(1900px, 100%);
    margin: 0 auto;
    padding: 14px;
}

.panel {
    background: linear-gradient(145deg, rgba(17,25,35,.96), rgba(11,16,24,.96));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 55px rgba(0,0,0,.2);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 58px;
    margin-bottom: 10px;
    padding: 8px 14px;
    background: rgba(9,13,20,.9);
    border: 1px solid var(--line);
    border-radius: 14px;
    backdrop-filter: blur(18px);
    position: sticky;
    top: 8px;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.brand-mark,
.brand-logo {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2875ea, #704de7);
    box-shadow: 0 8px 24px rgba(58,99,221,.3);
    font-size: .72rem;
    font-weight: 800;
}

.nav,
nav,
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar,
nav::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar { display: none; }

.nav a,
nav a,
.nav-menu a {
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.nav a:hover,
.nav a.active,
nav a:hover,
nav a.active,
.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text);
    background: rgba(255,255,255,.06);
}

.clock,
.live-status {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--mono);
    font-size: .7rem;
    white-space: nowrap;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.snapshot-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.snapshot-card {
    min-height: 76px;
    padding: 13px 15px;
    background: rgba(13,18,26,.92);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.snapshot-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.snapshot-value {
    display: block;
    margin-top: 9px;
    font-family: var(--mono);
    font-size: 1.06rem;
    font-weight: 800;
}

.snapshot-sub {
    display: block;
    margin-top: 3px;
    color: var(--faint);
    font-size: .6rem;
}

.up,
.snapshot-change.up { color: var(--green); }
.down,
.snapshot-change.down { color: var(--red); }

.quote-flash { animation: quoteFlash .95s ease; }
@keyframes quoteFlash {
    0% { color: var(--amber); text-shadow: 0 0 16px rgba(249,199,79,.75); transform: translateY(-1px); }
    100% { text-shadow: none; transform: translateY(0); }
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 10px;
    align-items: stretch;
}

.chart-frame {
    margin: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #10151f;
}

.small-btn,
.external-link {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text);
    font-size: .67rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.small-btn:hover,
.external-link:hover {
    border-color: var(--line-strong);
    background: #1b2735;
}

.news-list,
.news-container { overflow-y: auto; }

.news-item {
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.empty {
    padding: 24px 16px;
    color: var(--faint);
    font-size: .7rem;
    text-align: center;
}

@media (max-width: 1050px) {
    .hero { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .shell { padding: 6px; }
    .topbar { top: 4px; padding: 7px 9px; gap: 10px; }
    .section-head { flex-wrap: wrap; }
    .clock { display: none; }
}
