:root {
    color-scheme: dark;

    --background: #08090d;
    --background-elevated: #0d0f15;
    --background-soft: #11141c;
    --background-hover: #161a24;

    --accent: rgb(118, 118, 255);
    --accent-hover: rgb(139, 139, 255);
    --accent-soft: rgba(118, 118, 255, 0.12);
    --accent-border: rgba(118, 118, 255, 0.28);
    --accent-glow: rgba(118, 118, 255, 0.22);

    --text: #f4f5fa;
    --text-secondary: #a6aaba;
    --text-muted: #74798b;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.13);

    --success: #52d395;
    --success-soft: rgba(82, 211, 149, 0.12);

    --danger: #ff6f7d;
    --danger-soft: rgba(255, 111, 125, 0.11);

    --radius-small: 8px;
    --radius: 14px;
    --radius-large: 20px;

    --shadow:
        0 24px 80px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(118, 118, 255, 0.14),
            transparent 38%
        ),
        var(--background);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;

    border-bottom: 1px solid var(--border);

    background: rgba(8, 9, 13, 0.82);

    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 74px;
}

.brand {
    display: inline-flex;
    gap: 11px;
    align-items: center;

    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-mark {
    width: 12px;
    height: 12px;

    border-radius: 4px;

    background: var(--accent);

    box-shadow:
        0 0 0 5px var(--accent-soft),
        0 0 25px var(--accent-glow);

    transform: rotate(45deg);
}

.header-navigation {
    display: flex;
    gap: 14px;
    align-items: center;
}

.navigation-link,
.back-link {
    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;

    transition: color 150ms ease;
}

.navigation-link:hover,
.back-link:hover {
    color: var(--text);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 0 17px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease,
        color 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    border-color: var(--accent);

    background: var(--accent);
    color: white;

    box-shadow: 0 10px 30px var(--accent-glow);
}

.button-primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.button-secondary {
    border-color: var(--border-strong);

    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.button-large {
    min-height: 48px;
    padding: 0 22px;
}

.button-full {
    width: 100%;
    min-height: 46px;
}

.hero {
    padding: 116px 0 108px;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 80px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;

    margin-bottom: 18px;

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1,
.dashboard-heading h1,
.auth-heading h1,
.section-heading h2 {
    margin: 0;

    letter-spacing: -0.045em;
    line-height: 1.03;
}

.hero h1 {
    max-width: 760px;

    font-size: clamp(44px, 6vw, 76px);
}

.hero h1 span {
    color: var(--accent);
}

.hero-description {
    max-width: 650px;
    margin: 26px 0 0;

    color: var(--text-secondary);

    font-size: 18px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 36px;
}

.invite-notice {
    margin: 18px 0 0;

    color: var(--text-muted);

    font-size: 13px;
}

.hero-card,
.feature-card,
.dashboard-card,
.auth-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.01)
        ),
        var(--background-elevated);

    box-shadow: var(--shadow);
}

.hero-card {
    padding: 24px;
}

.hero-card-header {
    display: flex;
    gap: 10px;
    align-items: center;

    padding-bottom: 20px;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 700;
}

.status-indicator {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--success);

    box-shadow: 0 0 16px rgba(82, 211, 149, 0.55);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;

    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-height: 104px;
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(255, 255, 255, 0.025);
}

.stat-label,
.card-label {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-item strong {
    margin-top: auto;

    font-size: 15px;
}

.feature-section {
    padding: 90px 0 120px;

    border-top: 1px solid var(--border);
}

.section-heading {
    max-width: 650px;
}

.section-heading h2 {
    font-size: clamp(34px, 5vw, 52px);
}

.section-heading p {
    margin: 22px 0 0;

    color: var(--text-secondary);

    font-size: 16px;
    line-height: 1.75;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;

    margin-top: 48px;
}

.feature-card {
    padding: 27px;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border: 1px solid var(--accent-border);
    border-radius: 12px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 12px;
    font-weight: 800;
}

.feature-card h3 {
    margin: 24px 0 10px;

    font-size: 18px;
}

.feature-card p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.7;
}

.site-footer {
    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 13px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 76px;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px 20px;
}

.auth-layout {
    width: min(440px, 100%);

    text-align: center;
}

.auth-layout-wide {
    width: min(620px, 100%);
}

.auth-brand {
    margin-bottom: 28px;
}

.auth-card {
    padding: 34px;

    text-align: left;
}

.auth-heading {
    margin-bottom: 27px;

    text-align: center;
}

.auth-heading .eyebrow {
    margin-bottom: 12px;
}

.auth-heading h1 {
    font-size: 30px;
}

.auth-heading p {
    margin: 12px 0 0;

    color: var(--text-secondary);

    font-size: 14px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 650;
}

.form-group input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    outline: none;

    background: rgba(255, 255, 255, 0.03);
    color: var(--text);

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

.form-group input:hover {
    background: rgba(255, 255, 255, 0.045);
}

.form-group input:focus {
    border-color: var(--accent);

    background: rgba(118, 118, 255, 0.045);

    box-shadow: 0 0 0 4px var(--accent-soft);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 14px;

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    font-size: 13px;
    line-height: 1.5;
}

.alert-error {
    border-color: rgba(255, 111, 125, 0.25);

    background: var(--danger-soft);
    color: #ff9aa4;
}

.auth-footer {
    display: flex;
    gap: 6px;
    justify-content: center;

    margin-top: 24px;

    color: var(--text-muted);

    font-size: 13px;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 700;
}

.back-link {
    display: inline-block;

    margin-top: 24px;
}

.dashboard-main {
    min-height: calc(100vh - 151px);
    padding: 68px 0 90px;
}

.dashboard-heading {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 36px;
}

.dashboard-heading h1 {
    font-size: clamp(36px, 5vw, 54px);
}

.dashboard-heading p {
    margin: 16px 0 0;

    color: var(--text-secondary);
}

.role-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--accent-border);
    border-radius: 999px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.role-badge {
    min-height: 34px;
    padding: 0 14px;
}

