/* ═══════════════════════════════════════════════════════════════
   Analysis Single Page — EWI design system
   Variables: --bg, --bg-card (--bg-alt), --accent #4DA3FF,
              --border, --text, --text-muted
   ═══════════════════════════════════════════════════════════════ */

/* ── PAGE WRAPPER — contained to the site header's own width ─────
   Was max-width:none (genuinely full-bleed, edge to edge). Same
   pattern as base.v2.css's .container: max-width/margin/padding, not
   just max-width alone, so this page lines up with the header above
   it rather than just capping width without centering or a gutter. */

.as-page {
    max-width: var(--container, 1200px);
    margin: 0 auto;
    padding: 0 var(--space-4);
    color: var(--text);
}

/* ── DATA STRIP (live prices) ─────────────────────────────────────
   Moved from the old full-width .as-hero-bar into the 320px sidebar,
   as its first card — same markup ids/JS hook, restyled from one wide
   horizontal row (flex-wrap, "|" separators) into a compact vertical
   card matching .as-bottom-card's own look: a headline line (price +
   change + Live badge), then a 2-col grid of the PDH/PDL/etc. label/
   value pairs — everything a sidebar-width column can actually fit
   without wrapping mid-figure. */

.as-data-strip {
    background: var(--bg-card, var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.8125rem;
}

.as-ds-headline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.as-ds-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 8px;
}

.as-ds-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    padding: 1px 4px;
    border-radius: 4px;
}

/* Brief flash on each live price update — direction-colored, ~150ms,
   pure CSS animation rather than a transition + timed class removal,
   so it always completes cleanly even if updates arrive faster than
   150ms apart (the JS side just re-triggers the animation on each
   tick — see the price handler in template-single.php). */
@keyframes as-ds-price-flash-up {
    0%   { background-color: rgba(76, 175, 114, 0.35); }
    100% { background-color: transparent; }
}
@keyframes as-ds-price-flash-down {
    0%   { background-color: rgba(255, 90, 90, 0.35); }
    100% { background-color: transparent; }
}
.as-ds-price.is-flash-up   { animation: as-ds-price-flash-up 150ms ease-out; }
.as-ds-price.is-flash-down { animation: as-ds-price-flash-down 150ms ease-out; }

