/* ==========================================================================
   IDP Marketplace — standalone page styles (WEB-221 chunk 3.5)
   Scoped under .mp-* prefix; no inheritance from studio's index.html.
   Brand variables match studio (--primary #2196F3, --accent #ffd869).
   ========================================================================== */

:root {
    --mp-primary: #2196F3;
    --mp-accent: #ffd869;
    --mp-text: #e4e8ff;
    --mp-text-dim: #8899ac;
    --mp-bg: #050810;
    --mp-card-bg: rgba(255, 255, 255, 0.03);
    --mp-card-border: rgba(255, 255, 255, 0.08);
    --mp-success: #6dd47e;
    --mp-error: #ff6b6b;
    --mp-warn: #ffa500;
    --mp-info: #58a6ff;
    --mp-radius-card: 12px;
    --mp-radius-pill: 99px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
    width: 100%;
    min-height: 100%;
    background: #020308;
}
body { width: 100%; min-height: 100%; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background-color: #020308;
    background-image: radial-gradient(circle at top left, #202738 0, #050810 55%, #020308 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--mp-text);
    line-height: 1.6;
    overflow-x: hidden;
}

#f5-nav-root {
    width: 100%;
    align-self: stretch;
}

/* ----- Wallet Connect Bar (legacy modal removed; shared F5 nav owns wallet UI) ----- */
.mp-wallet-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.mp-wallet-connected {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(33, 150, 243, 0.08);
    border: 1px solid rgba(33, 150, 243, 0.25);
    color: var(--mp-text);
    padding: 6px 14px;
    border-radius: var(--mp-radius-pill);
    font-size: 0.78rem;
}
.mp-wallet-connected .mp-wallet-icon { font-size: 0.95rem; color: var(--mp-primary); }
.mp-wallet-connected .mp-wallet-addr {
    font-family: monospace;
    font-size: 0.72rem;
    color: var(--mp-text-dim);
}

