:root {
    --market-surface: rgba(4, 12, 26, 0.95);
    --market-surface-2: rgba(7, 18, 36, 0.94);
    --market-surface-3: rgba(10, 25, 48, 0.88);
    --market-field: rgba(2, 9, 21, 0.94);
    --market-line: rgba(47, 156, 255, 0.26);
    --market-line-strong: rgba(92, 190, 255, 0.64);
    --market-blue: #2f9cff;
    --market-blue-light: #78c4ff;
    --market-blue-dark: #126de0;
    --market-cyan: #75e6ff;
    --market-green: #2fe486;
    --market-red: #ff5f6d;
    --market-gold: #f2c86b;
    --market-text: #f5f9ff;
    --market-muted: #9daec7;
    --market-muted-2: #697b97;
    --market-radius-xl: 20px;
    --market-radius-lg: 16px;
    --market-radius-md: 12px;
    --market-panel-shadow:
        0 18px 54px rgba(0, 0, 0, 0.4),
        0 0 24px rgba(47, 156, 255, 0.07);
    --market-card-shadow:
        0 12px 30px rgba(0, 0, 0, 0.38),
        0 0 14px rgba(47, 156, 255, 0.09);

    --tabs-text: rgba(217, 232, 249, 0.7);
    --tabs-text-hover: #d9efff;
    --tabs-text-active: #ffffff;
    --tabs-underline: var(--market-blue);
    --tabs-divider: rgba(47, 156, 255, 0.22);
    --tabs-underline-glow:
        0 0 12px rgba(47, 156, 255, 0.42),
        0 0 28px rgba(47, 156, 255, 0.18);
    --tabs-focus-ring: 0 0 0 3px rgba(120, 196, 255, 0.2);
}

.market-page,
.market-page *,
.market-page *::before,
.market-page *::after,
.market-modal,
.market-modal *,
.market-modal *::before,
.market-modal *::after {
    box-sizing: border-box;
}

.market-page {
    position: relative;
}

.market-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% -8%, rgba(47, 156, 255, 0.18), transparent 40%),
        radial-gradient(circle at 88% 28%, rgba(18, 86, 196, 0.1), transparent 34%);
}

.market-shell,
.market-detail {
    width: 100%;
    min-width: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Market intro */
.market-intro {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    min-width: 0;
    margin: 0 0 14px;
    padding: 12px 15px;
    border: 1px solid rgba(47, 156, 255, 0.22);
    border-radius: 14px;
    color: var(--market-text);
    background:
        linear-gradient(90deg, rgba(47, 156, 255, 0.075), transparent 44%),
        rgba(4, 14, 30, 0.72);
    box-shadow:
        inset 0 0 0 1px rgba(120, 196, 255, 0.012),
        0 8px 24px rgba(0, 0, 0, 0.18),
        0 0 18px rgba(47, 156, 255, 0.055);
    overflow: hidden;
}

.market-intro::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(
        180deg,
        rgba(120, 196, 255, 0.18),
        var(--market-blue),
        rgba(18, 109, 224, 0.25)
    );
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.55),
        0 0 22px rgba(47, 156, 255, 0.18);
}

.market-intro::after {
    content: "";
    position: absolute;
    top: -32px;
    right: -24px;
    width: 160px;
    height: 100px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(47, 156, 255, 0.12),
        transparent 68%
    );
}

.market-intro__mark {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(92, 190, 255, 0.42);
    border-radius: 12px;
    color: var(--market-blue-light);
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.12), rgba(47, 156, 255, 0.035)),
        rgba(3, 13, 29, 0.9);
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.16),
        inset 0 0 12px rgba(47, 156, 255, 0.035);
}

.market-intro__chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 22px;
    height: 22px;
}

.market-intro__chart i {
    display: block;
    width: 4px;
    border-radius: 999px 999px 2px 2px;
    background: currentColor;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.42);
}

.market-intro__chart i:nth-child(1) {
    height: 8px;
    opacity: 0.72;
}

.market-intro__chart i:nth-child(2) {
    height: 14px;
    opacity: 0.86;
}

.market-intro__chart i:nth-child(3) {
    height: 21px;
}

.market-intro__content {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.market-intro__eyebrow {
    display: block;
    margin-bottom: 2px;
    color: var(--market-blue-light);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-intro p {
    margin: 0;
    color: #a9b9ce;
    font-size: 13px;
    line-height: 1.46;
}

.market-intro p > strong,
.market-intro__currency > strong {
    color: #f4f9ff;
    font-weight: 900;
}

.market-intro__currency .currency-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}


.market-intro__balance {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3px;
    min-width: 142px;
    padding: 9px 12px;
    border: 1px solid rgba(92, 190, 255, 0.34);
    border-radius: 11px;
    color: var(--market-text);
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.1), rgba(47, 156, 255, 0.025)),
        rgba(2, 10, 23, 0.74);
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    white-space: nowrap;
}

.market-intro__balance-label {
    color: var(--market-muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-intro__balance-value {
    justify-content: flex-start;
    color: #ffffff;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.1;
}

.market-intro__balance-value .currency-icon {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
}

.market-intro__balance.is-loading .market-intro__balance-value {
    opacity: 0.6;
}

.market-intro__balance.is-error {
    border-color: rgba(255, 95, 109, 0.34);
}

/* Tabs */
.market-page .tabs-underline {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--tabs-divider);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--market-blue) rgba(5, 16, 32, 0.94);
    -webkit-overflow-scrolling: touch;
}

.market-page .tabs-underline::-webkit-scrollbar {
    height: 6px;
}

.market-page .tabs-underline::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(5, 16, 32, 0.94);
}

.market-page .tabs-underline::-webkit-scrollbar-thumb {
    border: 2px solid rgba(2, 9, 21, 1);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--market-blue-light), var(--market-blue-dark));
    box-shadow: 0 0 8px rgba(47, 156, 255, 0.5);
}

.market-page .tabs-underline .tab {
    position: relative;
    flex: 0 0 auto;
    padding: 13px 6px;
    border: 0;
    background: transparent;
    color: var(--tabs-text);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    transition: color 0.16s ease;
}

.market-page .tabs-underline .tab:hover {
    color: var(--tabs-text-hover);
}

.market-page .tabs-underline .tab.is-active,
.market-page .tabs-underline .tab[aria-selected="true"] {
    color: var(--tabs-text-active);
}

.market-page .tabs-underline .tab.is-active::after,
.market-page .tabs-underline .tab[aria-selected="true"]::after,
.market-page .tabs-underline .tab:focus-visible::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: var(--tabs-underline);
}

.market-page .tabs-underline .tab.is-active::after,
.market-page .tabs-underline .tab[aria-selected="true"]::after {
    box-shadow: var(--tabs-underline-glow);
}

.market-page .tabs-underline .tab:focus-visible {
    outline: none;
    color: var(--tabs-text-hover);
}

.market-page .tabs-underline .tab:focus-visible::after {
    box-shadow: var(--tabs-focus-ring), var(--tabs-underline-glow);
}

.market-page .tab-panel[hidden] {
    display: none !important;
}

.market-panels {
    padding-top: 20px;
}

/* Panels */
.market-panel,
.market-card-summary,
.market-lots-section {
    position: relative;
    border: 1px solid var(--market-line);
    border-radius: var(--market-radius-xl);
    background:
        linear-gradient(180deg, rgba(65, 151, 255, 0.028), rgba(255, 255, 255, 0.005)),
        var(--market-surface);
    box-shadow: var(--market-panel-shadow);
    color: var(--market-text);
    overflow: hidden;
}

.market-panel {
    padding: 18px;
}

.market-panel::before,
.market-card-summary::before,
.market-lots-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 0%, rgba(47, 156, 255, 0.08), transparent 34%),
        linear-gradient(120deg, transparent 22%, rgba(255, 255, 255, 0.018), transparent 58%);
}

.market-panel > *,
.market-card-summary > *,
.market-lots-section > * {
    position: relative;
    z-index: 1;
}

.market-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.market-section-head h3,
.market-card-summary h2,
.market-modal h2 {
    margin: 3px 0 0;
    color: var(--market-text);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.market-section-head h3,
.market-modal h2 {
    font-size: 22px;
}

.market-section-head p,
.market-card-summary p,
.market-modal__description {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--market-muted);
    font-size: 14px;
    line-height: 1.45;
}

.market-kicker {
    display: block;
    color: var(--market-blue-light);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Controls */
.market-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 10px;
    margin-bottom: 16px;
}

.market-toolbar--sell {
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    align-items: end;
}

.market-toolbar__note {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid rgba(47, 156, 255, 0.14);
    border-radius: 10px;
    color: var(--market-muted);
    background: rgba(47, 156, 255, 0.045);
    font-size: 12px;
    line-height: 1.35;
}

.market-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.market-field > span {
    color: var(--market-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.market-field input,
.market-field select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(47, 156, 255, 0.46);
    border-radius: 10px;
    outline: 0;
    color: #d8ecff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.008)),
        var(--market-field);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.market-field input::placeholder {
    color: #9fb6ce;
}

.market-field input:hover,
.market-field select:hover {
    border-color: rgba(91, 191, 255, 0.7);
}

.market-field input:focus,
.market-field select:focus,
.market-filter-control input:focus,
.market-filter-control > select:focus {
    border-color: rgba(104, 202, 255, 0.92);
    box-shadow:
        0 0 0 1px rgba(92, 190, 255, 0.1),
        0 0 16px rgba(47, 156, 255, 0.23),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-field select option {
    color: var(--market-text);
    background: #051020;
}

.market-field--price input {
    height: 46px;
    font-size: 18px;
    font-weight: 850;
}

.market-secondary-button,
.market-modal__close {
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    border: 1px solid rgba(92, 190, 255, 0.48);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.market-secondary-button:hover:not(:disabled),
.market-modal__close:hover:not(:disabled),
.market-pagination__button:hover:not(:disabled):not(.is-active),
.market-filter-toggle:hover,
.market-filter-bar.is-mobile-expanded .market-filter-toggle,
.market-filter-button:hover:not(:disabled) {
    color: #ffffff;
    border-color: rgba(120, 208, 255, 0.72);
    background: rgba(15, 55, 96, 0.82);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-secondary-button:focus-visible,
.market-primary-button:focus-visible,
.market-modal__close:focus-visible,
.market-catalog-card:focus-visible,
.market-select-card:focus-visible,
.market-payment-card:focus-visible,
.market-trade-card__owner-button:focus-visible,
.market-sell-modal__close:focus-visible,
.market-pagination__button:focus-visible,
.market-filter-toggle:focus-visible,
.market-filter-button:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.86);
    outline-offset: 2px;
}

.market-pagination__button:active:not(:disabled):not(.is-active),
.market-filter-toggle:active,
.market-filter-button:active:not(:disabled) {
    transform: scale(0.97);
}


.market-secondary-button,
.market-primary-button {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.market-primary-button {
    border: 0;
    color: #ffffff;
    background: var(--market-blue);
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.34),
        0 0 26px rgba(47, 156, 255, 0.12);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.market-primary-button:hover:not(:disabled) {
    background: #56b5ff;
    transform: scale(0.985);
}

.market-primary-button:disabled,
.market-secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

/* Feedback */
.market-feedback:empty {
    display: none;
}

.market-feedback {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid rgba(47, 156, 255, 0.22);
    border-radius: 12px;
    color: #d8ecff;
    background: rgba(47, 156, 255, 0.07);
    font-size: 13px;
    line-height: 1.4;
}

.market-feedback.is-error {
    border-color: rgba(255, 95, 109, 0.34);
    color: #ffd7da;
    background: rgba(255, 95, 109, 0.1);
}

.market-feedback.is-success {
    border-color: rgba(47, 228, 134, 0.34);
    color: #bcffd8;
    background: rgba(47, 228, 134, 0.08);
}

.market-loader,
.market-empty-state {
    grid-column: 1 / -1;
    min-height: 170px;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px dashed rgba(47, 156, 255, 0.22);
    border-radius: 14px;
    color: var(--market-muted);
    background: rgba(2, 9, 21, 0.44);
    text-align: center;
}

.market-loader__content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.market-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(114, 185, 255, 0.18);
    border-top-color: var(--market-blue-light);
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(47, 156, 255, 0.6));
    animation: market-spin 0.75s linear infinite;
}

/* Catalog and cards */
.market-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.market-own-card,
.market-payment-card {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(47, 156, 255, 0.54);
    border-radius: 12px;
    color: var(--market-text);
    background:
        linear-gradient(180deg, rgba(80, 167, 255, 0.038), rgba(255, 255, 255, 0.008)),
        var(--market-surface-2);
    box-shadow: var(--market-card-shadow);
    overflow: hidden;
    isolation: isolate;
}

.market-payment-card {
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.market-own-card::before,
.market-payment-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(116, 205, 255, 0.9), rgba(30, 104, 220, 0.28));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
}

.market-card-media:not(.market-trade-card__image) {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        radial-gradient(circle at 45% 10%, rgba(47, 156, 255, 0.14), transparent 38%),
        #020814;
}

.market-card-media:not(.market-trade-card__image)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 40%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(2, 8, 18, 0.76));
}

.market-card-media:not(.market-trade-card__image) img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center top;
}

.market-media-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.68);
    background:
        linear-gradient(145deg, rgba(47, 156, 255, 0.22), rgba(47, 156, 255, 0.08)),
        #020814;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.market-media-fallback[hidden] {
    display: none !important;
}

.market-card-badge,
.market-status-badge,
.market-rarity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.market-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    border: 1px solid rgba(74, 178, 255, 0.42);
    color: #bfe7ff;
    background: rgba(2, 9, 20, 0.84);
    box-shadow: 0 0 10px rgba(47, 156, 255, 0.16);
    backdrop-filter: blur(7px);
}

.market-card-info {
    position: relative;
    z-index: 2;
    padding: 13px;
    border-top: 1px solid rgba(75, 157, 255, 0.09);
}

.market-card-info h4 {
    min-height: 36px;
    margin: 0;
    color: var(--market-text);
    font-size: 14px;
    line-height: 1.25;
    font-weight: 900;
}

.market-card-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-top: 12px;
}

.market-lot-row__seller span,
.market-card-meta span,
.market-own-card__meta span,
.market-lot-row__meta span,
.market-price-hint span,
.market-summary-stats span {
    display: block;
    color: var(--market-muted-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.market-card-meta strong,
.market-own-card__meta strong,
.market-lot-row__meta strong,
.market-price-hint strong,
.market-summary-stats strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--market-text);
    line-height: 1.15;
    font-weight: 900;
}

.market-card-meta strong,
.market-lot-row__meta strong,
.market-summary-stats strong {
    font-size: 15px;
}

.market-own-card__meta strong {
    font-size: 13px;
}

.market-payment-card.is-selected {
    border-color: rgba(108, 204, 255, 0.96);
    box-shadow:
        0 0 22px rgba(47, 156, 255, 0.36),
        inset 0 0 14px rgba(47, 156, 255, 0.15);
}

.market-payment-card.is-selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(180deg, var(--market-blue-light), var(--market-blue-dark));
    box-shadow: 0 0 14px rgba(47, 156, 255, 0.42);
    font-size: 13px;
    font-weight: 950;
}

.market-card-grid[data-market-catalog] {
    align-items: stretch;
}

.market-trade-card {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 148px;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 1px solid rgba(47, 156, 255, 0.72);
    border-radius: 12px;
    color: var(--market-text);
    background:
        linear-gradient(
            180deg,
            rgba(8, 36, 76, 0.88),
            rgba(7, 10, 18, 0.98)
        );
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.22),
        0 0 26px rgba(47, 156, 255, 0.10),
        inset 0 0 14px rgba(47, 156, 255, 0.06);
    overflow: hidden;
    isolation: isolate;
    text-align: left;
    cursor: pointer;
    transition: none;
}

.market-trade-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 7;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(
            145deg,
            rgba(108, 204, 255, 0.96),
            rgba(47, 156, 255, 0.52),
            rgba(47, 156, 255, 0.74)
        );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.86;
}

.market-trade-card__image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 148px;
    aspect-ratio: auto;
    border-radius: inherit;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 20% 18%,
            rgba(47, 156, 255, 0.16),
            transparent 28%
        ),
        radial-gradient(
            circle at 80% 16%,
            rgba(47, 156, 255, 0.18),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            rgba(5, 25, 53, 0.98),
            rgba(2, 8, 18, 0.98)
        );
}

.market-trade-card__image::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 3;
    height: 42%;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            transparent 0%,
            rgba(6, 8, 15, 0.18) 34%,
            rgba(6, 8, 15, 0.72) 100%
        );
}

.market-trade-card__image img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 148px;
    object-fit: fill;
    object-position: center top;
    opacity: 1;
    visibility: visible;
    transform: none;
    -webkit-transform: none;
    transition: none;
}

.market-trade-card__image .market-media-fallback {
    z-index: 1;
}

.market-trade-card__content {
    position: absolute;
    inset: auto 0 0;
    z-index: 6;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
    padding: 12px 8px 14px;
    pointer-events: none;
}

.market-trade-card__price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: calc(100% - 4px);
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    color: #d8e8f5;
    background: rgba(2, 9, 21, 0.56);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        0 4px 14px rgba(0, 0, 0, 0.2);
    font-size: clamp(14px, 1.55vw, 22px);
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.72);
    white-space: nowrap;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.market-trade-card__price strong {
    min-width: 0;
    overflow: hidden;
    color: #f6faff;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
}

.market-trade-card__price .currency-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

.market-trade-card__lot-count {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(74, 178, 255, 0.42);
    border-radius: 999px;
    color: #bfe7ff;
    background: rgba(2, 9, 20, 0.84);
    box-shadow: 0 0 10px rgba(47, 156, 255, 0.16);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}


