.apf-spread-page {
    --spread-panel: #101014;
    --spread-panel-soft: #15151a;
    --spread-line: rgba(255, 255, 255, 0.09);
    --spread-muted: #9a9aa3;
    width: min(100%, 1400px);
    margin: 0 auto;
    padding: clamp(22px, 3vw, 38px) clamp(12px, 2.5vw, 28px) 52px;
    color: #f8fafc;
}

.spread-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(25px, 3.5vw, 38px);
    background:
        linear-gradient(
            120deg,
            color-mix(in srgb, var(--beam-color) 8%, transparent),
            transparent 44%
        ),
        radial-gradient(
            circle at 85% 5%,
            color-mix(in srgb, var(--beam-color) 13%, transparent),
            transparent 27%
        ),
        #0d0d11;
    border: 1px solid color-mix(in srgb, var(--beam-color) 24%, #25252a);
    border-radius: 23px;
    box-shadow:
        0 20px 58px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.spread-hero__glow {
    position: absolute;
    z-index: -1;
    top: -170px;
    left: -140px;
    width: 330px;
    height: 330px;
    background: color-mix(in srgb, var(--beam-color) 10%, transparent);
    border-radius: 50%;
    filter: blur(90px);
}

.spread-hero__content {
    max-width: 900px;
    margin-inline: auto;
    text-align: center;
}

.spread-kicker {
    display: inline-block;
    color: var(--beam-color);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.spread-hero h1 {
    max-width: 1000px;
    margin: 9px auto 7px;
    color: #fff;
    font-size: clamp(29px, 4vw, 44px);
    font-weight: 900;
    line-height: 1.2;
}

.spread-hero h1 em {
    color: var(--beam-color);
    font-style: normal;
}

.spread-hero__content > p {
    max-width: 760px;
    margin: 0 auto;
    color: #b4b4bc;
    font-size: clamp(11px, 1.35vw, 14px);
    line-height: 1.7;
}

.spread-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 31px;
    margin-top: 14px;
    padding: 0 11px;
    color: #fde68a;
    font-size: 9px;
    font-weight: 900;
    background: rgba(245, 158, 11, 0.09);
    border: 1px solid rgba(245, 158, 11, 0.26);
    border-radius: 999px;
}

.spread-live-badge i,
.spread-board__pulse span {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 0 0 14px currentColor;
}

.spread-live-badge.is-live {
    color: #34d399;
    background: rgba(16, 185, 129, 0.09);
    border-color: rgba(16, 185, 129, 0.26);
}

.spread-live-badge.is-live i,
.spread-board__pulse span {
    animation: spreadPulse 1.7s ease-in-out infinite;
}

.spread-live-badge.is-offline {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.09);
    border-color: rgba(244, 63, 94, 0.28);
}

.spread-hero__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: clamp(17px, 2.5vw, 24px);
    overflow: hidden;
    background: var(--spread-line);
    border: 1px solid var(--spread-line);
    border-radius: 14px;
}

.spread-hero__metrics article {
    min-width: 0;
    padding: 11px 13px;
    background: rgba(10, 10, 13, 0.88);
    text-align: center;
}

.spread-hero__metrics span,
.spread-hero__metrics strong,
.spread-hero__metrics small {
    display: block;
}

.spread-hero__metrics span {
    color: #8b8b95;
    font-size: 9px;
}

.spread-hero__metrics strong {
    margin: 3px 0 2px;
    color: #fff;
    font-size: clamp(14px, 1.6vw, 17px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spread-hero__metrics small {
    color: #64646d;
    font-size: 8px;
}

.spread-connection-alert {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    margin-top: 18px;
    padding: 15px;
    color: #fecdd3;
    background: linear-gradient(
        120deg,
        rgba(136, 19, 55, 0.23),
        rgba(63, 15, 30, 0.34)
    );
    border: 1px solid rgba(244, 63, 94, 0.34);
    border-radius: 17px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}

.spread-connection-alert[hidden] {
    display: none;
}

.spread-connection-alert__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    background: #e11d48;
    border-radius: 14px;
}

.spread-connection-alert strong {
    display: block;
    color: #fff;
}

.spread-connection-alert p {
    margin: 4px 0 0;
    color: #fda4af;
    font-size: 11px;
}

.spread-connection-alert button {
    min-height: 40px;
    padding: 0 15px;
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    cursor: pointer;
}

.spread-board {
    margin-top: 18px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 100% 0,
            color-mix(in srgb, var(--beam-color) 8%, transparent),
            transparent 26%
        ),
        var(--spread-panel);
    border: 1px solid color-mix(in srgb, var(--beam-color) 25%, #28282e);
    border-radius: 21px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.spread-board__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    padding: clamp(16px, 2.5vw, 21px);
    border-bottom: 1px solid var(--spread-line);
}

.spread-board__header h2 {
    margin: 3px 0;
    color: #fff;
    font-size: clamp(20px, 2.8vw, 27px);
}

.spread-board__header p {
    margin: 0;
    color: var(--spread-muted);
    font-size: 10px;
}

.spread-board__pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    color: #34d399;
    font-size: 10px;
    font-weight: 900;
}

