html[data-x4a-theme="dark"] {
    color-scheme: dark;

    --x4a-bg: #0b0f14;
    --x4a-surface: #11161d;
    --x4a-surface-2: #161c24;
    --x4a-surface-3: #1b222c;

    --x4a-border: #252d38;
    --x4a-border-strong: #364150;

    --x4a-text: #e8edf2;
    --x4a-muted: #8f9baa;
    --x4a-faint: #667281;

    --x4a-accent: #4da3ff;

    --x4a-accent-soft:
        rgba(77, 163, 255, 0.12);

    --x4a-positive: #38c892;

    --x4a-shadow:
        0 18px 50px
        rgba(0, 0, 0, 0.22);
}

html[data-x4a-theme="light"] {
    color-scheme: light;

    --x4a-bg: #f5f7fa;
    --x4a-surface: #ffffff;
    --x4a-surface-2: #f8fafc;
    --x4a-surface-3: #eef2f6;

    --x4a-border: #dde3ea;
    --x4a-border-strong: #c8d1dc;

    --x4a-text: #161b22;
    --x4a-muted: #667281;
    --x4a-faint: #8a96a4;

    --x4a-accent: #1769d2;

    --x4a-accent-soft:
        rgba(23, 105, 210, 0.09);

    --x4a-positive: #138a61;

    --x4a-shadow:
        0 18px 45px
        rgba(30, 45, 65, 0.08);
}

body.x4a-marketwire-view {
    background:
        var(--x4a-bg) !important;

    color:
        var(--x4a-text) !important;

    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing:
        antialiased;

    text-rendering:
        optimizeLegibility;
}

body.x4a-marketwire-view
.wp-site-blocks,

body.x4a-marketwire-view
header.wp-block-template-part,

body.x4a-marketwire-view
footer.wp-block-template-part {

    background:
        var(--x4a-bg) !important;

    color:
        var(--x4a-text) !important;
}

body.x4a-marketwire-timeline
.wp-block-post-title,

body.x4a-marketwire-timeline
.entry-title {

    display: none;
}

body.x4a-marketwire-view
.wp-block-post-content {

    margin-top: 0;
}

body.x4a-marketwire-view a {
    color: inherit;
}

body.x4a-marketwire-view button,
body.x4a-marketwire-view input,
body.x4a-marketwire-view textarea,
body.x4a-marketwire-view select {

    font: inherit;
}

.x4a-theme-toggle {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    height: 36px;

    padding:
        0 11px;

    border:
        1px solid
        var(--x4a-border);

    border-radius:
        999px;

    background:
        var(--x4a-surface-2);

    color:
        var(--x4a-text);

    font-size:
        0.78rem;

    font-weight:
        650;

    cursor:
        pointer;

    transition:
        background 120ms ease,
        border-color 120ms ease,
        transform 120ms ease;
}

.x4a-theme-toggle:hover {
    background:
        var(--x4a-surface-3);

    border-color:
        var(--x4a-border-strong);
}

.x4a-theme-toggle:active {
    transform:
        translateY(1px);
}

.x4a-theme-icon {
    width: 15px;
    height: 15px;

    fill: none;

    stroke:
        currentColor;

    stroke-width:
        1.8;

    stroke-linecap:
        round;

    stroke-linejoin:
        round;
}

html[data-x4a-theme="dark"]
.x4a-theme-icon-sun,

html[data-x4a-theme="light"]
.x4a-theme-icon-moon {

    display: none;
}

@media
(prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior:
            auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;
    }
}

/* X4A 68L - TICKER MARKET PAGES */

.x4a-ticker-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 0 14px 60px;

    color: var(--x4a-text);
}

.x4a-ticker-topbar {
    position: sticky;
    top: 0;
    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin: 0 -14px 14px;
    padding: 13px 14px;

    border-bottom:
        1px solid var(--x4a-border);

    background:
        color-mix(
            in srgb,
            var(--x4a-bg) 88%,
            transparent
        );

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.x4a-ticker-breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: 2px;

    color: var(--x4a-muted);

    font-size: 0.76rem;
}

.x4a-ticker-breadcrumb a {
    color: var(--x4a-muted) !important;
    text-decoration: none;
}

.x4a-ticker-breadcrumb a:hover {
    color: var(--x4a-accent) !important;
}

.x4a-ticker-breadcrumb strong {
    color: var(--x4a-text);
}

.x4a-ticker-hero {
    padding: 20px;

    border:
        1px solid var(--x4a-border);

    border-radius: 15px;

    background:
        var(--x4a-surface);

    box-shadow:
        var(--x4a-shadow);
}

.x4a-ticker-symbol-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.x4a-ticker-symbol {
    color: var(--x4a-accent);

    font-size:
        clamp(
            1.45rem,
            4vw,
            2rem
        );

    font-weight: 800;
    letter-spacing: -0.035em;
}

.x4a-ticker-exchange {
    padding: 4px 7px;

    border:
        1px solid var(--x4a-border);

    border-radius: 6px;

    background:
        var(--x4a-surface-2);

    color:
        var(--x4a-muted);

    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.05em;
}