/* ----- Chain choice before the existing wallet selectors ----- */
.mp-wallet-chain-dialog {
    margin: auto;
    width: min(390px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    color: var(--mp-text);
    background: #101725;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 24px 80px #0009;
}
.mp-wallet-chain-dialog::backdrop { background: #020308b3; }
.mp-wallet-chain-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.mp-wallet-chain-heading h2 { font-size: 1.2rem; font-weight: 600; }
.mp-wallet-chain-heading button { background: none; border: 0; color: var(--mp-text-dim); font-size: 1.7rem; cursor: pointer; min-width: 36px; min-height: 36px; }
#mpWalletChainHint { margin: 8px 0 22px; color: #a8b5c7; font-size: .9rem; }
.mp-wallet-chain-options { display: grid; gap: 12px; }
.mp-wallet-chain-options button { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid #35445a; border-radius: 12px; background: #1a2537; color: var(--mp-text); text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
.mp-wallet-chain-options button span:first-child { font-size: 1.45rem; color: #72bdff; width: 26px; text-align: center; }
.mp-wallet-chain-options button span:last-child { margin-left: auto; color: #a8b5c7; }
.mp-wallet-chain-options button:hover { border-color: #72bdff; background: #203149; }
.mp-wallet-chain-dialog button:focus-visible, .mp-wallet-chain-back:focus-visible { outline: 2px solid #72bdff; outline-offset: 3px; }
#mpWalletChainStatus:not(:empty) { margin-top: 18px; font-size: .85rem; color: var(--mp-warn); }
.mp-wallet-chain-back { width: 100%; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mp-wallet-connection-notice { margin: 8px 24px; color: var(--mp-success); font-size: .85rem; text-align: right; }

/* ----- Buttons ----- */
.mp-btn {
    background: var(--mp-primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--mp-radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.mp-btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.mp-btn:active:not(:disabled) { transform: translateY(0); }
.mp-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mp-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--mp-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.mp-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--mp-primary);
}
.mp-btn-danger { background: var(--mp-error); color: #fff; }
.mp-btn-block { display: flex; width: 100%; justify-content: center; }
.mp-btn-sm { padding: 5px 12px; font-size: 0.75rem; }

/* ----- Layout ----- */
.mp-main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px 24px; }
.mp-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.mp-page-sub {
    color: var(--mp-text-dim);
    font-size: 0.88rem;
    margin-bottom: 22px;
}

/* ----- Section tabs ----- */
.mp-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 22px;
    flex-wrap: wrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mp-tabs::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}
.mp-tabs::-webkit-scrollbar-track,
.mp-tabs::-webkit-scrollbar-thumb {
    background: transparent;
}
.mp-tab {
    background: transparent;
    color: var(--mp-text-dim);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mp-tab:hover { color: var(--mp-text); }
.mp-tab.active {
    color: var(--mp-primary);
    border-bottom-color: var(--mp-primary);
    font-weight: 600;
}
.mp-tab-badge {
    background: rgba(33, 150, 243, 0.15);
    color: var(--mp-primary);
    border-radius: var(--mp-radius-pill);
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ----- Sections ----- */
.mp-section { display: none; }
.mp-section.active { display: block; }
.mp-section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.mp-section-hint {
    font-size: 0.78rem;
    color: var(--mp-text-dim);
    flex: 1 1 auto;
    min-width: 200px;
}

.mp-browse-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.mp-filter-rail {
    position: sticky;
    top: 98px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--mp-card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}
.mp-filter-rail-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}
.mp-filter-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    padding: 0;
    text-align: left;
    cursor: default;
}
.mp-filter-toggle i {
    display: none;
}
.mp-filter-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mp-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mp-filter-field span {
    font-size: 0.68rem;
    color: var(--mp-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mp-filter-rail .mp-filter-search,
.mp-filter-rail .mp-filter-collection {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 34px;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    line-height: 1.2;
}
.mp-filter-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}
.mp-filter-reset {
    justify-content: center;
}
.mp-browse-results {
    min-width: 0;
}
.mp-browse-summary {
    min-height: 28px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    color: var(--mp-text-dim);
}
.mp-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    padding: 2px 8px;
    border-radius: var(--mp-radius-pill);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mp-source-badge.idp {
    color: #fff;
    background: rgba(33, 150, 243, 0.22);
    border: 1px solid rgba(33, 150, 243, 0.4);
}
.mp-source-badge.jpg {
    color: #17130a;
    background: rgba(255, 216, 105, 0.88);
    border: 1px solid rgba(255, 216, 105, 0.95);
}
.mp-source-badge.tezos {
    color: #e9fffb;
    background: rgba(18, 153, 133, 0.22);
    border: 1px solid rgba(18, 153, 133, 0.48);
}
.mp-card-identity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    width: 100%;
}
.mp-card-verified-slot {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 28px;
    margin-left: auto;
}
.mp-card-verified-slot:empty {
    display: none;
}
.mp-card-verified-slot .mp-verified-badge {
    position: relative;
    right: auto;
    bottom: auto;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    font-size: 7px;
}
.mp-card-verified-slot .mp-verified-badge::after {
    right: 0;
    bottom: 110%;
}
.mp-card-price.pending {
    color: var(--mp-text-dim);
    font-size: 0.95rem;
}
.mp-card-external-note {
    font-size: 0.68rem;
    color: var(--mp-text-dim);
    line-height: 1.35;
}

/* ----- Banner ----- */
.mp-banner {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mp-banner-warn {
    background: rgba(255, 165, 0, 0.08);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: var(--mp-warn);
}
.mp-banner-info {
    background: rgba(33, 150, 243, 0.06);
    border: 1px solid rgba(33, 150, 243, 0.25);
    color: var(--mp-info);
}
.mp-banner i { font-size: 1.1rem; }

/* ----- Grid ----- */
.mp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

@media (min-width: 1024px) {
    .mp-browse-results .mp-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.mp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 30px;
    color: var(--mp-text-dim);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--mp-radius-card);
    font-size: 0.9rem;
}
.mp-empty i { font-size: 2rem; display: block; margin-bottom: 10px; opacity: 0.4; }

/* Fix 5 (2026-10-23): wallet-grid loading indicator. Shown while any held
 * wallet card (List for Sale / Not Listable) is still waiting for its media
 * layers to settle, so a cold first load never looks like an empty grid. */
.mp-wallet-grid-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: var(--mp-text-dim, #8a93b8);
    font-size: 0.85rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--mp-radius-card, 12px);
    background: rgba(255, 255, 255, 0.02);
}
.mp-empty-icon-only {
    padding: 32px 30px;
}
.mp-empty-icon-only i {
    margin-bottom: 0;
}

/* ----- Card ----- */
.mp-card {
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-card-border);
    border-radius: var(--mp-radius-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.28s ease, transform 0.15s ease, border-color 0.15s ease;
}
.mp-card:hover {
    transform: translateY(-2px);
    border-color: rgba(33, 150, 243, 0.4);
}
.mp-card-thumb {
    background: #1a1f3a;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 0.7rem;
    font-family: monospace;
    word-break: break-all;
    padding: 8px;
    text-align: center;
    overflow: hidden;
    position: relative;
}
.mp-card-thumb img,
.mp-card-thumb .mp-card-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    background: #1a1f3a;
    display: block;
}
.mp-card-thumb-fallback {
    font-size: 1.6rem;
    color: var(--mp-text-dim);
    opacity: 0.5;
    z-index: 0;
}
.mp-card.mp-card-bundle {
    border-color: rgba(255, 216, 105, 0.22);
}
.mp-card.mp-card-bundle:hover {
    border-color: rgba(255, 216, 105, 0.48);
}
.mp-card-thumb.mp-bundle-thumb {
    background:
        linear-gradient(145deg, rgba(255, 216, 105, 0.12), rgba(33, 150, 243, 0.08)),
        #080d17;
}
.mp-bundle-thumb-grid {
    position: absolute;
    inset: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    transform: rotate(-1deg);
}
.mp-bundle-thumb-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
        rgba(33, 150, 243, 0.1);
    color: rgba(255, 255, 255, 0.52);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.mp-bundle-thumb-tile:nth-child(2),
.mp-bundle-thumb-tile:nth-child(4) {
    transform: translateY(6px);
}
.mp-card-thumb .mp-bundle-thumb-tile img.mp-bundle-thumb-img {
    position: static;
    inset: auto;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    background: #080d17;
}
.mp-bundle-thumb-tile img + i {
    display: none;
}
.mp-bundle-label,
.mp-bundle-count-pill {
    position: absolute;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--mp-radius-pill);
    border: 1px solid rgba(255, 216, 105, 0.3);
    background: rgba(5, 8, 16, 0.82);
    color: #fff;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}
.mp-bundle-label {
    top: 10px;
    right: 10px;
    padding: 6px 9px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.mp-bundle-count-pill {
    left: 10px;
    bottom: 10px;
    padding: 7px 10px;
    font-size: 0.72rem;
    font-weight: 750;
    color: var(--mp-accent);
}
.mp-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
    line-height: 1.3;
}
.mp-card-meta {
    font-size: 0.72rem;
    color: var(--mp-text-dim);
    word-break: break-all;
    font-family: monospace;
}
.mp-card-price {
    font-size: 1.1rem;
    color: var(--mp-primary);
    font-weight: 700;
    margin-top: auto;
}
.mp-card-price-label {
    font-size: 0.7rem;
    color: var(--mp-text-dim);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}
.mp-card-price-note {
    display: block;
    margin-top: 2px;
    color: var(--mp-text-dim);
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.25;
}
.mp-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.mp-card-actions .mp-btn {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-card-actions .mp-btn i {
    flex: 0 0 auto;
}

/* Optimistic / pending state on a card */
.mp-card-pending {
    opacity: 0.7;
    border-style: dashed;
}
.mp-card-pending::after {
    content: 'Confirming on chain…';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(33, 150, 243, 0.18);
    color: var(--mp-info);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--mp-radius-pill);
}
.mp-card { position: relative; }

/* ----- Skeleton (loading) ----- */
@keyframes mp-shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.mp-skel {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.08) 200px, rgba(255,255,255,0.04) 400px);
    background-size: 800px 100%;
    animation: mp-shimmer 1.4s infinite linear;
    border-radius: 6px;
}
.mp-skel-card {
    background: var(--mp-card-bg);
    border: 1px solid var(--mp-card-border);
    border-radius: var(--mp-radius-card);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mp-skel-thumb { aspect-ratio: 1/1; }
.mp-skel-line { height: 12px; }
.mp-skel-line.short { width: 60%; }
.mp-skel-line.tiny { height: 8px; width: 40%; }

/* ----- Spinner ----- */
.mp-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--mp-primary);
    border-radius: 50%;
    animation: mp-spin 0.9s linear infinite;
    vertical-align: -3px;
    margin-right: 6px;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }

/* ----- Toasts ----- */
.mp-toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 48px));
}
.mp-toast {
    background: rgba(15, 22, 40, 0.96);
    border: 1px solid var(--mp-card-border);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--mp-text);
    font-size: 0.85rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    animation: mp-toast-in 0.25s ease;
    word-break: break-word;
}
@keyframes mp-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.mp-toast.kind-success { border-left-color: var(--mp-success); }
.mp-toast.kind-error   { border-left-color: var(--mp-error); }
.mp-toast.kind-info    { border-left-color: var(--mp-info); }
.mp-toast.kind-warn    { border-left-color: var(--mp-warn); }
.mp-toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}
.mp-toast-close {
    background: none;
    border: none;
    color: var(--mp-text-dim);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}
