.fund-performance-chart {
    container-type: inline-size;
    margin: 0;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.fund-performance-chart--panel,
.fund-performance-chart--compact {
    background: var(--gradient-surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: clamp(1rem, 2vw, 1.5rem);
}

.fund-performance-chart--compact {
    padding: 1rem;
}

.fund-performance-chart--bare {
    padding: 0;
}

.fund-performance-chart__header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.fund-performance-chart__header > div:first-child {
    min-width: 0;
}

.fund-performance-chart__title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.fund-performance-chart__subtitle {
    max-width: 42rem;
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.fund-performance-chart__summary {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    max-width: 100%;
    align-items: flex-end;
    gap: 0.8rem;
    text-align: right;
}

.fund-performance-chart__metric-label {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.fund-performance-chart__metric-value {
    display: block;
    margin-top: 0.22rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 750;
    line-height: 1;
}

.fund-performance-chart__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 1.2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--neutral-perf);
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
}

.fund-performance-chart__trend svg {
    width: 0.82rem;
    height: 0.82rem;
    flex: 0 0 auto;
}

.fund-performance-chart__trend--up {
    color: #047857;
}

.fund-performance-chart__trend--down {
    color: #b91c1c;
}

.fund-performance-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1rem;
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
}

.fund-performance-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1;
}

.fund-performance-chart__legend-line {
    width: 1.45rem;
    height: 0;
    border-top: 2px solid currentColor;
    border-radius: var(--radius-pill);
}

.fund-performance-chart__legend-line--nav {
    color: var(--fpc-nav-color);
}

.fund-performance-chart__legend-line--benchmark {
    color: var(--fpc-benchmark-color);
    border-top-style: dashed;
}

.fund-performance-chart__canvas {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-color: var(--border-strong) transparent;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.fund-performance-chart__canvas::-webkit-scrollbar {
    height: 6px;
}

.fund-performance-chart__canvas::-webkit-scrollbar-track {
    background: transparent;
}

.fund-performance-chart__canvas::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--border-strong);
}

.fund-performance-chart__svg {
    display: block;
    width: max(100%, var(--fpc-min-chart-width, 620px));
    min-width: var(--fpc-min-chart-width, 620px);
    height: auto;
    overflow: visible;
}

.fund-performance-chart__grid {
    stroke: var(--divider);
    stroke-dasharray: 2 4;
    vector-effect: non-scaling-stroke;
}

.fund-performance-chart__axis-label {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.fund-performance-chart__line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.fund-performance-chart__line--nav {
    stroke: var(--fpc-nav-color);
    stroke-width: 2.6;
}

.fund-performance-chart__line--benchmark {
    stroke: var(--fpc-benchmark-color);
    stroke-width: 2.1;
    stroke-dasharray: 6 5;
}

.fund-performance-chart__point {
    vector-effect: non-scaling-stroke;
}

.fund-performance-chart__hit {
    fill: transparent;
    cursor: default;
    pointer-events: all;
}

.fund-performance-chart__data-point {
    outline: none;
}

.fund-performance-chart__data-point:focus .fund-performance-chart__point,
.fund-performance-chart__data-point:focus-visible .fund-performance-chart__point,
.fund-performance-chart__data-point:hover .fund-performance-chart__point {
    filter: drop-shadow(0 5px 10px rgba(5, 46, 154, 0.22));
    stroke-width: 2.8;
}

.fund-performance-chart__tooltip,
.fund-performance-chart__guide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.fund-performance-chart__data-point:focus .fund-performance-chart__tooltip,
.fund-performance-chart__data-point:focus .fund-performance-chart__guide,
.fund-performance-chart__data-point:focus-visible .fund-performance-chart__tooltip,
.fund-performance-chart__data-point:focus-visible .fund-performance-chart__guide,
.fund-performance-chart__data-point.is-tooltip-active .fund-performance-chart__tooltip,
.fund-performance-chart__data-point.is-tooltip-active .fund-performance-chart__guide,
.fund-performance-chart__tooltip.is-tooltip-active,
.fund-performance-chart__data-point:hover .fund-performance-chart__tooltip,
.fund-performance-chart__data-point:hover .fund-performance-chart__guide,
.fund-performance-chart__hit:hover ~ .fund-performance-chart__tooltip,
.fund-performance-chart__hit:hover ~ .fund-performance-chart__guide,
.fund-performance-chart__point:hover ~ .fund-performance-chart__tooltip,
.fund-performance-chart__point:hover ~ .fund-performance-chart__guide {
    opacity: 1;
}

.fund-performance-chart__guide {
    stroke: var(--primary);
    stroke-dasharray: 3 4;
    stroke-opacity: 0.35;
    pointer-events: none;
    vector-effect: non-scaling-stroke;
}

.fund-performance-chart__tooltip-box {
    fill: var(--text-primary, #071a44);
    stroke: rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 14px 30px rgba(4, 18, 55, 0.22));
}

.fund-performance-chart__tooltip-label {
    fill: rgba(255, 255, 255, 0.62);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fund-performance-chart__tooltip-value {
    fill: #fff;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
}

.fund-performance-chart__tooltip-series {
    fill: #6ee7b7;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 750;
}

.fund-performance-chart__tooltip-trend {
    fill: rgba(255, 255, 255, 0.72);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 750;
}

.fund-performance-chart__tooltip-trend--up {
    fill: #6ee7b7;
}

.fund-performance-chart__tooltip-trend--down {
    fill: #fca5a5;
}

.fund-performance-chart__point--nav {
    fill: var(--surface);
    stroke: var(--fpc-nav-color);
    stroke-width: 2;
}

.fund-performance-chart__point--nav.is-last {
    fill: var(--fpc-nav-color);
    stroke: var(--surface);
    stroke-width: 2.5;
}

.fund-performance-chart__point--benchmark {
    fill: var(--surface);
    stroke: var(--fpc-benchmark-color);
    stroke-width: 1.8;
}

.fund-performance-chart__empty {
    display: grid;
    min-height: 12rem;
    place-items: center;
    border: 1px dashed var(--divider);
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-size: 0.86rem;
}

@container (max-width: 560px) {
    .fund-performance-chart__header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .fund-performance-chart__summary {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        text-align: left;
    }
}
