.market-page main {
    overflow: visible;
}

.market-intro {
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.30), transparent 23rem),
        linear-gradient(118deg, #e3ad16 0%, #f2c230 48%, #f6d569 100%);
}

.market-intro-inner,
.market-pulse-section,
.market-shell {
    width: min(var(--max-width), calc(100% - 56px));
    margin: 0 auto;
}

.market-intro-inner {
    min-height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 44px;
    padding: 54px 0 46px;
}

.market-intro h1 {
    margin: 0;
    color: #111315;
    font-size: clamp(3rem, 6vw, 5.4rem);
    line-height: .92;
    letter-spacing: -.065em;
}

.market-intro-copy {
    max-width: 780px;
    margin: 18px 0 0;
    color: rgba(17, 19, 21, 0.78);
    font-size: 1rem;
    line-height: 1.6;
}

.market-freshness {
    flex: 0 0 auto;
    max-width: 420px;
    padding: 12px 15px;
    color: #111315;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(17, 19, 21, 0.16);
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.45;
    text-align: right;
}

.market-pulse-section {
    padding: 38px 0 28px;
}

.market-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.market-section-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    letter-spacing: -.035em;
}

.market-page .view-kicker {
    margin: 0;
    color: #8a6900;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .115em;
}

.market-pulse-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.market-pulse-card {
    min-height: 150px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    background: var(--fm-card);
    border: 1px solid rgba(17, 19, 21, 0.16);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(17, 19, 21, 0.09);
}

.market-pulse-card::after {
    content: "";
    position: absolute;
    width: 92px;
    height: 92px;
    right: -42px;
    bottom: -42px;
    border: 16px solid rgba(242, 194, 48, 0.08);
    border-radius: 50%;
}

.market-pulse-card.is-loading {
    opacity: .64;
}

.market-pulse-card a {
    position: relative;
    z-index: 1;
    display: block;
    height: 100%;
}

.market-pulse-label {
    margin: 0;
    color: var(--fm-gold);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .105em;
    text-transform: uppercase;
}

.market-pulse-card h3 {
    margin: 11px 0 3px;
    color: #ffffff;
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.market-pulse-meta {
    color: #aeb5b8;
    font-size: .72rem;
    font-weight: 700;
}

.market-pulse-value {
    display: block;
    margin-top: 14px;
    color: #ffffff;
    font-size: 1.42rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.035em;
}

.market-pulse-caption {
    display: block;
    margin-top: 6px;
    color: #929a9e;
    font-size: .68rem;
}

.market-pulse-card a:hover h3,
.market-pulse-card a:focus-visible h3 {
    color: var(--fm-gold-soft);
}

.market-shell {
    margin-bottom: 64px;
    padding: 0 0 34px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 15px 34px rgba(17, 19, 21, 0.075);
    overflow: hidden;
}

.market-view-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.market-view-tab {
    flex: 0 0 auto;
    padding: 18px 22px 15px;
    color: #62696d;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 800;
}

.market-view-tab:hover {
    color: #111315;
}

.market-view-tab.is-active {
    color: #111315;
    border-bottom-color: var(--fm-gold);
}

.market-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 14px;
}

.market-position-tabs,
.market-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #f0f1ef;
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 10px;
}

.market-position-tab,
.market-segmented button {
    min-width: 48px;
    padding: 8px 11px;
    color: #5e6568;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 850;
}

.market-position-tab:hover,
.market-segmented button:hover {
    color: #111315;
}

.market-position-tab.is-active,
.market-segmented button.is-active {
    color: #111315;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(17, 19, 21, 0.11);
}

.market-search-wrap {
    flex: 0 1 360px;
}

.market-search {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    color: #111315;
    background: #ffffff;
    border: 1px solid rgba(17, 19, 21, 0.18);
    border-radius: 9px;
    outline: none;
}

.market-search:focus {
    border-color: rgba(171, 129, 0, 0.72);
    box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.18);
}

.market-secondary-controls {
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 0 24px;
}

.market-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-control-label {
    color: #747b7f;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.market-age-filter {
    gap: 6px;
}

.market-age-field {
    display: inline-flex;
}

.market-age-input {
    width: 64px;
    height: 34px;
    padding: 0 8px;
    color: #303538;
    background: #ffffff;
    border: 1px solid rgba(17, 19, 21, 0.16);
    border-radius: 7px;
    outline: none;
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
}

.market-age-input:focus {
    border-color: rgba(171, 129, 0, 0.72);
    box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.16);
}

.market-age-separator {
    color: #8a9093;
    font-size: .66rem;
    font-weight: 750;
}

.market-view-context {
    margin: 18px 24px 0;
    padding: 14px 16px;
    color: #5d6468;
    background: #f7f7f4;
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-left: 4px solid var(--fm-gold);
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.55;
}

.market-view-context strong {
    color: #111315;
}

.market-table-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 24px 10px;
    color: #747b7f;
    font-size: .72rem;
}