.market-trade-card__rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    display: block;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 50%;
    background:
        radial-gradient(
            circle at 35% 30%,
            rgba(255, 255, 255, 0.36),
            transparent 18%
        ),
        linear-gradient(
            180deg,
            rgba(47, 156, 255, 0.46),
            rgba(12, 47, 93, 0.92)
        );
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.22),
        inset 0 0 8px rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.market-trade-card.is-selected {
    transform: none;
    border-color: rgba(108, 204, 255, 0.96);
    box-shadow:
        0 0 22px rgba(47, 156, 255, 0.36),
        0 0 18px rgba(47, 156, 255, 0.38),
        inset 0 0 14px rgba(47, 156, 255, 0.18);
}


/* Owner tooltip */
.market-trade-card__owner-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 8;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 50%;
    color: #9bd6ff;
    background-color: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.market-trade-card__owner-button:hover,
.market-trade-card__owner-button.is-active {
    color: #ffffff;
    border-color: rgba(120, 208, 255, 0.72);
    background-color: rgba(25, 97, 164, 0.92);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-trade-card__owner-button:active {
    transform: scale(0.96);
}

.market-trade-card__owner-popover {
    position: absolute;
    top: 36px;
    right: 8px;
    z-index: 10;
    min-width: 130px;
    max-width: calc(100% - 16px);
    padding: 8px 10px;
    border: 1px solid rgba(47, 156, 255, 0.42);
    border-radius: 10px;
    color: #f6faff;
    background: rgba(2, 9, 21, 0.96);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.38),
        0 0 16px rgba(47, 156, 255, 0.18);
    text-align: right;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: default;
}

.market-trade-card__owner-popover[hidden] {
    display: none;
}

.market-trade-card__owner-popover::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-top: 1px solid rgba(47, 156, 255, 0.42);
    border-left: 1px solid rgba(47, 156, 255, 0.42);
    background: rgba(2, 9, 21, 0.96);
    transform: rotate(45deg);
}

.market-trade-card__owner-label {
    display: block;
    margin-bottom: 2px;
    color: rgba(246, 247, 255, 0.62);
    font-size: 9px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.market-trade-card__owner-name {
    display: block;
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .market-trade-card:hover {
        transform: translateY(-2px);
        border-color: rgba(89, 186, 255, 0.86);
        box-shadow:
            0 0 22px rgba(47, 156, 255, 0.24),
            0 0 18px rgba(47, 156, 255, 0.38),
            inset 0 0 14px rgba(47, 156, 255, 0.18);
    }
}

@media (max-width: 760px) {
    .market-trade-card__price {
        gap: 4px;
        padding: 3px 6px;
        font-size: clamp(12px, 3vw, 18px);
    }

    .market-trade-card__price .currency-icon {
        flex-basis: 15px;
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 500px) {
    .market-trade-card__content {
        padding: 8px 5px 10px;
    }

    .market-trade-card__lot-count {
        top: 6px;
        left: 6px;
        min-height: 20px;
        padding-inline: 6px;
        font-size: 7px;
    }

    .market-trade-card__rarity {
        display: none;
    }

    .market-trade-card__owner-button {
        top: 6px;
        right: 6px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .market-trade-card__owner-popover {
        top: 6px;
        left: 6px;
        right: 32px;
        min-width: 0;
        max-width: none;
        padding: 5px 7px;
        border-radius: 8px;
        text-align: left;
    }

    .market-trade-card__owner-popover::before {
        top: 6px;
        right: -5px;
        border-right: 1px solid rgba(47, 156, 255, 0.42);
        border-left: 0;
    }

    .market-trade-card__owner-label {
        display: none;
    }

    .market-trade-card__owner-name {
        font-size: 10px;
        line-height: 1.1;
    }
}

@media (max-width: 374px) {

    .market-trade-card {
        border-radius: 10px;
    }

    .market-trade-card__price {
        font-size: 17px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .market-trade-card,
    .market-trade-card.is-selected {
        transition: none !important;
    }

    .market-trade-card__price,
    .market-trade-card__lot-count,
    .market-trade-card__owner-button,
    .market-trade-card__owner-popover,
    .market-card-badge,
    .market-status-badge {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Sell */
.market-sell-modal[hidden] {
    display: none !important;
}

.market-sell-modal {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.market-sell-modal:not([hidden]) {
    display: flex;
}

.market-sell-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 5, 14, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: default;
}

.market-sell-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100dvh - 40px);
    padding: 22px;
    border: 1px solid rgba(47, 156, 255, 0.34);
    border-radius: 24px;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(47, 156, 255, 0.10),
            transparent 42%
        ),
        rgba(3, 11, 24, 0.97);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.58),
        0 0 12px rgba(47, 156, 255, 0.22),
        0 0 32px rgba(47, 156, 255, 0.09);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.market-sell-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 50%;
    color: #9bd6ff;
    background-color: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition:
        color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.market-sell-modal__close:hover:not(:disabled) {
    color: #ffffff;
    background-color: rgba(15, 55, 96, 0.82);
    border-color: rgba(120, 208, 255, 0.72);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-sell-modal__close:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow:
        0 0 8px rgba(47, 156, 255, 0.18),
        inset 0 0 16px rgba(47, 156, 255, 0.08);
}

.market-sell-modal__title {
    margin: 0 44px 8px 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.market-sell-modal__message {
    margin: 0 44px 16px 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    line-height: 1.45;
}

.market-sell-modal__content {
    min-width: 0;
}

.market-sell-modal .market-sell-form {
    position: static;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.market-sell-modal .market-sell-form__selected,
.market-sell-modal .market-price-hint {
    border: 1px solid rgba(47, 156, 255, 0.12);
    border-radius: 16px;
    background: rgba(47, 156, 255, 0.055);
}

.market-sell-modal .market-sell-form__selected {
    margin-bottom: 12px;
    padding: 14px;
}

.market-sell-modal .market-price-hint {
    gap: 0;
    margin-bottom: 14px;
    overflow: hidden;
}

.market-sell-modal .market-price-hint > div {
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.market-sell-modal .market-price-hint > div + div {
    border-left: 1px solid rgba(47, 156, 255, 0.12);
}

.market-sell-modal .market-field--price input {
    border-radius: 10px;
}

.market-sell-modal .market-commission-card {
    margin-top: 14px;
    border-radius: 16px;
}

.market-sell-modal .market-form-actions {
    gap: 10px;
}

.market-sell-modal .market-secondary-button,
.market-sell-modal .market-primary-button {
    min-height: 42px;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

.market-sell-modal .market-secondary-button {
    border-radius: 8px;
}

.market-sell-modal .market-primary-button {
    border-radius: 6px;
}

body.is-market-sell-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.market-sell-cards {
    min-width: 0;
}

.market-sell-grid {
    align-items: start;
    grid-auto-flow: row dense;
}

.market-sell-form {
    position: relative;
    top: auto;
    align-self: start;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: fit-content;
    padding: 16px;
    border: 1px solid var(--market-line);
    border-radius: 16px;
    color: var(--market-text);
    background:
        radial-gradient(circle at 50% 0%, rgba(47, 156, 255, 0.1), transparent 42%),
        rgba(3, 11, 24, 0.97);
    box-shadow: var(--market-card-shadow);
}

.market-sell-form[hidden] {
    display: none !important;
}

.market-sell-grid > .market-sell-form {
    margin: 0;
}

.market-sell-form__selected {
    margin-bottom: 14px;
}

.market-sell-form__selected strong {
    display: block;
    margin-top: 4px;
    color: var(--market-text);
    font-size: 17px;
    line-height: 1.25;
}

.market-sell-form__selected span {
    color: var(--market-muted);
    font-size: 11px;
}

.market-price-hint {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.market-price-hint > div {
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(47, 156, 255, 0.14);
    border-radius: 12px;
    background: rgba(47, 156, 255, 0.055);
}

.market-price-hint strong {
    font-size: 13px;
}

.market-commission-card {
    position: relative;
    margin-top: 12px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 202, 96, 0.56);
    border-radius: 14px;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 203, 91, 0.18), transparent 42%),
        linear-gradient(135deg, rgba(42, 30, 10, 0.92), rgba(5, 25, 45, 0.94));
    box-shadow:
        0 0 18px rgba(255, 190, 64, 0.12),
        inset 0 0 20px rgba(255, 212, 120, 0.035);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.market-commission-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.035), transparent 72%);
}

.market-commission-card__heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.market-commission-card__icon {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 211, 118, 0.58);
    border-radius: 10px;
    color: #ffe39a;
    background: rgba(255, 194, 66, 0.12);
    box-shadow: 0 0 14px rgba(255, 190, 64, 0.16);
    font-size: 16px;
    font-weight: 900;
}

.market-commission-card__heading > div {
    min-width: 0;
}

.market-commission-card__heading > div > span,
.market-commission-card__values > div > span,
.market-commission-card > p {
    color: rgba(226, 239, 255, 0.7);
}

.market-commission-card__heading > div > span {
    display: block;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.market-commission-card__heading strong {
    display: block;
    margin-top: 2px;
    color: #ffe6a6;
    font-size: 14px;
    line-height: 1.2;
}

.market-commission-card__values {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
}

.market-commission-card__values > div {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(255, 218, 135, 0.15);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.16);
}

.market-commission-card__values > div > span {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
}

.market-commission-card__values strong {
    color: #ffd889;
    font-size: 14px;
    line-height: 1.15;
}

.market-commission-card__received {
    border-color: rgba(87, 233, 158, 0.22) !important;
    background: rgba(31, 137, 85, 0.09) !important;
}

.market-commission-card__received strong {
    color: #91ffc6;
    text-shadow: 0 0 10px rgba(78, 238, 154, 0.18);
}

.market-commission-card > p {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    font-size: 10px;
    line-height: 1.3;
}

.market-commission-card.has-preview {
    border-color: rgba(255, 214, 123, 0.78);
    box-shadow:
        0 0 21px rgba(255, 190, 64, 0.2),
        0 0 30px rgba(57, 210, 137, 0.08),
        inset 0 0 20px rgba(255, 212, 120, 0.05);
}

.market-commission-card.is-loading .market-commission-card__values strong {
    opacity: 0.66;
}

.market-commission-card.is-error {
    border-color: rgba(255, 105, 120, 0.48);
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 86, 105, 0.12), transparent 42%),
        rgba(30, 9, 19, 0.9);
    box-shadow: 0 0 16px rgba(255, 75, 96, 0.1);
}

.market-commission-card.is-error > p {
    color: #ffb9bf;
}

.market-form-message {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--market-muted);
    font-size: 12px;
    line-height: 1.35;
}

.market-form-message.is-error {
    color: #ffb9bf;
}

.market-form-message.is-success {
    color: #aaffcc;
}

.market-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

/* Mine */

.market-own-card {
    display: flex;
    flex-direction: column;
}

.market-own-card__top {
    position: relative;
}

.market-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    border: 1px solid rgba(74, 178, 255, 0.42);
    color: #bfe7ff;
    background: rgba(2, 9, 20, 0.84);
}

.market-status-badge--active {
    border-color: rgba(47, 228, 134, 0.44);
    color: #8dffc0;
}

.market-status-badge--sold {
    border-color: rgba(242, 200, 107, 0.44);
    color: #ffe29a;
}

.market-status-badge--cancelled {
    border-color: rgba(157, 174, 199, 0.32);
    color: #b8c5d6;
}

.market-own-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 13px;
}

.market-own-card__body h4 {
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
}

.market-own-card__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.market-own-card__actions {
    margin-top: auto;
    padding-top: 14px;
}

.market-own-card__actions .market-secondary-button {
    width: 100%;
}

.market-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.market-pagination[hidden] {
    display: none !important;
}

.market-pagination__button {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 8px;
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.market-pagination__button.is-active {
    border-color: transparent;
    color: #ffffff;
    background: var(--market-blue);
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.34),
        0 0 26px rgba(47, 156, 255, 0.12);
    cursor: default;
}

.market-pagination__button:disabled,
.market-pagination.is-loading .market-pagination__button {
    cursor: not-allowed;
    opacity: 0.42;
}

.market-pagination__dots {
    min-width: 24px;
    color: var(--market-muted);
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

/* Cancel lot confirmation */
.market-cancel-modal[hidden] {
    display: none !important;
}

.market-cancel-modal {
    position: fixed;
    inset: 0;
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.market-cancel-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(0, 5, 14, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.market-cancel-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 112, 124, 0.42);
    border-radius: 22px;
    color: var(--market-text);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 82, 101, 0.12), transparent 43%),
        rgba(3, 11, 24, 0.98);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.62),
        0 0 22px rgba(255, 76, 96, 0.12),
        inset 0 0 24px rgba(255, 98, 113, 0.025);
    text-align: center;
}

.market-cancel-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 9px;
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.market-cancel-modal__close > span {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
    pointer-events: none;
}

.market-cancel-modal__close > span::before,
.market-cancel-modal__close > span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 10px;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
}

.market-cancel-modal__close > span::before {
    transform: rotate(45deg);
}

.market-cancel-modal__close > span::after {
    transform: rotate(-45deg);
}

.market-cancel-modal__close:hover:not(:disabled) {
    color: #ffffff;
    border-color: rgba(120, 208, 255, 0.72);
    background: rgba(15, 55, 96, 0.82);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-cancel-modal__close:active:not(:disabled) {
    transform: scale(0.97);
}

.market-cancel-modal__close:disabled,
.market-cancel-modal__backdrop:disabled {
    cursor: wait;
}

.market-cancel-modal__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border: 1px solid rgba(255, 122, 134, 0.56);
    border-radius: 18px;
    color: #ffbbc2;
    background: rgba(255, 79, 99, 0.12);
    box-shadow:
        0 0 20px rgba(255, 76, 96, 0.16),
        inset 0 0 16px rgba(255, 135, 146, 0.035);
    font-size: 28px;
    font-weight: 900;
}

.market-cancel-modal__kicker {
    display: block;
    color: #ff9ca6;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.market-cancel-modal__title {
    margin: 6px 38px 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

.market-cancel-modal__description {
    margin: 12px 0 0;
    color: var(--market-muted);
    font-size: 13px;
    line-height: 1.5;
}

.market-cancel-modal__description strong {
    color: #ffffff;
    font-weight: 900;
}

.market-cancel-modal__message {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--market-muted);
    font-size: 12px;
    line-height: 1.35;
}

.market-cancel-modal__message:empty {
    min-height: 0;
    margin-top: 0;
}

.market-cancel-modal__message.is-error {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 95, 109, 0.34);
    border-radius: 10px;
    color: #ffd0d5;
    background: rgba(255, 95, 109, 0.09);
}

.market-cancel-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 18px;
}

.market-danger-button {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(255, 128, 140, 0.22);
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(180deg, #ff6675, #d93145);
    box-shadow:
        0 0 14px rgba(255, 69, 89, 0.24),
        0 0 28px rgba(255, 69, 89, 0.08);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.market-danger-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #ff7a87, #e33b4f);
    box-shadow:
        0 0 18px rgba(255, 69, 89, 0.32),
        0 0 34px rgba(255, 69, 89, 0.12);
    transform: translateY(-1px);
}

.market-danger-button:focus-visible {
    outline: 2px solid rgba(255, 173, 181, 0.9);
    outline-offset: 2px;
}

.market-cancel-modal__close:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.86);
    outline-offset: 2px;
}

.market-danger-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

body.is-market-cancel-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

/* Detail */
.market-detail {
    display: grid;
    gap: 14px;
}

.market-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--market-muted);
    font-size: 13px;
    font-weight: 800;
    transition: color 0.2s ease, transform 0.2s ease;
}

.market-back-link:hover {
    color: var(--market-blue-light);
    transform: translateX(-2px);
}

.market-card-summary {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    padding: 18px;
}

.market-card-summary__media {
    position: relative;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(47, 156, 255, 0.44);
    border-radius: 14px;
    overflow: hidden;
    background: #020814;
    box-shadow: var(--market-card-shadow);
}

.market-card-summary__media img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center top;
}

.market-card-summary__content {
    align-self: center;
    min-width: 0;
}

.market-card-summary h2 {
    font-size: clamp(25px, 4vw, 40px);
}

.market-summary-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.market-summary-stats > div {
    padding: 12px;
    border: 1px solid rgba(47, 156, 255, 0.14);
    border-radius: 12px;
    background: rgba(47, 156, 255, 0.045);
}

.market-lot-list {
    display: grid;
}

.market-lot-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(110px, auto)) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid rgba(47, 156, 255, 0.2);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.01)),
        rgba(2, 9, 21, 0.76);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.market-lot-row__seller {
    min-width: 0;
}

.market-lot-row__seller strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--market-text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-rarity-badge {
    border: 1px solid rgba(117, 230, 255, 0.34);
    color: #bfefff;
    background: rgba(47, 156, 255, 0.08);
}

.market-lot-row .market-primary-button {
    min-width: 116px;
}

/* Purchase modal — follows the project exchange-modal visual pattern */
.market-modal[hidden] {
    display: none !important;
}

.market-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.market-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 5, 14, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.market-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100dvh - 40px);
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    color: #ffffff;
    background: rgba(3, 11, 24, 0.97);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(120, 196, 255, 0.62) rgba(2, 9, 21, 0.58);
}

.market-modal__dialog::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(2, 9, 21, 0.58);
}

.market-modal__dialog::-webkit-scrollbar-thumb {
    border: 2px solid rgba(2, 9, 21, 0.72);
    border-radius: 999px;
    background: rgba(120, 196, 255, 0.62);
}

.market-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
}

