﻿/* ============================================================
   whales.css — /whales/{ticker}. Prefix wh-.
   ============================================================ */

.wh-page {
    width: 100%;
    padding: 1.25rem 0 3rem;
    color: var(--text);
}

.wh-head {
    margin-bottom: 1.5rem;
}

.wh-title {
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: clamp(1.4rem, 2.8vw, 1.9rem);
    color: var(--text);
    margin: 0 0 .5rem;
    letter-spacing: -.01em;
}

.wh-desc {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
    max-width: 82ch;
}

/* ---- summary grid ---- */
.wh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.wh-stat {
    background: var(--surface);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.wh-lbl {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.wh-val {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    color: var(--text);
    line-height: 1.15;
}

.wh-note {
    font-size: .76rem;
    color: var(--text-muted);
}

/* direction rides alongside the sign, never alone */
.wh-up {
    color: var(--positive, #0F8A3B);
}

.wh-down {
    color: var(--negative, #c62828);
}

.wh-line {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 2rem;
    max-width: 80ch;
}

    .wh-line strong {
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

/* ---- holders ---- */
.wh-h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 .75rem;
}

.wh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .wh-table th[scope="col"] {
        text-align: left;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--text-muted);
        padding: 6px 10px;
        border-bottom: 1px solid var(--border);
    }

    .wh-table td,
    .wh-table th[scope="row"] {
        padding: 9px 10px;
        border-bottom: 1px solid var(--border);
    }

.wh-mgr {
    text-align: left;
    font-weight: 600;
    color: var(--text);
}

    .wh-mgr a {
        color: var(--text);
        text-decoration: none;
        border-bottom: 1px solid transparent;
    }

        .wh-mgr a:hover {
            color: var(--ew-gold, #DDB785);
            border-bottom-color: currentColor;
        }

.wh-n {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wh-table th.wh-n {
    text-align: right;
}

/* ---- gate ---- */
.wh-locked {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-alt, var(--surface));
    text-align: center;
}

    .wh-locked p {
        margin: 0 auto .9rem;
        max-width: 58ch;
        font-size: .95rem;
        line-height: 1.6;
        color: var(--text-muted);
    }

.wh-cta {
    display: inline-block;
    padding: .55rem 1.4rem;
    border-radius: 8px;
    background: var(--ew-gold, #DDB785);
    color: #1b1b1b;
    font-weight: 700;
    text-decoration: none;
}

    .wh-cta:hover {
        filter: brightness(1.06);
    }

.wh-empty {
    color: var(--text-muted);
    padding: 2.5rem 0;
}

.wh-note-fine {
    margin: 1.5rem 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 84ch;
}

@media (max-width: 48rem) {
    .wh-val {
        font-size: 1.3rem;
    }

    .wh-table {
        font-size: 13px;
    }
}


/* a quarter with a handful of reporting managers, flagged rather than dressed up */
.wh-thin {
    margin: 0 0 1rem;
    padding: .6rem .9rem;
    border-left: 3px solid var(--ew-gold, #DDB785);
    background: color-mix(in srgb, var(--ew-gold, #DDB785) 8%, transparent);
    font-size: 13px;
    color: var(--text-muted);
}


/* holder detail missing — stated plainly rather than rendered as zeros */
.wh-pending {
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--surface-alt, var(--surface));
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.6;
}

    .wh-pending p {
        margin: 0;
    }

.wh-err {
    margin-top: .5rem !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--negative, #c62828);
}


/* ---- action pills on the changes table ---- */
.wh-act {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    border: 1px solid currentColor;
    white-space: nowrap;
}

/* New and Sold Out are the decisive ones and take the solid colour; adding to or
   trimming an existing position is a smaller statement and reads lighter. */
.wh-act-new {
    color: var(--positive, #0F8A3B);
    background: color-mix(in srgb, var(--positive, #0F8A3B) 14%, transparent);
}

.wh-act-increased {
    color: var(--positive, #0F8A3B);
}

.wh-act-reduced {
    color: var(--negative, #c62828);
}

.wh-act-soldout {
    color: var(--negative, #c62828);
    background: color-mix(in srgb, var(--negative, #c62828) 14%, transparent);
}


/* ---- gate above the manager tables ----
   Horizontal rather than the centred block used at the foot of a page: it sits
   between the summary and the tables, and a tall centred panel there would push
   the data the reader came for below the fold. */
.wh-gate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin: 2rem 0 1rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--ew-gold, #DDB785);
    border-radius: 10px;
    background: color-mix(in srgb, var(--ew-gold, #DDB785) 9%, transparent);
}

    .wh-gate p {
        margin: 0;
        flex: 1 1 26rem;
        font-size: 13.5px;
        line-height: 1.55;
        color: var(--text-muted);
    }

        .wh-gate p strong {
            color: var(--text);
        }

    .wh-gate .wh-cta {
        flex: 0 0 auto;
    }


/* ============================================================
   Ownership heatmap
   Tokens are declared here so the script can hand them to color-mix without
   knowing the theme.
   ============================================================ */
.wh-heat {
    --wh-pos: var(--positive, #0F8A3B);
    --wh-neg: var(--negative, #c62828);
    --wh-flat: var(--surface-alt, #eef0f4);
    --wh-pos-fg: var(--text);
    --wh-neg-fg: var(--text);
    --wh-flat-fg: var(--text-muted);
    position: relative;
    width: 100%;
    margin: .25rem 0 .5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

.wh-sub {
    margin: 0 0 .6rem;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 80ch;
}

.wh-heat-c {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 3px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
}

a.wh-heat-c:hover {
    box-shadow: inset 0 0 0 2px var(--ew-gold, #DDB785);
}

.wh-heat-n {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wh-heat-m {
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    opacity: .8;
    white-space: nowrap;
}

/* ---- key ---- */
.wh-heat-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .5rem;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.wh-key-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.wh-key-pos {
    background: color-mix(in srgb, var(--positive, #0F8A3B) 55%, transparent);
}

.wh-key-neg {
    background: color-mix(in srgb, var(--negative, #c62828) 55%, transparent);
}

.wh-key-flat {
    background: var(--surface-alt, #eef0f4);
}

.wh-key-note {
    margin-left: auto;
    opacity: .8;
}

@media (max-width: 640px) {
    .wh-key-note {
        margin-left: 0;
        flex: 1 1 100%;
    }
}


/* ============================================================
   Section tabs + period selector
   ============================================================ */
.wh-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0 0 1.25rem;
    border-bottom: 1px solid var(--border);
}

.wh-tab {
    padding: .5rem .9rem;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

    .wh-tab:hover {
        color: var(--text);
    }

    .wh-tab.is-on {
        color: var(--text);
        border-bottom-color: var(--ew-gold, #DDB785);
    }

    /* present but not yet built — visible so the reader knows it's coming */
    .wh-tab.is-soon {
        color: var(--text-muted);
        opacity: .5;
        cursor: default;
    }

.wh-soon {
    margin-left: .35rem;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    vertical-align: 2px;
}

.wh-periods {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.wh-period {
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

    .wh-period:last-child {
        border-right: 0;
    }

    .wh-period:hover {
        color: var(--text);
    }

    .wh-period.is-on {
        background: var(--ew-gold, #DDB785);
        color: #23324a;
    }

/* ---- insider tables ---- */
/* Every table on the page lives in one of these. The cells are nowrap, so a table
   is wider than a phone viewport by design - the wrapper is what keeps that width
   contained instead of letting it push the document sideways.

   -webkit-overflow-scrolling for momentum on iOS; overscroll-behavior-x so a
   swipe that runs off the end of the table does not then start navigating back. */
.wh-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
}

.wh-date,
.wh-role {
    color: var(--text-muted);
    white-space: nowrap;
}

.wh-other {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.wh-other-cell {
    background: var(--surface);
    padding: .85rem 1rem;
}

.wh-other-v {
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.wh-of {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted);
}


/* ---- preplanned vs discretionary selling ---- */
.wh-split {
    margin-bottom: 1.75rem;
}

.wh-split-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--negative, #c62828);
    border: 1px solid var(--border);
}

/* preplanned takes the quieter tone: it was scheduled, not decided */
.wh-split-plan {
    display: block;
    height: 100%;
    background: var(--text-muted);
    opacity: .55;
}

.wh-split-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .5rem 1.5rem;
    margin-top: .6rem;
    font-size: 13px;
    color: var(--text-muted);
}

    .wh-split-legend strong {
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

    .wh-split-legend .wh-note {
        display: block;
        margin-left: 1.35rem;
    }

.wh-swatch-plan {
    background: color-mix(in srgb, var(--text-muted) 55%, transparent);
    display: inline-block;
}

.wh-swatch-disc {
    background: var(--negative, #c62828);
    display: inline-block;
}


/* ---- insider transaction detail ---- */
.wh-plan {
    margin-left: .35rem;
    padding: 0 .35rem;
    border: 1px solid var(--text-muted);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--text-muted);
    white-space: nowrap;
}

.wh-rows {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

.wh-after {
    color: var(--text-muted);
}

/* selling out entirely is a different statement from trimming */
.wh-exit {
    font-weight: 700;
    color: var(--negative, #c62828);
}

.wh-portion {
    display: block;
    font-size: 10px;
    color: var(--negative, #c62828);
}


/* ---- insider trade chart ---- */
.in-chart-wrap {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 8px;
    margin-bottom: .5rem;
}

/* Lightweight Charts is told its pixel width at creation, so a zero-width
   container silently draws nothing. */
.in-chart {
    width: 100%;
    min-height: 340px;
}

.in-tip {
    position: absolute;
    display: none;
    z-index: 3;
    max-width: 200px;
    padding: .45rem .6rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    pointer-events: none;
}

.in-tip-d {
    color: var(--text-muted);
    font-size: 11px;
}

.in-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .6rem;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.in-key-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    opacity: .55;
}

.in-key-buy {
    background: var(--positive, #0F8A3B);
}

.in-key-sell {
    background: var(--negative, #c62828);
}

.in-key-note {
    margin-left: auto;
    opacity: .85;
}

@media (max-width: 640px) {
    .in-key-note {
        margin-left: 0;
        flex: 1 1 100%;
    }

    .in-chart {
        min-height: 260px;
    }
}


/* ---- insider signal ----
   Derived from the company's own trailing year, so the wording stays honest about
   what it is: a pace comparison, not a rating. */
.in-signal {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    padding: .75rem 1rem;
    border-left: 3px solid var(--text-muted);
    border-radius: 0 8px 8px 0;
    background: var(--surface);
    margin-bottom: .75rem;
}

.in-tone-neg {
    border-left-color: var(--negative, #c62828);
}

.in-tone-pos {
    border-left-color: var(--positive, #0F8A3B);
}

.in-tone-flat {
    border-left-color: var(--ew-gold, #DDB785);
}

.in-signal-lbl {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.in-signal-v {
    font-size: 1.05rem;
    color: var(--text);
}

.in-tone-neg .in-signal-v {
    color: var(--negative, #c62828);
}

.in-tone-pos .in-signal-v {
    color: var(--positive, #0F8A3B);
}

.in-signal-d {
    flex: 1 1 24rem;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ---- cluster ---- */
.in-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .3rem 1.5rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
    color: var(--text-muted);
}

    .in-cluster strong {
        color: var(--text);
        font-variant-numeric: tabular-nums;
    }

.in-cluster-h {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* ---- split labels ---- */
.in-split-pct {
    margin-left: .5rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.in-split-name {
    display: block;
    margin-left: 1.35rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ---- last purchase ---- */
.in-last {
    margin: 0 0 .75rem;
    font-size: 13px;
    color: var(--text-muted);
}

    .in-last strong {
        color: var(--text);
    }

/* ---- tooltip extras ---- */
.in-tip-r {
    margin-left: .35rem;
    font-size: 11px;
    color: var(--text-muted);
}

.in-tip-plan {
    padding: 0 .3rem;
    border: 1px solid var(--text-muted);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
}

.wh-portion.is-big {
    font-weight: 700;
}


/* ---- containment ----
   A belt-and-braces stop on the whole page growing wider than the screen. The
   table wrappers above are the real fix; this catches whatever comes next - a long
   manager name, a pasted URL, a future column - and keeps it from taking the
   layout with it.

   It is scoped to the whales page rather than applied globally, because
   overflow-x: hidden on a shared container breaks position: sticky inside it. */
.wh-page {
    /* Same fix as .pr-page: .stock-page is a column flex container, so this box
       sizes to its own max-content width across the cross axis unless it is tied to
       the container. See peers.css for the full reasoning. */
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

    /* break-word, NOT anywhere. "anywhere" also lets the browser count mid-word
       breaks when working out the column's minimum width, so it hyphenlessly split
       "Vanguard" into "Vanguar / d" to make the column as narrow as possible.
       break-word only breaks a word that genuinely cannot fit, which leaves the
       column its natural width and lets the wrapper scroll. */
    .wh-page .wh-mgr,
    .wh-page .wh-note {
        overflow-wrap: break-word;
    }
