:root {
    --bg: #0c1117;
    --panel: #111c2b;
    --muted: #8ea2b5;
    --line: #1a2332;
    --text: #d7e1f1;
    --up: #28d07d;
    --dn: #ff5f5f;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, Segoe UI, Roboto, Apple SD Gothic Neo, Malgun Gothic, sans-serif;
}

.app-wrap {
    padding: 8px 10px;
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 10px;
    background: #152234;
    color: var(--text);
    border: 1px solid #2b3b55;
    border-radius: 6px;
    cursor: pointer;
}

.btn.active {
    background: #1b2d47;
}

.card {
    background: #0e1521;
    border: 1px solid #1e2a3f;
    border-radius: 10px;
    padding: 8px;
}

.header {
    color: var(--muted);
    margin: 2px 4px 10px;
}

.tip {
    position: absolute;
    pointer-events: none;
    background: #111c2b;
    border: 1px solid #2b3b55;
    border-radius: 8px;
    padding: 6px 8px;
    color: #d7e1f1;
    font-size: 12px;
    white-space: nowrap;
}

.legend {
    color: var(--muted);
    margin: 8px 6px 4px;
    font-size: 12px;
}

/* ---- 우측 정보 패널 ---- */
.info-panel {
    position: absolute;
    right: 12px;
    top: 36px;
    background: var(--panel);
    border: 1px solid #2b3b55;
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 140px;
    text-align: right;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.info-panel .sym {
    font-weight: 700;
    letter-spacing: .5px;
    opacity: .95;
}

.info-panel .slash {
    opacity: .55;
}

.info-panel .px {
    font-size: 20px;
    margin-top: 4px;
}

.info-panel .chg {
    font-size: 12px;
    margin-top: 2px;
}

.info-panel .chg.up {
    color: var(--up);
}

.info-panel .chg.dn {
    color: var(--dn);
}

/* inputs / table */
table {
    border-collapse: collapse;
}

th,
td {
    padding: 4px 6px;
}

input,
select {
    background: #0f1a2a;
    color: var(--text);
    border: 1px solid #2b3b55;
    border-radius: 6px;
    padding: 6px 8px;
}

/* ==================== 추가: Toast ==================== */
.toast-layer {
    position: fixed;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    min-width: 220px;
    max-width: 380px;
    background: #0f1a29;
    border: 1px solid #24344d;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-item.success {
    border-color: #1e6b4a;
}

.toast-item.info {
    border-color: #2b3b55;
}

.toast-item.error {
    border-color: #814646;
}

.toast-msg {
    flex: 1;
}

.toast-x {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

/* ==================== 추가: 에러 오버레이 ==================== */
.error-overlay {
    position: absolute;
    inset: 6px 6px 6px 6px;
    background: rgba(12, 17, 23, .72);
    border: 1px dashed #3a4b66;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 20;
}

.error-overlay .title {
    font-weight: 700;
}

.error-overlay .desc {
    color: var(--muted);
    font-size: 13px;
}

.error-overlay .btn-row {
    display: flex;
    gap: 8px;
}

/* ==================== 추가: Skeleton ==================== */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: #111b2a;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0.04) 80%);
    background-size: 200px 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 8px;
}

.skeleton--bar {
    height: 12px;
}

.skeleton--block {
    height: 80px;
}

.skeleton--chart-wrap {
    position: absolute;
    left: 8px;
    right: 232px;
    top: 36px;
    bottom: 12px;
    /* 대략 차트 영역 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.skeleton--chart {
    height: 16px;
    width: 80%;
}