.market-modal h2 {
    margin: 0 48px 8px 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.market-modal__description {
    margin: 0 48px 16px 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    line-height: 1.45;
}

.market-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.market-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.market-modal__actions .market-secondary-button,
.market-modal__actions .market-primary-button {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    border-radius: 14px;
    font-weight: 700;
}

.market-modal__actions .market-secondary-button {
    border-color: transparent;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.market-modal__actions .market-primary-button {
    background: linear-gradient(135deg, #49b7ff, #176fe0);
}

body.is-market-modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.currency-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    white-space: nowrap;
}

.currency-icon {
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: url("/assets/tradecoin.png") center / contain no-repeat;
    vertical-align: -3px;
}

@media (hover: hover) and (pointer: fine) {
    .market-payment-card:hover {
        transform: translateY(-3px);
        border-color: rgba(89, 186, 255, 0.86);
        background:
            linear-gradient(180deg, rgba(80, 167, 255, 0.06), rgba(255, 255, 255, 0.01)),
            var(--market-surface-2);
        box-shadow:
            0 16px 36px rgba(0, 0, 0, 0.42),
            0 0 12px rgba(47, 156, 255, 0.22),
            0 0 28px rgba(47, 156, 255, 0.11);
    }
}

@media (max-width: 920px) {
    .market-lot-row {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(110px, auto));
    }

    .market-lot-row__rarity {
        grid-column: 1 / 3;
    }
}

@media (max-width: 760px) {
    .market-intro {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 10px;
        margin-bottom: 10px;
        padding: 10px 11px;
        border-radius: 12px;
    }

    .market-intro__mark {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .market-intro__chart {
        transform: scale(0.88);
    }

    .market-intro p {
        font-size: 11px;
        line-height: 1.42;
    }

    .market-intro__eyebrow {
        font-size: 8px;
    }

    .market-intro__balance {
        min-width: 116px;
        padding: 7px 9px;
    }

    .market-intro__balance-value {
        font-size: 14px;
    }

    .market-panels {
        padding-top: 14px;
    }

    .market-panel,
    .market-card-summary,
    .market-lots-section {
        border-radius: 16px;
    }

    .market-panel,
    .market-lots-section {
        padding: 14px;
    }

    .market-page .tabs-underline {
        gap: 14px;
    }

    .market-page .tabs-underline .tab {
        padding: 11px 5px;
        font-size: 13px;
    }

    .market-toolbar,
    .market-toolbar--sell {
        grid-template-columns: 1fr;
    }

    .market-section-head h3 {
        font-size: 19px;
    }

    .market-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .market-card-info {
        padding: 10px;
    }

    .market-card-info h4 {
        min-height: 16px;
        font-size: 12px;
    }

    .market-card-meta {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .market-card-meta strong {
        font-size: 11px;
    }

    .market-own-card__meta strong {
        font-size: 9px;
    }

    .market-card-summary {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .market-card-summary h2 {
        font-size: 24px;
    }

    .market-summary-stats {
        grid-template-columns: 1fr 1fr;
        margin-top: 12px;
    }

    .market-summary-stats > div:last-child {
        grid-column: 1 / -1;
    }

    .market-lot-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .market-lot-row__seller,
    .market-lot-row__rarity,
    .market-lot-row .market-primary-button {
        grid-column: 1 / -1;
    }

    .market-lot-row .market-primary-button {
        width: 100%;
    }
}

@media (max-width: 500px) {

    .market-cancel-modal__title {
        margin-inline: 34px;
        font-size: 20px;
    }

    .market-cancel-modal__actions {
        grid-template-columns: 1fr;
    }

    .market-cancel-modal__actions .market-secondary-button {
        order: 2;
    }

    .market-sell-modal {
        padding: 12px;
    }

    .market-sell-modal__dialog {
        max-height: calc(100dvh - 24px);
        padding: 18px;
        border-radius: 20px;
    }

    .market-sell-modal__close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .market-sell-modal__title {
        margin-right: 38px;
        font-size: 18px;
    }

    .market-sell-modal__message {
        margin-right: 0;
        font-size: 12px;
    }

    .market-field--price input{
        height: 36px;
        font-size: 12px;
    }

    .market-sell-modal .market-price-hint > div + div {
        border-top: 1px solid rgba(47, 156, 255, 0.12);
        border-left: 0;
    }

    .market-intro {
        grid-template-columns: 1fr;
        padding-left: 13px;
    }

    .market-intro__mark {
        display: none;
    }

    .market-intro__eyebrow {
        margin-bottom: 3px;
    }

    .market-intro__balance {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        align-items: center;
        width: 100%;
        min-width: 0;
        margin-top: 2px;
    }

    .market-intro__balance-value {
        justify-content: flex-end;
    }

    .market-pagination {
        gap: 6px;
    }

    .market-pagination__button {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }

    .market-pagination__button--arrow {
        min-width: 38px;
        font-size: 20px;
    }

     .market-card-grid[data-my-lots] {
         grid-template-columns: repeat(2, minmax(0, 1fr));
     }

    .market-card-summary {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 11px;
    }

    .market-card-summary h2 {
        font-size: 20px;
    }

    .market-summary-stats {
        grid-template-columns: 1fr;
    }

    .market-summary-stats > div:last-child {
        grid-column: auto;
    }

    .market-sell-form__selected{
        margin-bottom: 12px;
        padding: 10px;
    }

    .market-sell-form__selected span {
        font-size: 12px;
    }

    .market-sell-form__selected strong {
        font-size: 14px;
    }

    .market-price-hint strong{
        font-size: 10px;
    }

    .market-sell-modal .market-price-hint > div {
        padding: 10px;
    }

    .market-modal {
        align-items: center;
        padding: 14px;
    }

    .market-modal__dialog {
        width: min(100%, 460px);
        max-height: calc(100dvh - 28px);
        padding: 18px;
        border-radius: 20px;
    }

    .market-modal h2 {
        margin-right: 42px;
        font-size: 18px;
    }

    .market-modal__description {
        margin-right: 0;
        font-size: 12px;
    }

    .market-payment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .market-modal__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 374px) {
    .market-page .tabs-underline {
        gap: 10px;
    }

    .market-card-grid {
        gap: 7px;
    }

    .market-card-grid[data-my-lots]{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-card-info {
        padding: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .market-payment-card,
    .market-own-card {
        transition: none !important;
    }

}

@media (prefers-reduced-motion: reduce) {
    .market-page *,
    .market-page *::before,
    .market-page *::after,
    .market-modal *,
    .market-modal *::before,
    .market-modal *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes market-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   Compact Select2 filters
========================= */

.market-filter-bar {
    display: grid;
    gap: 8px;
    align-items: center;
    min-width: 0;
    margin: 0 0 14px;
}

.market-filter-bar--lots,
.market-filter-bar--sell {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.market-filter-extra,
.market-filter-pair {
    display: contents;
}

.market-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.market-filter-actions--lots,
.market-filter-actions--sell {
    grid-column: 5;
}

.market-filter-bar--lots .market-filter-control--rating,
.market-filter-bar--sell .market-filter-control--name,
.market-filter-bar--sell .market-filter-control--rating {
    grid-column: span 2;
}

.market-filter-toggle,
.market-filter-button {
    width: 38px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 9px;
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    cursor: pointer;
}

.market-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.market-filter-toggle__icon {
    position: relative;
    display: block;
    width: 20px;
    height: 18px;
    pointer-events: none;
}

.market-filter-toggle__icon i {
    position: absolute;
    left: 1px;
    right: 1px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
}

.market-filter-toggle__icon i::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: rgba(4, 18, 36, 0.96);
    transform: translateY(-50%);
}

.market-filter-toggle__icon i:nth-child(1) {
    top: 2px;
}

.market-filter-toggle__icon i:nth-child(1)::after {
    left: 3px;
}

.market-filter-toggle__icon i:nth-child(2) {
    top: 8px;
}

.market-filter-toggle__icon i:nth-child(2)::after {
    right: 3px;
}

.market-filter-toggle__icon i:nth-child(3) {
    top: 14px;
}

.market-filter-toggle__icon i:nth-child(3)::after {
    left: 7px;
}

.market-filter-control {
    position: relative;
    min-width: 0;
    height: 36px;
}

.market-filter-control.is-hidden {
    display: none !important;
}

.market-filter-control input,
.market-filter-control > select {
    display: block;
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 11px;
    border: 1px solid rgba(47, 156, 255, 0.46);
    border-radius: 10px;
    outline: 0;
    color: #d8ecff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.008)),
        var(--market-field);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 13px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.market-filter-control input::placeholder {
    color: #9fb6ce;
    opacity: 1;
}

.market-filter-control input:hover:not(:disabled),
.market-filter-control > select:hover:not(:disabled) {
    border-color: rgba(91, 191, 255, 0.7);
}

.market-filter-control input:disabled,
.market-filter-control > select:disabled {
    cursor: not-allowed;
    color: var(--market-muted-2);
    border-color: rgba(73, 127, 178, 0.28);
    background: rgba(7, 18, 34, 0.82);
    box-shadow: inset 0 0 10px rgba(47, 156, 255, 0.015);
    opacity: 0.66;
}

.market-filter-control--select2 {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.market-filter-control--select2 > .select2-container {
    width: 100% !important;
    height: 36px;
}

/*
 * Нативный select не принимает касания до готовности Select2.
 * Это предотвращает системный picker в iOS/Telegram WebView.
 */
.market-filter-control--select2
    > select.js-anicard-select:not(.select2-hidden-accessible) {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Нейтральная оболочка на несколько кадров до инициализации Select2. */
.market-filter-bar:not(.is-select2-ready):not(.is-select2-fallback)
    .market-filter-control--select2::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(47, 156, 255, 0.46);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.008)),
        var(--market-field);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    pointer-events: none;
}

/* Если Select2 недоступен, возвращается полноценный нативный select. */
.market-filter-bar.is-select2-fallback
    .market-filter-control--select2
    > select.js-anicard-select:not(.select2-hidden-accessible) {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: 36px !important;
    padding: 0 32px 0 11px !important;
    border: 1px solid rgba(47, 156, 255, 0.46) !important;
    border-radius: 10px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    appearance: auto;
    color: #d8ecff;
    background: var(--market-field);
}

.market-filter-control--select2 > select.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
    touch-action: none !important;
}

.market-filter-button {
    display: grid;
    place-items: center;
    min-width: 0;
    font: inherit;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.market-filter-button__icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    overflow: visible;
    color: transparent;
    font-size: 0;
    line-height: 0;
    pointer-events: none;
}

.market-filter-button--apply .market-filter-button__icon::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    width: 9px;
    height: 9px;
    border: 2px solid #9bd6ff;
    border-radius: 50%;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
}

.market-filter-button--apply .market-filter-button__icon::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 13px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: #9bd6ff;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
    transform: rotate(45deg);
    transform-origin: left center;
}

.market-filter-button--reset .market-filter-button__icon::before,
.market-filter-button--reset .market-filter-button__icon::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 10px;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #9bd6ff;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
}

.market-filter-button--reset .market-filter-button__icon::before {
    transform: rotate(45deg);
}

.market-filter-button--reset .market-filter-button__icon::after {
    transform: rotate(-45deg);
}

.market-filter-button:hover:not(:disabled)
    .market-filter-button__icon::before,
.market-filter-button:hover:not(:disabled)
    .market-filter-button__icon::after {
    border-color: #ffffff;
    background-color: #ffffff;
}

.market-filter-button:disabled,
.market-filter-bar.is-loading .market-filter-button {
    cursor: not-allowed;
    opacity: 0.5;
}

.market-filter-note {
    margin: -5px 0 14px;
    color: var(--market-muted-2);
    font-size: 11px;
    line-height: 1.35;
}

.market-filter-bar.has-no-card-type
    .market-filter-control:not(:first-child) {
    opacity: 0.72;
}

@media (max-width: 1180px) {
    .market-filter-bar--lots,
    .market-filter-bar--sell {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .market-filter-bar--lots .market-filter-control--name,
    .market-filter-bar--lots .market-filter-control--rating,
    .market-filter-bar--sell .market-filter-control--name,
    .market-filter-bar--sell .market-filter-control--rating,
    .market-filter-control--price-sort,
    .market-filter-control--rating-sort,
    .market-filter-actions--lots,
    .market-filter-actions--sell {
        grid-column: auto;
        grid-row: auto;
    }

    .market-filter-actions--lots,
    .market-filter-actions--sell {
        justify-content: flex-end;
    }
}

@media (max-width: 760px) {
    .market-filter-bar--lots,
    .market-filter-bar--sell {
        grid-template-columns: minmax(0, 1fr) 38px auto;
        gap: 7px;
        align-items: start;
    }

    .market-filter-bar--lots > .market-filter-control:first-child,
    .market-filter-bar--sell > .market-filter-control:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .market-filter-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .market-filter-actions--lots,
    .market-filter-actions--sell {
        grid-column: 3;
        grid-row: 1;
        gap: 7px;
    }

    .market-filter-extra {
        display: none;
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        min-width: 0;
        padding-top: 1px;
    }

    .market-filter-bar.is-mobile-expanded
        .market-filter-extra {
        display: grid;
    }

    .market-filter-pair--name-rating {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        min-width: 0;
    }

    .market-filter-bar--lots .market-filter-control--name,
    .market-filter-bar--sell .market-filter-control--name {
        grid-column: 1;
        grid-row: auto;
    }

    .market-filter-bar--lots .market-filter-control--rating,
    .market-filter-bar--sell .market-filter-control--rating {
        grid-column: 2;
        grid-row: auto;
    }

    .market-filter-control--price-sort,
    .market-filter-control--rating-sort {
        grid-column: auto;
        grid-row: auto;
    }

    .market-filter-note {
        margin-top: -4px;
        font-size: 10px;
    }
}

@media (max-width: 374px) {
    .market-filter-control,
    .market-filter-control input,
    .market-filter-control > select,
    .market-filter-control--select2 > .select2-container,
    .market-filter-button,
    .market-filter-toggle {
        height: 34px;
    }

    .market-filter-toggle,
    .market-filter-button {
        width: 34px;
        min-width: 34px;
    }

    .market-filter-bar--lots,
    .market-filter-bar--sell {
        grid-template-columns: minmax(0, 1fr) 34px auto;
    }

    .market-filter-control input,
    .market-filter-control > select {
        font-size: 12px;
    }
}

/* Unified modal close buttons — same visual language as filter reset */
.market-sell-modal__close,
.market-cancel-modal__close,
.market-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 9px;
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.market-sell-modal__close > span,
.market-cancel-modal__close > span,
.market-modal__close > span {
    display: none;
}

.market-sell-modal__close::before,
.market-sell-modal__close::after,
.market-cancel-modal__close::before,
.market-cancel-modal__close::after,
.market-modal__close::before,
.market-modal__close::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 17px;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
    pointer-events: none;
}

.market-sell-modal__close::before,
.market-cancel-modal__close::before,
.market-modal__close::before {
    transform: rotate(45deg);
}

.market-sell-modal__close::after,
.market-cancel-modal__close::after,
.market-modal__close::after {
    transform: rotate(-45deg);
}

.market-sell-modal__close:hover:not(:disabled),
.market-cancel-modal__close:hover:not(:disabled),
.market-modal__close:hover:not(:disabled) {
    color: #ffffff;
    border-color: rgba(120, 208, 255, 0.72);
    background: rgba(15, 55, 96, 0.82);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-sell-modal__close:active:not(:disabled),
.market-cancel-modal__close:active:not(:disabled),
.market-modal__close:active:not(:disabled) {
    transform: scale(0.97);
}

.market-sell-modal__close:focus-visible,
.market-cancel-modal__close:focus-visible,
.market-modal__close:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.86);
    outline-offset: 2px;
}

@media (max-width: 374px) {
    .market-sell-modal__close,
    .market-cancel-modal__close,
    .market-modal__close {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
    }

    .market-sell-modal__close::before,
    .market-sell-modal__close::after,
    .market-cancel-modal__close::before,
    .market-cancel-modal__close::after,
    .market-modal__close::before,
    .market-modal__close::after {
        left: 8px;
        top: 16px;
    }
}

/* Payment cards: image-only tiles with equal card proportions */
.market-payment-grid {
    align-items: start;
}

.market-payment-card {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
}

.market-payment-card > .market-card-media:not(.market-trade-card__image) {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.market-payment-card > .market-card-media:not(.market-trade-card__image) img {
    width: 100%;
    height: 100%;
}

/* Pagination arrows — same visual language as modal close */
.market-pagination__button--arrow {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 9px;
    font-size: 0;
    line-height: 0;
}

.market-pagination__button--arrow::before {
    content: "";
    position: relative;
    top: 5px;
    display: block;
    width: 9px;
    height: 9px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    filter: drop-shadow(0 0 4px rgba(120, 196, 255, 0.34));
    pointer-events: none;
}

.market-pagination > .market-pagination__button--arrow:first-child::before {
    margin-left: 3px;
    transform: rotate(45deg);
}

.market-pagination > .market-pagination__button--arrow:last-child::before {
    margin-right: 3px;
    transform: rotate(-135deg);
}

@media (max-width: 374px) {
    .market-pagination__button--arrow {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
    }

    .market-pagination__button--arrow::before {
        width: 8px;
        height: 8px;
    }
}

/* Payment card name search */
.market-payment-search {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;
}


.market-payment-search__field {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.market-payment-search__field input {
    display: block;
    width: 100%;
    height: 36px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid rgba(47, 156, 255, 0.46);
    border-radius: 10px;
    outline: 0;
    color: #d8ecff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.008)),
        var(--market-field);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 13px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.market-payment-search__field input::placeholder {
    color: #9fb6ce;
    opacity: 1;
}

.market-payment-search__field input:hover:not(:disabled) {
    border-color: rgba(91, 191, 255, 0.7);
}

.market-payment-search__field input:focus {
    border-color: rgba(104, 202, 255, 0.92);
    box-shadow:
        0 0 0 1px rgba(92, 190, 255, 0.1),
        0 0 16px rgba(47, 156, 255, 0.23),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-payment-search__button {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.48);
    border-radius: 9px;
    color: #9bd6ff;
    background: rgba(4, 18, 36, 0.78);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        opacity 0.2s ease;
}

.market-payment-search__button:hover:not(:disabled) {
    color: #ffffff;
    border-color: rgba(120, 208, 255, 0.72);
    background: rgba(15, 55, 96, 0.82);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.28),
        0 0 26px rgba(47, 156, 255, 0.12),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-payment-search__button:active:not(:disabled) {
    transform: scale(0.97);
}

.market-payment-search__button:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.86);
    outline-offset: 2px;
}

.market-payment-search__button:disabled,
.market-payment-search__field input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.market-payment-search__icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.market-payment-search__icon::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
}

.market-payment-search__icon::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 13px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 7px rgba(120, 196, 255, 0.28);
    transform: rotate(45deg);
    transform-origin: left center;
}

.market-payment-search__button[hidden] {
    display: none !important;
}

.market-payment-search__reset-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: currentColor;
    filter: drop-shadow(0 0 5px rgba(120, 196, 255, 0.34));
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-1px);
}