.mp-toast-close:hover { color: var(--mp-text); }
.mp-toast-msg { color: var(--mp-text-dim); font-size: 0.8rem; }
.mp-toast-hint {
    color: var(--mp-text-dim);
    font-size: 0.72rem;
    margin-top: 6px;
    font-style: italic;
}
.mp-toast-link {
    color: var(--mp-primary);
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 4px;
    display: inline-block;
}
.mp-toast-link:hover { text-decoration: underline; }

/* ----- Modal ----- */
.mp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 24px;
    animation: mp-fade-in 0.2s ease;
}
.mp-modal-overlay.active { display: flex; }
@keyframes mp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.mp-modal-shell {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
}
.mp-modal-box {
    background: #0c1220;
    border: 1px solid var(--mp-card-border);
    border-radius: var(--mp-radius-card);
    padding: 24px;
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative;
    animation: mp-modal-in 0.25s ease;
}
@keyframes mp-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.mp-modal-shell > .mp-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 8;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}
.mp-modal-shell > .mp-modal-close:hover,
.mp-modal-shell > .mp-modal-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    outline: 2px solid rgba(255, 216, 105, 0.72);
    outline-offset: 2px;
}
.mp-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}
.mp-modal-asset {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--mp-text);
    word-break: break-all;
    border: 1px solid var(--mp-card-border);
}
.mp-modal-asset strong { color: #fff; display: block; margin-bottom: 4px; }
.mp-modal-asset .mp-modal-asset-meta {
    color: var(--mp-text-dim);
    font-size: 0.72rem;
    font-family: monospace;
}
.mp-label {
    display: block;
    font-size: 0.72rem;
    color: var(--mp-text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mp-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--mp-card-border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--mp-text);
    font-size: 0.9rem;
    margin-bottom: 14px;
    transition: border-color 0.15s ease;
}
.mp-input:focus {
    outline: none;
    border-color: var(--mp-primary);
}
.mp-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.mp-modal-actions .mp-btn { flex: 1; justify-content: center; }
.mp-modal-help {
    font-size: 0.72rem;
    color: var(--mp-text-dim);
    margin-top: -10px;
    margin-bottom: 14px;
    font-style: italic;
}

/* ----- Wallet picker modal ----- */
.mp-wallet-list { display: flex; flex-direction: column; gap: 8px; }
.mp-wallet-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--mp-card-border);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--mp-text);
    font-size: 0.9rem;
    text-align: left;
    width: 100%;
}
.mp-wallet-row:hover {
    background: rgba(33, 150, 243, 0.08);
    border-color: var(--mp-primary);
}
.mp-wallet-row img { width: 28px; height: 28px; }

/* ----- Responsive ----- */
@media (max-width: 720px) {
    body {
        background-attachment: scroll;
        background-color: #020308;
        background-image: radial-gradient(circle at top left, rgba(24, 31, 46, 0.58) 0, #050810 46%, #020308 100%);
        background-size: 100vw 100vh;
    }
    .mp-verified-badge { width: 24px; height: 24px; right: 7px; bottom: 7px; font-size: 7px; }
    .mp-main { padding: 18px 14px 50px 14px; }
    .mp-page-title { font-size: 1.3rem; }
    .mp-browse-layout { grid-template-columns: 1fr; gap: 14px; }
    .mp-filter-rail { position: static; display: block; padding: 10px 12px; }
    .mp-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        cursor: pointer;
    }
    .mp-filter-toggle i {
        display: inline-flex;
        font-size: 0.75rem;
        color: var(--mp-text-dim);
        transition: transform 0.16s ease;
    }
    .mp-filter-rail:not(.is-collapsed) .mp-filter-toggle i {
        transform: rotate(180deg);
    }
    .mp-filter-body {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 10px;
    }
    .mp-filter-rail.is-collapsed .mp-filter-body {
        display: none;
    }
    .mp-filter-reset { grid-column: 1 / -1; }
    .mp-filter-pair { grid-column: 1 / -1; }
    .mp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .mp-toasts { bottom: 12px; right: 12px; left: 12px; max-width: none; }
    .mp-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .mp-tab { white-space: nowrap; }
}