.spread-mobile-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 13px;
    color: #b4b4bc;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--spread-line);
}

.spread-mobile-hint span {
    color: var(--beam-color);
    font-size: 16px;
}

.spread-table-shell {
    position: relative;
}

.spread-table-shell.is-stale::after {
    content: "Latest successful data";
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 12;
    padding: 6px 9px;
    color: #fecaca;
    font-size: 9px;
    font-weight: 900;
    background: rgba(127, 29, 29, 0.92);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 999px;
    pointer-events: none;
}

.spread-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--beam-color) 65%, #303036)
        #19191e;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y;
}

.spread-table-scroll:focus-visible {
    outline: 2px solid var(--beam-color);
    outline-offset: -3px;
}

.spread-table-scroll::-webkit-scrollbar {
    height: 10px;
}

.spread-table-scroll::-webkit-scrollbar-track {
    background: #19191e;
}

.spread-table-scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--beam-color) 65%, #303036);
    border: 2px solid #19191e;
    border-radius: 999px;
}

.spread-table {
    width: 100%;
    min-width: 1120px;
    direction: ltr;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.spread-table th,
.spread-table td {
    height: 66px;
    padding: 9px 10px;
    text-align: center;
    vertical-align: middle;
    background: #101014;
    border-bottom: 1px solid var(--spread-line);
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    white-space: nowrap;
}

.spread-table thead th {
    height: 74px;
    color: #d4d4d8;
    background: #141419;
}

.spread-table tbody tr:last-child th,
.spread-table tbody tr:last-child td {
    border-bottom: 0;
}

.spread-table tbody tr:hover td,
.spread-table tbody tr:hover th {
    background-color: #15151a;
}

.company-col {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    padding-inline: 13px !important;
    text-align: left !important;
    background: #121217 !important;
    border-right: 1px solid color-mix(in srgb, var(--beam-color) 22%, #2b2b31) !important;
    box-shadow: 13px 0 24px rgba(0, 0, 0, 0.23);
}

.spread-table thead .company-col {
    z-index: 8;
    color: var(--beam-color);
    font-size: 12px;
    font-weight: 900;
    background: #16161b !important;
}

.spread-sticky-tools {
    position: fixed;
    z-index: 40000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #141419;
    border-bottom: 1px solid var(--spread-line);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.45),
        0 1px 0 color-mix(
            in srgb,
            var(--beam-color) 18%,
            transparent
        );
}

.spread-sticky-tools.is-visible {
    opacity: 1;
    visibility: visible;
}

.spread-sticky-tools__viewport {
    width: 100%;
    overflow: hidden;
    direction: ltr;
}

.spread-sticky-tools .spread-table {
    margin: 0;
}

.spread-sticky-tools .spread-table thead th {
    height: 74px;
    background: #141419;
    border-bottom-color: color-mix(
        in srgb,
        var(--beam-color) 20%,
        var(--spread-line)
    );
}

.spread-sticky-tools .spread-table thead .company-col {
    z-index: 12;
}

.company-box {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.company-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    padding: 6px;
    background: #0b0b0e;
    border: 1px solid color-mix(in srgb, var(--beam-color) 26%, #2d2d33);
    border-radius: 11px;
}

.company-name {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
}

.company-box:hover .company-name {
    color: var(--beam-color);
}

.symbol-head {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.symbol-head > img,
.flags-pair img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    border-radius: 50%;
}

.symbol-head b {
    color: #f4f4f5;
    font-size: 11px;
}

.symbol-head small {
    color: #62626b;
    font-size: 8px;
    direction: ltr;
}

.flags-pair {
    display: flex;
    direction: ltr;
}

.flags-pair img + img {
    margin-left: -8px;
    outline: 2px solid #141419;
}

.spread-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    direction: ltr;
    border: 1px solid transparent;
    border-radius: 999px;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease;
}

.spread-best {
    color: #20dca0;
    background: #062b21;
    border-color: transparent;
}

.spread-mid {
    color: #f0b90b;
    background: #2b1b06;
    border-color: transparent;
}

.spread-worst {
    color: #ff9da8;
    background: #3b1518;
    border-color: transparent;
}

.spread-neutral,
.spread-empty {
    color: #85858d;
    background: #242427;
    border-color: transparent;
}

.spread-skeleton {
    display: inline-block;
    width: 66px;
    height: 34px;
    overflow: hidden;
    background: #1e1e24;
    border-radius: 999px;
}

.spread-skeleton::after {
    content: "";
    display: block;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: spreadSkeleton 1.25s ease-in-out infinite;
}

.spread-board__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(15px, 2vw, 22px);
    background: rgba(255, 255, 255, 0.018);
    border-top: 1px solid var(--spread-line);
}

.spread-board__footer > div {
    flex: 0 0 auto;
}

.spread-board__footer span,
.spread-board__footer strong {
    display: block;
}

.spread-board__footer span {
    color: #6b6b74;
    font-size: 9px;
}