@media (max-width: 374px) {
    .market-payment-search__field input,
    .market-payment-search__button {
        height: 34px;
    }

    .market-payment-search__button {
        width: 34px;
        min-width: 34px;
    }
}


/* Purchase modal: keep scrolling, hide the scrollbar visually */
.market-modal__dialog {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.market-modal__dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Purchase confirmation state */
.market-purchase-confirmation[hidden],
[data-purchase-selection-view][hidden] {
    display: none !important;
}

.market-modal__dialog.is-purchase-confirmation {
    width: min(960px, 100%);
    padding: 26px 28px 24px;
    border-color: rgba(92, 190, 255, 0.25);
    background:
        radial-gradient(circle at 50% 42%, rgba(47, 156, 255, 0.075), transparent 34%),
        radial-gradient(circle at 4% 0%, rgba(47, 156, 255, 0.08), transparent 34%),
        rgba(3, 11, 24, 0.98);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.58),
        0 0 24px rgba(47, 156, 255, 0.09),
        inset 0 0 34px rgba(47, 156, 255, 0.025);
}

.market-modal__dialog.is-purchase-confirmation .market-modal__description {
    max-width: none;
    margin-bottom: 0;
}

.market-purchase-confirmation__exchange {
    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        minmax(210px, 236px)
        minmax(220px, 1fr);
    grid-template-areas: "give summary receive";
    gap: 34px;
    align-items: center;
    margin-top: 24px;
}

.market-purchase-confirmation__card {
    min-width: 0;
    text-align: center;
}

.market-purchase-confirmation__card--give {
    grid-area: give;
}

.market-purchase-confirmation__card--receive {
    grid-area: receive;
}

.market-purchase-confirmation__label {
    display: block;
    margin-bottom: 9px;
    color: var(--market-blue-light);
    filter: drop-shadow(0 0 6px rgba(120, 196, 255, 0.22));
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-purchase-confirmation__media {
    width: min(100%, 252px);
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(92, 190, 255, 0.64);
    border-radius: 18px;
    box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.46),
        0 0 18px rgba(47, 156, 255, 0.2),
        inset 0 0 18px rgba(47, 156, 255, 0.05);
    overflow: hidden;
}

.market-purchase-confirmation__media::after {
    display: none;
}

.market-purchase-confirmation__media img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center top;
}

.market-purchase-confirmation__name {
    display: block;
    max-width: 260px;
    margin: 12px auto 0;
    overflow: hidden;
    color: #ffffff;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-purchase-confirmation__rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
    color: rgba(220, 232, 247, 0.72);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.market-purchase-confirmation__rating strong {
    color: var(--market-blue-light);
    font-weight: 950;
}

.market-purchase-confirmation__summary {
    position: relative;
    grid-area: summary;
    isolation: isolate;
    display: grid;
    justify-items: center;
    align-content: center;
    min-width: 0;
    min-height: 292px;
    padding: 30px 20px 24px;
    clip-path: polygon(
        10% 0,
        90% 0,
        100% 14%,
        100% 86%,
        90% 100%,
        10% 100%,
        0 86%,
        0 14%
    );
    text-align: center;
}

.market-purchase-confirmation__summary::before,
.market-purchase-confirmation__summary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    clip-path: inherit;
    pointer-events: none;
}

.market-purchase-confirmation__summary::before {
    background: linear-gradient(
        160deg,
        rgba(120, 208, 255, 0.5),
        rgba(47, 156, 255, 0.12) 40%,
        rgba(47, 156, 255, 0.34)
    );
    filter: drop-shadow(0 0 16px rgba(47, 156, 255, 0.15));
}

.market-purchase-confirmation__summary::after {
    inset: 1px;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 43%, rgba(47, 156, 255, 0.17), transparent 34%),
        linear-gradient(180deg, rgba(6, 24, 49, 0.98), rgba(3, 13, 29, 0.98));
}

.market-purchase-confirmation__summary-label {
    color: rgba(220, 232, 247, 0.72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-purchase-confirmation__price {
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    color: #ffffff;
    font-size: 28px;
    font-weight: 950;
    line-height: 1;
    text-shadow: 0 0 14px rgba(120, 196, 255, 0.22);
}

.market-purchase-confirmation__price .currency-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
}

.market-purchase-confirmation__divider {
    width: 72%;
    height: 1px;
    margin: 16px 0 13px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(92, 190, 255, 0.52),
        transparent
    );
    box-shadow: 0 0 8px rgba(47, 156, 255, 0.2);
}

.market-purchase-confirmation__transfer {
    display: grid;
    grid-template-columns: 36px 68px 36px;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.market-purchase-confirmation__chevrons {
    color: #62c3ff;
    filter: drop-shadow(0 0 7px rgba(98, 195, 255, 0.42));
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
}

.market-purchase-confirmation__exchange-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border: 1px solid rgba(92, 190, 255, 0.72);
    border-radius: 50%;
    color: #8fd4ff;
    background:
        radial-gradient(circle, rgba(47, 156, 255, 0.23), rgba(5, 23, 47, 0.94) 66%);
    box-shadow:
        0 0 15px rgba(47, 156, 255, 0.38),
        0 0 34px rgba(47, 156, 255, 0.13),
        inset 0 0 16px rgba(120, 208, 255, 0.08);
}

.market-purchase-confirmation__exchange-icon::before {
    content: "⇄";
    filter: drop-shadow(0 0 5px rgba(120, 208, 255, 0.34));
    font-size: 35px;
    font-weight: 800;
    line-height: 1;
    transform: translateY(-1px);
}

.market-purchase-confirmation__notice {
    display: grid;
    gap: 5px;
    width: 100%;
    margin-top: 16px;
    padding: 11px 10px;
    border: 1px solid rgba(92, 190, 255, 0.16);
    border-radius: 12px;
    background: rgba(47, 156, 255, 0.055);
}

.market-purchase-confirmation__notice > span {
    color: rgba(220, 232, 247, 0.58);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-purchase-confirmation__notice > strong {
    color: #c9eaff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1.35;
}

.market-purchase-confirmation__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 30px;
}

.market-purchase-confirmation__actions .market-secondary-button,
.market-purchase-confirmation__actions .market-primary-button {
    min-height: 54px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 850;
}

.market-purchase-confirmation__actions .market-secondary-button {
    border-color: transparent;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.085);
    box-shadow: none;
}

.market-purchase-confirmation__actions .market-primary-button {
    background: linear-gradient(110deg, #43b7ff, #1675ea 62%, #267dff);
    box-shadow:
        0 0 18px rgba(47, 156, 255, 0.34),
        0 0 38px rgba(47, 156, 255, 0.13);
}

@media (max-width: 820px) {
    .market-modal__dialog.is-purchase-confirmation {
        width: min(720px, 100%);
        padding-inline: 22px;
    }

    .market-purchase-confirmation__exchange {
        grid-template-columns:
            minmax(170px, 1fr)
            minmax(135px, 190px)
            minmax(170px, 1fr);
        gap: 18px;
    }

    .market-purchase-confirmation__media {
        width: min(100%, 205px);
    }

    .market-purchase-confirmation__summary {
        min-height: 262px;
        padding: 24px 14px 20px;
    }

    .market-purchase-confirmation__transfer {
        grid-template-columns: 25px 58px 25px;
        gap: 5px;
    }

    .market-purchase-confirmation__exchange-icon {
        width: 58px;
        height: 58px;
    }

    .market-purchase-confirmation__exchange-icon::before {
        font-size: 30px;
    }

    .market-purchase-confirmation__chevrons {
        font-size: 27px;
    }
}

@media (max-width: 560px) {

    .market-purchase-confirmation__actions {
        gap: 8px;
        margin-top: 20px;
    }

    .market-purchase-confirmation__actions .market-secondary-button,
    .market-purchase-confirmation__actions .market-primary-button {
        min-height: 46px;
        padding-inline: 8px;
        font-size: 12px;
    }
}

@media (max-width: 374px) {

    .market-purchase-confirmation__media {
        border-radius: 10px;
    }
}

/* Mobile purchase confirmation: keep the exchange summary between both cards */
@media (max-width: 560px) {
    .market-modal__dialog.is-purchase-confirmation {
        width: min(100%, 500px);
        padding: 18px 12px 16px;
    }

    .market-purchase-confirmation__exchange {
        grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
        grid-template-areas: "give summary receive";
        gap: 7px;
        align-items: start;
        margin-top: 18px;
    }

    .market-purchase-confirmation__card {
        min-width: 0;
    }

    .market-purchase-confirmation__media {
        width: min(100%, 150px);
        border-radius: 11px;
    }

    .market-purchase-confirmation__label {
        min-height: 20px;
        margin-bottom: 5px;
        font-size: 7px;
        letter-spacing: 0.075em;
    }

    .market-purchase-confirmation__name {
        max-width: 100%;
        margin-top: 6px;
        font-size: 10px;
    }

    .market-purchase-confirmation__rating {
        margin-top: 2px;
        font-size: 8px;
    }

    .market-purchase-confirmation__summary {
        align-self: start;
        width: 92px;
        min-width: 0;
        min-height: 214px;
        margin: 24px 0 0;
        clip-path: polygon(
            13% 0,
            87% 0,
            100% 9%,
            100% 91%,
            87% 100%,
            13% 100%,
            0 91%,
            0 9%
        );
    }

    .market-purchase-confirmation__summary-label {
        font-size: 7px;
        letter-spacing: 0.055em;
    }

    .market-purchase-confirmation__price {
        gap: 3px;
        margin-top: 5px;
        font-size: 17px;
    }

    .market-purchase-confirmation__price .currency-icon {
        flex-basis: 14px;
        width: 14px;
        height: 14px;
    }

    .market-purchase-confirmation__divider {
        width: 76%;
    }

    .market-purchase-confirmation__transfer {
        grid-template-columns: 14px 38px 14px;
        gap: 1px;
    }

    .market-purchase-confirmation__exchange-icon {
        width: 38px;
        height: 38px;
    }

    .market-purchase-confirmation__exchange-icon::before {
        font-size: 21px;
    }

    .market-purchase-confirmation__chevrons {
        font-size: 17px;
    }

    .market-purchase-confirmation__notice {
        gap: 3px;
        margin-top: 10px;
        padding: 7px 4px;
        border-radius: 9px;
    }

    .market-purchase-confirmation__notice > span {
        font-size: 5px;
        letter-spacing: 0.04em;
    }

    .market-purchase-confirmation__notice > strong {
        font-size: 6px;
        line-height: 1.3;
    }
}

@media (max-width: 374px) {
    .market-modal__dialog.is-purchase-confirmation {
        padding-inline: 9px;
    }

    .market-purchase-confirmation__exchange {
        grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
        gap: 5px;
    }

    .market-purchase-confirmation__media {
        width: min(100%, 136px);
    }

    .market-purchase-confirmation__summary {
        width: 82px;
        min-height: 202px;
        margin-top: 23px;
        padding-inline: 5px;
    }

    .market-purchase-confirmation__price {
        font-size: 15px;
    }

    .market-purchase-confirmation__transfer {
        grid-template-columns: 12px 34px 12px;
    }

    .market-purchase-confirmation__exchange-icon {
        width: 34px;
        height: 34px;
    }

    .market-purchase-confirmation__exchange-icon::before {
        font-size: 19px;
    }

    .market-purchase-confirmation__chevrons {
        font-size: 15px;
    }

    .market-purchase-confirmation__notice > strong {
        font-size: 5.5px;
    }
}

/* Mobile confirmation: hide the explanatory notice and match the summary to card height */
@media (max-width: 760px) {
    .market-purchase-confirmation__notice {
        display: none;
    }

    .market-purchase-confirmation__summary {
        min-height: 0;
        height: clamp(220px, 36vw, 274px);
        padding-block: 18px;
    }
}

@media (max-width: 560px) {
    .market-purchase-confirmation__summary {
        height: clamp(145px, 30vw, 200px);
        padding: 13px 6px;
    }

    .market-purchase-confirmation__divider {
        margin: 8px 0 7px;
    }
}

@media (max-width: 374px) {
    .market-purchase-confirmation__summary {
        height: 164px;
        padding-block: 11px;
    }
}

/* Mobile confirmation: reserve space for close button and vertically center summary */
@media (max-width: 760px) {
    .market-modal__dialog.is-purchase-confirmation > .market-kicker,
    .market-modal__dialog.is-purchase-confirmation > .market-modal__description {
        width: calc(100% - 52px);
        max-width: calc(100% - 52px);
    }

    .market-purchase-confirmation__exchange {
        align-items: center;
    }

    .market-purchase-confirmation__summary {
        align-self: center;
        margin-top: 0;
    }
}

/* Mobile cancel-lot modal: keep the dialog centered in the viewport */
@media (max-width: 500px) {
    .market-cancel-modal {
        align-items: center;
        justify-content: center;
        padding:
            max(14px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(14px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));
    }

    .market-cancel-modal__dialog {
        width: min(420px, 100%);
        max-height: calc(100dvh - 28px);
        margin: auto;
        padding: 22px 16px 16px;
        border-radius: 22px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .market-cancel-modal__dialog::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}

/* =========================================================
   Market detail redesign: card profile, price chart and lots
========================================================= */
.market-card-overview {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 282px) minmax(0, 1fr);
    gap: 26px;
    padding: 20px;
    border: 1px solid rgba(47, 156, 255, 0.26);
    border-radius: 22px;
    color: var(--market-text);
    background:
        radial-gradient(circle at 25% 4%, rgba(47, 156, 255, 0.11), transparent 32%),
        linear-gradient(180deg, rgba(65, 151, 255, 0.025), rgba(255, 255, 255, 0.004)),
        rgba(3, 11, 24, 0.97);
    box-shadow: var(--market-panel-shadow);
    overflow: hidden;
}

.market-card-overview::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.018), transparent 58%),
        radial-gradient(circle at 88% 26%, rgba(47, 156, 255, 0.065), transparent 28%);
}

.market-card-overview > * {
    position: relative;
    z-index: 1;
}

.market-card-overview__visual {
    min-width: 0;
}

.market-card-overview .market-card-summary__media {
    width: 100%;
    max-width: 282px;
    margin: 0 auto;
    border-color: rgba(92, 190, 255, 0.58);
    border-radius: 18px;
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(47, 156, 255, 0.19),
        inset 0 0 18px rgba(47, 156, 255, 0.05);
}

.market-card-overview__main {
    min-width: 0;
}

.market-card-overview__header h1 {
    margin: 5px 0 0;
    color: #ffffff;
    font-size: clamp(31px, 4.1vw, 50px);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: -0.025em;
    text-shadow: 0 0 24px rgba(120, 196, 255, 0.08);
}

.market-card-overview__meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 13px;
}

.market-card-meta-chip,
.market-card-relations {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid rgba(47, 156, 255, 0.22);
    border-radius: 10px;
    color: #cfe8ff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.07), rgba(47, 156, 255, 0.018)),
        rgba(2, 10, 23, 0.72);
    box-shadow: inset 0 0 12px rgba(47, 156, 255, 0.025);
}

.market-card-meta-chip {
    gap: 7px;
    padding: 0 11px;
    color: #d7e9fb;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.market-card-meta-chip > span {
    color: var(--market-blue-light);
    filter: drop-shadow(0 0 5px rgba(120, 196, 255, 0.35));
}

.market-card-relations {
    gap: 8px;
    max-width: 100%;
    padding: 4px 5px 4px 10px;
}

.market-card-relations[hidden] {
    display: none !important;
}

.market-card-relations__label {
    flex: 0 0 auto;
    color: #b9d7f2;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.market-card-relations__list {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.market-card-relations__list::-webkit-scrollbar {
    display: none;
}