/* ----- Filter bar (List for Sale tab) ----- */
.mp-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.mp-filter-search,
.mp-filter-collection {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--mp-card-border);
    border-radius: var(--mp-radius-pill);
    padding: 8px 14px;
    color: var(--mp-text);
    font-size: 0.85rem;
    transition: border-color 0.15s ease;
}
.mp-filter-search { flex: 1 1 220px; min-width: 180px; }
.mp-filter-collection { flex: 0 0 auto; max-width: 280px; }
.mp-filter-search:focus,
.mp-filter-collection:focus {
    outline: none;
    border-color: var(--mp-primary);
}
.mp-filter-collection option { background: #0c1220; color: var(--mp-text); }

/* ----- List-for-sale wallet source switch ----- */
.mp-chain-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--mp-card-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}
.mp-chain-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--mp-radius-pill);
    background: rgba(0, 0, 0, 0.25);
}
.mp-chain-option {
    appearance: none;
    border: 0;
    border-radius: var(--mp-radius-pill);
    background: transparent;
    color: var(--mp-text-dim);
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 12px;
}
.mp-chain-option.active {
    background: var(--mp-primary);
    color: #fff;
}
.mp-chain-option:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.mp-tezos-wallet-panel {
    display: flex;
    align-items: center;
    flex: 1 1 520px;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
.mp-tezos-wallet-panel[hidden] {
    display: none;
}
.mp-tezos-wallet-panel .mp-filter-search {
    flex: 1 1 240px;
    min-width: 180px;
    max-width: 390px;
}
.mp-tezos-wallet-status {
    flex: 1 1 260px;
    min-width: 220px;
    color: var(--mp-text-dim);
    font-size: 0.76rem;
    line-height: 1.35;
}
.mp-tezos-wallet-status[data-kind="success"] {
    color: var(--mp-success);
}
.mp-tezos-wallet-status[data-kind="warn"] {
    color: var(--mp-warn);
}

/* ----- Sync status line ----- */
.mp-sync-status {
    font-size: 0.78rem;
    color: var(--mp-text-dim);
    margin-bottom: 10px;
    padding: 6px 12px;
    border-left: 3px solid rgba(33, 150, 243, 0.4);
    background: rgba(33, 150, 243, 0.05);
    border-radius: 4px;
}
.mp-sync-status[data-kind="warn"] {
    color: var(--mp-warn);
    border-left-color: var(--mp-warn);
    background: rgba(255, 165, 0, 0.05);
}

/* ----- Collection card (vs asset card) — bigger thumb, badge for asset count ----- */
.mp-card-collection .mp-card-thumb {
    cursor: pointer;
    transition: transform 0.15s ease;
}
.mp-card-collection:hover .mp-card-thumb {
    transform: scale(1.02);
}
.mp-collection-count-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--mp-radius-pill);
    z-index: 5;
}
.mp-collection-cat-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(33, 150, 243, 0.85);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--mp-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 5;
}
.mp-collection-cat-badge.cat-edition { background: rgba(255, 216, 105, 0.9); color: #1a1a1a; }
.mp-collection-standard-text {
    margin: -1px 0 5px;
    color: rgba(255, 216, 105, 0.72);
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.1;
    text-transform: uppercase;
}
.mp-verified-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    background-image: url('/fre5hfence/RF5.png?v=2');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px #000;
    z-index: 8;
    cursor: default;
}
.mp-verified-badge::before { content: 'IDP'; }
.mp-verified-badge.green {
    border: 1px solid #4CAF50;
    box-shadow: 0 0 5px 1px #4CAF50;
}
.mp-verified-badge.yellow {
    border: 1px solid #FFC107;
    box-shadow: 0 0 5px 1px #FFC107;
}
.mp-verified-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: 110%;
    display: none;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: pre;
}
.mp-verified-badge:hover::after { display: block; }
.mp-modal-title .mp-verified-badge {
    position: relative;
    right: auto;
    bottom: auto;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    vertical-align: middle;
    font-size: 8px;
}
.mp-modal-title .mp-verified-badge::after {
    left: 100%;
    right: auto;
    bottom: 50%;
    transform: translateY(50%);
    margin-left: 10px;
}
.mp-royalty-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    color: #ffd869;
    vertical-align: middle;
    white-space: nowrap;
}
.mp-royalty-inline .fa-crown {
    color: #ffd869;
    flex: 0 0 auto;
}
.mp-royalty-rate {
    display: inline-flex;
    align-items: center;
    color: #ffd869;
    background: rgba(255, 216, 105, 0.10);
    border: 1px solid rgba(255, 216, 105, 0.25);
    border-radius: 7px;
    padding: 0 5px;
    font-size: 0.66rem;
    line-height: 1.28;
}
.mp-royalty-inline-header {
    margin-left: 6px;
    gap: 6px;
}
.mp-royalty-inline-header .mp-royalty-rate {
    padding: 1px 8px;
    font-size: 0.78rem;
}

