/**
 * Theme Marketplace page (dark, matches downloads chrome).
 */
.marketplace-page {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 12% -8%, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(700px 400px at 90% 10%, rgba(94, 234, 212, 0.08), transparent 50%),
        linear-gradient(180deg, #050810 0%, #0b1220 45%, #070b12 100%);
    padding-top: 60px;
    color: #e8eef7;
}
.marketplace-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}
.marketplace-header {
    text-align: center;
    margin-bottom: 2rem;
}
.marketplace-header h1 {
    font-size: 2.4rem;
    margin: 0 0 0.75rem;
    color: #f8fafc;
}
.marketplace-header p {
    font-size: 1.05rem;
    color: #cbd5e1;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.55;
}
.marketplace-header code {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #5eead4;
    word-break: break-all;
}
.marketplace-howto {
    background: #121c2c;
    border: 1px solid rgba(94, 234, 212, 0.22);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.marketplace-howto h2 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    color: #f8fafc;
}
.marketplace-howto ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: #cbd5e1;
    line-height: 1.55;
}
.marketplace-howto-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}
.marketplace-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.marketplace-search input {
    width: min(360px, 100%);
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #e8eef7;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
}
.marketplace-search input:focus {
    outline: 2px solid rgba(14, 165, 233, 0.55);
    outline-offset: 1px;
}
.marketplace-count {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
}
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.mp-card {
    background: #121c2c;
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.mp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.mp-preview {
    position: relative;
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.75rem;
}
.mp-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.mp-card-body {
    padding: 1.15rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.mp-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    color: #f8fafc;
}
.mp-meta {
    margin: 0 0 0.65rem;
    color: #94a3b8;
    font-size: 0.88rem;
}
.mp-desc {
    margin: 0 0 0.75rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.45;
    flex: 1;
}
.mp-price {
    margin: 0 0 0.85rem;
    font-weight: 700;
    color: #5eead4;
}
.mp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.mp-btn {
    display: inline-block;
    background: #0ea5e9;
    color: #041018 !important;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
}
.mp-btn:hover {
    background: #38bdf8;
}
.mp-btn-secondary {
    background: rgba(148, 163, 184, 0.22);
    color: #e8eef7 !important;
}
.mp-btn-secondary:hover {
    background: rgba(148, 163, 184, 0.35);
}
.mp-btn-ghost {
    background: transparent;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.35);
}
.mp-btn-ghost:hover {
    color: #e8eef7 !important;
    border-color: rgba(148, 163, 184, 0.55);
}
.mp-btn-disabled {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.marketplace-error,
.marketplace-empty {
    background: #121c2c;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: #fecaca;
}
.marketplace-empty {
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.mp-modal[hidden] {
    display: none !important;
}
.mp-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.mp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 14, 0.72);
}
.mp-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    background: #121c2c;
    border: 1px solid rgba(94, 234, 212, 0.28);
    border-radius: 14px;
    padding: 1.35rem 1.5rem 1.5rem;
    color: #e8eef7;
}
.mp-modal-dialog h2 {
    margin: 0 0 1rem;
    color: #f8fafc;
}
.mp-modal-close {
    position: absolute;
    top: 0.55rem;
    right: 0.7rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.mp-modal-swatch {
    height: 160px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin-bottom: 0.85rem;
}
.mp-modal-hint {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.45;
}
@media (max-width: 640px) {
    .marketplace-header h1 {
        font-size: 1.85rem;
    }
}
