.market-page {
    display: flex;
    flex-direction: column;
    padding: 18px 0 48px;
    min-width: 0;
    max-width: 100%;
}

.market-hero { order: 1; }
.market-new-strip { order: 2; }
.market-stat-grid { order: 3; }
.market-tabs { order: 4; }
.market-highlight-nav { order: 5; }
.market-toolbar { order: 6; }
.market-listings { order: 7; }
.market-signal-grid { order: 8; }
.market-privacy-note { order: 9; }

.market-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    gap: 28px;
    min-height: 286px;
    overflow: hidden;
    border: 1px solid rgba(125, 199, 255, .34);
    background:
        radial-gradient(circle at 88% 18%, rgba(125, 199, 255, .2), transparent 30%),
        linear-gradient(132deg, rgba(16, 31, 58, .98), rgba(8, 13, 25, .98) 62%, rgba(28, 24, 39, .98));
    box-shadow: 0 22px 55px rgba(0, 0, 0, .27), inset 0 1px rgba(255, 255, 255, .04);
    min-width: 0;
    max-width: 100%;
}

.market-hero::after {
    position: absolute;
    inset: auto -100px -130px auto;
    width: 390px;
    height: 260px;
    border: 1px solid rgba(220, 185, 111, .2);
    border-radius: 50%;
    content: "";
    transform: rotate(-18deg);
}

.market-hero-copy {
    position: relative;
    z-index: 1;
    padding: 38px 0 34px 38px;
    max-width: 760px;
    min-width: 0;
}

.market-title-line {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap;
    margin: 5px 0 10px;
}

.market-title-line h1 {
    margin: 0;
    color: #f6e5b9;
    font-size: clamp(2.15rem, 5vw, 4.2rem);
    letter-spacing: -.045em;
    line-height: .98;
}

.market-new-badge,
.market-new-strip-mark {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid rgba(148, 240, 177, .56);
    border-radius: 999px;
    color: #aaffc1;
    background: rgba(51, 124, 73, .19);
    font-size: .69rem;
    font-weight: 900;
    letter-spacing: .13em;
}

.market-new-badge {
    position: relative;
    isolation: isolate;
    min-height: 32px;
    padding: 0 13px 0 29px;
    border-color: rgba(125, 199, 255, .74);
    border-radius: 6px 13px 6px 13px;
    color: #ecfbff;
    background:
        linear-gradient(135deg, rgba(79, 166, 194, .96), rgba(31, 72, 101, .98) 56%, rgba(16, 29, 48, .98));
    box-shadow:
        0 0 0 3px rgba(125, 199, 255, .07),
        0 8px 20px rgba(0, 0, 0, .26),
        inset 0 1px rgba(255, 255, 255, .28);
    font-size: .72rem;
    letter-spacing: .2em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .48);
    overflow: hidden;
}

.market-new-badge::before {
    position: absolute;
    left: 11px;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(236, 251, 255, .82);
    background: #aaffc1;
    box-shadow: 0 0 10px rgba(170, 255, 193, .94);
    content: "";
    transform: rotate(45deg);
}

.market-new-badge::after {
    position: absolute;
    inset: 1px;
    z-index: 0;
    background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, .27) 49%, transparent 66%);
    content: "";
    pointer-events: none;
    transform: translateX(-125%);
    animation: market-new-badge-shine 4.8s ease-in-out infinite;
}

@keyframes market-new-badge-shine {
    0%, 48% { transform: translateX(-125%); }
    68%, 100% { transform: translateX(125%); }
}

@media (prefers-reduced-motion: reduce) {
    .market-new-badge::after {
        animation: none;
    }
}

.market-hero-copy > p {
    max-width: 690px;
    margin: 0;
    color: #c8d8ec;
    font-size: 1.04rem;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.market-hero .hero-actions {
    margin-top: 23px;
}

.market-hero-art {
    position: relative;
    min-height: 260px;
}

.market-hero-card {
    position: absolute;
    z-index: 2;
    top: 67px;
    right: 52px;
    width: 205px;
    height: 205px;
    overflow: hidden;
    border: 1px solid rgba(244, 221, 176, .48);
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(43, 57, 84, .92), rgba(13, 19, 31, .93));
    box-shadow: 0 17px 30px rgba(0, 0, 0, .28), 0 0 0 8px rgba(125, 199, 255, .035);
    transform: rotate(5deg);
}