/* ----- Wide modal (asset browser drill-in) ----- */
.mp-modal-shell-wide {
    max-width: 1100px;
}
.mp-modal-overlay-wide .mp-modal-box-wide {
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mp-modal-overlay-wide .mp-modal-box-wide::-webkit-scrollbar { width: 0; height: 0; display: none; }
.mp-modal-scroll-jump {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 560;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 216, 105, 0.38);
    background: rgba(12, 18, 32, 0.92);
    color: #ffd869;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
    cursor: pointer;
}
.mp-modal-scroll-jump:hover,
.mp-modal-scroll-jump:focus-visible {
    background: rgba(255, 216, 105, 0.14);
    outline: none;
}
.mp-modal-scroll-jump-top {
    left: max(12px, calc(50vw - 610px));
}
.mp-modal-scroll-jump-bottom {
    right: max(12px, calc(50vw - 610px));
}
.mp-asset-browser-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}
.mp-asset-browser-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}
@media (min-width: 721px) {
    .mp-asset-browser-title-row {
        padding-right: 46px;
    }
}
.mp-asset-browser-title-row .mp-modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 4px;
}
.mp-asset-browser-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 1 58%;
    min-width: 0;
    max-width: 640px;
    margin-top: 2px;
    color: var(--mp-text-dim);
    text-align: right;
}
.mp-asset-browser-type {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mp-asset-browser-policy-label {
    flex: 0 0 auto;
    font-size: 0.66rem;
    color: var(--mp-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mp-asset-browser-policy {
    min-width: 0;
    max-width: 44ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mp-text-dim);
    font-size: 0.68rem;
    line-height: 1.2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.mp-policy-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 216, 105, 0.24);
    border-radius: 6px;
    background: rgba(255, 216, 105, 0.08);
    color: var(--mp-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.mp-policy-copy-btn:hover {
    background: rgba(255, 216, 105, 0.16);
    border-color: rgba(255, 216, 105, 0.46);
}
.mp-asset-browser-identity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    margin: 0 0 8px;
}
.mp-asset-browser-seed-pill {
    display: flex;
    align-items: center;
    min-height: 0;
}
.mp-asset-browser-seed-pill:empty {
    display: none;
}
.mp-asset-browser-seed-pill .cph__seed-pill {
    margin: 0 0 2px;
}
.mp-asset-browser-verified-slot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}
.mp-asset-browser-verified-slot:empty {
    display: none;
}
.mp-asset-browser-identity-row:has(.mp-asset-browser-seed-pill:empty):has(.mp-asset-browser-verified-slot:empty) {
    display: none;
}
.mp-asset-browser-verified-slot .mp-verified-badge {
    position: relative;
    right: auto;
    bottom: auto;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}
.mp-asset-browser-verified-slot .mp-verified-badge::after {
    right: 0;
    bottom: 110%;
}
.mp-asset-browser-controls {
    display: grid;
    grid-template-columns: minmax(220px, 380px) minmax(300px, 1fr);
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 14px;
}
.mp-asset-browser-controls .mp-filter-search {
    width: 100%;
    max-width: 380px;
    flex: none;
}
.mp-asset-browser-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.mp-asset-browser-filter-row .mp-filter-collection {
    flex: 0 1 320px;
    min-width: 170px;
}
.mp-asset-browser-count {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    height: 34px;
    min-width: max-content;
    color: var(--mp-text-dim);
    font-size: 0.78rem;
    text-align: right;
}
.mp-grid-tight {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-gutter: auto;
}
.mp-grid-tight::-webkit-scrollbar { width: 0; height: 0; display: none; }
.mp-modal-box-wide,
.mp-grid-tight,
.mp-grid-tight .mp-card {
    min-width: 0;
}
.mp-grid-tight .mp-card {
    overflow: hidden;
}
.mp-grid-tight .mp-card-name,
.mp-grid-tight .mp-card-meta,
.mp-grid-tight .mp-card-external-note {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .mp-modal-scroll-jump {
        width: 34px;
        height: 34px;
    }
    .mp-modal-scroll-jump-top {
        left: 8px;
    }
    .mp-modal-scroll-jump-bottom {
        right: 8px;
    }
    .mp-asset-browser-title-row {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .mp-asset-browser-meta {
        justify-content: flex-start;
        text-align: left;
        flex: 1 1 auto;
        max-width: 100%;
        gap: 5px;
    }
    .mp-asset-browser-policy-label {
        font-size: 0.54rem;
    }
    .mp-asset-browser-policy {
        max-width: min(100%, 32ch);
        font-size: 0.54rem;
    }
    .mp-policy-copy-btn {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }
    .mp-asset-browser-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mp-asset-browser-controls .mp-filter-search {
        max-width: none;
    }
    .mp-asset-browser-filter-row .mp-filter-collection {
        flex: 1 1 auto;
        min-width: 0;
    }
    .mp-asset-browser-count {
        flex: 0 0 auto;
        font-size: 0.72rem;
        white-space: nowrap;
    }
    .mp-grid-tight {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* ----- Single asset detail modal ----- */
.mp-card[data-asset-detail="true"] {
    cursor: pointer;
}

.mp-asset-detail-shell {
    max-width: 1040px;
}

.mp-asset-detail-box {
    width: min(100%, 1040px);
    max-width: 1040px;
    padding: 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mp-asset-detail-box::-webkit-scrollbar { width: 0; height: 0; display: none; }

.mp-asset-detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
    gap: 22px;
    align-items: start;
}

.mp-asset-detail-media-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-asset-detail-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 320px;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 216, 105, 0.07), rgba(33, 150, 243, 0.055)),
        #060a12;
    border: 1px solid rgba(255, 216, 105, 0.16);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.045),
        0 18px 38px rgba(0, 0, 0, 0.28);
}