.x4a-ticker-company {
    margin:
        4px 0 8px;

    color:
        var(--x4a-text);

    font-size:
        clamp(
            1.15rem,
            3vw,
            1.55rem
        );

    line-height: 1.2;
    letter-spacing: -0.025em;
}

.x4a-ticker-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-bottom: 18px;
}

.x4a-ticker-metadata span {
    padding: 4px 7px;

    border-radius: 6px;

    background:
        var(--x4a-surface-2);

    color:
        var(--x4a-muted);

    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.x4a-ticker-chart-panel {
    margin-top: 15px;

    padding: 12px;

    border:
        1px solid var(--x4a-border);

    border-radius: 12px;

    background:
        var(--x4a-surface-2);

    min-width: 0;
    max-width: 100%;

    overflow: hidden;
}

.x4a-ticker-chart-stage {
    height: 360px;
    min-height: 360px;
}

.x4a-ticker-chart-unavailable {
    margin-top: 15px;
    padding: 16px;

    border:
        1px dashed var(--x4a-border-strong);

    border-radius: 10px;

    color:
        var(--x4a-muted);

    font-size: 0.8rem;
}

.x4a-ticker-feed-section {
    width: min(100%, 780px);
    margin: 28px auto 0;
}

.x4a-ticker-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 12px;
    padding: 0 2px 10px;

    border-bottom:
        1px solid var(--x4a-border);
}

.x4a-ticker-section-header h2 {
    margin: 1px 0 0;

    color: var(--x4a-text);

    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.x4a-ticker-feed-label {
    color: var(--x4a-accent);

    font-size: 0.77rem;
    font-weight: 750;
}

.x4a-ticker-empty {
    padding: 26px;

    border:
        1px solid var(--x4a-border);

    border-radius: 12px;

    background:
        var(--x4a-surface);

    color:
        var(--x4a-muted);

    text-align: center;

    font-size: 0.82rem;
}

@media (max-width: 640px) {

    .x4a-ticker-shell {
        padding-inline: 8px;
    }

    .x4a-ticker-topbar {
        margin-inline: -8px;
        padding-inline: 10px;
    }

    .x4a-ticker-hero {
        padding: 14px;

        border-radius: 12px;
    }

    .x4a-ticker-chart-panel {
        padding: 9px;
    }

    .x4a-ticker-chart-stage {
        height: 260px;
        min-height: 260px;
    }

    .x4a-ticker-feed-section {
        margin-top: 20px;
    }
}

/* X4A 68L1 - TICKER FEED WIDTH */

/*
 * A symbol page has one authoritative chart above.
 * The related MarketWire stream underneath uses the
 * same available width as the ticker hero.
 */

.x4a-ticker-feed-section {
    width: 100%;
    max-width: 100%;
}

.x4a-ticker-feed-section
.x4a-marketwire-feed,

.x4a-ticker-feed-section
.x4a-feed-items,

.x4a-ticker-feed-section
.x4a-wire-card {

    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;
}


/*
 * Without an embedded chart the cards can be slightly
 * tighter vertically on a dedicated ticker page.
 */

.x4a-ticker-feed-section
.x4a-wire-card {

    padding:
        15px 16px;
}


/* X4A 68L3 - TICKER CHART INSTRUMENT IDENTITY */

.x4a-ticker-chart-identity {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 15px;
    padding-bottom: 13px;

    border-bottom:
        1px solid
        var(--x4a-border);
}

.x4a-ticker-chart-identity-main {
    min-width: 0;
}

.x4a-ticker-chart-name {
    display: block;

    margin-top: 4px;

    color:
        var(--x4a-text);

    font-size:
        clamp(
            1rem,
            2.5vw,
            1.2rem
        );

    font-weight: 750;

    line-height: 1.25;

    letter-spacing:
        -0.018em;
}

.x4a-ticker-chart-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 5px;

    margin-top: 5px;

    color:
        var(--x4a-muted);

    font-size: 0.7rem;

    font-weight: 650;

    letter-spacing:
        0.025em;
}

.x4a-ticker-chart-symbol {
    color:
        var(--x4a-accent);

    font-weight: 800;
}


/*
 * Give RANGE a little breathing room beneath the
 * instrument identity without enlarging the actual
 * TradingView canvas.
 */

.x4a-ticker-chart-panel
.x4a-range-heading {

    margin-top: 2px;
}


@media (max-width: 640px) {

    .x4a-ticker-chart-name {
        font-size: 1rem;
    }

    .x4a-ticker-chart-meta {
        font-size: 0.66rem;
    }
}

/* X4A 68M - MARKET SNAPSHOT */

.x4a-issuer-profile-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin:
        -8px 0 16px;

    color:
        var(--x4a-muted);

    font-size:
        0.69rem;

    font-weight:
        650;
}

.x4a-issuer-profile-line span {
    display: inline-flex;

    align-items: center;

    min-height: 25px;

    padding:
        0 8px;

    border:
        1px solid
        var(--x4a-border);

    border-radius:
        7px;

    background:
        var(--x4a-surface-2);
}

.x4a-primary-listing {
    color:
        var(--x4a-text);
}