.market-hero-card::before {
    display: none;
    width: 38px;
    height: 38px;
    border: 2px solid #dcb96f;
    border-radius: 50%;
    content: "✦";
    color: #f4ddb0;
    font-size: 21px;
    line-height: 34px;
    text-align: center;
}

.market-hero-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-hero-card span {
    color: #9acfff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.market-hero-card strong {
    color: #fff2cb;
    font-size: 1.3rem;
}

.market-hero-card small {
    color: #adc0da;
}

.market-hero-orbit {
    position: absolute;
    border: 1px solid rgba(125, 199, 255, .25);
    border-radius: 50%;
    transform: rotate(24deg);
}

.market-hero-orbit-one {
    top: 34px;
    right: 8px;
    width: 310px;
    height: 190px;
}

.market-hero-orbit-two {
    top: 78px;
    right: 40px;
    width: 225px;
    height: 150px;
    border-color: rgba(220, 185, 111, .28);
    transform: rotate(-33deg);
}

.market-new-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    padding: 13px 17px;
    border: 1px solid rgba(148, 240, 177, .28);
    border-radius: 13px;
    background: linear-gradient(90deg, rgba(38, 76, 59, .34), rgba(20, 33, 43, .65));
}

.market-new-strip p {
    flex: 1;
    margin: 0;
    color: #c8d8e8;
    line-height: 1.45;
}

.market-new-strip p strong {
    color: #f2f7ff;
}

.market-new-strip a {
    color: #aaffc1;
    font-weight: 800;
    white-space: nowrap;
}

.market-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.market-stat-card {
    display: grid;
    gap: 5px;
    min-height: 112px;
    padding: 18px 19px;
    border: 1px solid rgba(98, 141, 205, .28);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(18, 28, 44, .9), rgba(10, 16, 27, .88));
}

.market-stat-card-accent {
    border-color: rgba(125, 199, 255, .43);
    background: linear-gradient(145deg, rgba(23, 56, 79, .77), rgba(10, 18, 29, .93));
}

.market-stat-label,
.market-toolbar label > span {
    color: #90a9c8;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.market-stat-card strong {
    color: #f4ddb0;
    font-size: 1.9rem;
    letter-spacing: -.035em;
}

.market-stat-card small {
    color: #9fb2ce;
}

.market-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.market-tab {
    display: grid;
    gap: 4px;
    min-height: 67px;
    padding: 13px 15px;
    border: 1px solid rgba(98, 141, 205, .25);
    border-radius: 11px;
    color: #d6e4f7;
    background: rgba(12, 19, 31, .68);
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.market-tab:hover,
.market-tab.active {
    border-color: rgba(125, 199, 255, .7);
    background: linear-gradient(135deg, rgba(27, 59, 82, .76), rgba(16, 27, 43, .91));
    transform: translateY(-1px);
}

.market-tab.active {
    box-shadow: inset 0 2px rgba(220, 185, 111, .65);
}

.market-tab strong {
    color: #f3e2b9;
    font-size: .91rem;
}

.market-tab small {
    color: #8fa8c8;
    line-height: 1.3;
}

.market-highlight-nav {
    display: grid;
    grid-template-columns: minmax(170px, .72fr) minmax(0, 2.5fr);
    gap: 12px;
    align-items: stretch;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(220, 185, 111, .24);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(29, 35, 50, .85), rgba(12, 19, 31, .82));
}

.market-highlight-heading {
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 3px 8px;
}

.market-highlight-heading h2 {
    margin: 0;
    color: #f4ddb0;
    font-size: 1rem;
}

.market-highlight-heading p {
    margin: 2px 0 0;
    color: #91a8c7;
    font-size: .76rem;
    line-height: 1.35;
}

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

