.day-investor-section {
    overflow: hidden;
}

.day-investor-layout {
    display: flex;
    flex-direction: column;
}

.day-investor-table-section {
    padding-bottom: 0;
}

.day-investor-table-section .card-header,
.day-investor-section .investor-flow-chart-section .card-header {
    min-height: 58px;
}

.investor-table-wrap {
    padding: 0.35rem 1.25rem 1.25rem;
}

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

.investor-table th,
.investor-table td {
    padding: 0.86rem 0.2rem;
    border-bottom: 1px solid var(--border-color);
}

.investor-table tr:last-child th,
.investor-table tr:last-child td {
    border-bottom: none;
}

.investor-table th {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.investor-table thead th {
    padding: 0.55rem 0.2rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.investor-table thead th:last-child {
    text-align: right;
}

.investor-table td {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: right;
}

.investor-row-dot {
    display: inline-block;
    width: 0.56rem;
    height: 0.56rem;
    margin-right: 0.55rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
    flex-shrink: 0;
    vertical-align: -0.05rem;
}

.investor-row--individual th,
.legend-individual {
    color: #34d399;
}

.investor-row--foreign th,
.legend-foreign {
    color: #38bdf8;
}

.investor-row--investment th,
.legend-investment {
    color: #fbbf24;
}

.investor-row--trust th,
.legend-trust {
    color: #a78bfa;
}

.investor-row--bank th,
.legend-bank {
    color: #22c55e;
}

.investor-row--insurance th,
.legend-insurance {
    color: #fb7185;
}

.investor-row--pension th,
.legend-pension {
    color: #60a5fa;
}

.legend-trust,
.legend-bank,
.legend-insurance,
.legend-pension {
    background: currentColor;
}

.day-investor-section .investor-flow-chart-section {
    border-left: 0;
}

.day-investor-section .investor-chart-container {
    height: 320px;
}

.day-investor-section .investor-chart-legend {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    padding: 0 1.25rem 1rem;
    row-gap: 0.45rem;
}

.day-investor-section .investor-legend-toggle {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.18s ease, color 0.18s ease;
}

.day-investor-section .investor-legend-toggle:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 3px;
    border-radius: 4px;
}

.day-investor-section .investor-legend-toggle.is-hidden {
    opacity: 0.45;
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.day-investor-section .investor-legend-toggle.is-hidden .legend-dot {
    opacity: 0.35;
}

@media (max-width: 768px) {
    .investor-table-wrap {
        padding: 0.15rem 0.75rem 0.95rem;
    }

    .investor-table {
        display: block;
        table-layout: auto;
    }

    .investor-table thead,
    .investor-table tbody {
        display: block;
        width: 100%;
    }

    .investor-table tr {
        display: grid;
        grid-template-columns: minmax(4rem, 1fr) minmax(6rem, 0.8fr);
        align-items: center;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .investor-table th,
    .investor-table td {
        display: block;
        min-width: 0;
        padding: 0.6rem 0.1rem;
        border-bottom: 0;
    }

    .investor-table tr:last-child {
        border-bottom: none;
    }

    .investor-table th {
        font-size: 0.72rem;
    }

    .investor-table thead th {
        font-size: 0.62rem;
        letter-spacing: 0.02em;
    }

    .investor-table thead th:last-child {
        white-space: normal;
        line-height: 1.25;
    }

    .investor-table td {
        font-size: 0.9rem;
        text-align: right;
        white-space: nowrap;
        overflow: visible;
    }

    .investor-row-dot {
        width: 0.45rem;
        height: 0.45rem;
        margin-right: 0.38rem;
        box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
    }

    .day-investor-section .investor-chart-container {
        height: 270px;
    }

    .day-investor-section .investor-chart-legend {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0.35rem 0.5rem;
        padding-right: 0.75rem;
        padding-left: 0.75rem;
        line-height: 1.4;
    }

    .day-investor-section .investor-chart-legend span {
        min-width: 0;
        font-size: 0.66rem;
        white-space: normal;
    }

    .day-investor-section .investor-chart-legend > span {
        flex: 0 1 auto;
        max-width: 100%;
    }
}

@media (max-width: 430px) {
    .day-investor-section .investor-chart-legend {
        gap: 0.32rem 0.4rem;
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

@media (max-width: 360px) {
    .investor-table tr {
        grid-template-columns: minmax(3.8rem, 1fr) minmax(5.35rem, 0.7fr);
    }

    .investor-table th {
        font-size: 0.68rem;
    }

    .investor-table td {
        font-size: 0.84rem;
    }
}
