body {
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    font-family: -apple-system, sans-serif;
}

#SYMBOL_UPBIT {
    margin: 40px;
    padding: 0 12px;
}

h1 {
    font-size: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #2a3458 !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
}
h1 img {
    vertical-align: middle;
    width: 80px;
    border-radius: 50%;
}
h1 span {
    color: #388eff;
    font-size: 60px;
    font-weight: bold;
    margin-left: 12px;
}
h1 label {
    display: inline-block;
    border-left: 1px solid #94a3b8;
    color: #94a3b8;
    font-size: 14px;
    font-weight: normal;
    margin-left: 6px;
    padding-left: 12px;
}

/* ===== 상단 컨트롤 바 ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

#searchInput {
    width: 100%;
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #2a3458;
    background: #040b1b;
    color: #e2e8f0;
    font-size: 15px;
    outline: none;
}

#searchInput::placeholder {
    color: #64748b;
}

#searchInput:focus {
    border-color: #3b82f6;
}

/* 전종목 셀렉트 (다크 커스텀) */
.select-wrap {
    position: relative;
}

#symbolSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 36px 10px 14px;
    border-radius: 8px;
    border: 1px solid #2a3458;
    background: #040b1b;
    color: #e2e8f0;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    min-width: 160px;
}

#symbolSelect:focus {
    border-color: #3b82f6;
}

.select-wrap::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 13px;
}

/* select option 다크 스타일 (지원 브라우저 한정) */
#symbolSelect option {
    background: #1a1f3a;
    color: #e2e8f0;
}

/* ===== 정렬 버튼 ===== */
.sort-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #2a3458;
    background: #040b1b;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s, color 0.15s;
}

.sort-btn:hover {
    border-color: #3b82f6;
    color: #e2e8f0;
}

.sort-btn.active {
    border-color: #3b82f6;
    color: #fff;
}

.sort-btn .arrow {
    font-size: 12px;
    min-width: 12px;
    text-align: center;
}

/* ===== 그리드 ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card {
    background: #040b1b;
    border: 1px solid #2a3458;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.15s, transform 0.15s;
    cursor: pointer;
}

.card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.card img {
    width: 90px;
    height: 90px;
    margin-bottom: 6px;
}

.card .symbol {
    font-size: 25px;
    font-weight: bold;
    color: #fff;
}

.card .korname {
    font-size: 12px;
    font-weight: normal;
    color: #94a3b8;
}

.card .price {
    font-size: 18px;
    margin: 4px 0;
}

.card .rate {
    font-size: 15px;
    font-weight: bold;
}

.up   { color: #f43f5e; }
.down { color: #3b82f6; }
.flat { color: #94a3b8; }

.no-result {
    text-align: center;
    color: #64748b;
    padding: 40px 0;
    grid-column: 1 / -1;
}

/* ===== 커스텀 스크롤바 ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #2a3458; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b82f6; }
* { scrollbar-width: thin; scrollbar-color: #2a3458 #0f172a; }

/* ===== 값 변경 플래시 애니메이션 ===== */
@keyframes flash-up {
    0%   { background-color: rgba(244, 63, 94, 0.35); }
    100% { background-color: transparent; }
}
@keyframes flash-down {
    0%   { background-color: rgba(59, 130, 246, 0.35); }
    100% { background-color: transparent; }
}
.flash-up   { animation: flash-up   0.8s ease-out; border-radius: 3px; }
.flash-down { animation: flash-down 0.8s ease-out; border-radius: 3px; }