.as-ds-change,
.as-ds-pct {
    font-weight: 600;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.as-ds-change.is-up,
.as-ds-pct.is-up   { color: #4caf72; }
.as-ds-change.is-down,
.as-ds-pct.is-down { color: #ff5a5a; }

.as-ds-live {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.as-ds-live.is-live {
    color: #4caf72;
    border-color: rgba(76, 175, 114, 0.35);
    background: rgba(76, 175, 114, 0.08);
}

.as-ds-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.as-ds-val {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ── ENGAGEMENT CARD (sidebar) ─────────────────────────────────────
   Moved out of the body into the sidebar's first card — author, time-
   ago, views/comments/likes. .ap-card-author/.ap-card-engagement are
   shared with the Analysis Feed's cards (Insight-Theme's analysis.css)
   and both flex as a horizontal row there; stacked vertically here
   instead, since a wide feed-card layout doesn't fit a 320px column. */

.as-engagement-card .ap-card-author {
    margin-bottom: 10px;
}

.as-engagement-card .ap-card-author__info {
    min-width: 0;
}

.as-engagement-card .ap-card-author__meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.as-engagement-card .ap-card-engagement {
    flex-wrap: wrap;
    gap: 12px;
}

/* ── POST TITLE ───────────────────────────────────────────────── */

/* Sized as a real page H1 now that it's the first thing on the page
   (moved here from below the removed hero badge row, which used to
   carry the visual weight instead — was 1.1rem, sized for a secondary
   confirmation line under that row). Top padding matches .as-page's
   own container gutter rather than the hero bar's old 20px. */
.as-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    padding: 20px 0 10px;
    line-height: 1.3;
}

/* Deck — the analyst's Chart Image Alt Text, shown as a pull-quote
   under the H1 (a "dek" line under the headline, same idea as a normal
   blog post's excerpt/standfirst, styled as a quote per Tony's request).
   A real <blockquote> — accent left border + large opening quote mark,
   italic body text. */
.as-deck {
    position: relative;
    font-size: 1.0625rem;
    font-style: italic;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0 0 16px;
    padding: 2px 0 2px 20px;
    line-height: 1.5;
    border-left: 3px solid var(--accent, #4DA3FF);
}

.as-deck::before {
    content: '\201C';
    position: absolute;
    left: 6px;
    top: -4px;
    font-size: 1.5rem;
    font-style: normal;
    color: var(--accent, #4DA3FF);
    opacity: 0.6;
}

/* The analyst's own readable headline — post_title (.as-title, above) is
   the auto-generated SEO string now, so this carries the human-written
   text that used to be the only title. Lighter weight than .as-title,
   same horizontal padding (now 0 — .as-page's own container gutter
   handles it), no top padding of its own (sits right under it). */
.as-subtitle {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    padding: 0 0 10px;
    line-height: 1.4;
}

/* Primary ↔ Alternate cross-link — relocated from the removed hero
   badge row. Plain accent-colored text link, not a badge/pill — it's
   a single, page-level link about this post's own identity, not a
   status indicator like the badges it used to sit among. */
.as-scenario-link {
    margin: 0;
    padding: 0 0 10px;
    font-size: 0.8125rem;
}

.as-scenario-link a {
    color: var(--accent, #4DA3FF);
    text-decoration: none;
    font-weight: 600;
}

.as-scenario-link a:hover {
    text-decoration: underline;
}

/* ── SHARE ROW ────────────────────────────────────────────────── */
/* Base .as-share-row/.as-share-btn rules moved to analysis.css — the share
   row is now reused on feed cards and Quick View too, neither of which
   load this single-page-only stylesheet (see ap_enqueue_assets()'s
   is_singular('analysis') gate). Only this page's own gutter spacing
   stays here — 0 now that .as-page itself provides the horizontal inset. */

.as-share-row {
    padding: 0 0 16px;
}

/* ── GUEST SIGN-UP NUDGE ──────────────────────────────────────── */
/* Soft nudge only — never blocks or blurs the content below it. Own
   horizontal margin dropped — .as-page's container gutter covers it now. */

.as-guest-nudge {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 14px 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.as-guest-nudge__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.as-guest-nudge__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.as-guest-nudge__text strong {
    font-size: 0.9375rem;
    color: var(--text);
}

.as-guest-nudge__text span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.as-guest-nudge__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    background: var(--accent);
    color: #000;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.as-guest-nudge__cta:hover {
    background: var(--accent-hover);
    color: #000;
}

@media (max-width: 640px) {
    .as-guest-nudge {
        flex-direction: column;
        align-items: flex-start;
    }
    .as-guest-nudge__cta {
        width: 100%;
        justify-content: center;
    }
}

/* ── BADGES ───────────────────────────────────────────────────── */

.as-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
}

.as-badge--sm {
    padding: 2px 6px;
    font-size: 0.65rem;
}

.as-badge--bias.as-badge--bullish {
    background: rgba(76, 175, 114, 0.15);
    color: #4caf72;
    border: 1px solid rgba(76, 175, 114, 0.3);
}
.as-badge--bias.as-badge--bearish {
    background: rgba(255, 90, 90, 0.15);
    color: #ff5a5a;
    border: 1px solid rgba(255, 90, 90, 0.3);
}
.as-badge--bias.as-badge--turning_bullish {
    background: rgba(136, 204, 68, 0.15);
    color: #88cc44;
    border: 1px solid rgba(136, 204, 68, 0.3);
}
.as-badge--bias.as-badge--turning_bearish {
    background: rgba(238, 136, 102, 0.15);
    color: #ee8866;
    border: 1px solid rgba(238, 136, 102, 0.3);
}
.as-badge--bias.as-badge--sharp_correction {
    background: rgba(201, 162, 39, 0.15);
    color: #c9a227;
    border: 1px solid rgba(201, 162, 39, 0.3);
}
.as-badge--bias.as-badge--neutral {
    background: rgba(150, 150, 150, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(150, 150, 150, 0.3);
}
.as-badge--timeframe {
    background: rgba(77, 163, 255, 0.12);
    color: #4DA3FF;
    border: 1px solid rgba(77, 163, 255, 0.25);
}

/* ── SECTION 3: CHART + TABS, STACKED ─────────────────────────────
   Was a 55/45 side-by-side split (grid-template-columns: 55fr 45fr).
   Now single-column: chart, then tabs full-width below it — same DOM
   order as before, so this is purely a grid-columns change, nothing
   about the markup itself moved. */

.as-two-col {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-items: stretch;
    border-top: 1px solid var(--border);
}

/* ── CHART ──────────────────────────────────────────────────────── */

.as-chart-col {
    min-height: 460px;
    position: relative;
    border-bottom: 1px solid var(--border);
    background: #000;
}

.as-chart {
    height: 100%;
    display: flex;
    align-items: stretch;
}

.as-chart--blurred .as-chart__img {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.as-chart--zoomable { cursor: zoom-in; }

.as-chart__zoom-link {
    display: flex;
    width: 100%;
    position: relative;
}

.as-chart__zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.as-chart--zoomable:hover .as-chart__zoom-icon { opacity: 1; }

.as-chart__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.as-chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Chart carousel (multi-image gallery, Stage 2) ── */

.as-chart-carousel { position: relative; height: 100%; }
.as-chart-carousel__track { height: 100%; }
.as-chart-carousel__slide { display: none; }
.as-chart-carousel__slide.is-active { display: flex; flex-direction: column; }

/* Direct flex children only (the zoom link, or the bare <img> in the
   blurred case) — fills remaining height above the caption bar, rather
   than the caption pushing the slide taller than .as-chart-col allows. */
.as-chart-carousel__slide > .as-chart__zoom-link,
.as-chart-carousel__slide > .as-chart__img {
    flex: 1;
    min-height: 0;
}

/* Moved from an absolute overlay on the image to normal flow below it —
   the overlay directly collided with TradingView's watermark, which sits
   in the same bottom corner on most chart screenshots. Solid background
   now (was a gradient meant to sit over image content), matching the
   admin panel's already-correct below-image treatment. */
.as-chart-carousel__caption {
    position: static;
    flex-shrink: 0;
    padding: 10px 14px;
    background: var(--bg-alt, #111);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Was hardcoded #fff / rgba(255,255,255,.7) — readable against this
   bar's dark-mode background (--bg-alt), invisible in light mode where
   --bg-alt becomes near-white, same white-on-white pattern as every
   other contrast bug fixed tonight. Text tokens now match the bar's
   own already-theme-aware background. */
.as-chart-carousel__caption-text { color: var(--text, #fff); font-size: 0.8125rem; font-weight: 600; }
.as-chart-carousel__caption-time { color: var(--text-muted, rgba(255,255,255,.7)); font-size: 0.75rem; }

.as-chart-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.as-chart-carousel__nav:hover { background: rgba(0,0,0,.8); }
.as-chart-carousel__nav--prev { left: 10px; }
.as-chart-carousel__nav--next { right: 10px; }

.as-chart-carousel__dots {
    /* top, not bottom — the caption bar's height now varies with its
       content (or is absent entirely on the cover slide), so anchoring
       from the bottom could still land inside it; the top of the image
       is a fixed, always-safe position regardless of caption length. */
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.as-chart-carousel__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.4);
    cursor: pointer;
    padding: 0;
}

.as-chart-carousel__dot.is-active { background: #fff; }

/* Count badge, opposite corner from the dots (top-center) — lets a
   member tell there's more content beyond the current slide even
   before they interact with nav/dots at all. */
.as-chart-carousel__counter {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    z-index: 2;
}

/* ── TABS PANEL ─────────────────────────────────────────────────
   overflow-y/max-height/scrollbar rules removed — they existed only
   to cap this column's height to match the chart column in the old
   side-by-side layout. Stacked below the chart now, so it just flows
   with the page's own scroll like everything else. */

.as-data-col {
    padding: 20px 24px;
}

/* ── PILL TABS ────────────────────────────────────────────────── */

.as-pill-tabs {
    display: flex;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 16px;
    width: fit-content;
}

.as-pill-tab {
    padding: 6px 16px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    font-family: inherit;
}

.as-pill-tab:hover { color: var(--text); }

.as-pill-tab.is-active {
    background: var(--accent, #4DA3FF);
    color: #000;
}

.as-pill-panel { /* full width within data col */ }

/* ── PANEL SECTIONS (inside pill tabs) ────────────────────────── */

.as-panel-section {
    margin-bottom: 16px;
}

.as-panel-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.as-label-badge {
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.12);
    color: #c9a227;
    border: 1px solid rgba(201, 162, 39, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── STAT ROW ─────────────────────────────────────────────────── */

.as-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.as-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.as-stat-card__label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.as-stat-card__val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.as-stat-card--bullish          { border-color: rgba(76, 175, 114, 0.3); }
.as-stat-card--bullish .as-stat-card__val          { color: #4caf72; }
.as-stat-card--bearish          { border-color: rgba(255, 90, 90, 0.3); }
.as-stat-card--bearish .as-stat-card__val          { color: #ff5a5a; }
.as-stat-card--turning_bullish  { border-color: rgba(136, 204, 68, 0.3); }
.as-stat-card--turning_bullish .as-stat-card__val  { color: #88cc44; }
.as-stat-card--turning_bearish  { border-color: rgba(238, 136, 102, 0.3); }
.as-stat-card--turning_bearish .as-stat-card__val  { color: #ee8866; }
.as-stat-card--sharp_correction { border-color: rgba(201, 162, 39, 0.3); }
.as-stat-card--sharp_correction .as-stat-card__val { color: #c9a227; }

/* ── WAVE COMPACT ─────────────────────────────────────────────── */

.as-wave-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.as-wave-compact__section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.as-wave-compact__label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
}

.as-wave-compact__val {
    font-weight: 600;
    color: var(--text);
    font-size: 0.8rem;
}

.as-wave-compact__val--accent { color: #4DA3FF; }

.as-wave-compact__arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ── INTRADAY: 4H CONTEXT LOOKUP ──────────────────────────────── */
.as-htf-context-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
}

.as-htf-context-row__empty {
    color: var(--text-muted);
}

.as-htf-context-row__link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
    flex: 1;
}

.as-htf-context-row__link:hover { color: #4DA3FF; }

.as-htf-context-row__ago {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.as-next-tf-card {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.as-next-tf-card__row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.as-next-tf-card__summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.as-next-tf-card__summary.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.as-next-tf-card__toggle {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    color: #4DA3FF;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.as-next-tf-card__toggle:hover { text-decoration: underline; }

/* ── WAVE THESIS / FULL CONTENT ───────────────────────────────── */

.as-thesis {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text);
}

.as-thesis p { margin: 0 0 10px; }
.as-thesis p:last-child { margin-bottom: 0; }

.as-content {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text);
}

.as-content p { margin: 0 0 12px; }
.as-content p:last-child { margin-bottom: 0; }

.as-summary {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
}

/* ── INVALIDATION ─────────────────────────────────────────────── */

.as-invalidation-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff5a5a;
    margin-bottom: 6px;
}

.as-invalidation-pattern {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ── CARDS ────────────────────────────────────────────────────── */

.as-card {
    background: var(--bg-card, var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.as-card--trade {
    border-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
}

/* ── TRADE LEVELS ─────────────────────────────────────────────── */

.as-trade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.875rem;
}

.as-trade-row:last-child { border-bottom: none; }

.as-trade-row__key { color: var(--text-muted); }
.as-trade-row__val { font-weight: 700; font-size: 0.9375rem; }

.as-trade-row--entry .as-trade-row__val { color: var(--text); }
.as-trade-row--sl    .as-trade-row__val { color: #ff5a5a; }
.as-trade-row--tp    .as-trade-row__val { color: #4caf72; }
.as-trade-row--rr    .as-trade-row__val { color: #4DA3FF; font-size: 0.875rem; }

/* ── NEXT UPDATE ──────────────────────────────────────────────── */

.as-next-update {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(77, 163, 255, 0.06);
    border: 1px solid rgba(77, 163, 255, 0.15);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.as-next-update strong { color: var(--text); }

/* ── KEY LEVELS COMPACT ────────────────────────────────────────
   Same component family as WAVE COMPACT above (label/value pairs in
   one shared row, no per-item card chrome) — reused here instead of
   the old as-kl-card grid so Key Levels and HTF Context read as one
   consistent convention rather than two different visual languages. */

.as-kl-compact {
    display: flex;
    align-items: flex-start;
    gap: 8px 20px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 0.8rem;
}

.as-kl-compact__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 260px;
}

.as-kl-compact__label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
}

.as-kl-compact__val {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.2;
}

.as-kl-compact__reason {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.as-kl-compact__item--support .as-kl-compact__val   { color: #4caf72; }
.as-kl-compact__item--resistance .as-kl-compact__val { color: #ff5a5a; }
.as-kl-compact__item--invalidation .as-kl-compact__val { color: #c9a227; }
.as-kl-compact__item--target .as-kl-compact__val     { color: #4DA3FF; }

/* ── KEY LEVELS TABLE ─────────────────────────────────────────── */

.as-kl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.as-kl-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.as-kl-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text);
    vertical-align: middle;
}

.as-kl-table__row:last-child td { border-bottom: none; }

.as-kl-table__price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.as-kl-table__reason {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.as-kl-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.as-kl-type--support     { background: rgba(76, 175, 114, 0.15); color: #4caf72; }
.as-kl-type--resistance  { background: rgba(255, 90, 90, 0.15);  color: #ff5a5a; }
.as-kl-type--target      { background: rgba(77, 163, 255, 0.15); color: #4DA3FF; }
.as-kl-type--invalidation{ background: rgba(201, 162, 39, 0.15); color: #c9a227; }

/* ── CONFLUENCES ──────────────────────────────────────────────── */

.as-confluence-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.as-confluence-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(77, 163, 255, 0.05);
    border: 1px solid rgba(77, 163, 255, 0.15);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
}

.as-confluence-item::before {
    content: '✓';
    color: #4DA3FF;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── STATUS CALLOUT (Invalidated / New Revised Count) ─────────────
   Set via the Gallery panel's Update Type selector — see
   ap_gallery_add_image() (analysis-gallery.php) and the callout's own
   PHP right after .as-chart-col in template-single.php. Never shown
   for the default 'active' status. */

.as-status-callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid;
}

.as-status-callout__label {
    margin: 0;
    font-weight: 700;
    font-size: 0.9375rem;
}

.as-status-callout__reason {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.as-status-callout--invalidated {
    background: rgba(255, 90, 90, 0.08);
    border-color: rgba(255, 90, 90, 0.35);
}
.as-status-callout--invalidated .as-status-callout__label { color: #ff5a5a; }

.as-status-callout--revised {
    background: rgba(201, 162, 39, 0.08);
    border-color: rgba(201, 162, 39, 0.35);
}
.as-status-callout--revised .as-status-callout__label { color: #c9a227; }

/* ── LOCKED / PREMIUM GATE ────────────────────────────────────── */

.as-locked {
    padding: 16px 20px;
    background: rgba(255, 200, 0, 0.05);
    border: 1px dashed rgba(255, 200, 0, 0.35);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 14px;
}

.as-locked p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.as-upgrade-btn {
    display: inline-block;
    padding: 9px 18px;
    background: #4DA3FF;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background .2s;
}

.as-upgrade-btn:hover { background: #3a8fe8; color: #fff; }

/* ── MAIN + SIDEBAR LAYOUT ────────────────────────────────────────
   Replaces the old full-width .as-two-col (Section 3) + separate
   full-width .as-bottom-grid (Section 4, 3-up) with a genuine two-
   column page: main content (Section 3, unchanged internally) next
   to a real sidebar carrying what Section 4's three cards used to
   show horizontally at the page bottom — now stacked vertically to
   fit the sidebar's own, much narrower column. */

.as-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    border-top: 1px solid var(--border);
    padding: 12px 0 24px;
}

.as-content-layout .as-two-col {
    border-top: none; /* .as-content-layout already carries this border */
}

.as-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Sits below the site's own sticky header (real, fixed height —
       .site-header { height: 64px; position: sticky; }, header.v2.css
       — not the community-page-only --ewi-nav-h variable, which isn't
       set on this page). 12px added on top of that so the sidebar
       doesn't sit flush against the header when stuck — a little
       breathing room rather than truly touching it. */
    position: sticky;
    top: 76px;
}

.as-bottom-card {
    background: var(--bg-card, var(--bg-alt));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

.as-bottom-card__eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.as-bottom-card__heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}

.as-bottom-card__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
    flex: 1;
}

.as-bottom-card__btn {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    transition: background .2s, border-color .2s;
    margin-top: auto;
}

.as-bottom-card__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

.as-bottom-card__btn--intel {
    background: rgba(77, 163, 255, 0.1);
    border-color: rgba(77, 163, 255, 0.25);
    color: #4DA3FF;
}

.as-bottom-card__btn--intel:hover {
    background: rgba(77, 163, 255, 0.18);
    color: #4DA3FF;
}

.as-bottom-card--intel { border-color: rgba(77, 163, 255, 0.2); }

/* ⚠ TEMPORARY PLACEHOLDER — replace once real AdSense publisher/slot
   IDs exist (see enqueue.php's ewi_adsense_client_id option and this
   card's own markup in template-single.php). Dashed border and label
   make it obvious in any screenshot/review that this isn't the final
   ad unit. */
.as-bottom-card--ad {
    border-style: dashed;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-align: center;
    color: var(--text-muted);
}

.as-bottom-card--ad__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── SIDEBAR INFO BLOCK ───────────────────────────────────────────
   Scenario/Count Status/Timeframe/Session/Trade Type — reuses
   .as-bottom-card's own box styling (border/radius/padding), just a
   plain label/value list inside rather than a promo card. */
.as-sidebar-info__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.as-sidebar-info__row + .as-sidebar-info__row {
    border-top: 1px solid var(--border);
}

.as-sidebar-info__label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.as-sidebar-info__val {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* ── RELATED MINI CARDS ───────────────────────────────────────── */

.as-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.as-related-mini {
    display: block;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

.as-related-mini:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(77, 163, 255, 0.25);
}

.as-related-mini__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.as-related-mini__date {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
}

.as-related-mini__title {
    display: block;
    font-size: 0.78rem;
    color: var(--text);
    line-height: 1.4;
}

/* ── ENGAGEMENT BAR wrapper ───────────────────────────────────── */

.as-discussion {
    /* Explicit grid reset — this is now a direct grid item of .as-two-col
       (moved in from being a page-level sibling block outside any grid),
       so it needs its own column-span/width stated rather than inherited. */
    display: block;
    grid-column: 1 / -1;
    width: 100%;
    max-width: 860px;
    margin: 40px auto;
    padding: 0 24px;
    border-top: 1px solid var(--border);
}

/* ── DISCUSSION SECTION ───────────────────────────────────────── */

.as-discussion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.as-discussion__header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.as-discussion__count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.as-discussion__messages {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    margin-bottom: 16px;
}

.as-discussion__messages::-webkit-scrollbar { width: 4px; }
.as-discussion__messages::-webkit-scrollbar-track { background: transparent; }
.as-discussion__messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.as-discussion__composer {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}

.as-discussion__composer:focus-within {
    border-color: rgba(77, 163, 255, 0.4);
}

.as-disc-compose-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.as-disc-compose-row textarea {
    flex: 1;
}

.as-discussion__composer textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--text, #e0e0e0);
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 40px;
    max-height: 140px;
    overflow-y: auto;
    font-family: inherit;
}

/* Image preview strip */
.as-disc-image-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
}

.as-disc-image-preview img {
    max-height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.as-disc-image-remove {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-muted, #888);
    cursor: pointer;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    flex-shrink: 0;
}

.as-disc-image-remove:hover { background: rgba(255,90,90,0.15); color: #ff5a5a; }

/* Image attach button */
.as-disc-attach-btn {
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 2px;
    transition: opacity 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.as-disc-attach-btn:hover { opacity: 1; }

/* Emoji row inside context menu (for .as-disc-ctx) */
.ewi-c-ctx__emoji-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    max-width: 216px;
}

.ewi-c-ctx__emoji {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 5px;
    border-radius: 5px;
    line-height: 1;
    transition: background 0.1s;
}

.ewi-c-ctx__emoji:hover { background: rgba(255,255,255,0.1); }

/* Message images — small thumbnail in feed, full size via lightbox */
.as-disc-message .ewi-c-msg__img,
.ewi-c-msg__img {
    max-width: 120px;
    max-height: 90px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
}

.as-discussion__composer textarea::placeholder { color: var(--text-muted, #555); }

.as-disc-send {
    background: var(--accent, #4DA3FF);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.as-disc-send:hover:not(:disabled) { opacity: 0.88; }
.as-disc-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* Locked state */
.as-discussion__locked {
    padding: 24px 20px;
    background: rgba(255, 200, 0, 0.05);
    border: 1px dashed rgba(255, 200, 0, 0.3);
    border-radius: 8px;
    text-align: center;
}

.as-discussion__locked p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.as-disc-upgrade {
    display: inline-block;
    padding: 8px 20px;
    background: var(--accent, #4DA3FF);
    color: #000;
    text-decoration: none;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: opacity 0.15s;
}

.as-disc-upgrade:hover { opacity: 0.88; color: #000; }

/* ── Discussion messages ──────────────────────────────────────── */

.as-disc-message { cursor: default; }

.ewi-c-msg {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    transition: background 0.1s;
}

.ewi-c-msg:hover { background: rgba(255,255,255,0.02); }

.ewi-c-msg__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-card, #1a1a1a);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted, #888);
}

.ewi-c-msg__avatar img { width: 100%; height: 100%; object-fit: cover; }

.ewi-c-msg__body { flex: 1; min-width: 0; }

.ewi-c-msg__header {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.ewi-c-msg__name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text, #e0e0e0);
}

.ewi-c-msg__time {
    font-size: 0.72rem;
    color: var(--text-muted, #666);
}

.ewi-c-msg__edited {
    font-size: 0.68rem;
    color: var(--text-muted, #666);
    font-style: italic;
}

/* Role badges */
.ewi-c-badge {
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.ewi-c-badge--admin   { background: rgba(255,200,50,0.15);  color: #e8b830; }
.ewi-c-badge--analyst { background: rgba(77,163,255,0.15);  color: #4DA3FF; }
.ewi-c-badge--premium { background: rgba(76,175,114,0.15);  color: #4caf72; }

.ewi-c-msg__text {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text, #d0d0d0);
    word-break: break-word;
    white-space: pre-wrap;
}

/* Reactions */
.ewi-c-msg__reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    align-items: center;
    position: relative;
}

.ewi-c-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 12px;
    padding: 3px 9px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted, #888);
    transition: background 0.1s, border-color 0.1s;
}

.ewi-c-reaction:hover { background: rgba(255,255,255,0.09); }

.ewi-c-reaction.is-reacted {
    background: rgba(77,163,255,0.12);
    border-color: rgba(77,163,255,0.35);
    color: var(--accent, #4DA3FF);
}

.ewi-c-reaction-add {
    background: transparent;
    border: 1px dashed var(--border, #333);
    border-radius: 12px;
    padding: 3px 9px;
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    cursor: pointer;
}

.ewi-c-reaction-add:hover { border-color: var(--accent, #4DA3FF); color: var(--accent, #4DA3FF); }

.ewi-c-reaction-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    display: flex;
    gap: 4px;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
    padding: 6px 8px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.ewi-c-reaction-pick {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 5px;
    transition: background 0.1s;
}

.ewi-c-reaction-pick:hover { background: rgba(255,255,255,0.08); }

/* Message actions (edit / delete — shown on hover) */
.ewi-c-msg__actions {
    display: none;
    gap: 8px;
    margin-top: 4px;
}

.ewi-c-msg:hover .ewi-c-msg__actions { display: flex; }

.ewi-c-msg__actions button {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted, #777);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}

.ewi-c-msg__actions button:hover { background: rgba(255,255,255,0.06); color: var(--text, #e0e0e0); }

.ewi-c-msg-delete:hover { color: #ff5a5a !important; }

/* Context menu */
.as-disc-ctx {
    background: var(--bg-card, #1e1e1e);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 120px;
}

.as-disc-ctx__item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 7px 12px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text, #e0e0e0);
    cursor: pointer;
    border-radius: 5px;
    font-family: inherit;
    transition: background 0.1s;
}

.as-disc-ctx__item:hover { background: rgba(255, 255, 255, 0.07); }

.as-disc-ctx__item--danger { color: #ff5a5a; }
.as-disc-ctx__item--danger:hover { background: rgba(255, 90, 90, 0.08); }

/* ── EMPTY STATE ──────────────────────────────────────────────── */

.as-empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 20px 0;
    text-align: center;
}

/* ── DISCUSSION REPLY IMAGES ──────────────────────────────────── */

.ewi-reply-image { margin-top: 8px; }

.ewi-reply-img {
    max-width: 100%;
    border-radius: 8px;
    cursor: zoom-in;
    max-height: 400px;
    object-fit: contain;
}

.ewi-reply-img-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.ewi-reply-img-btn {
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    transition: background .2s;
    user-select: none;
}

.ewi-reply-img-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ── LIGHTBOX ─────────────────────────────────────────────────── */
/* Extracted to the shared Insight-Theme/assets/css/components/
   gallery-lightbox.css (.ewi-lightbox*) — see that file. This page's
   own .as-chart__zoom-link/.as-chart__zoom-icon rules above stay here,
   since they style the trigger on the chart itself, not the lightbox
   overlay. */

/* ── RESPONSIVE ───────────────────────────────────────────────── */

@media (max-width: 900px) {
    .as-content-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 0;
    }

    .as-sidebar {
        position: static; /* drops below main content, stacked, no longer sticky */
    }

    .as-chart-col {
        min-height: 300px;
    }

    .as-data-col {
        padding: 16px 18px;
    }
}

@media (max-width: 600px) {
    .as-data-strip {
        font-size: 0.75rem;
    }

    .as-ds-price { font-size: 0.9375rem; }

    .as-stat-row {
        grid-template-columns: 1fr 1fr;
    }

    .as-kl-compact__item {
        max-width: none;
        flex: 1 1 100%;
    }

    .as-pill-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .as-pill-tab { flex: 1; text-align: center; }
}

/* ── Risk disclaimer card (bottom-grid middle column) ────────── */
.as-bottom-card--disclaimer .as-bottom-card__desc {
    font-size: 0.75rem;
    line-height: 1.65;
    margin-bottom: 0;
}