.market-table-status > :first-child {
    color: #111315;
    font-weight: 850;
}

.market-table-wrap {
    margin: 0 24px;
    overflow-x: auto;
    border: 1px solid rgba(17, 19, 21, 0.12);
    border-radius: 10px;
}

.market-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
    table-layout: auto;
}

.market-table th {
    padding: 11px 13px;
    color: #6e7579;
    background: #f3f4f2;
    border-bottom: 1px solid rgba(17, 19, 21, 0.12);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: right;
    white-space: nowrap;
}

.market-table th:first-child {
    min-width: 260px;
    text-align: left;
}

.market-table td {
    padding: 13px;
    color: #2e3336;
    border-top: 1px solid rgba(17, 19, 21, 0.075);
    font-size: .78rem;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.market-table tbody tr:first-child td {
    border-top: 0;
}

.market-table tbody tr:hover {
    background: #fffdf5;
}

.market-table td:first-child {
    text-align: left;
    white-space: normal;
}

.market-sort-button {
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.market-sort-button::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: 2px;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    opacity: .42;
}

.market-sort-button[data-direction="desc"]::after {
    border-top: 5px solid currentColor;
}

.market-sort-button[data-direction="asc"]::after {
    border-bottom: 5px solid currentColor;
}

.market-player-link {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-width: 100%;
}

.market-player-link strong {
    color: #111315;
    font-size: .84rem;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.market-player-link span {
    color: #7b8286;
    font-size: .67rem;
    font-weight: 700;
}

.market-player-link:hover strong {
    color: #8a6800;
}

.market-value {
    color: #111315;
    font-size: .88rem;
    font-weight: 900;
}

.market-rank {
    color: #444a4e;
    font-weight: 800;
}

.market-change {
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.market-change.is-positive {
    color: #23734a;
}

.market-change.is-negative {
    color: #a34c35;
}

.market-change.is-neutral {
    color: #697074;
}

.market-drawdown {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.05;
}

.market-drawdown .market-subvalue {
    margin-top: 4px;
    color: #858b8e;
    font-size: .61rem;
    font-weight: 700;
}

.market-momentum {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    color: #3d4346;
    background: #f1f2f0;
    border: 1px solid rgba(17, 19, 21, 0.08);
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 850;
}

.market-momentum small {
    color: #83898c;
    font-size: .58rem;
    font-weight: 800;
}

.market-gap {
    font-weight: 900;
}

.market-gap.is-production {
    color: #2f6e53;
}

.market-gap.is-market {
    color: #9a6f00;
}

.market-subvalue {
    display: block;
    margin-top: 2px;
    color: #858b8e;
    font-size: .62rem;
}

.market-empty {
    padding: 34px 18px !important;
    color: #777e82 !important;
    text-align: center !important;
}

.market-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 22px 24px 0;
}

.market-pagination button {
    min-width: 35px;
    height: 34px;
    padding: 0 10px;
    color: #4f565a;
    background: #ffffff;
    border: 1px solid rgba(17, 19, 21, 0.14);
    border-radius: 7px;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 800;
}

.market-pagination button:hover:not(:disabled),
.market-pagination button.is-active {
    color: #111315;
    border-color: #d5a812;
    background: #fff8da;
}

.market-pagination button:disabled {
    opacity: .38;
    cursor: default;
}

.market-load-error {
    margin: 22px 24px 0;
    padding: 16px;
    color: #7e3524;
    background: #fff4ee;
    border: 1px solid #e4b7aa;
    border-radius: 9px;
    font-size: .8rem;
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .market-pulse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-intro-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .market-freshness {
        text-align: left;
    }
}

@media (max-width: 760px) {
    .market-intro-inner,
    .market-pulse-section,
    .market-shell {
        width: calc(100% - 28px);
    }

    .market-intro-inner {
        min-height: 210px;
        padding: 40px 0 34px;
    }

    .market-intro-copy {
        font-size: .9rem;
    }

    .market-pulse-section {
        padding-top: 28px;
    }

    .market-pulse-grid {
        grid-template-columns: 1fr;
    }

    .market-pulse-card {
        min-height: 132px;
    }

    .market-shell {
        margin-bottom: 42px;
    }

    .market-view-tab {
        padding: 15px 16px 13px;
        font-size: .74rem;
    }

    .market-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 18px 14px 12px;
    }

    .market-position-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .market-position-tab {
        min-width: 0;
    }

    .market-search-wrap {
        flex-basis: auto;
    }

    .market-secondary-controls {
        padding: 0 14px;
    }

    .market-control-group {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .market-segmented {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-view-context {
        margin: 16px 14px 0;
    }

    .market-table-status {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        padding: 18px 14px 9px;
    }

    .market-table-wrap {
        margin: 0 14px;
    }

    .market-table th,
    .market-table td {
        padding: 11px 10px;
    }

    .market-pagination {
        padding-inline: 14px;
    }
}