.market-card-relation {
    display: inline-grid;
    grid-template-columns: 30px minmax(0, auto);
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
    min-width: 36px;
    min-height: 42px;
    padding: 3px 7px 3px 3px;
    border: 1px solid rgba(92, 190, 255, 0.16);
    border-radius: 8px;
    color: #edf7ff;
    background: rgba(47, 156, 255, 0.045);
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.market-card-relation:hover {
    border-color: rgba(92, 190, 255, 0.54);
    background: rgba(47, 156, 255, 0.11);
    box-shadow: 0 0 13px rgba(47, 156, 255, 0.13);
    transform: translateY(-1px);
}

.market-card-relation__media {
    position: relative;
    display: block;
    width: 30px;
    height: 38px;
    border: 1px solid rgba(92, 190, 255, 0.28);
    border-radius: 5px;
    overflow: hidden;
    background: #020814;
}

.market-card-relation__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.market-card-relation__media .market-media-fallback {
    font-size: 4px;
    letter-spacing: 0.03em;
}

.market-card-relation__text {
    display: grid;
    min-width: 0;
}

.market-card-relation__text strong,
.market-card-relation__text span {
    max-width: 102px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-card-relation__text strong {
    color: #f5f9ff;
    font-size: 10px;
    line-height: 1.15;
}

.market-card-relation__text span {
    margin-top: 2px;
    color: var(--market-muted);
    font-size: 8px;
    line-height: 1.1;
}

.market-detail-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 20px;
    border: 1px solid rgba(47, 156, 255, 0.15);
    border-radius: 14px;
    background: rgba(5, 18, 37, 0.64);
    overflow: hidden;
}

.market-detail-stats > div {
    min-width: 0;
    padding: 13px 14px;
}

.market-detail-stats > div + div {
    border-left: 1px solid rgba(47, 156, 255, 0.12);
}

.market-detail-stats span,
.market-card-specs span {
    display: block;
    color: rgba(164, 184, 210, 0.66);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-detail-stats strong,
.market-card-specs strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 950;
    line-height: 1.1;
}

.market-detail-stats .currency-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.market-card-specs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 10px;
    border: 1px solid rgba(47, 156, 255, 0.12);
    border-radius: 14px;
    background: rgba(2, 10, 23, 0.5);
    overflow: hidden;
}

.market-card-specs > div {
    min-width: 0;
    padding: 11px 14px;
}

.market-card-specs > div + div {
    border-left: 1px solid rgba(47, 156, 255, 0.1);
}

.market-card-specs > div[hidden] {
    display: none;
}

.market-card-specs strong {
    justify-content: center;
    font-size: 13px;
}

.market-price-chart-panel {
    margin-top: 12px;
    border: 1px solid rgba(47, 156, 255, 0.17);
    border-radius: 15px;
    overflow: hidden;
}

.market-price-chart-panel__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 2px 8px;
}

.market-price-chart-panel__head h2 {
    color: #f7fbff;
    font-weight: 900;
    line-height: 1.2;
}

.market-price-periods {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid rgba(47, 156, 255, 0.13);
    border-radius: 9px;
    background: rgba(1, 8, 19, 0.76);
}

.market-price-periods button {
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    color: #8fa7c4;
    background: transparent;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.market-price-periods button:hover,
.market-price-periods button.is-active {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(47, 156, 255, 0.68), rgba(20, 91, 190, 0.74));
    box-shadow: 0 0 12px rgba(47, 156, 255, 0.22);
}

.market-price-periods button:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.8);
    outline-offset: 1px;
}

.market-chart-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--market-muted);
    font-size: 12px;
    text-align: center;
}