.account-label {
    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 650;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-card {
    padding: 26px;
}

.card-heading {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 24px;
}

.card-heading h2 {
    margin: 5px 0 0;

    font-size: 20px;
}

.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border: 1px solid var(--accent-border);
    border-radius: 14px;

    background: var(--accent-soft);
    color: var(--accent);

    font-size: 17px;
    font-weight: 800;
}

.detail-list,
.status-list {
    display: flex;
    flex-direction: column;
}

.detail-row,
.status-row {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;

    min-height: 58px;

    border-top: 1px solid var(--border);
}

.detail-row span {
    color: var(--text-muted);

    font-size: 13px;
}

.detail-row strong {
    overflow: hidden;

    max-width: 65%;

    font-size: 13px;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-row {
    padding: 14px 0;
}

.status-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-row strong {
    font-size: 14px;
}

.status-row span:not(.status-pill) {
    color: var(--text-muted);

    font-size: 12px;
}

.status-pill {
    min-width: 70px;
    min-height: 28px;
    padding: 0 10px;
}

.status-success {
    border-color: rgba(82, 211, 149, 0.25);

    background: var(--success-soft);
    color: var(--success);
}

.activity-card {
    margin-top: 18px;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;

    min-height: 68px;

    border-top: 1px solid var(--border);
}

.activity-marker {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow: 0 0 12px var(--accent-glow);
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.activity-content strong {
    font-size: 13px;
}

.activity-content span,
.activity-row time {
    color: var(--text-muted);

    font-size: 11px;
}

.empty-state {
    padding: 34px 0;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 13px;
    text-align: center;
}








.dashboard-grid-spaced {
    margin-top: 18px;
}

.alert-success {
    border-color: rgba(82, 211, 149, 0.25);

    background: var(--success-soft);
    color: var(--success);
}

.button-danger {
    border-color: rgba(255, 111, 125, 0.3);

    background: var(--danger-soft);
    color: #ff9aa4;
}

.button-danger:hover {
    border-color: rgba(255, 111, 125, 0.55);

    background: rgba(255, 111, 125, 0.18);
    color: #ffc3c9;
}

.form-group textarea {
    width: 100%;
    padding: 13px 14px;

    resize: vertical;

    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    outline: none;

    background: rgba(255, 255, 255, 0.03);
    color: var(--text);

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

.form-group textarea:hover {
    background: rgba(255, 255, 255, 0.045);
}

.form-group textarea:focus {
    border-color: var(--accent);

    background: rgba(118, 118, 255, 0.045);

    box-shadow: 0 0 0 4px var(--accent-soft);
}

.code-editor {
    min-height: 340px;

    font-family:
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 13px;
    line-height: 1.65;
    tab-size: 4;
}

.field-help {
    color: var(--text-muted);

    font-size: 11px;
}

.library-tabs {
    display: inline-flex;
    gap: 5px;

    margin-bottom: 22px;
    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: rgba(255, 255, 255, 0.025);
}

.library-tab {
    padding: 9px 18px;

    border-radius: 7px;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 700;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.library-tab:hover {
    color: var(--text);
}

.library-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.library-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.75fr) minmax(0, 1.25fr);
    gap: 18px;
    align-items: start;
}

.library-editor-card {
    position: sticky;
    top: 94px;
}

.library-options {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.checkbox-control {
    display: inline-flex;
    gap: 9px;
    align-items: center;

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;
}

.checkbox-control input {
    width: 17px;
    height: 17px;

    accent-color: var(--accent);
}

/* Login remember-me checkbox */
.auth-remember-control {
    width: max-content;
    gap: 10px;
    user-select: none;
}

.auth-remember-control input {
    position: relative;

    width: 18px;
    height: 18px;
    margin: 0;

    flex: 0 0 auto;

    appearance: none;
    -webkit-appearance: none;

    border: 1px solid var(--border-strong);
    border-radius: 5px;

    background: rgba(255, 255, 255, 0.035);

    cursor: pointer;

    transition:
        border-color 150ms ease,
        background 150ms ease,
        box-shadow 150ms ease,
        transform 100ms ease;
}

.auth-remember-control input:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.auth-remember-control input:focus-visible {
    outline: none;

    border-color: var(--accent);

    box-shadow:
        0 0 0 4px var(--accent-soft);
}

.auth-remember-control input:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.auth-remember-control input:checked::after {
    content: "";

    position: absolute;
    top: 2px;
    left: 5px;

    width: 5px;
    height: 9px;

    border: solid #fff;
    border-width: 0 2px 2px 0;

    transform: rotate(45deg);
}

.auth-remember-control input:active {
    transform: scale(0.9);
}

.auth-remember-control span {
    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 650;
}

.auth-remember-control:hover span {
    color: var(--text);
}

.library-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.library-item {
    box-shadow: none;
}

.library-item-heading h2 {
    margin: 0;

    font-size: 19px;
    letter-spacing: -0.02em;
}

.library-item-heading p {
    margin: 11px 0 0;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.65;
}

.library-item-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.library-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;

    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 11px;
}

.library-hash {
    display: flex;
    flex-direction: column;
    gap: 7px;

    margin-top: 17px;
}

.library-hash span {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.library-hash code {
    overflow: hidden;

    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.025);
    color: var(--text-secondary);

    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-item-actions {
    display: flex;
    gap: 9px;

    margin-top: 18px;
}

.library-item-actions form {
    margin: 0;
}

@media (max-width: 940px) {
    .library-layout {
        grid-template-columns: 1fr;
    }

    .library-editor-card {
        position: static;
    }
}

@media (max-width: 620px) {
    .library-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        width: 100%;
    }

    .library-tab {
        text-align: center;
    }

    .library-item-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .library-item-actions form,
    .library-item-actions .button {
        width: 100%;
    }
}



@media (max-width: 880px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 52px;
    }

    .hero-card {
        max-width: 600px;
    }

    .feature-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 28px, 1160px);
    }

    .header-inner {
        min-height: 66px;
    }

    .header-navigation {
        gap: 8px;
    }

    .account-label,
    .navigation-link {
        display: none;
    }

    .hero {
        padding: 82px 0 76px;
    }

    .hero h1 {
        font-size: 43px;
    }

    .stat-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .feature-section {
        padding: 68px 0 80px;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .dashboard-heading {
        flex-direction: column;
    }

    .dashboard-main {
        padding: 48px 0 68px;
    }

    .activity-row {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 14px 0;
    }

    .activity-row time {
        grid-column: 2;
    }

    .footer-inner {
        flex-direction: column;
        justify-content: center;

        padding: 20px 0;
    }
}