.mp-asset-detail-media-node {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #060a12;
}

.mp-asset-detail-image,
.mp-asset-detail-video,
.mp-asset-detail-model {
    object-fit: contain;
}

.mp-asset-detail-html {
    overflow: auto;
}

.mp-asset-detail-fullscreen-btn {
    justify-content: center;
}

.mp-asset-detail-info {
    min-width: 0;
    padding-right: 28px;
}

.mp-asset-detail-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.mp-asset-detail-title {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.18;
    word-break: break-word;
}

.mp-asset-detail-subtitle {
    margin-top: 6px;
    color: rgba(178, 190, 213, 0.88);
    font-size: 0.88rem;
    line-height: 1.35;
    word-break: break-word;
}

.mp-asset-detail-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-asset-detail-price span,
.mp-asset-detail-policy-row span {
    color: var(--mp-text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mp-asset-detail-price strong {
    color: var(--mp-accent);
    font-size: 1.25rem;
}
.mp-asset-detail-price em {
    flex: 1 0 100%;
    color: var(--mp-text-dim);
    font-size: 0.78rem;
    font-style: normal;
    text-align: right;
}

.mp-bundle-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
    max-height: min(360px, 48vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mp-bundle-detail-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
.mp-bundle-detail-item {
    display: grid;
    grid-template-rows: auto minmax(2.4em, auto);
    gap: 6px;
    min-width: 0;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}
.mp-bundle-detail-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background:
        linear-gradient(145deg, rgba(255, 216, 105, 0.12), rgba(33, 150, 243, 0.1)),
        #080d17;
    color: rgba(255, 255, 255, 0.48);
}
.mp-bundle-detail-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mp-bundle-detail-name {
    min-width: 0;
    color: var(--mp-text);
    font-size: 0.73rem;
    font-weight: 650;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

@media (max-width: 680px) {
    .mp-bundle-detail-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: min(390px, 46vh);
    }
}

.mp-asset-detail-policy-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.mp-asset-detail-policy-row code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(178, 190, 213, 0.9);
    font-size: 0.72rem;
}

.mp-asset-detail-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.mp-asset-detail-action-row .mp-btn {
    justify-content: center;
}

.mp-asset-detail-section {
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.027);
    overflow: hidden;
}