.spread-board__footer strong {
    margin-top: 3px;
    color: #d4d4d8;
    font-size: 11px;
}

.spread-board__footer p {
    max-width: 760px;
    margin: 0;
    color: #777780;
    font-size: 10px;
    line-height: 1.8;
    text-align: left;
}

.spread-empty-state {
    padding: 60px 20px;
    text-align: center;
}

.spread-empty-state strong {
    display: block;
    color: #fff;
}

.spread-empty-state p {
    margin: 7px 0 0;
    color: var(--spread-muted);
}

.spread-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 13px;
}

.spread-info-grid article {
    position: relative;
    min-width: 0;
    padding: 15px 17px;
    overflow: hidden;
    background: #101014;
    border: 1px solid var(--spread-line);
    border-radius: 14px;
}

.spread-info-grid article > span {
    position: absolute;
    top: 6px;
    left: 11px;
    color: color-mix(in srgb, var(--beam-color) 12%, transparent);
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.spread-info-grid h2 {
    position: relative;
    margin: 0 0 5px;
    color: #fff;
    font-size: 14px;
}

.spread-info-grid p {
    position: relative;
    margin: 0;
    color: var(--spread-muted);
    font-size: 9px;
    line-height: 1.65;
}

@keyframes spreadPulse {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes spreadSkeleton {
    from {
        transform: translateX(-160%);
    }
    to {
        transform: translateX(250%);
    }
}

@media (max-width: 900px) {
    .spread-board__header,
    .spread-board__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .spread-board__footer p {
        text-align: left;
    }
}

@media (max-width: 700px) {
    .apf-spread-page {
        padding: 14px 7px 40px;
    }

    .spread-hero {
        padding: 20px 12px 13px;
        border-radius: 17px;
    }

    .spread-hero h1 {
        margin: 7px auto 5px;
        font-size: clamp(25px, 7.2vw, 30px);
        line-height: 1.25;
    }

    .spread-hero__content > p {
        max-width: 96%;
        font-size: 10px;
        line-height: 1.65;
    }

    .spread-live-badge {
        min-height: 28px;
        margin-top: 10px;
        font-size: 8px;
    }

    .spread-hero__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1px;
        margin-top: 13px;
        background: var(--spread-line);
        border: 1px solid var(--spread-line);
        border-radius: 11px;
    }

    .spread-hero__metrics article {
        display: block;
        padding: 8px 4px;
        border: 0;
        border-radius: 0;
        text-align: center;
    }

    .spread-hero__metrics span {
        font-size: 7px;
    }

    .spread-hero__metrics strong {
        margin: 2px 0 0;
        font-size: 12px;
    }

    .spread-hero__metrics small {
        display: none;
    }

    .spread-connection-alert {
        grid-template-columns: 42px minmax(0, 1fr);
        border-radius: 14px;
    }

    .spread-connection-alert__icon {
        width: 42px;
        height: 42px;
    }

    .spread-connection-alert button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .spread-board {
        margin-top: 12px;
        border-radius: 16px;
    }

    .spread-board__header {
        gap: 6px;
        padding: 13px 12px;
    }

    .spread-board__header h2 {
        font-size: 19px;
    }

    .spread-board__header p {
        font-size: 9px;
        line-height: 1.55;
    }

    .spread-board__pulse {
        display: none;
    }

    .spread-mobile-hint {
        display: flex;
    }

    .spread-table {
        width: max-content;
        min-width: 850px;
    }

    .spread-table th,
    .spread-table td {
        width: 110px;
        min-width: 110px;
        height: 62px;
        padding: 7px 8px;
    }

    .spread-table thead th {
        height: 72px;
    }

    .spread-sticky-tools .spread-table thead th {
        height: 72px;
    }

    .company-col {
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        padding: 8px !important;
        box-shadow:
            12px 0 24px rgba(0, 0, 0, 0.56),
            inset 1px 0 color-mix(in srgb, var(--beam-color) 28%, transparent);
    }

    .spread-table thead .company-col {
        font-size: 9px;
        text-align: center !important;
    }

    .company-box {
        justify-content: center;
    }

    .company-logo {
        width: 41px;
        height: 41px;
        flex-basis: 41px;
        padding: 5px;
        border-radius: 10px;
    }

    .company-name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .symbol-head b {
        font-size: 10px;
    }

    .spread-value {
        min-width: 58px;
        min-height: 28px;
        padding-inline: 9px;
        font-size: 11.5px;
    }

    .spread-board__footer {
        gap: 7px;
        padding: 10px 12px;
    }

    .spread-info-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-top: 9px;
    }

    .spread-info-grid article {
        min-height: 0;
        padding: 11px 13px;
    }

    .spread-info-grid article > span {
        top: 5px;
        left: 9px;
        font-size: 34px;
    }

    .spread-info-grid h2 {
        margin-bottom: 3px;
        font-size: 12px;
    }

    .spread-info-grid p {
        font-size: 8px;
        line-height: 1.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spread-live-badge i,
    .spread-board__pulse span,
    .spread-skeleton::after {
        animation: none;
    }
}