.market-price-chart__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.market-price-chart__grid {
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.market-price-chart__axis-label {
    font-family: "Segoe UI", Arial, sans-serif;
}

.market-price-chart__area {
    pointer-events: none;
}

.market-price-chart__line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.market-price-chart__point {
    transition: r 0.16s ease;
}

.market-price-chart__point:hover {
    r: 6px;
}

.market-lots-section {
    padding: 16px 18px 18px;
}

.market-section-head--lots {
    align-items: center;
    margin-bottom: 13px;
}

.market-section-head--lots h3 {
    margin-top: 3px;
}

.market-section-head--lots p {
    margin-top: 5px;
}

.market-lot-table {
    border: 1px solid rgba(47, 156, 255, 0.16);
    border-radius: 14px;
    background: rgba(2, 9, 21, 0.55);
    overflow: hidden;
}

.market-lot-table__head,
.market-lot-table__row {
    display: grid;
    gap: 12px;
    align-items: center;
}

.market-lot-table__head {
    min-height: 38px;
    padding: 0 13px;
    border-bottom: 1px solid rgba(47, 156, 255, 0.12);
    color: rgba(156, 180, 210, 0.65);
    background: rgba(47, 156, 255, 0.035);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.market-lot-list {
    gap: 0;
}

.market-lot-table__row {
    min-height: 58px;
    padding: 8px 13px;
    color: var(--market-text);
    background: rgba(2, 9, 21, 0.34);
    transition: background 0.17s ease;
}

.market-lot-table__row + .market-lot-table__row {
    border-top: 1px solid rgba(47, 156, 255, 0.09);
}

.market-lot-table__row:hover {
    background: rgba(47, 156, 255, 0.055);
}

.market-lot-table__seller {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
}

.market-lot-table__avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(92, 190, 255, 0.35);
    border-radius: 50%;
    color: #dff4ff;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 22%),
        linear-gradient(145deg, rgba(47, 156, 255, 0.4), rgba(20, 72, 145, 0.75));
    box-shadow: 0 0 10px rgba(47, 156, 255, 0.15);
    font-size: 12px;
    font-weight: 950;
}

.market-lot-table__seller strong {
    min-width: 0;
    overflow: hidden;
    color: #f5f9ff;
    font-size: 12px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-lot-table__cell {
    min-width: 0;
}

.market-lot-table__label {
    display: none;
}

.market-lot-table__price {
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
}

.market-lot-table__price .currency-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.market-lot-table__payment-card {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    max-width: 100%;
    padding: 0 9px;
    border: 1px solid rgba(92, 190, 255, 0.34);
    border-radius: 999px;
    overflow: hidden;
    color: #c5e9ff;
    background: rgba(47, 156, 255, 0.07);
    font-size: 9px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-lot-table__date {
    color: #a9bad0;
    font-size: 11px;
    font-weight: 700;
}

.market-lot-table__buy {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 8px;
    font-size: 11px;
}

@media (max-width: 1080px) {
    .market-card-overview {
        grid-template-columns: minmax(190px, 235px) minmax(0, 1fr);
        gap: 20px;
        padding: 18px;
    }

    .market-detail-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .market-detail-stats > div:nth-child(4) {
        border-left: 0;
        border-top: 1px solid rgba(47, 156, 255, 0.12);
    }

    .market-detail-stats > div:nth-child(5) {
        border-top: 1px solid rgba(47, 156, 255, 0.12);
    }

    .market-lot-table__head,
    .market-lot-table__row {
        gap: 9px;
    }
}

@media (max-width: 820px) {
    .market-card-overview {
        grid-template-columns: 176px minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .market-card-overview__main {
        display: contents;
    }

    .market-card-overview__header {
        min-width: 0;
    }

    .market-card-overview__header h1 {
        font-size: clamp(28px, 6vw, 38px);
    }

    .market-card-overview__meta-row {
        align-items: stretch;
        flex-direction: column;
    }

    .market-card-meta-chip,
    .market-card-relations {
        width: 100%;
    }

    .market-card-relations__list {
        flex: 1;
    }

    .market-detail-stats,
    .market-card-specs,
    .market-price-chart-panel {
        grid-column: 1 / -1;
    }

    .market-detail-stats {
        margin-top: 16px;
    }

    .market-card-specs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .market-card-specs > div:nth-child(4) {
        border-left: 0;
        border-top: 1px solid rgba(47, 156, 255, 0.1);
    }

    .market-card-specs > div:nth-child(5) {
        border-top: 1px solid rgba(47, 156, 255, 0.1);
    }

    .market-lot-table__head {
        display: none;
    }

    .market-lot-list {
        display: grid;
        gap: 9px;
        padding: 9px;
    }

    .market-lot-table__row {
        gap: 10px;
        min-height: 0;
        padding: 12px;
        border: 1px solid rgba(47, 156, 255, 0.14);
        border-radius: 12px;
        background: rgba(3, 13, 28, 0.84);
    }

    .market-lot-table__row + .market-lot-table__row {
        border-top: 1px solid rgba(47, 156, 255, 0.14);
    }

    .market-lot-table__label {
        display: block;
        margin-bottom: 4px;
        color: rgba(156, 180, 210, 0.64);
        font-size: 8px;
        font-weight: 850;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .market-lot-table__seller .market-lot-table__label {
        grid-column: 1 / -1;
        margin-bottom: -4px;
    }

    .market-lot-table__buy {
        grid-column: 1 / -1;
        min-height: 40px;
    }
}

@media (max-width: 620px) {
    .market-card-overview {
        grid-template-columns: 126px minmax(0, 1fr);
        gap: 13px;
        padding: 13px;
        border-radius: 17px;
    }

    .market-card-overview .market-card-summary__media {
        border-radius: 12px;
    }

    .market-card-overview__header .market-kicker {
        font-size: 8px;
    }

    .market-card-overview__header h1 {
        margin-top: 3px;
        font-size: clamp(24px, 8vw, 34px);
    }

    .market-card-overview__meta-row {
        gap: 6px;
        margin-top: 9px;
    }

    .market-card-meta-chip {
        min-height: 30px;
        padding-inline: 8px;
        font-size: 10px;
    }

    .market-card-relations {
        display: grid;
        gap: 4px;
        padding: 6px;
    }

    .market-card-relations__label {
        padding-left: 2px;
        font-size: 8px;
    }

    .market-card-relation {
        grid-template-columns: 25px minmax(0, auto);
        min-height: 34px;
    }

    .market-card-relation__media {
        width: 25px;
        height: 31px;
    }

    .market-card-relation__text strong {
        font-size: 8px;
    }

    .market-card-relation__text span {
        font-size: 7px;
    }

    .market-detail-stats {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 13px;
    }

    .market-detail-stats > div {
        padding: 10px;
    }

    .market-detail-stats > div:nth-child(3),
    .market-detail-stats > div:nth-child(5) {
        border-left: 0;
    }

    .market-detail-stats > div:nth-child(n + 3) {
        border-top: 1px solid rgba(47, 156, 255, 0.12);
    }

    .market-detail-stats > div:last-child {
        grid-column: 1 / -1;
    }

    .market-detail-stats strong {
        font-size: 14px;
    }

    .market-card-specs {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-card-specs > div:nth-child(3),
    .market-card-specs > div:nth-child(5) {
        border-left: 0;
    }

    .market-card-specs > div:nth-child(n + 3) {
        border-top: 1px solid rgba(47, 156, 255, 0.1);
    }

    .market-card-specs > div:last-child {
        grid-column: 1 / -1;
    }

    .market-price-chart-panel {
        grid-column: 1 / -1;
        padding: 11px 8px 5px;
    }

    .market-price-chart-panel__head {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .market-price-periods {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
    }

    .market-price-periods button {
        min-width: 0;
        padding-inline: 4px;
    }

    .market-price-chart,
    .market-chart-placeholder {
        min-height: 190px;
    }

    .market-price-chart__svg {
        min-height: 190px;
    }

    .market-lots-section {
        padding: 13px;
    }

    .market-section-head--lots {
        align-items: flex-start;
    }

    .market-section-head--lots p {
        font-size: 11px;
    }
}

@media (max-width: 390px) {
    .market-card-overview {
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }

    .market-card-overview__header h1 {
        font-size: 24px;
    }

    .market-card-meta-chip {
        font-size: 9px;
    }

    .market-card-relation__text {
        display: none;
    }

    .market-card-relation {
        display: block;
        padding: 2px;
    }

    .market-card-relation__media {
        width: 27px;
        height: 34px;
    }

    .market-detail-stats span,
    .market-card-specs span {
        font-size: 8px;
    }

    .market-detail-stats strong,
    .market-card-specs strong {
        font-size: 12px;
    }

    .market-lot-table__row {
        grid-template-columns: 1fr;
    }

    .market-lot-table__seller,
    .market-lot-table__buy {
        grid-column: 1;
    }
}

/* =========================
   Enhanced market price chart
========================= */

.market-price-chart-panel {
    padding: 15px 16px 10px;
    background:
        radial-gradient(circle at 42% 58%, rgba(21, 94, 220, 0.1), transparent 40%),
        linear-gradient(180deg, rgba(5, 18, 39, 0.92), rgba(2, 10, 23, 0.96));
    box-shadow:
        inset 0 0 0 1px rgba(120, 196, 255, 0.012),
        0 12px 28px rgba(0, 0, 0, 0.2);
}

.market-price-chart-panel__head {
    align-items: center;
    padding-bottom: 5px;
}

.market-price-chart-panel__title {
    min-width: 0;
}

.market-price-chart-panel__title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 4px;
}

.market-price-chart-panel__head h2 {
    margin: 0;
    font-size: 16px;
}

.market-price-chart-change {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.market-price-chart-change[hidden] {
    display: none !important;
}

.market-price-chart-change.is-positive {
    color: #65ef65;
    text-shadow: 0 0 11px rgba(74, 238, 105, 0.28);
}

.market-price-chart-change.is-negative {
    color: #ff5e70;
    text-shadow: 0 0 11px rgba(255, 69, 91, 0.25);
}

.market-price-chart-change.is-neutral {
    color: #9db3ce;
}

.market-price-periods {
    gap: 4px;
}

.market-price-periods button {
    min-width: 68px;
    height: 30px;
    padding-inline: 11px;
    font-size: 10px;
}

.market-price-chart {
    min-height: 300px;
}

.market-price-chart__svg {
    min-height: 300px;
}

.market-price-chart__grid {
    stroke: rgba(103, 145, 197, 0.12);
}

.market-price-chart__grid--vertical {
    stroke: rgba(103, 145, 197, 0.065);
}

.market-price-chart__axis-label {
    fill: rgba(184, 202, 224, 0.7);
    font-size: 10px;
    font-weight: 750;
}

.market-price-chart__axis-label--x {
    fill: rgba(190, 207, 228, 0.78);
    font-size: 9px;
}

.market-price-chart__line {
    stroke: #3d9cff;
}

.market-price-chart__extremum circle {
    stroke-width: 2;
    filter: drop-shadow(0 0 6px currentColor);
}

.market-price-chart__extremum text {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 11px;
    font-weight: 900;
}

.market-price-chart__extremum--max {
    color: #45ec72;
}

.market-price-chart__extremum--max circle {
    fill: #36e86c;
    stroke: rgba(180, 255, 199, 0.88);
}

.market-price-chart__extremum--max text {
    fill: #54ee7a;
}

.market-price-chart__extremum--min {
    color: #ff4a60;
}

.market-price-chart__extremum--min circle {
    fill: #ff354e;
    stroke: rgba(255, 179, 188, 0.9);
}

.market-price-chart__extremum--min text {
    fill: #ff5367;
}

.market-price-chart__current rect {
    fill: rgba(14, 77, 204, 0.96);
    stroke: rgba(80, 164, 255, 0.68);
    stroke-width: 1;
    filter: drop-shadow(0 0 8px rgba(29, 110, 255, 0.32));
}

.market-price-chart__current-ring {
    fill: rgba(15, 91, 226, 0.18);
    stroke: #3d9cff;
    stroke-width: 2;
}

.market-price-chart__current-dot {
    fill: #cceeff;
    stroke: #2d8eff;
    stroke-width: 1.5;
}

.market-price-chart__current-label,
.market-price-chart__current-price {
    fill: #dceeff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 850;
}

.market-price-chart__current-label {
    font-size: 8px;
}

.market-price-chart__current-price {
    fill: #ffffff;
    font-size: 12px;
    font-weight: 950;
}

.market-price-chart__volume-baseline {
    stroke: rgba(92, 158, 226, 0.13);
    stroke-width: 1;
}

.market-price-chart__volume-bar {
    fill: rgba(27, 117, 225, 0.5);
    filter: drop-shadow(0 0 3px rgba(30, 130, 255, 0.18));
}

.market-price-chart__volume-bar:hover {
    fill: rgba(47, 156, 255, 0.84);
}

.market-price-chart__volume-legend rect {
    fill: #168ce8;
}

.market-price-chart__volume-legend text {
    fill: rgba(189, 207, 229, 0.72);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 9px;
    font-weight: 750;
}

@media (max-width: 760px) {
    .market-price-chart-panel__head {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }

    .market-price-chart-panel__title-row {
        gap: 6px 9px;
    }

    .market-price-periods {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    .market-price-periods button {
        min-width: 0;
        padding-inline: 4px;
    }
}

@media (max-width: 560px) {
    .market-price-chart-panel {
        padding: 12px 7px 7px;
    }

    .market-price-chart-panel__head {
        padding-inline: 4px;
    }

    .market-price-chart-panel__head h2 {
        font-size: 14px;
    }

    .market-price-chart-change {
        font-size: 10px;
    }

    .market-price-periods button {
        height: 29px;
        font-size: 8px;
    }

    .market-price-chart,
    .market-price-chart__svg,
    .market-chart-placeholder {
        min-height: 270px;
    }

    .market-price-chart__axis-label {
        font-size: 8px;
    }

    .market-price-chart__axis-label--x {
        font-size: 7px;
    }

    .market-price-chart__extremum text {
        font-size: 8px;
    }

    .market-price-chart__volume-legend text {
        font-size: 7px;
    }
}

@media (max-width: 374px) {
    .market-price-chart-panel__title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .market-price-periods button {
        font-size: 7px;
    }
}

/* Seller avatars in available lots */
.market-lot-table__avatar {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.market-lot-table__avatar > img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
}

.market-lot-table__avatar-fallback {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    border-radius: inherit;
    color: #dff4ff;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 22%),
        linear-gradient(145deg, rgba(47, 156, 255, 0.4), rgba(20, 72, 145, 0.75));
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.market-lot-table__avatar-fallback[hidden] {
    display: none !important;
}

/* Mobile available lots: two information columns */
@media (max-width: 760px) {
    .market-lot-table__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "seller price"
            "payment published"
            "buy buy";
        gap: 12px 10px;
        align-items: start;
    }

    .market-lot-table__seller {
        grid-area: seller;
        grid-column: auto;
        min-width: 0;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(2) {
        grid-area: price;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(3) {
        grid-area: payment;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(4) {
        grid-area: published;
    }
}

/* Mobile lot purchase button: span the full panel width */
@media (max-width: 760px) {
    .market-lot-table__buy {
        grid-area: buy;
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
        max-width: none;
    }
}

/* Price chart: smooth trend line without visual towers */
.market-price-chart__line {
    stroke-width: 2.25;
    filter: drop-shadow(0 0 4px rgba(61, 156, 255, 0.42));
}

.market-price-chart__area {
    opacity: 0.88;
}

.market-price-chart__point {
    fill: transparent;
    stroke: transparent;
    stroke-width: 0;
    opacity: 0;
    filter: none;
    cursor: help;
}

.market-price-chart__point:hover {
    fill: rgba(218, 244, 255, 0.96);
    stroke: #2f9cff;
    stroke-width: 2;
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(47, 156, 255, 0.78));
}

/* =========================
   Sales history
========================= */

.market-card-overview__visual {
    display: grid;
    align-content: start;
    gap: 12px;
}

.market-sales-history {
    min-width: 0;
    padding: 13px 12px 10px;
    border: 1px solid rgba(47, 156, 255, 0.2);
    border-radius: 14px;
    color: var(--market-text);
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.045), rgba(47, 156, 255, 0.008)),
        rgba(2, 10, 23, 0.82);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.22),
        inset 0 0 16px rgba(47, 156, 255, 0.025);
    overflow: hidden;
}

.market-sales-history[hidden] {
    display: none !important;
}

.market-sales-history__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(47, 156, 255, 0.11);
}

.market-sales-history__head h2 {
    margin: 0;
    color: #f7fbff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.market-sales-history__head > span {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    padding-inline: 6px;
    border: 1px solid rgba(92, 190, 255, 0.22);
    border-radius: 999px;
    color: var(--market-blue-light);
    background: rgba(47, 156, 255, 0.07);
    font-size: 9px;
    font-weight: 900;
}

.market-sales-history__list {
    display: grid;
}

.market-sales-history__item {
    display: grid;
    grid-template-columns: 24px minmax(54px, auto) minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 36px;
    padding: 7px 2px;
}

.market-sales-history__item + .market-sales-history__item {
    border-top: 1px solid rgba(47, 156, 255, 0.075);
}

.market-sales-history__coin {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(92, 190, 255, 0.27);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.14), transparent 24%),
        rgba(47, 156, 255, 0.065);
    box-shadow: 0 0 8px rgba(47, 156, 255, 0.12);
}

.market-sales-history__coin .currency-icon {
    flex-basis: 15px;
    width: 15px;
    height: 15px;
}

.market-sales-history__price {
    color: #f4f9ff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.market-sales-history__date {
    min-width: 0;
    overflow: hidden;
    color: #9eb0c7;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-sales-history__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 34px;
    margin-top: 6px;
    padding: 0 10px;
    border: 0;
    border-top: 1px solid rgba(47, 156, 255, 0.11);
    color: #50acff;
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        text-shadow 0.18s ease;
}

.market-sales-history__more:hover:not(:disabled) {
    color: #90d3ff;
    background: rgba(47, 156, 255, 0.045);
    text-shadow: 0 0 8px rgba(47, 156, 255, 0.24);
}

.market-sales-history__more:focus-visible {
    outline: 2px solid rgba(120, 208, 255, 0.8);
    outline-offset: -2px;
}

.market-sales-history__more[hidden] {
    display: none !important;
}

@media (max-width: 820px) {
    .market-card-overview__visual {
        display: contents;
    }

    .market-card-overview .market-card-summary__media {
        grid-column: 1;
        grid-row: 1;
    }

    .market-card-overview__header {
        grid-column: 2;
        grid-row: 1;
    }

    .market-detail-stats {
        grid-row: 2;
    }

    .market-card-specs {
        grid-row: 3;
    }

    .market-price-chart-panel {
        grid-row: 4;
    }

    .market-sales-history {
        grid-column: 1 / -1;
        grid-row: 5;
        width: 100%;
        margin-top: 0;
    }

    .market-sales-history__item {
        grid-template-columns: 26px minmax(62px, auto) minmax(0, 1fr);
        min-height: 38px;
        padding-inline: 4px;
    }

    .market-sales-history__price {
        font-size: 12px;
    }

    .market-sales-history__date {
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    .market-sales-history {
        padding-inline: 10px;
    }

    .market-sales-history__item {
        grid-template-columns: 24px minmax(58px, auto) minmax(0, 1fr);
        gap: 7px;
    }

    .market-sales-history__price {
        font-size: 11px;
    }

    .market-sales-history__date {
        font-size: 9px;
    }
}

/* Fixed latest-sales history and equal desktop panel heights */
@media (min-width: 821px) {
    .market-price-chart-panel,
    .market-sales-history {
        height: 420px;
    }

    .market-price-chart-panel {
        display: flex;
        flex-direction: column;
    }

    .market-sales-history {
        display: flex;
        flex-direction: column;
    }

    .market-sales-history__list {
        flex: 1 1 auto;
        align-content: stretch;
        grid-template-rows: repeat(10, minmax(0, 1fr));
        min-height: 0;
    }

    .market-sales-history__item {
        min-height: 0;
    }
}

@media (max-width: 820px) {
    .market-price-chart-panel,
    .market-sales-history {
        height: auto;
    }

    .market-sales-history__list {
        grid-template-rows: none;
    }
}

/* Desktop detail layout: align the bottom of sales history and price chart */
@media (min-width: 821px) {
    .market-card-overview {
        align-items: stretch;
    }

    .market-card-overview__visual {
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
    }

    .market-sales-history {
        height: auto;
        min-height: 0;
        align-self: stretch;
    }

    .market-card-overview__main {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .market-price-chart-panel {
        flex: 1 1 auto;
        height: auto;
        min-height: 420px;
    }

    .market-price-chart {
        flex: 1 1 auto;
        min-height: 0;
    }

    .market-price-chart__svg {
        width: 100%;
        height: 100%;
        min-height: 0;
    }
}


/* =========================
   Card grid skeleton loader
========================= */
.market-card-skeleton {
    position: relative;
    min-width: 0;
    border: 1px solid rgba(47, 156, 255, 0.44);
    border-radius: 12px;
    background:
        radial-gradient(
            circle at 28% 12%,
            rgba(67, 171, 255, 0.13),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            rgba(7, 28, 58, 0.96),
            rgba(3, 10, 22, 0.98)
        );
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.15),
        0 10px 28px rgba(0, 0, 0, 0.3),
        inset 0 0 18px rgba(47, 156, 255, 0.035);
    overflow: hidden;
    isolation: isolate;
    pointer-events: none;
}

.market-card-skeleton::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        145deg,
        rgba(108, 204, 255, 0.62),
        rgba(47, 156, 255, 0.12),
        rgba(47, 156, 255, 0.42)
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.72;
}

.market-card-skeleton::after {
    content: "";
    position: absolute;
    top: -35%;
    bottom: -35%;
    left: -85%;
    z-index: 3;
    width: 58%;
    pointer-events: none;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(116, 205, 255, 0.045) 22%,
        rgba(184, 229, 255, 0.2) 50%,
        rgba(116, 205, 255, 0.045) 78%,
        transparent
    );
    filter: blur(1px);
    transform: skewX(-13deg);
    animation: market-card-skeleton-shimmer 1.35s ease-in-out infinite;
}


.market-card-skeleton:nth-of-type(5n + 2)::after {
    animation-delay: 55ms;
}

.market-card-skeleton:nth-of-type(5n + 3)::after {
    animation-delay: 110ms;
}

.market-card-skeleton:nth-of-type(5n + 4)::after {
    animation-delay: 165ms;
}

.market-card-skeleton:nth-of-type(5n + 5)::after {
    animation-delay: 220ms;
}

.market-card-skeleton--trade {
    width: 100%;
    min-height: 148px;
    aspect-ratio: 3 / 4;
}

.market-card-skeleton--trade::after {
    background: linear-gradient(
        100deg,
        transparent,
        rgba(116, 205, 255, 0.035) 20%,
        rgba(190, 232, 255, 0.18) 50%,
        rgba(116, 205, 255, 0.035) 80%,
        transparent
    );
}

.market-card-skeleton__badge,
.market-card-skeleton__price,
.market-card-skeleton__line {
    display: block;
    border: 1px solid rgba(111, 196, 255, 0.08);
    background:
        linear-gradient(
            90deg,
            rgba(85, 173, 255, 0.06),
            rgba(126, 203, 255, 0.15),
            rgba(85, 173, 255, 0.06)
        ),
        rgba(8, 31, 61, 0.88);
    box-shadow:
        inset 0 0 10px rgba(120, 196, 255, 0.025),
        0 3px 12px rgba(0, 0, 0, 0.16);
}

.market-card-skeleton__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 54px;
    height: 22px;
    border-radius: 999px;
}

.market-card-skeleton__price {
    position: absolute;
    right: 16%;
    bottom: 14px;
    left: 16%;
    height: clamp(22px, 2.5vw, 30px);
    border-radius: 999px;
}

.market-card-skeleton--own {
    display: flex;
    flex-direction: column;
}

.market-card-skeleton__media {
    position: relative;
    aspect-ratio: 3 / 4;
    background:
        radial-gradient(
            circle at 45% 15%,
            rgba(47, 156, 255, 0.12),
            transparent 38%
        ),
        linear-gradient(
            180deg,
            rgba(8, 33, 67, 0.84),
            rgba(3, 12, 26, 0.96)
        );
}

.market-card-skeleton__body {
    display: grid;
    gap: 13px;
    padding: 13px;
}

.market-card-skeleton__line {
    width: 72%;
    height: 10px;
    border-radius: 999px;
}

.market-card-skeleton__line--title {
    width: 88%;
    height: 13px;
}

.market-card-skeleton__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.market-card-skeleton__meta .market-card-skeleton__line {
    width: 100%;
    height: 24px;
    border-radius: 7px;
}

@media (max-width: 760px) {
    .market-card-skeleton__badge {
        top: 6px;
        left: 6px;
        width: 42px;
        height: 18px;
    }

    .market-card-skeleton__price {
        right: 12%;
        bottom: 10px;
        left: 12%;
        height: 20px;
    }
}

@media (max-width: 500px) {
    .market-card-skeleton__body {
        gap: 9px;
        padding: 10px;
    }

    .market-card-skeleton__line--title {
        height: 10px;
    }

    .market-card-skeleton__meta {
        gap: 5px;
    }

    .market-card-skeleton__meta .market-card-skeleton__line {
        height: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .market-card-skeleton::after {
        animation: none !important;
        left: 24%;
        opacity: 0.42;
    }
}

@keyframes market-card-skeleton-shimmer {
    0% {
        left: -85%;
    }

    58%,
    100% {
        left: 132%;
    }
}

/* Sales history participant avatars and click tooltip */
.market-sales-history__avatar {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(92, 190, 255, 0.38);
    border-radius: 50%;
    color: #dff4ff;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 22%),
        linear-gradient(145deg, rgba(47, 156, 255, 0.4), rgba(20, 72, 145, 0.75));
    box-shadow:
        0 0 8px rgba(47, 156, 255, 0.16),
        inset 0 0 7px rgba(255, 255, 255, 0.035);
    font: inherit;
    cursor: pointer;
    overflow: visible;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.market-sales-history__avatar:hover,
.market-sales-history__avatar.is-open {
    z-index: 12;
    border-color: rgba(120, 208, 255, 0.85);
    box-shadow:
        0 0 12px rgba(47, 156, 255, 0.34),
        0 0 22px rgba(47, 156, 255, 0.12);
    transform: scale(1.05);
}

.market-sales-history__avatar:focus-visible {
    z-index: 12;
    outline: 2px solid rgba(120, 208, 255, 0.88);
    outline-offset: 2px;
}

.market-sales-history__avatar > img,
.market-sales-history__avatar-fallback {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.market-sales-history__avatar > img {
    object-fit: cover;
    object-position: center;
}

.market-sales-history__avatar-fallback {
    display: grid;
    place-items: center;
    color: #e7f6ff;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.2), transparent 22%),
        linear-gradient(145deg, rgba(47, 156, 255, 0.4), rgba(20, 72, 145, 0.75));
    font-size: 10px;
    font-weight: 950;
    line-height: 1;
}

.market-sales-history__avatar-fallback[hidden] {
    display: none !important;
}

.market-sales-history__tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 9px);
    z-index: 30;
    display: grid;
    gap: 2px;
    width: max-content;
    max-width: 175px;
    padding: 7px 9px;
    border: 1px solid rgba(92, 190, 255, 0.42);
    border-radius: 9px;
    color: #f6fbff;
    background: rgba(2, 9, 21, 0.98);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.42),
        0 0 16px rgba(47, 156, 255, 0.17);
    text-align: left;
    transform: translateY(-50%);
    pointer-events: none;
}

.market-sales-history__tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -5px;
    width: 9px;
    height: 9px;
    border-bottom: 1px solid rgba(92, 190, 255, 0.42);
    border-left: 1px solid rgba(92, 190, 255, 0.42);
    background: rgba(2, 9, 21, 0.98);
    transform: translateY(-50%) rotate(45deg);
}

.market-sales-history__tooltip[hidden] {
    display: none !important;
}

.market-sales-history__tooltip > span {
    color: #7fc9ff;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1.1;
    text-transform: uppercase;
}

.market-sales-history__tooltip > strong {
    max-width: 155px;
    overflow: hidden;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Price chart requires at least four deals in the selected period */
.market-chart-placeholder--minimum {
    align-content: center;
    gap: 7px;
    padding: 24px;
}

.market-chart-placeholder--minimum strong {
    color: #eaf6ff;
    font-size: 14px;
    font-weight: 900;
}

.market-chart-placeholder--minimum span {
    max-width: 360px;
    color: var(--market-muted);
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 820px) {
    .market-sales-history__avatar {
        width: 26px;
        height: 26px;
    }

    .market-sales-history__tooltip {
        max-width: min(190px, calc(100vw - 110px));
    }
}

/* =========================
   Lot counter-offers
========================= */

.market-lot-table__head,
.market-lot-table__row {
    grid-template-columns:
        minmax(150px, 1.15fr)
        minmax(90px, 0.62fr)
        minmax(150px, 0.95fr)
        minmax(110px, 0.72fr)
        minmax(214px, 1.18fr);
}

.market-lot-table__actions {
    display: grid;
    gap: 7px;
}

.market-lot-table__actions .market-lot-table__buy,
.market-lot-table__offer {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding-inline: 8px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.15;
}

.market-lot-table__offer {
    color: #bfe7ff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.09), rgba(47, 156, 255, 0.025)),
        rgba(4, 18, 36, 0.82);
}

.market-offer-price-panel {
    display: grid;
    grid-template-columns: minmax(170px, 0.85fr) minmax(0, 1.15fr);
    gap: 12px;
    align-items: end;
    margin: 0 0 14px;
    padding: 13px;
    border: 1px solid rgba(92, 190, 255, 0.2);
    border-radius: 14px;
    background:
        radial-gradient(circle at 0 0, rgba(47, 156, 255, 0.1), transparent 42%),
        rgba(47, 156, 255, 0.04);
}

.market-offer-price-panel[hidden] {
    display: none !important;
}

.market-offer-price-panel__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.market-offer-price-panel__field > span:first-child {
    color: var(--market-blue-light);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.market-offer-price-panel__input-wrap {
    position: relative;
    display: block;
}

.market-offer-price-panel__input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 42px 0 12px;
    border: 1px solid rgba(47, 156, 255, 0.46);
    border-radius: 10px;
    outline: 0;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.06), rgba(47, 156, 255, 0.012)),
        var(--market-field);
    box-shadow:
        0 0 10px rgba(47, 156, 255, 0.1),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
    font: inherit;
    font-size: 17px;
    font-weight: 900;
}

.market-offer-price-panel__input-wrap input:hover:not(:disabled) {
    border-color: rgba(91, 191, 255, 0.72);
}

.market-offer-price-panel__input-wrap input:focus {
    border-color: rgba(104, 202, 255, 0.94);
    box-shadow:
        0 0 0 1px rgba(92, 190, 255, 0.1),
        0 0 17px rgba(47, 156, 255, 0.23),
        inset 0 0 12px rgba(47, 156, 255, 0.04);
}

.market-offer-price-panel__input-wrap input[aria-invalid="true"]:not(:placeholder-shown) {
    border-color: rgba(255, 95, 109, 0.58);
}

.market-offer-price-panel__input-wrap .currency-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    pointer-events: none;
}