.mp-asset-detail-section-title {
    padding: 10px 12px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mp-asset-detail-properties {
    display: flex;
    flex-direction: column;
}

.mp-asset-detail-property-row {
    display: grid;
    grid-template-columns: minmax(88px, 0.8fr) minmax(110px, 1.1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}
.mp-asset-detail-property-row.no-rarity {
    grid-template-columns: minmax(88px, 0.8fr) minmax(110px, 1.4fr);
}

.mp-asset-detail-property-row:last-child {
    border-bottom: 0;
}

.mp-asset-detail-property-key {
    color: var(--mp-text-dim);
    font-size: 0.74rem;
    word-break: break-word;
}

.mp-asset-detail-property-value {
    color: #fff;
    font-size: 0.8rem;
    word-break: break-word;
}

.mp-asset-detail-property-rarity {
    color: var(--mp-accent);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.mp-asset-detail-rank-row {
    background: rgba(255, 216, 105, 0.045);
}

.mp-asset-detail-empty {
    padding: 14px 12px;
    color: var(--mp-text-dim);
    font-size: 0.82rem;
}

.mp-asset-detail-overlay.mp-asset-detail-source-fullscreen {
    z-index: 6000;
    padding: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: none;
}

.mp-asset-detail-source-fullscreen .mp-asset-detail-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
}

.mp-asset-detail-source-fullscreen .mp-asset-detail-box {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    animation: none;
    transform: none;
}

.mp-asset-detail-source-fullscreen .mp-asset-detail-info,
.mp-asset-detail-source-fullscreen .mp-asset-detail-fullscreen-btn,
.mp-asset-detail-source-fullscreen .mp-modal-close {
    visibility: hidden;
    pointer-events: none;
}

.mp-asset-detail-media.mp-asset-detail-media-fullscreen {
    position: fixed;
    inset: 24px;
    z-index: 1;
    width: auto;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    pointer-events: auto;
}

.mp-asset-fullscreen {
    --mp-in-place-fullscreen: 1;
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    padding: 24px;
}

.mp-asset-fullscreen.active {
    display: flex;
}

.mp-asset-fullscreen-host {
    width: min(100%, 1200px);
    height: min(100%, 90vh);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-asset-fullscreen-host img,
.mp-asset-fullscreen-host video,
.mp-asset-fullscreen-host model-viewer {
    position: static;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mp-asset-fullscreen-host iframe {
    position: static;
    width: 100%;
    height: 100%;
    border: 0;
    background: #05070c;
}

.mp-asset-fullscreen.mp-asset-fullscreen-in-place {
    z-index: 6001;
    align-items: initial;
    justify-content: initial;
    padding: 0;
    background: transparent;
    pointer-events: none;
}

.mp-asset-fullscreen.mp-asset-fullscreen-in-place.active {
    display: block;
}

.mp-asset-fullscreen.mp-asset-fullscreen-in-place .mp-asset-fullscreen-host {
    display: none;
}

.mp-asset-fullscreen-close {
    position: absolute;
    z-index: 6002;
    top: 18px;
    right: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

@media (max-width: 760px) {
    .mp-asset-detail-box {
        padding: 18px;
    }

    .mp-asset-detail-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mp-asset-detail-media {
        min-height: 0;
    }

    .mp-asset-detail-info {
        padding-right: 0;
    }

    .mp-asset-detail-title {
        font-size: 1.12rem;
    }

    .mp-asset-detail-action-row .mp-btn {
        flex: 1 1 100%;
    }

    .mp-asset-detail-property-row {
        grid-template-columns: minmax(72px, 0.8fr) minmax(88px, 1fr) auto;
        gap: 7px;
        padding: 8px 10px;
    }

    .mp-asset-detail-property-row.no-rarity {
        grid-template-columns: minmax(72px, 0.8fr) minmax(88px, 1fr);
    }

    .mp-asset-detail-property-key,
    .mp-asset-detail-property-value,
    .mp-asset-detail-property-rarity {
        font-size: 0.7rem;
    }

    .mp-asset-detail-media.mp-asset-detail-media-fullscreen {
        inset: 14px;
    }

    .mp-asset-fullscreen {
        padding: 14px;
    }
}

/* ----- Rarity badge on individual asset cards ----- */
.mp-card-rarity-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(255, 216, 105, 0.85);
    color: #1a1a1a;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--mp-radius-pill);
    z-index: 9;
}

/* ----- Multi-format card thumb (image / video / iframe HTML / 3D model) -----
 *
 * C14 ported the dashboard's `applyCollectionPreview` which mounts media with
 * classes `thumb-media`, `thumb-media-html`, `thumb-media-video`,
 * `thumb-media-img`, `thumb-media-model` (wrapped in `.html-thumb-wrapper`
 * for HTML). The previous selectors here targeted the legacy
 * `.mp-card-thumb-iframe` / `.mp-card-thumb-video` names from the deleted
 * media-loader.js; without these rules, iframes mounted on hover defaulted to
 * the browser's 300x150 inline size and overflowed the thumb.
 *
 * Mirrors the dashboard's positioning at index.html:847-853 but scoped to
 * `.mp-card-thumb` (marketplace parent class) instead of `.col-thumb`.
 */
.mp-card-thumb .html-thumb-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.mp-card-thumb .thumb-media-html,
.mp-card-thumb .thumb-media-video,
.mp-card-thumb .thumb-media-model {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px;
    background: #1a1f3a;
    display: block;
    object-fit: cover;
}
.mp-card-thumb .thumb-media-html {
    pointer-events: none; /* don't steal scroll/click while in the grid */
}
/* Match the dashboard's HTML thumbnail viewport: render at a larger size,
   then fit the complete artwork into the card instead of clipping its corner. */
.mp-card-thumb .html-thumb-wrapper iframe.thumb-media-html {
    width: 400%;
    height: 400%;
    transform: scale(0.25);
    transform-origin: top left;
    overflow: hidden;
}
/* CC10.K (2026-05-07): broaden hover-interactive rule to ANY .mp-card variant.
   Old selector only matched .mp-card-collection (the listable collection grid),
   so chain-listing cards on Browse + My Listings (just .mp-card, no -collection)
   never got pointer-events:auto and the hover-revealed iframe was visible but
   not interactive. Marketplace listed-section thumbs should behave the same
   as listable thumbs. Same applies to drill-in asset cards (.mp-card-asset). */
.mp-card:hover .mp-card-thumb .thumb-media-html {
    pointer-events: auto; /* allow interaction with revealed iframe on hover */
}

/* ----- Last-sale placeholder badge (Part B — data wired in Round 7) ----- */
.mp-card-lastsale-badge {
    font-size: 0.68rem;
    color: var(--mp-text-dim);
    opacity: 0.65;
    padding: 2px 0 0;
    line-height: 1.3;
}

/* ----- Rarity estimated-from-wallet note above the drill-in grid ----- */
.mp-rarity-source-note {
    font-size: 0.68rem;
    color: var(--mp-text-dim);
    opacity: 0.75;
    margin-bottom: 8px;
    font-style: italic;
}

/* ----- Disabled card (e.g. FT — not listable) ----- */
.mp-card-disabled {
    opacity: 0.55;
    filter: grayscale(0.4);
}
.mp-card-disabled .mp-card-thumb {
    background: rgba(255, 255, 255, 0.02);
}
.mp-card-disabled .mp-btn[disabled] {
    cursor: not-allowed;
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
    color: var(--mp-text-dim);
}

.mp-card-view-only {
    border-color: rgba(18, 153, 133, 0.28);
}
.mp-card-view-only .mp-card-meta {
    color: rgba(233, 255, 251, 0.72);
    font-family: inherit;
    word-break: normal;
}
.mp-card-view-only .mp-btn[disabled] {
    justify-content: center;
    white-space: normal;
    line-height: 1.2;
    opacity: 0.82;
    background: rgba(18, 153, 133, 0.12);
    border-color: rgba(18, 153, 133, 0.24);
    color: rgba(233, 255, 251, 0.82);
}
.mp-view-only-card-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 2px;
}
.mp-view-only-card-facts {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 7px 9px;
}
.mp-view-only-card-fact {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
}
.mp-view-only-card-fact:last-child {
    border-bottom: 0;
}
.mp-view-only-card-fact span {
    flex: 0 0 auto;
    color: var(--mp-text-dim);
}
.mp-view-only-card-fact strong {
    min-width: 0;
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-family: monospace;
    font-weight: 600;
    text-align: right;
}
.mp-view-only-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.mp-view-only-card-tags span {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--mp-radius-pill);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(233, 255, 251, 0.84);
    padding: 3px 7px;
    font-size: 0.68rem;
    line-height: 1.15;
}

/* ===== C2: Rarity sync UX (Bug C v2) ===== */

/* Syncing badge — replaces wallet-only note during global-cache poll */
.mp-rarity-source-note--syncing {
    color: var(--accent, #6da4ff);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    min-width: 16px;
    margin-bottom: 0;
}
.mp-rarity-source-note--syncing .mp-rarity-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: mp-rarity-spin 0.8s linear infinite;
}
@keyframes mp-rarity-spin {
    to { transform: rotate(360deg); }
}

/* Failed-sync state — keeps the wallet note text but a subtle visual hint */
.mp-rarity-source-note--failed {
    opacity: 0.7;
}

/* Per-asset rank pill on cards */
.mp-card-rarity-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 9;
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent, #6da4ff);
    background: rgba(109, 164, 255, 0.1);
    border: 1px solid rgba(109, 164, 255, 0.3);
    border-radius: 12px;
    line-height: 1.4;
    cursor: help;
}
.mp-card-rarity-rank:hover {
    background: rgba(109, 164, 255, 0.2);
}

/* Subtle swap-in transition when rarity upgrades from wallet → global-cache */
.mp-rarity-source-note,
.mp-card-rarity-badge,
.mp-card-rarity-rank {
    transition: opacity 0.25s ease, color 0.25s ease;
}

/* E: Asset count label in drill-in modal — lives across from the property dropdown. */
.mp-asset-browser-count {
    font-size: 0.78rem;
    color: var(--mp-text-dim);
    margin: 0;
    font-family: inherit;
    word-break: normal;
}

/* Desktop keeps the same compact count so it aligns with the dropdown. */
@media (min-width: 768px) {
    .mp-asset-browser-count {
        font-size: 0.78rem;
        margin: 0;
    }
}

/* Premium collectible grid polish - subtle depth for Browse and drill-in cards. */
.mp-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
        rgba(5, 8, 16, 0.92);
    border-color: rgba(255, 216, 105, 0.13);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.28s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.mp-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 216, 105, 0.45), rgba(33, 150, 243, 0.24), transparent);
    opacity: 0.55;
    pointer-events: none;
}