/* Library management */
.library-selection-empty h2 {
    margin: 8px 0 10px;
    font-size: 22px;
}

.library-selection-empty p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.library-item.selected {
    border-color: rgba(118, 118, 255, 0.42);
    box-shadow: 0 0 0 1px rgba(118, 118, 255, 0.12);
}

.library-manage-meta {
    margin-top: 16px;
}

.library-manage-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 22px 0;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.library-manage-tab {
    padding: 9px 8px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: background 150ms ease, color 150ms ease;
}

.library-manage-tab:hover {
    color: var(--text);
}

.library-manage-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.library-update-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library-update-entry {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
}

.library-update-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.library-update-heading > div {
    display: flex;
    gap: 9px;
    align-items: center;
}

.library-update-heading strong {
    color: var(--text);
    font-size: 13px;
}

.library-update-heading time {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.library-update-entry p {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.library-update-entry code {
    display: block;
    overflow: hidden;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-history-empty {
    padding: 26px 16px;
    border: 1px dashed var(--border);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* Marketplace */
.marketplace-toolbar {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.marketplace-type-tabs {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.marketplace-search {
    display: flex;
    gap: 8px;
    align-items: center;
    width: min(100%, 650px);
}

.marketplace-search-field {
    flex: 1 1 auto;
}

.marketplace-search input,
.marketplace-search select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.marketplace-search select {
    width: 155px;
}

.marketplace-search input:focus,
.marketplace-search select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.marketplace-card {
    display: block;
    box-shadow: none;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.marketplace-card:hover {
    transform: translateY(-2px);
    border-color: rgba(118, 118, 255, 0.4);
    background: rgba(118, 118, 255, 0.035);
}

.marketplace-card-heading,
.marketplace-detail-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.marketplace-card-heading h2,
.marketplace-detail h2 {
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

.marketplace-card-heading h2 {
    font-size: 18px;
}

.marketplace-card-heading > div > span,
.marketplace-author {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
}

.marketplace-card p {
    min-height: 42px;
    margin: 15px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.marketplace-card-no-description {
    color: var(--text-muted) !important;
}

.marketplace-card-meta,
.marketplace-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 10px;
}

.marketplace-detail {
    margin-bottom: 22px;
}

.marketplace-detail-badges {
    display: flex;
    gap: 7px;
    margin-bottom: 10px;
}

.marketplace-detail h2 {
    font-size: 26px;
}

.marketplace-detail-description {
    max-width: 850px;
    margin: 20px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.marketplace-get-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.marketplace-get-row .button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.marketplace-update-log {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

@media (max-width: 940px) {
    .marketplace-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .marketplace-search {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .marketplace-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-search {
        display: grid;
        grid-template-columns: 1fr;
    }

    .marketplace-search select {
        width: 100%;
    }

    .marketplace-get-row,
    .library-update-heading,
    .marketplace-detail-top {
        align-items: stretch;
        flex-direction: column;
    }

    .library-manage-tabs {
        grid-template-columns: 1fr;
    }
}

/* Admin */
.admin-main { padding: 72px 0 100px; }
.admin-heading { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; margin-bottom:28px; }
.admin-heading h1 { margin:0; font-size:clamp(36px,5vw,56px); letter-spacing:-0.045em; line-height:1; }
.admin-heading p { max-width:720px; margin:14px 0 0; color:var(--text-secondary); }
.admin-badge,.placeholder-pill { display:inline-flex; align-items:center; min-height:30px; padding:0 10px; border:1px solid var(--accent-border); border-radius:999px; background:var(--accent-soft); color:var(--accent-hover); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.admin-alert { margin-bottom:22px; }
.admin-generated-value { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); }
.admin-generated-value code { font-size:14px; color:var(--text); user-select:all; }
.admin-generated-value span { color:var(--text-muted); font-size:11px; }
.admin-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.admin-stat-card,.admin-section { border:1px solid var(--border); border-radius:var(--radius); background:rgba(255,255,255,.025); box-shadow:0 18px 55px rgba(0,0,0,.15); }
.admin-stat-card { padding:18px; }
.admin-stat-card span { display:block; color:var(--text-muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.admin-stat-card strong { display:block; margin-top:7px; font-size:28px; letter-spacing:-.04em; }
.admin-section { padding:20px; margin-top:18px; }
.admin-section-heading { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:18px; }
.admin-section-heading h2 { margin:3px 0 0; font-size:21px; letter-spacing:-.025em; }
.admin-search { display:flex; gap:8px; width:min(100%,430px); }
.admin-search input { width:100%; min-height:40px; padding:0 12px; border:1px solid var(--border); border-radius:8px; outline:none; background:rgba(255,255,255,.035); color:var(--text); font:inherit; font-size:12px; }
.admin-search input:focus { border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft); }
.admin-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:10px; }
.admin-table { width:100%; min-width:1000px; border-collapse:collapse; }
.admin-table th { padding:11px 14px; border-bottom:1px solid var(--border); background:rgba(255,255,255,.025); color:var(--text-muted); font-size:10px; text-align:left; text-transform:uppercase; letter-spacing:.08em; }
.admin-table td { padding:14px; border-bottom:1px solid var(--border); vertical-align:top; font-size:12px; }
.admin-table tbody tr:last-child td { border-bottom:0; }
.admin-table td strong,.admin-table td span { display:block; }
.admin-table td > span,.admin-table td > div > span { margin-top:4px; color:var(--text-muted); font-size:10px; }
.status-pill { display:inline-flex !important; width:max-content; padding:3px 7px; border-radius:999px; margin-bottom:5px; font-size:9px !important; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.admin-hwid { display:block; max-width:190px; overflow:hidden; color:var(--text-secondary); font-size:10px; white-space:nowrap; text-overflow:ellipsis; }
.text-muted { color:var(--text-muted) !important; }
.admin-user-form { display:grid; grid-template-columns:120px auto auto; gap:7px; align-items:center; margin-bottom:7px; }
.admin-user-toggles { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.button-danger { border:1px solid rgba(255,111,125,.25); background:var(--danger-soft); color:var(--danger); }
.button-danger:hover { border-color:rgba(255,111,125,.5); background:rgba(255,111,125,.16); }
.button-compact { min-height:34px; padding:0 11px; font-size:11px; }
.admin-pagination { display:flex; justify-content:flex-end; gap:12px; align-items:center; margin-top:14px; color:var(--text-muted); font-size:11px; }
.admin-empty { padding:30px !important; color:var(--text-muted); text-align:center; }
.admin-two-column { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.admin-two-column .admin-section { margin-top:18px; }
.admin-generator { display:flex; gap:10px; align-items:flex-end; }
.admin-generator label { flex:1; color:var(--text-secondary); font-size:11px; font-weight:700; }
.admin-mini-list { margin-top:18px; border-top:1px solid var(--border); }
.admin-mini-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--border); }
.admin-mini-row strong,.admin-mini-row span { display:block; }
.admin-mini-row strong { font-size:11px; }
.admin-mini-row span { margin-top:3px; color:var(--text-muted); font-size:10px; }
.admin-text-button { padding:0; background:none; color:var(--danger); font-size:10px; font-weight:800; cursor:pointer; }
.admin-section-copy { margin:-2px 0 18px; color:var(--text-secondary); font-size:12px; line-height:1.7; }
.admin-placeholder-note { margin-top:18px; padding:14px; border:1px dashed var(--accent-border); border-radius:9px; background:var(--accent-soft); }
.admin-placeholder-note strong,.admin-placeholder-note span { display:block; }
.admin-placeholder-note strong { font-size:11px; }
.admin-placeholder-note span { margin-top:4px; color:var(--text-secondary); font-size:10px; line-height:1.55; }

@media (max-width: 980px) {
    .admin-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .admin-two-column { grid-template-columns:1fr; gap:0; }
    .admin-section-heading { align-items:stretch; flex-direction:column; }
    .admin-search { width:100%; }
}
@media (max-width: 650px) {
    .admin-main { padding-top:48px; }
    .admin-heading { flex-direction:column; }
    .admin-stat-grid { grid-template-columns:1fr 1fr; }
    .admin-generator { align-items:stretch; flex-direction:column; }
    .admin-search { flex-direction:column; }
}

/* Admin custom dropdowns + account toggle */
.admin-select {
    position: relative;
    min-width: 120px;
    font-size: 12px;
}

.admin-select-trigger {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: #101117;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.admin-select-trigger:hover {
    border-color: rgba(255,255,255,.16);
    background: #13141b;
}

.admin-select.is-open .admin-select-trigger,
.admin-select-trigger:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.admin-select-trigger svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .16s ease, stroke .16s ease;
}

.admin-select.is-open .admin-select-trigger svg {
    transform: rotate(180deg);
    stroke: var(--accent-hover);
}

.admin-select-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    overflow: hidden;
    padding: 5px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    background: #111218;
    box-shadow: 0 18px 45px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.35);
}

.admin-select.is-open .admin-select-menu {
    display: block;
    animation: admin-select-in .12s ease-out;
}

/* Keep row dropdowns inside the table viewport so opening the final row does not
   increase .admin-table-wrap's scroll height and create a vertical scrollbar. */
.admin-select.drop-up .admin-select-menu {
    top: auto;
    bottom: calc(100% + 6px);
}

.admin-select.is-measuring .admin-select-menu {
    display: block;
    visibility: hidden;
    pointer-events: none;
}

.admin-select.drop-up.is-open .admin-select-menu {
    animation-name: admin-select-in-up;
}

@keyframes admin-select-in-up {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes admin-select-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-select-option {
    display: flex;
    width: 100%;
    min-height: 35px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}

.admin-select-option:hover,
.admin-select-option:focus-visible {
    outline: none;
    background: rgba(255,255,255,.055);
    color: var(--text);
}

.admin-select-option.is-selected {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.admin-select-check {
    opacity: 0;
    color: var(--accent-hover);
    font-size: 11px;
}

.admin-select-option.is-selected .admin-select-check {
    opacity: 1;
}

.admin-generator label > .admin-select {
    margin-top: 6px;
}

.admin-select-generator {
    width: 100%;
}

.admin-toggle {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.admin-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.admin-toggle-track {
    position: relative;
    width: 30px;
    height: 17px;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.admin-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform .16s ease, background .16s ease;
}

.admin-toggle input:checked + .admin-toggle-track {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.admin-toggle input:checked + .admin-toggle-track .admin-toggle-knob {
    transform: translateX(13px);
    background: var(--accent-hover);
}

.admin-toggle input:focus-visible + .admin-toggle-track {
    box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (max-width: 650px) {
    .admin-select-menu { position: absolute; }
}

/* Header navigation drawer */
.header-menu-trigger {
    appearance: none;
    display: inline-flex;
    width: 42px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.header-menu-trigger span {
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: var(--text-secondary);
    transition: background 150ms ease;
}

.header-menu-trigger:hover,
.header-menu-trigger:focus-visible,
.header-menu-trigger[aria-expanded="true"] {
    outline: none;
    border-color: var(--accent-border);
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px rgba(118, 118, 255, 0.08);
}

.header-menu-trigger:hover span,
.header-menu-trigger:focus-visible span,
.header-menu-trigger[aria-expanded="true"] span {
    background: var(--accent-hover);
}

body.overlay-open {
    overflow: hidden;
}

.header-menu {
    position: fixed;
    inset: 0;
    z-index: 2100;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.header-menu.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.header-menu-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(3, 4, 8, 0.64);
    backdrop-filter: blur(7px);
    cursor: default;
}

.header-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    width: min(370px, calc(100% - 28px));
    height: 100%;
    flex-direction: column;
    border-left: 1px solid var(--border);
    background: #0c0e13;
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.header-menu.is-open .header-menu-panel {
    transform: translateX(0);
}

.header-menu-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 86px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.header-menu-heading strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 15px;
}

.header-menu-close {
    appearance: none;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-secondary);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.header-menu-close:hover,
.header-menu-close:focus-visible {
    outline: none;
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--text);
}

.header-menu-links {
    display: grid;
    gap: 7px;
    padding: 16px;
}

.header-menu-link {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.header-menu-link:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    transform: translateX(-2px);
}

.header-menu-arrow {
    color: var(--text-muted);
    font-size: 21px;
    font-weight: 400;
}

.header-menu-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.header-menu-logout {
    width: 100%;
}

/* Account security and email verification */
.verification-resend-meta {
    margin: -4px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

.button:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.auth-secondary-link {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
}

.auth-secondary-link a {
    color: var(--text-muted);
    font-weight: 700;
    transition: color 150ms ease;
}

.auth-secondary-link a:hover {
    color: var(--accent-hover);
}

.account-action-form {
    flex: 0 0 auto;
    margin: 0;
}

.account-verified-value {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
}

.account-verified-value .status-pill {
    margin: 0;
}

.account-verified-value small {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}

@media (max-width: 620px) {
    .account-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .account-action-form,
    .account-action-form .button {
        width: 100%;
    }
}


/* Account avatar */
.profile-avatar-image {
    object-fit: cover;
}

.account-avatar-row {
    align-items: center;
}

.account-avatar-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.account-avatar-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.account-avatar-picker:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.account-avatar-picker:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.account-avatar-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 720px) {
    .account-avatar-row {
        align-items: stretch;
        flex-direction: column;
    }

    .account-avatar-form {
        width: 100%;
    }

    .account-avatar-picker,
    .account-avatar-form .button {
        flex: 1 1 0;
    }
}

/* Marketplace 2026 redesign */
.marketplace-page {
    background:
        radial-gradient(circle at 55% -15%, rgba(118,118,255,.12), transparent 34%),
        #07080c;
}
.marketplace-page .container { width:min(1280px,calc(100% - 44px)); }
.marketplace-main { min-height:calc(100vh - 74px); padding:52px 0 86px; }
.marketplace-shell { position:relative; }
.marketplace-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:30px; margin-bottom:28px; }
.marketplace-hero h1 { margin:6px 0 0; font-size:clamp(32px,4vw,46px); letter-spacing:-.045em; line-height:1; }
.marketplace-hero p { max-width:680px; margin:13px 0 0; color:var(--text-secondary); font-size:14px; }
.marketplace-count { display:flex; gap:9px; align-items:baseline; padding:12px 15px; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.025); }
.marketplace-count strong { font-size:19px; }
.marketplace-count span { color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.marketplace-layout { display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:22px; align-items:start; }
.marketplace-content { min-width:0; }
.marketplace-filter-panel { margin-bottom:10px; }
.marketplace-filter-row { display:flex; gap:10px; align-items:stretch; margin-bottom:10px; }
.marketplace-game-select,.marketplace-access-chip { min-height:48px; display:flex; align-items:center; border:1px solid var(--border-strong); background:#0d1119; }
.marketplace-game-select { width:220px; gap:10px; padding:0 13px; border-radius:8px; font-size:12px; font-weight:750; }
.marketplace-game-mark { display:grid; place-items:center; width:24px; height:24px; border-radius:6px; background:linear-gradient(135deg,var(--accent),#5353cb); color:white; font-size:11px; font-weight:900; box-shadow:0 0 18px var(--accent-glow); }
.marketplace-filter-chevron { margin-left:auto; color:var(--text-muted); font-size:18px; }
.marketplace-category-tabs { display:flex; gap:5px; padding:5px; border:1px solid var(--border-strong); border-radius:8px; background:#0d1119; }
.marketplace-category-tab { display:flex; gap:7px; align-items:center; justify-content:center; min-width:112px; padding:0 14px; border:1px solid transparent; border-radius:5px; color:var(--text-secondary); font-size:12px; font-weight:750; transition:150ms ease; }
.marketplace-category-tab:hover { color:var(--text); background:rgba(255,255,255,.035); }
.marketplace-category-tab.active { border-color:var(--accent-border); background:var(--accent-soft); color:#fff; box-shadow:inset 0 0 0 1px rgba(118,118,255,.05); }
.marketplace-tab-icon { color:var(--accent-hover); font-size:11px; }
.marketplace-access-chip { margin-left:auto; gap:8px; padding:0 14px; border-radius:8px; color:var(--text-secondary); font-size:11px; font-weight:750; }
.marketplace-access-dot { width:7px; height:7px; border-radius:50%; background:var(--success); box-shadow:0 0 12px rgba(82,211,149,.5); }
.marketplace-page .marketplace-search { display:grid; grid-template-columns:minmax(0,1fr) 250px auto; gap:8px; width:100%; }
.marketplace-page .marketplace-search-field { position:relative; display:block; }
.marketplace-search-icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:17px; pointer-events:none; }
.marketplace-page .marketplace-search input,.marketplace-page .marketplace-search select { min-height:42px; border:1px solid var(--border-strong); border-radius:7px; background:#090d13; color:var(--text); }
.marketplace-page .marketplace-search input { padding-left:39px; }
.marketplace-page .marketplace-search select { width:100%; padding:0 34px 0 12px; }
.marketplace-search-submit { min-height:42px; padding:0 17px; border:1px solid var(--accent-border); border-radius:7px; background:var(--accent-soft); color:#fff; font-weight:800; font-size:12px; cursor:pointer; }
.marketplace-results { border:1px solid var(--border-strong); border-radius:8px; overflow:hidden; background:rgba(7,11,17,.75); }
.marketplace-listing { position:relative; display:grid; grid-template-columns:minmax(250px,1fr) 120px 86px 92px 105px 20px; gap:14px; align-items:center; min-height:94px; padding:13px 15px; border-bottom:1px solid var(--border); transition:background 140ms ease,border-color 140ms ease; }
.marketplace-listing:last-child { border-bottom:0; }
.marketplace-listing:hover,.marketplace-listing.active { background:rgba(118,118,255,.055); }
.marketplace-listing.active { box-shadow:inset 3px 0 0 var(--accent); }
.marketplace-listing-main { min-width:0; }
.marketplace-listing-title-row { display:flex; gap:8px; align-items:center; min-width:0; }
.marketplace-item-type-icon { display:grid; place-items:center; flex:0 0 auto; width:22px; height:22px; border-radius:5px; background:var(--accent-soft); color:var(--accent-hover); font-size:9px; font-weight:900; }
.marketplace-listing h2 { margin:0; overflow:hidden; color:#fff; font-size:13px; font-weight:760; text-overflow:ellipsis; white-space:nowrap; }
.marketplace-listing-main p { display:-webkit-box; overflow:hidden; margin:7px 0 0; color:var(--text-muted); font-size:10.5px; line-height:1.35; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.marketplace-no-description { font-style:italic; opacity:.7; }
.marketplace-listing-author,.marketplace-listing-version,.marketplace-listing-downloads,.marketplace-listing-updated { min-width:0; }
.marketplace-listing-author span,.marketplace-listing-version span,.marketplace-listing-downloads span,.marketplace-listing-updated span { display:block; margin-bottom:4px; color:#5e6575; font-size:8px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.marketplace-listing-author strong,.marketplace-listing-version strong,.marketplace-listing-downloads strong,.marketplace-listing-updated strong { display:block; overflow:hidden; color:var(--text-secondary); font-size:10.5px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.marketplace-listing-author strong { color:#fff; }
.marketplace-listing-arrow { color:#4d5362; font-size:24px; text-align:right; transition:transform 140ms ease,color 140ms ease; }
.marketplace-listing:hover .marketplace-listing-arrow { color:var(--accent-hover); transform:translateX(2px); }
.marketplace-sidebar { position:sticky; top:96px; display:grid; gap:12px; }
.marketplace-sidebar-card,.marketplace-sidebar-note { border:1px solid var(--border-strong); border-radius:8px; background:#0b1018; }
.marketplace-sidebar-user { display:flex; gap:11px; align-items:center; padding:14px; border-bottom:1px solid var(--border); }
.marketplace-avatar { display:grid; place-items:center; width:36px; height:36px; border:1px solid var(--accent-border); border-radius:50%; background:linear-gradient(145deg,var(--accent-soft),rgba(118,118,255,.03)); color:var(--accent-hover); font-size:14px; font-weight:900; box-shadow:0 0 22px rgba(118,118,255,.1); }
.marketplace-sidebar-user span { display:block; color:var(--text-muted); font-size:9px; }
.marketplace-sidebar-user strong { display:block; margin-top:1px; max-width:145px; overflow:hidden; color:#fff; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.marketplace-side-nav { padding:8px; }
.marketplace-side-nav a { display:flex; gap:11px; align-items:center; min-height:42px; padding:0 10px; border-radius:6px; color:var(--text-secondary); font-size:11.5px; font-weight:650; transition:background 140ms ease,color 140ms ease; }
.marketplace-side-nav a:hover { background:rgba(255,255,255,.035); color:#fff; }
.marketplace-side-nav a.active { background:var(--accent-soft); color:#fff; }
.marketplace-side-icon { width:20px; color:var(--accent-hover); font-size:15px; text-align:center; }
.marketplace-sidebar-note { display:flex; gap:10px; padding:14px; }
.marketplace-note-icon { color:var(--accent-hover); }
.marketplace-sidebar-note strong { font-size:11px; }
.marketplace-sidebar-note p { margin:5px 0 0; color:var(--text-muted); font-size:9.5px; line-height:1.5; }
.marketplace-detail { margin-bottom:10px; padding:18px; border:1px solid var(--accent-border); border-radius:8px; background:linear-gradient(135deg,rgba(118,118,255,.075),rgba(10,13,20,.92) 44%); }
.marketplace-detail-top { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.marketplace-detail-badges { display:flex; gap:6px; margin-bottom:8px; }
.marketplace-mini-pill { display:inline-flex; align-items:center; min-height:21px; padding:0 7px; border:1px solid var(--accent-border); border-radius:4px; background:var(--accent-soft); color:var(--accent-hover); font-size:8px; font-weight:850; letter-spacing:.06em; text-transform:uppercase; }
.marketplace-mini-pill-success { border-color:rgba(82,211,149,.24); background:var(--success-soft); color:var(--success); }
.marketplace-detail h2 { margin:0; font-size:21px; letter-spacing:-.025em; }
.marketplace-author { margin:4px 0 0; color:var(--text-muted); font-size:10px; }
.marketplace-author strong { color:var(--text-secondary); }
.marketplace-detail-close { display:grid; place-items:center; width:30px; height:30px; border:1px solid var(--border); border-radius:6px; color:var(--text-muted); font-size:20px; }
.marketplace-detail-close:hover { border-color:var(--border-strong); color:#fff; }
.marketplace-detail-description { max-width:800px; margin:14px 0 0; color:var(--text-secondary); font-size:11.5px; line-height:1.65; }
.marketplace-detail-meta { display:flex; flex-wrap:wrap; gap:15px; margin-top:13px; padding-top:12px; border-top:1px solid var(--border); color:var(--text-muted); font-size:9px; }
.marketplace-detail-actions { display:flex; gap:12px; align-items:center; margin-top:14px; }
.marketplace-detail-actions .button { min-height:36px; font-size:11px; }
.marketplace-detail-hash { flex:1 1 auto; min-width:0; margin:0; }
.marketplace-detail-hash code { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.marketplace-update-log { margin-top:14px; padding-top:13px; border-top:1px solid var(--border); }
.marketplace-update-log summary { display:flex; justify-content:space-between; cursor:pointer; color:var(--text-secondary); font-size:10px; font-weight:750; list-style:none; }
.marketplace-update-log summary::-webkit-details-marker { display:none; }
.marketplace-update-log summary span { color:var(--text-muted); font-weight:600; }
.marketplace-update-log .library-update-list { margin-top:12px; }
.marketplace-empty { padding:48px 20px; color:var(--text-muted); font-size:12px; text-align:center; }
@media(max-width:1080px){
    .marketplace-layout{grid-template-columns:minmax(0,1fr)}
    .marketplace-sidebar{position:static;grid-template-columns:1fr 1fr}.marketplace-side-nav{display:grid;grid-template-columns:repeat(2,1fr)}
}
@media(max-width:800px){
    .marketplace-filter-row{flex-wrap:wrap}.marketplace-game-select{width:100%}.marketplace-access-chip{margin-left:0}.marketplace-category-tabs{flex:1}.marketplace-category-tab{flex:1}
    .marketplace-page .marketplace-search{grid-template-columns:1fr}.marketplace-listing{grid-template-columns:minmax(0,1fr) 80px 20px}.marketplace-listing-version,.marketplace-listing-downloads,.marketplace-listing-updated{display:none}
    .marketplace-sidebar{grid-template-columns:1fr}.marketplace-hero{align-items:flex-start;flex-direction:column}.marketplace-count{display:none}
}
@media(max-width:560px){
    .marketplace-page .container{width:min(100% - 24px,1280px)}.marketplace-main{padding-top:34px}.marketplace-listing{grid-template-columns:minmax(0,1fr) 20px}.marketplace-listing-author{display:none}.marketplace-category-tabs{width:100%}.marketplace-access-chip{width:100%;justify-content:center}.marketplace-detail-actions{align-items:stretch;flex-direction:column}.marketplace-detail-hash{width:100%}.marketplace-side-nav{grid-template-columns:1fr}
}

/* Marketplace cloud navigation refinements */
.marketplace-category-tabs-wide { flex: 1 1 auto; }
.marketplace-category-tabs-wide .marketplace-category-tab { flex: 1 1 0; min-width: 0; }
.marketplace-avatar-image { display:block; object-fit:cover; padding:0; }
.marketplace-side-icon { display:grid; place-items:center; }
.marketplace-side-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
@media(max-width:800px){
    .marketplace-category-tabs-wide{width:100%;}
}

/* Unified Marketplace / My Library */
.marketplace-old-library-tabs {
    margin: 0;
    width: fit-content;
}

.marketplace-search-no-sort {
    grid-template-columns: minmax(0, 1fr) auto;
}

.marketplace-library-layout {
    margin-top: 0;
}

.marketplace-library-listing {
    cursor: default;
}

.marketplace-library-listing:hover {
    transform: none;
}

@media (max-width: 700px) {
    .marketplace-old-library-tabs {
        width: 100%;
    }

    .marketplace-old-library-tabs .library-tab {
        flex: 1 1 0;
        text-align: center;
    }

    .marketplace-search-no-sort {
        grid-template-columns: 1fr;
    }
}

/* Cloud Items refresh */
.cloud-items-shell { max-width: 1380px; }
.cloud-items-hero { margin-bottom: 24px; align-items: flex-end; }
.cloud-items-hero h1 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -.045em; }
.cloud-items-hero p { max-width: 680px; margin-top: 6px; font-size: 13px; }
.cloud-items-layout { grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; align-items: start; }
.cloud-items-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cloud-type-tabs { flex: 0 0 auto; margin: 0; }
.cloud-type-tabs .library-tab { display: inline-flex; gap: 8px; align-items: center; min-width: 108px; justify-content: center; }
.cloud-tab-icon { color: var(--accent-hover); font-size: 10px; font-weight: 900; }
.cloud-items-search { position: relative; flex: 1 1 auto; min-width: 0; }
.cloud-items-search input { width: 100%; min-height: 42px; padding: 0 14px 0 39px; border: 1px solid var(--border-strong); border-radius: 7px; background: #090d13; color: var(--text); outline: none; transition: border-color 140ms ease, box-shadow 140ms ease; }
.cloud-items-search input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(118,118,255,.08); }
.cloud-items-results { border-radius: 8px; }
.cloud-item-row { min-height: 82px; padding: 11px 14px; grid-template-columns: minmax(280px,1fr) 115px 78px 88px 104px 18px; }
.cloud-item-row .marketplace-listing-main p { margin-top: 5px; -webkit-line-clamp: 1; }
.cloud-library-row { grid-template-columns: minmax(280px,1fr) 115px 78px 92px 104px auto; }
.cloud-row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.cloud-row-actions form { margin: 0; }
.cloud-row-actions .button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.cloud-item-detail, .cloud-manage-panel { margin-bottom: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #0b1018; }
.cloud-item-detail { background: linear-gradient(135deg, rgba(118,118,255,.055), #0b1018 45%); }
.cloud-manage-panel { padding: 18px; }
.cloud-manage-panel .card-heading { margin-bottom: 12px; }
.cloud-manage-form { margin-top: 16px; }
.cloud-form-grid { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 12px; }
.cloud-items-sidebar { top: 92px; }
.cloud-library-note { padding: 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: #0b1018; }
.cloud-library-note strong { color: #fff; font-size: 10.5px; }
.cloud-library-note p { margin: 6px 0 0; color: var(--text-muted); font-size: 9.5px; line-height: 1.5; }
.cloud-library-note code { color: var(--accent-hover); font-size: inherit; }

@media (max-width: 1100px) {
    .cloud-items-layout { grid-template-columns: 1fr; }
    .cloud-items-sidebar { position: static; order: -1; }
    .cloud-items-sidebar .marketplace-sidebar-card { display: grid; grid-template-columns: 220px 1fr; }
    .cloud-items-sidebar .marketplace-sidebar-user { border-right: 1px solid var(--border); border-bottom: 0; }
    .cloud-items-sidebar .marketplace-side-nav { display: grid; grid-template-columns: repeat(2, 1fr); align-items: center; }
    .cloud-library-note { display: none; }
}

@media (max-width: 760px) {
    .cloud-items-toolbar { align-items: stretch; flex-direction: column; }
    .cloud-type-tabs { width: 100%; }
    .cloud-type-tabs .library-tab { min-width: 0; flex: 1 1 0; }
    .cloud-item-row { grid-template-columns: minmax(0,1fr) 80px 18px; }
    .cloud-item-row .marketplace-listing-version,
    .cloud-item-row .marketplace-listing-downloads,
    .cloud-item-row .marketplace-listing-updated { display: none; }
    .cloud-library-row { grid-template-columns: minmax(0,1fr) auto; }
    .cloud-library-row .marketplace-listing-author { display: none; }
    .cloud-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
    .cloud-items-sidebar .marketplace-sidebar-card { display: block; }
    .cloud-items-sidebar .marketplace-sidebar-user { border-right: 0; border-bottom: 1px solid var(--border); }
    .cloud-item-row { grid-template-columns: minmax(0,1fr) 18px; }
    .cloud-item-row .marketplace-listing-author { display: none; }
    .cloud-library-row { grid-template-columns: 1fr; }
    .cloud-row-actions { justify-content: flex-start; margin-top: 8px; }
    .cloud-items-hero { align-items: flex-start; }
}

/* Cloud custom library creator */
.cloud-create-library {
    margin-bottom: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #0b1018;
    overflow: hidden;
}
.cloud-create-library > summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 58px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.cloud-create-library > summary::-webkit-details-marker { display: none; }
.cloud-create-library > summary strong { display: block; color: #fff; font-size: 12px; }
.cloud-create-library > summary small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9.5px; font-weight: 500; }
.cloud-create-library-plus {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--accent-hover);
    font-size: 19px;
    line-height: 1;
    transition: transform 140ms ease;
}
.cloud-create-library[open] .cloud-create-library-plus { transform: rotate(45deg); }
.cloud-create-library-form {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,.012);
}
.cloud-create-library-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 2px;
}
.cloud-create-library-footer .button { min-width: 132px; }

/* Clean dashboard */
.dashboard-main-clean { padding: 38px 0 58px; }
.dashboard-shell-clean { width: min(100% - 32px, 1180px); }
.dashboard-welcome-card {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(118,118,255,.07), #0b1018 42%);
}
.dashboard-welcome-profile { display: flex; gap: 16px; align-items: center; min-width: 0; }
.dashboard-profile-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-soft), rgba(118,118,255,.025));
    color: var(--accent-hover);
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 0 30px rgba(118,118,255,.1);
}
.dashboard-profile-avatar-image { display: block; object-fit: cover; }
.dashboard-welcome-card h1 { margin: 2px 0 4px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
.dashboard-welcome-card p { margin: 0; color: var(--text-muted); font-size: 11.5px; }
.dashboard-welcome-actions { display: flex; gap: 9px; align-items: center; flex: 0 0 auto; }
.dashboard-welcome-actions .button { min-height: 34px; }

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.dashboard-stat-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 12px;
    align-items: center;
    min-height: 78px;
    padding: 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #0b1018;
    color: var(--text-secondary);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.dashboard-stat-card:hover { border-color: var(--accent-border); background: rgba(118,118,255,.045); transform: translateY(-1px); }
.dashboard-stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent-border);
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 850;
}
.dashboard-stat-card strong { display: block; color: #fff; font-size: 21px; line-height: 1; }
.dashboard-stat-card span:not(.dashboard-stat-icon):not(.dashboard-stat-arrow) { display: block; margin-top: 4px; color: var(--text-muted); font-size: 9.5px; }
.dashboard-stat-arrow { color: #4d5362; font-size: 22px; text-align: right; }
.dashboard-stat-card:hover .dashboard-stat-arrow { color: var(--accent-hover); }

.dashboard-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    gap: 14px;
    margin-top: 14px;
}
.dashboard-account-card,
.dashboard-quick-card,
.dashboard-activity-clean { margin: 0; }
.dashboard-card-link { color: var(--accent-hover); font-size: 10px; font-weight: 700; }
.dashboard-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.dashboard-detail-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255,255,255,.015);
}
.dashboard-detail-item span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 8.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.dashboard-detail-item strong { display: block; overflow: hidden; color: var(--text-secondary); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-quick-links { display: grid; gap: 7px; }
.dashboard-quick-links a {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255,255,255,.012);
    transition: border-color 140ms ease, background 140ms ease;
}
.dashboard-quick-links a:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.dashboard-quick-links strong { display: block; color: #fff; font-size: 10.5px; }
.dashboard-quick-links small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 8.8px; line-height: 1.35; }
.dashboard-quick-links b { color: #4d5362; font-size: 20px; font-weight: 500; }
.dashboard-quick-links a:hover b { color: var(--accent-hover); }
.dashboard-activity-clean { margin-top: 14px; }

@media (max-width: 820px) {
    .dashboard-content-grid { grid-template-columns: 1fr; }
    .dashboard-stat-grid { grid-template-columns: 1fr; }
    .dashboard-welcome-card { align-items: flex-start; flex-direction: column; }
    .dashboard-welcome-actions { width: 100%; }
    .dashboard-welcome-actions .button { margin-left: auto; }
}
@media (max-width: 560px) {
    .dashboard-main-clean { padding-top: 24px; }
    .dashboard-shell-clean { width: min(100% - 22px, 1180px); }
    .dashboard-detail-grid { grid-template-columns: 1fr; }
    .dashboard-profile-avatar { flex-basis: 48px; width: 48px; height: 48px; }
    .cloud-create-library-footer { align-items: stretch; flex-direction: column; }
    .cloud-create-library-footer .button { width: 100%; }
}