.market-highlight-tab {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgba(125, 199, 255, .22);
    border-radius: 9px;
    color: #d6e4f7;
    background: rgba(9, 17, 29, .72);
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.market-highlight-tab:hover,
.market-highlight-tab.active {
    border-color: rgba(220, 185, 111, .72);
    background: linear-gradient(135deg, rgba(54, 52, 39, .82), rgba(19, 30, 46, .92));
    transform: translateY(-1px);
}

.market-highlight-tab strong {
    overflow: hidden;
    color: #f3e2b9;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-highlight-tab small {
    overflow: hidden;
    color: #8fa8c8;
    font-size: .68rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(155px, .56fr) minmax(180px, .7fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
    padding: 15px;
    border-color: rgba(98, 141, 205, .3);
    background: rgba(10, 17, 28, .79);
}

.market-toolbar label {
    display: grid;
    gap: 6px;
}

.market-toolbar input,
.market-toolbar select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(119, 155, 207, .4);
    border-radius: 8px;
    color: #eef5ff;
    background: #101c2d;
}

.market-toolbar input:focus,
.market-toolbar select:focus {
    border-color: #7dc7ff;
    outline: 2px solid rgba(125, 199, 255, .18);
    outline-offset: 1px;
}

.market-filter-button {
    min-height: 42px;
    white-space: nowrap;
}

.market-signal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.market-signal-card {
    min-width: 0;
    padding: 16px;
    border-color: rgba(98, 141, 205, .27);
    background: rgba(12, 19, 31, .83);
}

.market-signal-card > header,
.market-listings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.market-signal-card h2,
.market-listings h2 {
    margin: 3px 0 0;
    color: #f4ddb0;
    font-size: 1.15rem;
}

.market-signal-count,
.market-result-count {
    display: inline-flex;
    min-width: 29px;
    min-height: 27px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(125, 199, 255, .35);
    border-radius: 999px;
    color: #9edaff;
    background: rgba(26, 65, 90, .45);
    font-size: .78rem;
    font-weight: 800;
}

.market-signal-list {
    display: grid;
    gap: 3px;
    margin-top: 15px;
}

.market-signal-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(98, 141, 205, .15);
    color: inherit;
    text-decoration: none;
}

.market-signal-row:hover strong {
    color: #fff0bd;
}

.market-signal-icon {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid rgba(220, 185, 111, .22);
    border-radius: 8px;
    background: rgba(7, 11, 19, .76);
}

.market-signal-icon img {
    width: 32px;
    height: 25px;
    object-fit: contain;
    image-rendering: pixelated;
}

.market-signal-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.market-signal-copy strong,
.market-signal-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-signal-copy strong {
    color: #eaf3ff;
    font-size: .82rem;
}

.market-signal-copy small {
    color: #8fa8c8;
    font-size: .69rem;
}

.market-signal-price {
    display: grid;
    color: #f4ddb0;
    font-size: .81rem;
    font-weight: 800;
    text-align: right;
}

.market-signal-price small {
    color: #8fa8c8;
    font-size: .62rem;
    font-weight: 600;
}

.market-mini-empty {
    min-height: 88px;
    margin: 14px 0 0;
    color: #8fa8c8;
    font-size: .8rem;
    line-height: 1.5;
}

.market-listings {
    overflow: hidden;
    padding: 0;
    border-color: rgba(98, 141, 205, .32);
    background: rgba(8, 14, 24, .88);
}

.market-listings-head {
    align-items: center;
    padding: 22px 22px 18px;
    border-bottom: 1px solid rgba(98, 141, 205, .22);
}

.market-listings-head p {
    max-width: 760px;
    margin: 8px 0 0;
    color: #9fb2ce;
    line-height: 1.5;
}

.market-history-note {
    display: inline-block;
    margin-top: 7px;
    color: #b8d6bf;
    font-size: .76rem;
    font-weight: 700;
}

.market-result-count {
    padding: 4px 11px;
    white-space: nowrap;
}

.market-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.market-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.market-table th {
    padding: 13px 14px;
    color: #85a3c8;
    background: rgba(21, 34, 53, .65);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-align: left;
    text-transform: uppercase;
}

.market-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.market-sort-link:hover,
.market-sort-link:focus-visible,
.market-sort-link.active {
    color: #f4ddb0;
}

.market-sort-link span {
    color: #6f8eaf;
    font-size: .72rem;
    letter-spacing: 0;
}

.market-sort-link.active span {
    color: #f4c86f;
}

.market-table td {
    padding: 13px 14px;
    border-top: 1px solid rgba(98, 141, 205, .15);
    color: #dfeaff;
    vertical-align: middle;
}

.market-table tbody tr:hover {
    background: rgba(28, 54, 77, .28);
}

.market-table td > strong,
.market-table td > small {
    display: block;
}

.market-table td > strong {
    color: #eef6ff;
    font-size: .9rem;
}

.market-table td > small {
    margin-top: 3px;
    color: #829bc0;
    font-size: .7rem;
}