/*
 * Snapshot is deliberately separate from X4A's
 * own metadata. TradingView remains responsible
 * for rendering the actual market quote.
 */

.x4a-market-snapshot {
    margin:
        16px 0;

    padding:
        12px;

    border:
        1px solid
        var(--x4a-border);

    border-radius:
        12px;

    background:
        var(--x4a-surface-2);

    min-width:
        0;

    max-width:
        100%;

    overflow:
        hidden;

    color-scheme:
        inherit;

    /*
     * TradingView public widget tokens.
     */
    --tv-widget-background-color:
        transparent;

    --tv-widget-font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

.x4a-market-snapshot-heading {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        12px;

    margin-bottom:
        7px;
}

.x4a-market-snapshot-delay {
    color:
        var(--x4a-muted);

    font-size:
        0.66rem;

    font-weight:
        650;
}

.x4a-market-snapshot-widget {
    width:
        100%;

    max-width:
        100%;

    min-width:
        0;

    overflow:
        hidden;
}

.x4a-market-snapshot-widget
tv-single-ticker {

    display:
        block;

    width:
        100%;

    max-width:
        100%;

    min-width:
        0;

    box-sizing:
        border-box;

    color-scheme:
        inherit;
}

.x4a-market-snapshot-note {
    margin-top:
        6px;

    color:
        var(--x4a-faint);

    font-size:
        0.62rem;

    line-height:
        1.35;
}


@media (max-width: 640px) {

    .x4a-market-snapshot {
        padding:
            10px;
    }

    .x4a-market-snapshot-heading {
        align-items:
            flex-start;

        flex-direction:
            column;

        gap:
            3px;
    }
}

/* X4A 68M2A - SYMBOL OVERVIEW */

/*
 * Symbol Overview brings its own date-range controls.
 * Hide the old X4A Mini Chart range controls only
 * inside the dedicated ticker hero.
 *
 * Timeline controls remain completely untouched.
 */

.x4a-ticker-chart-panel
.x4a-range-heading,

.x4a-ticker-chart-panel
.x4a-range-tabs {

    display: none !important;
}


/*
 * Dedicated chart canvas.
 *
 * The TradingView iframe needs an explicitly sized
 * parent when autosize is enabled.
 */

.x4a-ticker-symbol-overview-stage {

    position: relative;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    height:
        clamp(
            430px,
            49vw,
            520px
        );

    min-height:
        430px;

    max-height:
        520px;

    margin-top:
        10px;

    overflow: hidden;

    border-radius:
        8px;

    box-sizing:
        border-box;
}


.x4a-ticker-symbol-overview-stage
.tradingview-widget-container {

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    max-width: 100%;

    box-sizing:
        border-box;
}


.x4a-ticker-symbol-overview-stage
.tradingview-widget-container__widget {

    width: 100%;

    /*
     * Reserve a small footer for required
     * TradingView attribution.
     */
    height:
        calc(
            100% - 22px
        );

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    box-sizing:
        border-box;
}


.x4a-ticker-symbol-overview-stage
.tradingview-widget-container__widget
iframe {

    display: block;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;

    border: 0 !important;
}


.x4a-ticker-symbol-overview-stage
.tradingview-widget-copyright {

    min-height:
        22px;

    padding-top:
        4px;

    overflow: hidden;

    color:
        var(--x4a-muted);

    font-size:
        0.62rem;

    line-height:
        1.25;

    white-space:
        nowrap;

    text-overflow:
        ellipsis;
}


.x4a-ticker-symbol-overview-stage
.tradingview-widget-copyright a {

    text-decoration:
        none;
}


@media (max-width: 700px) {

    .x4a-ticker-symbol-overview-stage {

        height:
            360px;

        min-height:
            360px;

        max-height:
            360px;
    }
}

/* X4A 68M2A1 - STATEFUL TICKER RANGE CONTROLS */

/*
 * 68M2A hid X4A's controls because TradingView
 * initially owned the range selection.
 *
 * X4A now owns range state so the selection can
 * survive a Light/Dark widget rebuild.
 */

.x4a-ticker-chart-panel
.x4a-range-heading {

    display:
        flex !important;
}


.x4a-ticker-chart-panel
.x4a-range-tabs {

    display:
        flex !important;
}


/*
 * Do not present ranges that are not part of the
 * currently verified Symbol Overview mapping.
 *
 * They remain available in the timeline's existing
 * Mini Chart implementation.
 */

.x4a-ticker-chart-panel
.x4a-range-tab[data-range="5D"],

.x4a-ticker-chart-panel
.x4a-range-tab[data-range="YTD"] {

    display:
        none !important;
}

/* X4A 68N2B - Crypto-aware ticker presentation */

.x4a-ticker-reference-market {

    display:
        flex;

    align-items:
        center;

    flex-wrap:
        wrap;

    gap:
        6px;

    margin-top:
        8px;

    font-size:
        0.82rem;

    line-height:
        1.4;

    opacity:
        0.72;
}


.x4a-ticker-reference-market strong {

    font-weight:
        600;

    letter-spacing:
        0.02em;
}

