/* --------------------------------------------------------------------------
 * PositionSummaryV3 — horizontal split-gauge redesign.
 *
 * Replaces the donut (two-state BUY/SELL) with a compact horizontal bar:
 * title + total-pill header, single gauge rail, legend row with trend
 * icons, percentages, and counts. Class names are prefixed `psv3-` to
 * avoid collisions with the existing donut/ring styles.
 * -------------------------------------------------------------------------- */

.psv3-card {
    --psv3-buy: #22c55e;
    --psv3-sell: #ef4444;
    --psv3-text-primary: #e7edf3;
    --psv3-text-secondary: #8a95a5;
    --psv3-text-tertiary: #57636f;
    --psv3-border: #2a2b2e;
    --psv3-border-strong: #3a3b3f;

    background: #1b1c1e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

/* -------- Split gauge ---------------------------------------------------- */

.psv3-gauge {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    display: flex;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.psv3-seg-buy {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.psv3-seg-sell {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.psv3-split {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #1b1c1e;
    transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.psv3-gauge-skeleton {
    padding: 0 2px;
}

/* -------- Legend --------------------------------------------------------- */

.psv3-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.psv3-leg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.psv3-leg-trend {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.psv3-leg-trend svg {
    width: 22px;
    height: 16px;
}

.psv3-leg-trend.psv3-buy,
.psv3-leg-label.psv3-buy,
.psv3-leg-count.psv3-buy {
    color: var(--psv3-buy);
}

.psv3-leg-trend.psv3-sell,
.psv3-leg-label.psv3-sell,
.psv3-leg-count.psv3-sell {
    color: var(--psv3-sell);
}

.psv3-leg-label {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.psv3-leg-pct {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--psv3-text-secondary);
    font-variant-numeric: tabular-nums;
}

.psv3-leg-count {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}