.market-offer-price-panel__bounds {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.market-offer-price-panel__bounds > span {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(92, 190, 255, 0.12);
    border-radius: 10px;
    color: var(--market-muted);
    background: rgba(2, 9, 21, 0.4);
    font-size: 10px;
    line-height: 1.3;
}

.market-offer-price-panel__bounds strong {
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.market-trade-selection-actions > [hidden] {
    display: none !important;
}

.market-modal__dialog.is-offer-mode {
    width: min(820px, 100%);
    border-color: rgba(92, 190, 255, 0.22);
}

.market-modal__dialog.is-offer-mode .market-trade-selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-modal__dialog.is-offer-mode .market-danger-button {
    min-height: 42px;
}

@media (max-width: 1080px) {
    .market-lot-table__head,
    .market-lot-table__row {
        grid-template-columns:
            minmax(130px, 1fr)
            minmax(86px, 0.58fr)
            minmax(130px, 0.9fr)
            minmax(100px, 0.68fr)
            minmax(200px, 1.1fr);
    }
}

@media (max-width: 820px) {

    .market-lot-table__actions {
        width: 100%;
    }

    .market-lot-table__actions .market-lot-table__buy,
    .market-lot-table__offer {
        grid-area: auto;
        grid-column: auto;
        min-height: 40px;
    }

    .market-offer-price-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 560px) {
    .market-modal__dialog.is-offer-mode {
        width: min(100%, 500px);
    }

    .market-offer-price-panel {
        padding: 10px;
    }

    .market-offer-price-panel__bounds {
        gap: 6px;
    }

    .market-offer-price-panel__bounds > span {
        padding: 8px;
        font-size: 9px;
    }

    .market-lot-table__actions {
        gap: 6px;
    }

    .market-lot-table__actions .market-lot-table__buy,
    .market-lot-table__offer {
        padding-inline: 5px;
        font-size: 9px;
    }
}

@media (max-width: 374px) {
    .market-offer-price-panel__bounds {
        grid-template-columns: 1fr;
    }
}

/* Counter-offer lot layout on tablet and mobile */
@media (max-width: 820px) {
    .market-lot-table__seller {
        grid-area: seller;
        grid-column: auto;
        min-width: 0;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(2) {
        grid-area: price;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(3) {
        grid-area: payment;
    }

    .market-lot-table__row > .market-lot-table__cell:nth-child(4) {
        grid-area: published;
    }
}

/* =========================
   Offer modal visual refresh
========================= */

.market-modal__dialog.is-offer-mode {
    background:
        radial-gradient(circle at 12% 0%, rgba(109, 73, 255, 0.15), transparent 34%),
        radial-gradient(circle at 88% 4%, rgba(28, 203, 214, 0.11), transparent 31%),
        radial-gradient(circle at 50% 100%, rgba(47, 156, 255, 0.08), transparent 42%),
        rgba(3, 11, 24, 0.985);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.6),
        0 0 26px rgba(87, 108, 255, 0.12),
        0 0 42px rgba(39, 197, 216, 0.07),
        inset 0 0 34px rgba(92, 190, 255, 0.025);
}

.market-modal__dialog.is-offer-mode > .market-kicker {
    color: #83ccff;
    text-shadow: 0 0 9px rgba(80, 176, 255, 0.24);
}

.market-modal__dialog.is-offer-mode .market-offer-price-panel {
    border-color: rgba(116, 116, 255, 0.28);
    background:
        radial-gradient(circle at 5% 0%, rgba(119, 81, 255, 0.16), transparent 42%),
        radial-gradient(circle at 95% 100%, rgba(40, 206, 190, 0.1), transparent 45%),
        linear-gradient(135deg, rgba(31, 42, 83, 0.68), rgba(4, 24, 42, 0.72));
    box-shadow:
        inset 0 0 18px rgba(117, 116, 255, 0.035),
        0 10px 26px rgba(0, 0, 0, 0.18);
}

.market-modal__dialog.is-offer-mode
    .market-offer-price-panel__field > span:first-child {
    color: #a9a7ff;
}

.market-modal__dialog.is-offer-mode
    .market-offer-price-panel__input-wrap input {
    border-color: rgba(135, 121, 255, 0.56);
    background:
        linear-gradient(180deg, rgba(103, 79, 255, 0.1), rgba(47, 156, 255, 0.025)),
        rgba(2, 10, 24, 0.95);
    box-shadow:
        0 0 13px rgba(101, 83, 255, 0.16),
        inset 0 0 14px rgba(91, 116, 255, 0.035);
}

.market-modal__dialog.is-offer-mode
    .market-offer-price-panel__input-wrap input:focus {
    border-color: rgba(155, 145, 255, 0.94);
    box-shadow:
        0 0 0 1px rgba(155, 145, 255, 0.12),
        0 0 18px rgba(107, 89, 255, 0.28),
        inset 0 0 14px rgba(91, 116, 255, 0.055);
}

.market-offer-price-panel__bound {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    overflow: hidden;
}

.market-offer-price-panel__bound--min {
    border-color: rgba(61, 224, 166, 0.24);
    background:
        radial-gradient(circle at 10% 0%, rgba(61, 224, 166, 0.12), transparent 48%),
        rgba(5, 30, 31, 0.46);
    box-shadow: inset 0 0 14px rgba(61, 224, 166, 0.025);
}

.market-offer-price-panel__bound--max {
    border-color: rgba(255, 184, 84, 0.25);
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 184, 84, 0.13), transparent 48%),
        rgba(36, 24, 7, 0.42);
    box-shadow: inset 0 0 14px rgba(255, 184, 84, 0.025);
}

.market-offer-price-panel__bound-label {
    color: var(--market-muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.055em;
    line-height: 1.1;
    text-transform: uppercase;
}

.market-offer-price-panel__bound--min
    .market-offer-price-panel__bound-label {
    color: #72e6b5;
}

.market-offer-price-panel__bound--max
    .market-offer-price-panel__bound-label {
    color: #f4be69;
}

.market-offer-price-panel__bound-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    line-height: 1;
}

.market-offer-price-panel__bound-value strong {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
}

.market-offer-price-panel__bound-value .currency-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 6px rgba(72, 123, 255, 0.36));
}