.market-item-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
}

.market-item-image {
    display: grid;
    flex: 0 0 62px;
    width: 62px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(220, 185, 111, .34);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(47, 61, 84, .6), rgba(7, 12, 21, .8)),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 5px);
    box-shadow: inset 0 0 16px rgba(0, 0, 0, .25);
}

.market-item-image img {
    width: 48px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

.market-item-cell > span:last-child {
    display: grid;
    gap: 4px;
}

.market-item-cell strong {
    color: #f0f6ff;
    font-size: .91rem;
}

.market-item-cell small {
    color: #8da8c9;
    font-size: .7rem;
    text-transform: capitalize;
}

.market-direction {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.market-direction.offer {
    border: 1px solid rgba(125, 199, 255, .33);
    color: #a4dbff;
    background: rgba(32, 82, 111, .25);
}

.market-direction.wanted {
    border: 1px solid rgba(148, 240, 177, .34);
    color: #b0ffc3;
    background: rgba(40, 103, 67, .23);
}

.market-direction.purchased {
    border: 1px solid rgba(220, 185, 111, .42);
    color: #f6d991;
    background: rgba(105, 76, 28, .25);
}

.market-time-left {
    color: #b7d6f3;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.market-time-left.closing {
    color: #ffb1a6;
}

.market-empty-state {
    display: grid;
    justify-items: center;
    min-height: 265px;
    padding: 48px 24px;
    text-align: center;
}

.market-empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(220, 185, 111, .42);
    border-radius: 50%;
    color: #f4ddb0;
    font-size: 2rem;
    box-shadow: 0 0 0 8px rgba(220, 185, 111, .045);
}

.market-empty-state h3 {
    margin: 18px 0 5px;
    color: #f4ddb0;
}

.market-empty-state p {
    max-width: 580px;
    margin: 0 0 19px;
    color: #9fb2ce;
    line-height: 1.6;
}

.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 17px;
    border-top: 1px solid rgba(98, 141, 205, .18);
    color: #8fa8c8;
    font-size: .82rem;
}

.market-pagination a {
    color: #a6d8ff;
    font-weight: 800;
}

.market-privacy-note {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 17px 19px;
    border: 1px solid rgba(220, 185, 111, .26);
    border-radius: 13px;
    background: linear-gradient(90deg, rgba(36, 31, 24, .61), rgba(13, 20, 31, .8));
}

.market-privacy-mark {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(220, 185, 111, .5);
    border-radius: 10px;
    color: #f4ddb0;
}

.market-privacy-note > div {
    flex: 1;
}

.market-privacy-note strong {
    color: #f4ddb0;
}

.market-privacy-note p {
    margin: 3px 0 0;
    color: #9fb2ce;
    font-size: .84rem;
    line-height: 1.45;
}

@media (max-width: 980px) {
    .market-hero {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .market-stat-grid,
    .market-signal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

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

    .market-highlight-heading {
        padding: 2px 4px;
    }

    .market-filter-button {
        width: max-content;
    }
}

@media (max-width: 720px) {
    .market-page {
        padding-top: 8px;
    }

    .market-hero {
        display: block;
        min-height: 0;
    }

    .market-hero-copy {
        padding: 28px 23px 31px;
    }

    .market-hero-art {
        display: none;
    }

    .market-new-strip,
    .market-privacy-note {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .market-new-strip a {
        margin-left: auto;
    }

    .market-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-highlight-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-listings-head {
        display: grid;
    }

    .market-result-count {
        justify-self: start;
    }

    .market-privacy-note .btn {
        margin-left: 50px;
    }
}

@media (max-width: 500px) {
    .market-stat-grid,
    .market-signal-grid,
    .market-toolbar {
        grid-template-columns: 1fr;
    }

    .market-tabs {
        display: flex;
        overflow-x: auto;
    }

    .market-highlight-tabs {
        display: flex;
        overflow-x: auto;
    }

    .market-tab {
        min-width: 175px;
    }

    .market-highlight-tab {
        min-width: 145px;
    }

    .market-toolbar .btn {
        width: 100%;
    }

    .market-new-strip p {
        flex-basis: calc(100% - 120px);
    }

    .market-new-strip a {
        width: 100%;
        margin-left: 0;
    }

    .market-privacy-note .btn {
        width: calc(100% - 50px);
        margin-left: 50px;
    }
}