.mp-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 216, 105, 0.3);
    box-shadow:
        0 22px 42px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(33, 150, 243, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mp-card-thumb {
    background:
        linear-gradient(145deg, rgba(255, 216, 105, 0.08), rgba(33, 150, 243, 0.055)),
        #080d17;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.55),
        inset 0 1px 18px rgba(255, 255, 255, 0.035);
}

.mp-card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
    pointer-events: none;
    z-index: 6;
}

.mp-card-thumb img,
.mp-card-thumb .mp-card-thumb-img,
.mp-card-thumb .thumb-media-html,
.mp-card-thumb .thumb-media-video,
.mp-card-thumb .thumb-media-model {
    border-radius: 7px;
}

.mp-card-name {
    color: #f7f9ff;
    font-weight: 650;
}

.mp-card-meta {
    color: rgba(178, 190, 213, 0.82);
}

.mp-card-price {
    color: var(--mp-accent);
    text-shadow: 0 0 14px rgba(255, 216, 105, 0.16);
}

.mp-card-identity-row {
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    padding-top: 8px;
}

.mp-filter-rail,
.mp-chain-panel {
    background:
        linear-gradient(180deg, rgba(5, 8, 16, 0.82), rgba(2, 3, 8, 0.88));
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.mp-card,
.mp-skel-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
        rgba(3, 6, 12, 0.94);
    border-color: rgba(255, 216, 105, 0.09);
}

.mp-card::before {
    opacity: 0.3;
}

.mp-card-rarity-badge,
.mp-card-rarity-rank {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.mp-grid-tight .mp-card {
    padding: 12px;
}

@media (max-width: 520px) {
    .mp-chain-panel {
        align-items: stretch;
    }

    .mp-chain-switch,
    .mp-tezos-wallet-panel,
    .mp-tezos-wallet-panel .mp-filter-search,
    .mp-tezos-wallet-panel .mp-btn,
    .mp-tezos-wallet-status {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .mp-chain-switch {
        justify-content: stretch;
    }

    .mp-chain-option {
        flex: 1 1 0;
        text-align: center;
    }

    .mp-tezos-wallet-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .mp-tezos-wallet-panel .mp-filter-search,
    .mp-tezos-wallet-panel .mp-btn,
    .mp-tezos-wallet-status {
        flex: 0 0 auto;
    }

    .mp-card-actions {
        gap: 4px;
    }

    .mp-card-actions .mp-btn {
        gap: 4px;
        padding: 7px 9px;
        font-size: 0.72rem;
    }
}
/* Tezos uses the existing Market card and form layout. */
.mp-grid[hidden], [data-tezos-more][hidden], [hidden].mp-tezos-activity { display: none; }
.mp-tezos-review { margin: auto; box-sizing: border-box; width: min(92vw, 480px); max-height: 88vh; overflow: auto; padding: 26px; border: 1px solid #343c47; border-radius: 18px; background: #141a22; color: #f1f4f7; }
.mp-tezos-review::backdrop { background: rgba(0, 0, 0, .72); }
.mp-tezos-review h2 { font-size: 1.2rem; margin: 0 28px 20px 0; }
.mp-tezos-review .mp-modal-help { margin-top: 10px; }
.mp-tezos-close { float: right; border: 0; background: transparent; color: inherit; font-size: 1.6rem; cursor: pointer; }
.mp-tezos-review-total { font-size: 1.15rem; font-weight: 600; }
.mp-tezos-activity { margin: 14px 0; padding: 12px 16px; border: 1px solid #343c47; border-radius: 12px; }
.mp-tezos-activity summary { cursor: pointer; }
.mp-tezos-receipt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; overflow-wrap: anywhere; }
.mp-tezos-receipt strong { text-transform: capitalize; }

.mp-tezos-receipt a { color: #78caff; }

.mp-filter-field[hidden] { display: none; }