/* Override the older generic bound styles. */
.market-offer-price-panel__bounds > .market-offer-price-panel__bound {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.market-modal__dialog.is-offer-mode .market-payment-search__field input {
    border-color: rgba(58, 190, 207, 0.48);
    background:
        linear-gradient(180deg, rgba(40, 205, 202, 0.055), rgba(47, 156, 255, 0.012)),
        var(--market-field);
    box-shadow:
        0 0 11px rgba(33, 191, 202, 0.11),
        inset 0 0 12px rgba(47, 156, 255, 0.025);
}

.market-modal__dialog.is-offer-mode .market-payment-search__field input:focus {
    border-color: rgba(82, 227, 222, 0.86);
    box-shadow:
        0 0 0 1px rgba(82, 227, 222, 0.08),
        0 0 17px rgba(40, 205, 202, 0.21),
        inset 0 0 12px rgba(47, 156, 255, 0.035);
}

.market-modal__dialog.is-offer-mode .market-payment-search__button {
    color: #86e8e3;
    border-color: rgba(52, 207, 202, 0.48);
    background: rgba(4, 37, 46, 0.78);
}

.market-modal__dialog.is-offer-mode .market-payment-card.is-selected {
    border-color: rgba(139, 114, 255, 0.98);
    box-shadow:
        0 0 24px rgba(106, 83, 255, 0.38),
        0 0 34px rgba(40, 205, 202, 0.09),
        inset 0 0 16px rgba(116, 99, 255, 0.16);
}

.market-modal__dialog.is-offer-mode .market-primary-button {
    background: linear-gradient(110deg, #745cff, #426dff 52%, #23bfc9);
    box-shadow:
        0 0 18px rgba(102, 80, 255, 0.32),
        0 0 34px rgba(35, 191, 201, 0.11);
}

.market-modal__dialog.is-offer-mode
    .market-primary-button:hover:not(:disabled) {
    background: linear-gradient(110deg, #8975ff, #5784ff 52%, #36d4d5);
}

.market-modal__dialog.is-offer-mode .market-secondary-button {
    border-color: rgba(127, 146, 255, 0.26);
    background: rgba(42, 48, 84, 0.54);
}

.market-modal__dialog.is-offer-mode .market-pagination {
    margin-top: 14px;
}

.market-modal__dialog.is-offer-mode .market-pagination__button.is-active {
    background: linear-gradient(135deg, #755dff, #2a9cd9);
    box-shadow:
        0 0 13px rgba(105, 83, 255, 0.3),
        0 0 24px rgba(42, 156, 217, 0.1);
}

/* Five cards on one offer page on desktop. */
@media (min-width: 760px) {
    .market-modal__dialog.is-offer-mode .market-payment-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 759px) {
    .market-modal__dialog.is-offer-mode .market-payment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .market-offer-price-panel__input-wrap input{
        height: 32px;
        font-size: 12px;
    }
}

@media (max-width: 430px) {
    .market-modal__dialog.is-offer-mode .market-payment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .market-offer-price-panel__bound-value strong {
        font-size: 13px;
    }

    .market-offer-price-panel__bound-value .currency-icon {
        flex-basis: 16px;
        width: 16px;
        height: 16px;
    }
}

/* Fix counter-offer action buttons overflow */
.market-lot-table__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.market-lot-table__actions .market-lot-table__buy,
.market-lot-table__actions .market-lot-table__offer {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding-inline: 7px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

/* Definitive mobile lot grid: prevent horizontal overflow */
@media (max-width: 820px) {
    .market-lot-table,
    .market-lot-list,
    .market-lot-table__row,
    .market-lot-table__actions {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .market-lot-table {
        overflow: hidden;
    }

    .market-lot-list {
        overflow: hidden;
    }

    .market-lot-table__row {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
        grid-template-areas:
            "seller price"
            "payment published"
            "actions actions";
        box-sizing: border-box;
        overflow: hidden;
    }

    .market-lot-table__seller,
    .market-lot-table__cell,
    .market-lot-table__actions {
        min-width: 0;
        max-width: 100%;
    }

    .market-lot-table__actions {
        grid-area: actions;
        grid-column: 1 / -1;
        justify-self: stretch;
        overflow: visible;
    }
}

@media (max-width: 760px) {

    .market-lot-table__actions .market-lot-table__buy,
    .market-lot-table__actions .market-lot-table__offer {
        grid-area: auto;
        grid-column: auto;
        justify-self: stretch;
    }
}

/* Mobile lot actions: keep both buttons in one row */
@media (max-width: 760px) {
    .market-lot-table__actions {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
        gap: 6px;
    }

    .market-lot-table__actions .market-lot-table__buy,
    .market-lot-table__actions .market-lot-table__offer {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 30px;
        padding: 5px 6px;
        font-size: clamp(8px, 2.35vw, 10px);
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }
}

@media (max-width: 390px) {
    .market-lot-table__actions {
        gap: 5px;
    }

    .market-lot-table__actions .market-lot-table__buy,
    .market-lot-table__actions .market-lot-table__offer {
        padding-inline: 4px;
        font-size: 8px;
    }
}

/* Offer modal: reserve space for close button and show 6 cards on mobile */
.market-modal__dialog.is-offer-mode > .market-kicker,
.market-modal__dialog.is-offer-mode > .market-modal__description {
    display: block;
    width: calc(100% - 54px);
    max-width: calc(100% - 54px);
    margin-right: 54px;
    overflow-wrap: anywhere;
}

@media (max-width: 759.98px) {
    .market-modal__dialog.is-offer-mode > .market-kicker,
    .market-modal__dialog.is-offer-mode > .market-modal__description {
        width: calc(100% - 48px);
        max-width: calc(100% - 48px);
        margin-right: 48px;
    }

    .market-modal__dialog.is-offer-mode .market-payment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================
   Mine offers
========================= */

.market-mine-offer-card {
    border-color: rgba(105, 105, 255, 0.46);
    background:
        radial-gradient(circle at 50% 0, rgba(105, 80, 255, 0.09), transparent 38%),
        linear-gradient(180deg, rgba(80, 167, 255, 0.03), rgba(255, 255, 255, 0.008)),
        var(--market-surface-2);
}

.market-mine-offer-card--seller {
    border-color: rgba(48, 205, 198, 0.42);
}

.market-mine-offer-card__direction {
    display: block;
    margin-bottom: 5px;
    color: #9e90ff;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-mine-offer-card--seller .market-mine-offer-card__direction {
    color: #67ded7;
}

.market-mine-offer-card__prices {
    margin-top: 10px;
}

.market-mine-offer-card__offer-price {
    color: #98f1d0 !important;
    text-shadow: 0 0 9px rgba(57, 223, 159, 0.15);
}

.market-mine-offer-card .market-own-card__actions .market-primary-button,
.market-mine-offer-card .market-own-card__actions .market-secondary-button {
    width: 100%;
}

.market-offer-person {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 11px;
    padding: 8px;
    border: 1px solid rgba(92, 190, 255, 0.12);
    border-radius: 10px;
    background: rgba(2, 9, 21, 0.42);
}

.market-offer-person__avatar {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border: 1px solid rgba(92, 190, 255, 0.42);
    border-radius: 50%;
    background: linear-gradient(145deg, #6f57ff, #168fad);
    box-shadow: 0 0 10px rgba(70, 130, 255, 0.18);
}

.market-offer-person__avatar img,
.market-offer-person__avatar-fallback {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.market-offer-person__avatar img {
    object-fit: cover;
}

.market-offer-person__avatar-fallback {
    display: grid;
    place-items: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 950;
}

.market-offer-person__avatar-fallback[hidden] {
    display: none !important;
}

.market-offer-person__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.market-offer-person__copy small {
    color: var(--market-muted-2);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.market-offer-person__copy strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-offer-status-badge--pending,
.market-offer-status-pill--pending {
    color: #ffe29a;
    border-color: rgba(242, 200, 107, 0.44);
}

.market-offer-status-badge--accepted,
.market-offer-status-pill--accepted {
    color: #8dffc0;
    border-color: rgba(47, 228, 134, 0.44);
}

.market-offer-status-badge--rejected,
.market-offer-status-badge--failed,
.market-offer-status-pill--rejected,
.market-offer-status-pill--failed {
    color: #ffb4bc;
    border-color: rgba(255, 95, 109, 0.44);
}

.market-offer-status-badge--cancelled,
.market-offer-status-badge--unknown,
.market-offer-status-pill--cancelled,
.market-offer-status-pill--unknown {
    color: #bac7d9;
    border-color: rgba(157, 174, 199, 0.34);
}

/* Mine offer modal */
.market-mine-offer-modal__dialog {
    width: min(900px, 100%);
    border-color: rgba(104, 104, 255, 0.3);
}

.market-mine-offer-modal__title {
    width: calc(100% - 54px);
    max-width: calc(100% - 54px);
    margin: 4px 54px 0 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.market-mine-offer-modal__content {
    min-width: 0;
}

.market-mine-offer-detail__exchange {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 0.78fr) minmax(150px, 1fr);
    gap: 18px;
    align-items: center;
}

.market-mine-offer-detail__card {
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 0;
    text-align: center;
}

.market-mine-offer-detail__card > span {
    color: var(--market-blue-light);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.market-mine-offer-detail__card-media {
    width: min(210px, 100%);
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(92, 190, 255, 0.42);
    border-radius: 14px;
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.36),
        0 0 18px rgba(47, 156, 255, 0.12);
}

.market-mine-offer-detail__card > strong {
    max-width: 100%;
    overflow: hidden;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-mine-offer-detail__card > small {
    color: var(--market-muted);
    font-size: 10px;
}

.market-mine-offer-detail__price {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 10px;
    min-width: 0;
    padding: 24px 14px;
    border: 1px solid rgba(125, 112, 255, 0.34);
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 0, rgba(108, 83, 255, 0.18), transparent 48%),
        rgba(5, 20, 42, 0.82);
    box-shadow:
        0 0 24px rgba(103, 83, 255, 0.12),
        inset 0 0 18px rgba(47, 156, 255, 0.03);
    text-align: center;
}

.market-mine-offer-detail__price::before,
.market-mine-offer-detail__price::after {
    content: "⇄";
    color: #73cfff;
    font-size: 26px;
    font-weight: 900;
    text-shadow: 0 0 12px rgba(47, 156, 255, 0.45);
}

.market-mine-offer-detail__price::after {
    display: none;
}

.market-mine-offer-detail__price > span {
    color: #adabff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.market-mine-offer-detail__price > strong {
    color: #ffffff;
    font-size: 26px;
    font-weight: 950;
}

.market-mine-offer-detail__price > small {
    color: var(--market-muted);
    font-size: 10px;
    line-height: 1.35;
}

.market-mine-offer-detail__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.market-mine-offer-detail__footer .market-offer-person {
    flex: 1 1 auto;
    margin: 0;
}

.market-offer-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid;
    border-radius: 999px;
    background: rgba(2, 9, 21, 0.64);
    font-size: 10px;
    font-weight: 900;
}

.market-mine-offer-detail__actions,
.market-mine-offer-editor__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-mine-offer-detail__actions > *,
.market-mine-offer-editor__actions > * {
    width: 100%;
}

/* Second-level confirmations and results */
.market-mine-offer-confirmation,
.market-mine-offer-result {
    display: grid;
    justify-items: center;
    gap: 13px;
    min-height: 290px;
    padding: 30px 20px 20px;
    border: 1px solid rgba(104, 104, 255, 0.22);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 0, rgba(105, 80, 255, 0.14), transparent 46%),
        rgba(2, 9, 21, 0.58);
    text-align: center;
}

.market-mine-offer-confirmation__icon,
.market-mine-offer-result__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(92, 190, 255, 0.42);
    border-radius: 20px;
    color: #9edbff;
    background: rgba(47, 156, 255, 0.1);
    box-shadow: 0 0 20px rgba(47, 156, 255, 0.14);
    font-size: 30px;
    font-weight: 950;
}

.market-mine-offer-confirmation__icon--accept,
.market-mine-offer-result--success .market-mine-offer-result__icon {
    color: #8dffc0;
    border-color: rgba(47, 228, 134, 0.48);
    background: rgba(47, 228, 134, 0.1);
    box-shadow: 0 0 20px rgba(47, 228, 134, 0.14);
}

.market-mine-offer-confirmation__icon--reject,
.market-mine-offer-result--error .market-mine-offer-result__icon {
    color: #ffb4bc;
    border-color: rgba(255, 95, 109, 0.48);
    background: rgba(255, 95, 109, 0.1);
    box-shadow: 0 0 20px rgba(255, 95, 109, 0.14);
}

.market-mine-offer-confirmation h4,
.market-mine-offer-result h4 {
    margin: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
}

.market-mine-offer-confirmation__price {
    display: grid;
    gap: 5px;
    padding: 13px 18px;
    border: 1px solid rgba(92, 190, 255, 0.18);
    border-radius: 12px;
    background: rgba(47, 156, 255, 0.045);
}

.market-mine-offer-confirmation__price > span {
    color: var(--market-muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.market-mine-offer-confirmation__price strong {
    color: #ffffff;
    font-size: 22px;
}

.market-mine-offer-confirmation .market-modal__actions {
    width: min(520px, 100%);
}

.market-mine-offer-result p {
    max-width: 520px;
    margin: 0;
    color: var(--market-muted);
    font-size: 13px;
    line-height: 1.5;
}

.market-mine-offer-result > .market-primary-button {
    width: min(300px, 100%);
    margin-top: 6px;
}

/* Outgoing offer editor */
.market-mine-offer-editor__cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.market-mine-offer-editor .market-payment-card {
    min-width: 0;
}

.market-mine-offer-editor
    .market-offer-price-panel__input-wrap
    input[aria-invalid="true"]:not(:placeholder-shown) {
    border-color: rgba(255, 95, 109, 0.62);
}

@media (max-width: 760px) {

    .market-mine-offer-modal__title {
        width: calc(100% - 48px);
        max-width: calc(100% - 48px);
        margin-right: 48px;
        font-size: 19px;
    }

    .market-mine-offer-detail__exchange {
        grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
        gap: 7px;
    }

    .market-mine-offer-detail__card-media {
        width: 100%;
        border-radius: 10px;
    }

    .market-mine-offer-detail__card > strong {
        font-size: 10px;
    }

    .market-mine-offer-detail__card > small {
        font-size: 8px;
    }

    .market-mine-offer-detail__price {
        align-self: center;
        padding: 12px 6px;
        border-radius: 16px;
    }

    .market-mine-offer-detail__price::before {
        font-size: 21px;
    }

    .market-mine-offer-detail__price > strong {
        font-size: 18px;
    }

    .market-mine-offer-detail__price > small {
        font-size: 7px;
    }

    .market-mine-offer-detail__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .market-offer-status-pill {
        width: 100%;
    }

    .market-mine-offer-editor__cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .market-mine-offer-modal {
        align-items: center;
        padding: 12px;
    }

    .market-mine-offer-modal__dialog {
        max-height: calc(100dvh - 24px);
        padding: 18px;
        border-radius: 20px;
    }

    .market-mine-offer-detail__actions,
    .market-mine-offer-editor__actions {
        gap: 8px;
    }

    .market-mine-offer-detail__actions button,
    .market-mine-offer-editor__actions button {
        padding-inline: 7px;
        font-size: 10px;
    }

    .market-mine-offer-confirmation,
    .market-mine-offer-result {
        min-height: 250px;
        padding: 24px 12px 16px;
    }
}

@media (max-width: 374px) {

    .market-mine-offer-detail__exchange {
        grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
        gap: 5px;
    }

    .market-mine-offer-detail__price {
        padding-inline: 4px;
    }

    .market-mine-offer-detail__price > strong {
        font-size: 15px;
    }
}

/* =========================
   Mine section selector
========================= */

.market-mine-view-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 340px));
    gap: 10px;
    width: min(690px, 100%);
    min-width: 0;
    margin-bottom: 16px;
}

.market-mine-view-filter__control {
    width: 100%;
    height: 42px;
}

.market-mine-view-filter__control > .select2-container {
    width: 100% !important;
    height: 42px;
}

.market-mine-view-filter__control
    .select2-container--anicard-neon-select
    .select2-selection--single {
    min-height: 42px;
    border-color: rgba(92, 190, 255, 0.58);
    border-radius: 12px;
    background:
        radial-gradient(circle at 0 0, rgba(47, 156, 255, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(47, 156, 255, 0.07), rgba(47, 156, 255, 0.015)),
        rgba(3, 14, 30, 0.94);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.15),
        inset 0 0 14px rgba(47, 156, 255, 0.03);
}

.market-mine-view-filter__control
    .select2-container--anicard-neon-select
    .select2-selection--single
    .select2-selection__rendered {
    min-height: 40px;
    padding-left: 14px;
    padding-right: 42px;
    color: #dff2ff;
    font-size: 13px;
    font-weight: 850;
    line-height: 40px;
}

.market-mine-view-filter__control
    .select2-container--anicard-neon-select
    .select2-selection--single
    .select2-selection__arrow {
    right: 10px;
    height: 40px;
}

.market-mine-view-filter__control
    .select2-container--anicard-neon-select.select2-container--open
    .select2-selection--single,
.market-mine-view-filter__control
    .select2-container--anicard-neon-select
    .select2-selection--single:hover {
    border-color: rgba(120, 208, 255, 0.82);
    box-shadow:
        0 0 18px rgba(47, 156, 255, 0.26),
        0 0 30px rgba(47, 156, 255, 0.1),
        inset 0 0 14px rgba(47, 156, 255, 0.04);
}

/* Native select fallback when Select2 is unavailable. */
.market-mine-view-filter.is-select2-fallback
    .market-mine-view-filter__control
    > select.js-anicard-select:not(.select2-hidden-accessible) {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 38px 0 13px !important;
    border: 1px solid rgba(92, 190, 255, 0.58) !important;
    border-radius: 12px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    appearance: auto;
    color: #dff2ff;
    background:
        linear-gradient(180deg, rgba(47, 156, 255, 0.07), rgba(47, 156, 255, 0.015)),
        rgba(3, 14, 30, 0.94);
    box-shadow:
        0 0 14px rgba(47, 156, 255, 0.15),
        inset 0 0 14px rgba(47, 156, 255, 0.03);
    font: inherit;
    font-size: 13px;
    font-weight: 850;
}

.market-mine-view-filter.is-select2-fallback
    .market-mine-view-filter__control
    > select
    option,
.market-mine-view-filter.is-select2-fallback
    .market-mine-view-filter__control
    > select
    optgroup {
    color: #f5f9ff;
    background: #051020;
}

@media (max-width: 760px) {
    .market-mine-view-filter {
        grid-template-columns: 1fr;
        width: 100%;
        margin-bottom: 14px;
    }
}

/* Compact final state for purchase / offer result */
.market-modal__dialog.is-trade-result {
    width: min(460px, calc(100vw - 32px));
    padding: 22px;
}

.market-modal__dialog.is-trade-result .market-modal__description {
    max-width: 360px;
    margin-bottom: 0;
}

.market-modal__dialog.is-trade-result .market-purchase-confirmation {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.market-modal__dialog.is-trade-result
    .market-purchase-confirmation__exchange {
    display: block;
    margin-top: 18px;
}

.market-modal__dialog.is-trade-result .market-mine-offer-result {
    min-height: 0;
    padding: 24px 18px;
    border-radius: 18px;
}

.market-modal__dialog.is-trade-result .market-mine-offer-result__icon {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    font-size: 27px;
}

.market-modal__dialog.is-trade-result .market-mine-offer-result h4 {
    max-width: 320px;
    font-size: 20px;
    line-height: 1.2;
}

.market-modal__dialog.is-trade-result .market-mine-offer-result p {
    max-width: 330px;
    font-size: 12px;
}

.market-modal__dialog.is-trade-result
    .market-purchase-confirmation__actions {
    grid-template-columns: 1fr;
    margin-top: 16px;
}

.market-modal__dialog.is-trade-result
    .market-purchase-confirmation__actions
    .market-primary-button {
    width: 100%;
    min-height: 48px;
}

@media (max-width: 500px) {
    .market-modal__dialog.is-trade-result {
        width: calc(100vw - 20px);
        padding: 18px;
        border-radius: 18px;
    }

    .market-modal__dialog.is-trade-result .market-mine-offer-result {
        padding: 22px 14px;
    }

    .market-modal__dialog.is-trade-result .market-mine-offer-result h4 {
        font-size: 18px;
    }
}

/* Single action in offer details occupies the full modal width */
.market-mine-offer-detail__actions > :only-child {
    grid-column: 1 / -1;
}

/* Accept / reject offer confirmation alignment */
.market-mine-offer-modal__dialog.is-offer-decision-confirmation
    > .market-kicker,
.market-mine-offer-modal__dialog.is-offer-decision-confirmation
    > .market-mine-offer-modal__title,
.market-mine-offer-modal__dialog.is-offer-decision-confirmation
    > .market-modal__description {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.market-mine-offer-modal__dialog.is-offer-decision-confirmation
    > .market-modal__description {
    max-width: 620px;
}

.market-mine-offer-confirmation {
    text-align: center;
}

.market-mine-offer-confirmation .market-modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(520px, 100%);
    gap: 10px;
}

.market-mine-offer-confirmation .market-modal__actions > button {
    width: 100%;
    min-width: 0;
}

.market-mine-offer-confirmation h4 {
    text-align: center;
}

/* Payment-card owner icon and tooltip */
.market-payment-card-shell {
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: visible;
}

.market-payment-card-shell.is-owner-popover-open {
    z-index: 30;
}

.market-payment-card-shell > .market-payment-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.market-payment-card-shell
    > .market-payment-card
    > .market-card-media {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.market-payment-card__owner-button {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 11px;
}

.market-payment-card__owner-popover {
    top: 34px;
    right: 6px;
    width: max-content;
    min-width: 132px;
    max-width: min(190px, calc(100vw - 40px));
    text-align: left;
}

.market-payment-card__owner-popover::before {
    right: 7px;
}

.market-payment-card-shell
    .market-payment-card.is-selected::after {
    left: 8px;
    right: auto;
}

.market-payment-card-shell
    .market-trade-card__owner-name {
    max-width: 165px;
}

@media (max-width: 760px) {
    .market-payment-card__owner-button {
        top: 5px;
        right: 5px;
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .market-payment-card__owner-popover {
        top: 31px;
        right: 5px;
        min-width: 120px;
        max-width: min(170px, calc(100vw - 28px));
        padding: 7px 9px;
    }

    .market-payment-card-shell
        .market-payment-card.is-selected::after {
        top: 6px;
        left: 6px;
        width: 22px;
        height: 22px;
    }
}

/* Busy state for transactional buttons */
button.is-market-busy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

button.is-market-busy::before {
    content: "";
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: market-spin 0.72s linear infinite;
}


/* Inline offer price validation */
.market-offer-price-panel__message {
    grid-column: 1 / -1;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--market-muted);
    background: rgba(2, 9, 21, 0.42);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.market-offer-price-panel__message:empty {
    display: none;
}

.market-offer-price-panel__message.is-error {
    border-color: rgba(255, 95, 109, 0.38);
    color: #ffbec4;
    background: rgba(255, 95, 109, 0.09);
}

.market-modal__dialog.is-offer-mode
    .market-offer-price-panel.has-error {
    border-color: rgba(255, 95, 109, 0.46);
    box-shadow:
        0 0 18px rgba(255, 95, 109, 0.09),
        inset 0 0 18px rgba(255, 95, 109, 0.025);
}

@media (max-width: 430px) {
    .market-offer-price-panel__message {
        padding: 8px 9px;
        font-size: 10px;
    }
}

/* =========================
   Mine deals
========================= */

.market-mine-deal-card {
    border-color: rgba(242, 200, 107, 0.44);
    background:
        radial-gradient(circle at 50% 0, rgba(242, 200, 107, 0.09), transparent 38%),
        linear-gradient(180deg, rgba(80, 167, 255, 0.03), rgba(255, 255, 255, 0.008)),
        var(--market-surface-2);
}

.market-mine-deal-card--seller {
    border-color: rgba(47, 228, 134, 0.4);
    background:
        radial-gradient(circle at 50% 0, rgba(47, 228, 134, 0.08), transparent 38%),
        linear-gradient(180deg, rgba(80, 167, 255, 0.03), rgba(255, 255, 255, 0.008)),
        var(--market-surface-2);
}

.market-mine-deal-card__direction {
    display: block;
    margin-bottom: 5px;
    color: #f2c86b;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.market-mine-deal-card--seller .market-mine-deal-card__direction {
    color: #82efb7;
}

.market-mine-deal-card__meta {
    align-items: start;
    margin-top: 10px;
}

.market-mine-deal-card__price {
    color: #ffe29a !important;
}

.market-mine-deal-card--seller .market-mine-deal-card__price {
    color: #98f1d0 !important;
}

.market-mine-deal-card__date {
    display: block !important;
    color: #d9e6f6 !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
}

.market-mine-deal-card .market-own-card__actions .market-secondary-button {
    width: 100%;
}

.market-deal-status-badge--buyer,
.market-deal-status-pill--buyer {
    color: #ffe29a;
    border-color: rgba(242, 200, 107, 0.44);
}

.market-deal-status-badge--seller,
.market-deal-status-pill--seller {
    color: #8dffc0;
    border-color: rgba(47, 228, 134, 0.44);
}

.market-mine-deal-detail__price {
    border-color: rgba(242, 200, 107, 0.34);
    background:
        radial-gradient(circle at 50% 0, rgba(242, 200, 107, 0.16), transparent 48%),
        rgba(5, 20, 42, 0.82);
    box-shadow:
        0 0 24px rgba(242, 200, 107, 0.1),
        inset 0 0 18px rgba(47, 156, 255, 0.03);
}

.market-mine-deal-detail__price > span {
    color: #ffe29a;
}

.market-mine-deal-detail__empty-card-media {
    display: grid;
    place-items: center;
    width: min(210px, 100%);
    aspect-ratio: 3 / 4;
    border: 1px dashed rgba(92, 190, 255, 0.3);
    border-radius: 14px;
    color: var(--market-muted);
    background:
        radial-gradient(circle at 50% 20%, rgba(47, 156, 255, 0.08), transparent 44%),
        rgba(2, 9, 21, 0.58);
    font-size: 28px;
    font-weight: 900;
}

@media (max-width: 760px) {
    .market-mine-deal-card__date {
        font-size: 8px !important;
    }

    .market-mine-deal-detail__empty-card-media {
        width: 100%;
        border-radius: 10px;
    }
}


/* =========================
   Strongly overpriced lot warning
========================= */

.market-lot-price-warning {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-left: 4px;
    padding: 0;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 128, 140, 0.72);
    border-radius: 7px;
    color: #fff0f2;
    background:
        linear-gradient(
            180deg,
            rgba(255, 116, 130, 0.28) 0%,
            rgba(163, 24, 45, 0.28) 48%,
            rgba(74, 7, 20, 0.82) 100%
        ),
        rgba(52, 7, 17, 0.96);
    box-shadow:
        0 2px 0 rgba(74, 5, 17, 0.96),
        0 0 11px rgba(255, 69, 89, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -8px 12px rgba(24, 0, 7, 0.2);
    cursor: pointer;
    vertical-align: middle;
    transition:
        color 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.market-lot-price-warning::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 2px;
    left: 3px;
    right: 3px;
    height: 42%;
    border-radius: 5px 5px 3px 3px;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.015)
    );
}

.market-lot-price-warning > span {
    position: relative;
    z-index: 1;
    display: block;
    width: 12px;
    height: 12px;
    pointer-events: none;
    filter: drop-shadow(0 1px 0 rgba(74, 3, 15, 0.9));
}

.market-lot-price-warning > span::before,
.market-lot-price-warning > span::after {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #ff9ca6 62%, #ff6877);
    box-shadow:
        0 0 6px rgba(255, 110, 124, 0.72),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.market-lot-price-warning > span::before {
    transform: rotate(45deg);
}

.market-lot-price-warning > span::after {
    transform: rotate(-45deg);
}

.market-lot-price-warning:hover,
.market-lot-price-warning.is-active {
    color: #ffffff;
    border-color: rgba(255, 166, 175, 0.98);
    background:
        linear-gradient(
            180deg,
            rgba(255, 142, 153, 0.42) 0%,
            rgba(202, 35, 58, 0.4) 48%,
            rgba(105, 10, 27, 0.92) 100%
        ),
        rgba(82, 9, 24, 0.98);
    box-shadow:
        0 3px 0 rgba(72, 4, 16, 0.98),
        0 0 15px rgba(255, 69, 89, 0.46),
        0 0 26px rgba(255, 69, 89, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        inset 0 -8px 13px rgba(35, 0, 9, 0.24);
    transform: translateY(-1px);
}

.market-lot-price-warning:active {
    box-shadow:
        0 1px 0 rgba(72, 4, 16, 0.98),
        0 0 10px rgba(255, 69, 89, 0.34),
        inset 0 2px 7px rgba(37, 0, 9, 0.32);
    transform: translateY(1px) scale(0.97);
}

.market-lot-price-warning:focus-visible {
    outline: 2px solid rgba(255, 169, 177, 0.94);
    outline-offset: 2px;
}

.market-lot-price-tooltip {
    position: fixed;
    z-index: 18000;
    width: min(286px, calc(100vw - 16px));
    padding: 10px 12px;
    border: 1px solid rgba(255, 95, 109, 0.46);
    border-radius: 10px;
    color: #ffd9dd;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 95, 109, 0.13), transparent 48%),
        rgba(28, 7, 14, 0.98);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.52),
        0 0 16px rgba(255, 69, 89, 0.16);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    pointer-events: auto;
}

.market-lot-price-tooltip[hidden] {
    display: none !important;
}

.market-lot-price-tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -5px;
    width: 9px;
    height: 9px;
    border-top: 1px solid rgba(255, 95, 109, 0.46);
    border-left: 1px solid rgba(255, 95, 109, 0.46);
    background: rgba(28, 7, 14, 0.98);
    transform: translateX(-50%) rotate(45deg);
}

.market-lot-price-tooltip.is-above::before {
    top: auto;
    bottom: -5px;
    border-top: 0;
    border-left: 0;
    border-right: 1px solid rgba(255, 95, 109, 0.46);
    border-bottom: 1px solid rgba(255, 95, 109, 0.46);
}

@media (max-width: 820px) {
    .market-lot-table__price {
        flex-wrap: wrap;
    }

    .market-lot-price-warning {
        flex-basis: 22px;
        width: 22px;
        height: 22px;
        margin-left: 3px;
        border-radius: 6px;
    }

    .market-lot-price-tooltip {
        font-size: 11px;
    }
}

/* Mobile lots filters: keep limited status last and half-width. */
@media (max-width: 760px) {
    .market-filter-bar--lots .market-filter-control--limits {
        grid-column: 1;
        grid-row: auto;
        order: 10;
    }
}
