.lb-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0 0.25rem;
}

.lb-page-header h2 {
    font-size: 1rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lb-base-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.lb-card-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem 0;
}

.lb-unit-badge {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
}

.lb-table-wrapper {
    padding: 0.5rem 1.25rem 1.25rem;
    overflow-x: auto;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.lb-table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.lb-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.84rem;
}

.lb-table tbody tr:last-child td {
    border-bottom: none;
}

.lb-table tbody tr:hover td {
    background: var(--bg-card-hover);
}

/* ── 컬럼 너비 & 정렬 ───────────────────────────────────────────────────────── */

.col-rank {
    width: 2.5rem;
    text-align: center;
}

.lb-table th.col-rank {
    text-align: center;
}

.lb-table td.col-rank {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.col-ticker {
    white-space: nowrap;
}

.ticker-code {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    vertical-align: middle;
}

.ticker-name {
    display: none;
    margin-left: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    vertical-align: middle;
}

.col-quantity,
.col-balance {
    text-align: right;
    white-space: nowrap;
}

.lb-table th.col-quantity,
.lb-table th.col-balance {
    text-align: right;
}

.lb-table td.col-balance {
    font-weight: 600;
}

/* ── 정렬 ───────────────────────────────────────────────────────────────── */

.lb-table th[data-sort-col] {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.lb-table th[data-sort-col]:hover {
    color: var(--text-primary);
}

.lb-table th[data-sort-col]::after {
    content: ' ⇅';
    opacity: 0.35;
    font-size: 0.65rem;
}

.lb-table th[data-sort-col].sort-desc::after {
    content: ' ▼';
    opacity: 0.9;
    color: #8b5cf6;
}

.lb-table th[data-sort-col].sort-asc::after {
    content: ' ▲';
    opacity: 0.9;
    color: #8b5cf6;
}

@media (max-width: 480px) {
    .lb-table th[data-sort-col]::after,
    .lb-table th[data-sort-col].sort-desc::after,
    .lb-table th[data-sort-col].sort-asc::after {
        display: none;
    }
}

/* ── 상태 행 (로딩 / 에러 / 빈 데이터) ─────────────────────────────────────── */

.lb-status {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── 반응형 ─────────────────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .ticker-name {
        display: inline;
    }
}

@media (max-width: 480px) {
    .lb-table-wrapper {
        padding: 0.5rem 0.75rem 1rem;
    }

    .lb-table thead th,
    .lb-table tbody td {
        font-size: 0.75rem;
        padding: 0.5rem 0.5rem;
    }
}

/* ── 대차비율 설명 ───────────────────────────────────────────────────────── */

.lb-ratio-note {
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 0 1.25rem 0.5rem;
}

/* ── 출처 (카드 하단 우측) ────────────────────────────────────────────────── */

.lb-source-note {
    text-align: right;
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 0 1.25rem 0.9rem;
}
