﻿/* ============================================================
   pivots.css — Pivot Points (EW2027).
   Prefix is pv-. Uses ew-theme.css tokens; no Bootstrap.
   ============================================================ */

.pv-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 16px 48px;
}

/* ---- head ---- */
.pv-head {
    margin: 12px 0 16px;
}

.pv-title {
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -.01em;
}

.pv-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    max-width: 82ch;
}

.pv-signin {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 8px 0 0;
}

/* ---- controls ---- */
.pv-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 8px;
}

.pv-groups,
.pv-sorts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pv-sorts-lbl {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-right: 2px;
}

.pv-btn,
.pv-sbtn {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

    .pv-btn:hover,
    .pv-sbtn:hover {
        border-color: var(--ew-gold, #DDB785);
        color: var(--text);
    }

    .pv-btn.is-active,
    .pv-sbtn.is-active {
        background: var(--ew-gold, #DDB785);
        border-color: var(--ew-gold, #DDB785);
        color: #23324a;
    }

.pv-count {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

/* ---- groups ---- */
.pv-group {
    margin-bottom: 22px;
}

.pv-group-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.pv-group-n {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-alt, #f6f7f9);
}

/* ---- row ---- */
.pv-row {
    display: grid;
    grid-template-columns: 150px 1fr 108px;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    margin-bottom: 6px;
}

    /* which side of the pivot the symbol is on */
    .pv-row.is-above {
        border-left-color: var(--positive, #0F8A3B);
    }

    .pv-row.is-below {
        border-left-color: var(--negative, #c62828);
    }

.pv-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pv-tk {
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    line-height: 1.15;
}

    .pv-tk:hover {
        color: var(--ew-gold, #DDB785);
    }

.pv-co {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- the rail ----
   Support green through the pivot in gold to resistance red, matching how EW2023
   tinted its pivot columns. Levels sit at their real positions, not evenly spaced. */
.pv-rail {
    position: relative;
    height: 46px;
    border-radius: 6px;
    background: linear-gradient(to right, color-mix(in srgb, var(--positive, #0F8A3B) 26%, transparent) 0%, color-mix(in srgb, var(--ew-gold, #DDB785) 26%, transparent) 50%, color-mix(in srgb, var(--negative, #c62828) 26%, transparent) 100%);
}

.pv-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

    .pv-tick::before {
        content: "";
        position: absolute;
        top: 3px;
        bottom: 3px;
        width: 1px;
        background: var(--text-muted);
        opacity: .45;
    }

    .pv-tick.is-pp::before {
        width: 2px;
        opacity: .9;
        background: var(--ew-gold, #DDB785);
    }

.pv-tick-lbl {
    position: relative;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .03em;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 12px;
    white-space: nowrap;
}

.pv-tick.is-pp .pv-tick-lbl {
    color: var(--text);
}

.pv-tick-val {
    position: absolute;
    bottom: 4px;
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* the price marker */
.pv-mark {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    margin-top: -6.5px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: var(--text);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--text);
    z-index: 2;
}

    /* trading beyond S3 or R3 is real information, so the marker pins and flags */
    .pv-mark.is-outside {
        border-radius: 2px;
        background: var(--ew-gold, #DDB785);
    }

/* ---- current price ---- */
.pv-now {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.pv-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.pv-near {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---- misc ---- */
.pv-empty,
.pv-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 44px 0;
    font-size: 14px;
}

/* ---- responsive ---- */
@media (max-width: 820px) {
    .pv-row {
        grid-template-columns: 110px 1fr 90px;
        gap: 10px;
    }

    .pv-tick-val {
        display: none;
    }
}

@media (max-width: 560px) {
    .pv-row {
        grid-template-columns: 1fr auto;
        row-gap: 8px;
    }

    .pv-rail {
        grid-column: 1 / -1;
    }
}
