/* ============================================================================
 * PrimeLoadingFacts — the market-facts card shown while a heavy panel loads.
 * ----------------------------------------------------------------------------
 * Paired with assets/js/shared/loading-facts.js. Quiet institutional styling:
 * white card, navy rail, one statement, one optional detail line, one
 * optional "guess how many" quiz. No animation beyond a short fade-in, and
 * none at all under prefers-reduced-motion.
 *
 * The host element owns layout: .tp-warm-facts (Technical Patterns) and
 * .sc-warm-facts (Screener) are the two mounts; both are hidden until the
 * component has something to say.
 * ========================================================================== */

.tp-warm-facts,
.sc-warm-facts {
    margin-top: 14px;
    max-width: 760px;
}

/* The site-wide watcher parks one card after whichever panel loader is
   visible. It is centred in the section and never wider than the panel. */
.plf-auto {
    margin: 14px auto 6px;
    width: min(560px, 100%);
    max-width: 100%;
    text-align: left;
}

/* The overlay variant sits inside the running-screener card, full width. */
.sc-warm-facts--overlay {
    margin: 14px auto 0;
    width: 100%;
    max-width: 520px;
}

.plf-card {
    position: relative;
    overflow: hidden;
    background: var(--bbw-surface, #fff);
    border: 1px solid var(--bbw-border, #e2e7ee);
    border-radius: 14px;
    padding: 15px 17px 13px;
    box-shadow: 0 10px 28px -18px rgba(11, 21, 38, .35);
    color: var(--bbw-ink, #0b1526);
    text-align: left;
}

.plf-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #0b2a5b, var(--bbw-blue, #1e56e0));
}

.plf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.plf-kicker {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--bbw-ink-2, #46556c);
}

.plf-close {
    flex: none;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bbw-ink-2, #46556c);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}

.plf-close:hover,
.plf-close:focus-visible {
    background: var(--bbw-surface-3, #f0f3f7);
    color: var(--bbw-ink, #0b1526);
}

.plf-stat {
    margin: 0;
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.plf-detail {
    margin: 5px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--bbw-ink-2, #46556c);
    overflow-wrap: anywhere;
}

.plf-quiz {
    margin-top: 11px;
    padding: 10px 12px;
    background: var(--bbw-surface-2, #f7f9fb);
    border: 1px solid var(--bbw-border, #e2e7ee);
    border-radius: 11px;
}

.plf-q {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--bbw-ink-2, #46556c);
}

.plf-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.plf-opt {
    min-width: 64px;
    padding: 7px 16px;
    border: 1px solid var(--bbw-border-strong, #cfd8e3);
    border-radius: 999px;
    background: var(--bbw-surface, #fff);
    color: var(--bbw-ink, #0b1526);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.plf-opt:hover,
.plf-opt:focus-visible {
    background: var(--bbw-blue-soft, #eef3ff);
    border-color: var(--bbw-blue, #1e56e0);
    color: var(--bbw-blue-strong, #1745b5);
}

.plf-answer {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.plf-answer.is-right { color: var(--bbw-up, #0c7f5c); }
.plf-answer.is-off { color: var(--bbw-amber, #b45309); }

.plf-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--bbw-border, #e2e7ee);
}

.plf-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--bbw-blue, #1e56e0);
    text-decoration: none;
}

.plf-link:hover,
.plf-link:focus-visible {
    color: var(--bbw-blue-strong, #1745b5);
    text-decoration: underline;
}

.plf-note {
    font-size: 11px;
    line-height: 1.5;
    color: var(--bbw-ink-2, #46556c);
}

.plf-close:focus-visible,
.plf-opt:focus-visible,
.plf-link:focus-visible {
    outline: 2px solid var(--bbw-blue, #1e56e0);
    outline-offset: 2px;
}

.plf-live .plf-card {
    animation: plf-fade .24s ease-out;
}

@keyframes plf-fade {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
    .plf-card { padding: 13px 14px 11px; }
    .plf-stat { font-size: 13.5px; }
    .plf-opt { padding: 7px 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .plf-live .plf-card { animation: none; }
    .plf-opt { transition: none; }
}

/* Navigation loading note: names the page that is on its way. */
.plf-nav {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: calc(100vw - 32px);
    padding: 9px 16px;
    border-radius: 999px;
    background: #0f1e3d;
    color: #fff;
    font: 600 12.5px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 10px 30px rgba(6, 18, 48, .28);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}
.plf-nav.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.plf-nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.plf-nav-spin {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .28);
    border-top-color: #f5c451;
    animation: plf-nav-spin .7s linear infinite;
}
@keyframes plf-nav-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 640px) {
    .plf-nav { top: 10px; padding: 8px 13px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .plf-nav { transition: none; }
    .plf-nav-spin { animation: none; }
}
