/* ============================================================
   Flow — Main styles
   ============================================================ */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1bd96a;
    --primary-dark: #16b85a;
    --bg: #14141c;
    --bg-card: #1e1e2a;
    --bg-hover: #272736;
    --text: #e4e4ec;
    --text-muted: #9696a4;
    --border: #303042;
    --danger: #e53e3e;
    --success: #38a169;
    --warning: #d69e2e;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.22);
}

html { font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
body.no-scroll { overflow: hidden; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ── Header ─────────────────────────────────────────────── */
.header {
    background: rgba(30, 30, 42, .82);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(255,255,255,.07);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow .3s;
}
.header.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1rem;
    height: 56px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -.02em;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity .15s;
}
.logo:hover { opacity: .85; text-decoration: none; }
.logo-icon { color: var(--primary); flex-shrink: 0; }
.logo-text { line-height: 1; }

/* Main nav */
.nav-main {
    display: flex;
    align-items: center;
    gap: .15rem;
    margin-left: .5rem;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .7rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all .15s;
    text-decoration: none;
}
.nav-link svg { opacity: .55; transition: opacity .15s; flex-shrink: 0; }
.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,.07);
    color: var(--text);
    text-decoration: none;
}
.nav-link:hover svg,
.nav-link.active svg { opacity: .9; }
.nav-link.active {
    color: var(--primary);
    background: rgba(27,217,106,.08);
}
.nav-link.active svg { opacity: 1; color: var(--primary); }

.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 12, .58);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
    z-index: 1080;
}
body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Header search */
.header-search {
    flex: 1;
    min-width: 0;
    max-width: 340px;
    margin-left: auto;
    position: relative;
}
.header-search-form { width: 100%; }
.header-search .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.header-search .search-input {
    width: 100%;
    height: 36px;
    padding: 0 2rem 0 2.2rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    color: var(--text);
    font-size: .82rem;
    transition: all .2s;
}
.header-search .search-input::placeholder {
    color: var(--text-muted);
    opacity: .65;
}
.header-search .search-input:focus {
    outline: none;
    background: rgba(255,255,255,.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,217,106,.12);
}
.header-search .search-icon {
    position: absolute;
    left: .6rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color .2s;
    opacity: .6;
}
.header-search .search-input-wrapper:focus-within .search-icon {
    color: var(--primary);
    opacity: 1;
}
.search-kbd {
    position: absolute;
    right: .5rem;
    padding: .08rem .35rem;
    font-size: .65rem;
    font-family: inherit;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 4px;
    color: var(--text-muted);
    pointer-events: none;
    line-height: 1.5;
    opacity: .6;
}

/* Header actions (right side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-left: .5rem;
    flex-shrink: 0;
}

/* Icon buttons in header */
.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    flex-shrink: 0;
}
.header-icon-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--text);
    text-decoration: none;
}
.header-icon-btn.active {
    color: var(--primary);
    background: rgba(27,217,106,.1);
}
.header-search-toggle { display: none; }

/* Ghost button variant */
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,.1);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(255,255,255,.2);
    background: rgba(255,255,255,.05);
}

/* ── User dropdown ──────────────────────────────────────── */
.user-dropdown-wrap { position: relative; }
.user-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .5rem .25rem .25rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: var(--text);
    cursor: pointer;
    transition: all .15s;
    font-size: .82rem;
    font-weight: 500;
}
.user-dropdown-toggle:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.12);
}
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}
.user-avatar--mobile { width: 32px; height: 32px; font-size: .85rem; border-radius: 8px; }
.user-name-desktop {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-chevron {
    color: var(--text-muted);
    transition: transform .2s;
    flex-shrink: 0;
}
.user-dropdown-wrap.open .user-chevron { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.97);
    transition: all .18s cubic-bezier(.4,0,.2,1);
    z-index: 500;
    overflow: hidden;
}
.user-dropdown-wrap.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.user-dropdown-header {
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--border);
}
.user-dropdown-name {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
    line-height: 1.3;
}
.user-dropdown-email {
    display: block;
    font-size: .72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: .1rem;
}
.user-dropdown-body { padding: .35rem 0; }
.user-dropdown-footer {
    border-top: 1px solid var(--border);
    padding: .35rem 0;
}
.user-dropdown-logout { margin: 0; }
.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .5rem .85rem;
    font-size: .82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .12s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.user-dropdown-item:hover {
    background: rgba(255,255,255,.06);
    color: var(--text);
    text-decoration: none;
}
.user-dropdown-item svg { opacity: .55; flex-shrink: 0; }
.user-dropdown-item:hover svg { opacity: .85; }
.user-dropdown-item--admin { color: var(--warning); }
.user-dropdown-item--admin:hover { color: var(--warning); background: rgba(214,158,46,.08); }
.user-dropdown-item--danger { color: var(--danger); }
.user-dropdown-item--danger:hover { background: rgba(229,62,62,.08); }

/* ── Burger (mobile) ────────────────────────────────────── */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4.5px;
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background .15s;
    margin-left: .1rem;
}
.burger:hover { background: rgba(255,255,255,.08); }
body.menu-open .burger {
    position: fixed;
    top: 11px;
    right: max(12px, env(safe-area-inset-right));
    z-index: 1200;
    background: rgba(255,255,255,.08);
}
.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    transform-origin: center;
}
.burger.open .burger-line:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.burger.open .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.burger.open .burger-line:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile search expanded state */
.header-search.mobile-expanded {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
    padding: 0 .75rem;
    background: rgba(30, 30, 42, .95);
    backdrop-filter: blur(16px);
    z-index: 10;
}
.header-search.mobile-expanded .search-input {
    height: 40px;
    font-size: .9rem;
    border-radius: 10px;
}
.mobile-search-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: .4rem;
    transition: all .15s;
}
.mobile-search-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.header-search.mobile-expanded .mobile-search-close { display: inline-flex; }

/* ── Responsive: Tablet ─────────────────────────────────── */
@media (max-width: 960px) {
    .nav-main {
        position: fixed;
        top: 0;
        right: 0;
        bottom: auto;
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        margin-left: 0;
        padding: 72px 1rem calc(1rem + env(safe-area-inset-bottom));
        background: rgba(30, 30, 42, .98);
        border-left: none;
        box-shadow: -12px 0 28px rgba(0,0,0,.25);
        z-index: 1100;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .25rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
    }
    body.menu-open .nav-main {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-main .nav-link {
        width: 100%;
        border-radius: 10px;
        padding: .72rem .85rem;
        font-size: .92rem;
    }
    .nav-main .nav-link svg {
        width: 18px;
        height: 18px;
        opacity: .5;
    }
    .burger { display: flex; }
    .header-search { max-width: 260px; }
    .user-name-desktop { display: none; }
}

/* ── Responsive: Phone ──────────────────────────────────── */
@media (max-width: 640px) {
    .header-inner { padding: 0 .75rem; }
    .header-search { display: none; max-width: none; }
    .header-search-toggle { display: inline-flex; }
    .header-search.mobile-expanded { display: flex; }
    .header-actions { gap: .2rem; margin-left: auto; }
    .header-actions > .btn-primary { display: none; }
}

/* Search input */
.search-input {
    width: 100%;
    padding: .5rem .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-input-lg { padding: .75rem 1rem; font-size: 1rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #000; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27, 217, 106, 0.3); }
.btn-secondary { background: var(--bg-hover); border: 2px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(27, 217, 106, 0.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 0.5rem 1rem; font-size: .9rem; }
.btn-xs { padding: 0.3rem 0.7rem; font-size: .75rem; }
.btn-block { width: 100%; }
.inline-form { display: inline; }

/* Alerts */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-success { background: rgba(56,161,105,.15); border: 1px solid var(--success); color: var(--success); }
.alert-danger { background: rgba(229,62,62,.15); border: 1px solid var(--danger); color: var(--danger); }
.alert-warning { background: rgba(214,158,46,.15); border: 1px solid var(--warning); color: var(--warning); }
.alert-info { background: rgba(27,217,106,.1); border: 1px solid var(--primary); color: var(--primary); }

/* Badges */
.badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--bg-hover);
    color: var(--text-muted);
}
.badge-type { background: rgba(27,217,106,.15); color: var(--primary); }
.badge-release { background: rgba(56,161,105,.2); color: var(--success); }
.badge-beta { background: rgba(214,158,46,.2); color: var(--warning); }
.badge-alpha { background: rgba(229,62,62,.2); color: var(--danger); }
.badge-new { background: rgba(27,217,106,.2); color: var(--primary); }
.badge-update { background: rgba(214,158,46,.2); color: var(--warning); }
.badge-admin { background: rgba(229,62,62,.2); color: var(--danger); }
.badge-published { background: rgba(56,161,105,.2); color: var(--success); }
.badge-pending { background: rgba(214,158,46,.2); color: var(--warning); }
.badge-rejected { background: rgba(229,62,62,.15); color: var(--danger); border: 1px solid rgba(229,62,62,0.3); }
.badge-hidden { background: rgba(128,128,128,.2); color: var(--text-muted); }
.badge-approved { background: rgba(56,161,105,.2); color: var(--success); }

/* Tags */
.tag {
    display: inline-block;
    padding: .1rem .4rem;
    font-size: .75rem;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-muted);
}
.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag.active {
    background: rgba(27,217,106,.22);
    color: var(--primary);
    border: 1px solid rgba(27,217,106,.4);
}

.tag.tag-disabled {
    opacity: .5;
    cursor: not-allowed;
    border: 1px dashed rgba(255,255,255,.16);
}

/* Main */
.main { padding: 2rem 0; min-height: calc(100vh - 120px); }

/* Footer */
/* ── Footer (minimalist) ── */
.footer {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: .82rem;
    padding: 1.25rem 0 1rem;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem .75rem;
}
.footer-copyright {
    margin: 0;
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.footer-custom-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem .75rem;
}
.footer-custom-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: .8rem;
    transition: color .15s;
}
.footer-custom-links a:hover {
    color: var(--primary);
}
.footer-counter {
    display: flex;
    justify-content: center;
    margin-top: .75rem;
}
.footer-counter img {
    display: block;
    width: 31px;
    height: 34px;
}

/* Footer responsive — tablet */
@media (max-width: 768px) {
    .footer {
        padding: 1rem 0 .75rem;
    }
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: .4rem;
    }
}

/* Footer responsive — mobile */
@media (max-width: 480px) {
    .footer {
        padding: .75rem 0 .5rem;
        margin-top: 2rem;
    }
}

/* Hero (legacy) */
.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}
.hero h1 { font-size: 2rem; margin-bottom: .5rem; }
.hero p { color: var(--text-muted); margin-bottom: 1.5rem; }
.hero-search { display: flex; gap: .5rem; max-width: 560px; margin: 0 auto; align-items: stretch; }

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

/* Category card (legacy) */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .2s;
    text-decoration: none;
    color: var(--text);
}
.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
}
.category-card h3 { margin-bottom: .5rem; }
.category-count { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

/* Project card (legacy) */
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all .2s;
    color: var(--text);
}
.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
}
.project-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.project-card-icon img { width: 64px; height: 64px; border-radius: var(--radius); }
.project-card-info { padding: 0 1rem 1rem; }
.project-card-title { font-size: 1rem; margin-bottom: .3rem; }
.project-card-desc { font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.project-card-meta { display: flex; gap: .5rem; align-items: center; font-size: .75rem; }
.downloads { color: var(--text-muted); }

/* ============================================================
   Homepage redesign (hp-*)
   ============================================================ */

/* ── Hero ──────────────────────────────────────────── */
.hp-hero {
    position: relative;
    text-align: center;
    padding: 3.5rem 0 3rem;
    margin: -1rem -1rem 0;
    overflow: hidden;
}
.hp-hero-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(27,217,106,.10) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 20% 100%, rgba(27,217,106,.06) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 80% 100%, rgba(99,102,241,.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.hp-hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem;
}
.hp-hero-title {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: .5rem;
    background: linear-gradient(135deg, var(--text) 40%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hp-hero-sub,
.hp-hero-lead {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ── Hero search ───────────────────────────────────── */
.hp-search {
    max-width: 540px;
    margin: 0 auto;
}
.hp-search-field {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .25rem .3rem .25rem .9rem;
    gap: .5rem;
    transition: border-color .2s, box-shadow .2s;
}
.hp-search-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,217,106,.12);
}
.hp-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}
.hp-search-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: .93rem;
    padding: .55rem 0;
    font-family: inherit;
}
.hp-search-input::placeholder { color: var(--text-muted); opacity: .7; }
.hp-search-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .55rem 1.2rem;
    background: var(--primary);
    color: #0d1117;
    border: none;
    border-radius: 9px;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
}
.hp-search-btn:hover { background: var(--primary-dark); }
.hp-search-btn:active { transform: scale(.97); }
.hp-search-btn-icon { display: none; }

/* Quick tags below search */
.hp-search-tags {
    display: flex;
    justify-content: center;
    gap: .4rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.hp-tag {
    display: inline-block;
    padding: .22rem .7rem;
    font-size: .75rem;
    color: var(--text-muted);
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 20px;
    text-decoration: none;
    transition: all .15s;
}
.hp-tag:hover {
    color: var(--primary);
    border-color: rgba(27,217,106,.25);
    background: rgba(27,217,106,.06);
    text-decoration: none;
}

/* ── Sections ──────────────────────────────────────── */
.hp-section {
    margin-top: 2.5rem;
    margin-bottom: .5rem;
}
.hp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: .75rem;
    flex-wrap: wrap;
}
.hp-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.hp-section-sub {
    color: var(--text-muted);
    font-size: .82rem;
    margin-left: .25rem;
}
.hp-section-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .82rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity .15s;
}
.hp-section-link:hover { opacity: .8; text-decoration: none; }

/* ── Category list ─────────────────────────────────── */
.hp-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
}
.hp-cat {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    transition: all .18s;
    min-width: 0;
}
.hp-cat:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.hp-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(27,217,106,.08);
    color: var(--primary);
    flex-shrink: 0;
}
.hp-cat-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.hp-cat-name {
    font-weight: 600;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-cat-desc {
    font-size: .72rem;
    color: var(--text-muted);
}
.hp-cat-count {
    font-weight: 700;
    font-size: .95rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-left: auto;
}
.hp-cat-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: all .18s;
}
.hp-cat:hover .hp-cat-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ── Project card grid ─────────────────────────────── */
.hp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .7rem;
}
.hp-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .9rem;
    color: var(--text);
    text-decoration: none;
    transition: all .18s;
    min-width: 0;
}
.hp-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    text-decoration: none;
}
.hp-card-top {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: .55rem;
}
.hp-card-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-hover);
}
.hp-card-head {
    min-width: 0;
    flex: 1;
}
.hp-card-title {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: .2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hp-card-badge {
    display: inline-block;
    padding: .1rem .45rem;
    font-size: .65rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(27,217,106,.09);
    border-radius: 4px;
    letter-spacing: .01em;
}
.hp-card-desc {
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .6rem;
    flex: 1;
}
.hp-card-foot {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: auto;
}
.hp-card-stat {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--text-muted);
}

/* ── Homepage responsive ───────────────────────────── */

/* Tablet landscape */
@media (max-width: 1024px) {
    .hp-grid { grid-template-columns: repeat(3, 1fr); }
    .hp-categories { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .hp-hero { padding: 2.5rem 0 2rem; }
    .hp-hero-title { font-size: 1.65rem; }
    .hp-hero-sub { font-size: .88rem; }
    .hp-grid { grid-template-columns: repeat(2, 1fr); }
    .hp-categories { grid-template-columns: repeat(2, 1fr); }
    .hp-cat-desc { display: none; }
    .hp-section-sub { display: none; }
}

/* Mobile */
@media (max-width: 540px) {
    .hp-hero { padding: 2rem 0 1.5rem; margin: -.5rem -.5rem 0; }
    .hp-hero-title { font-size: 1.4rem; }
    .hp-hero-sub { font-size: .85rem; margin-bottom: 1.2rem; }
    .hp-search-btn-text { display: none; }
    .hp-search-btn-icon { display: inline-block; }
    .hp-search-btn { padding: .55rem .7rem; }
    .hp-search-field { padding: .2rem .25rem .2rem .75rem; border-radius: 10px; }
    .hp-search-input { font-size: .87rem; }
    .hp-grid { grid-template-columns: 1fr; gap: .55rem; }
    .hp-card { flex-direction: row; gap: .7rem; padding: .7rem; }
    .hp-card-top { margin-bottom: 0; flex-shrink: 0; }
    .hp-card-head { display: flex; flex-direction: column; }
    .hp-card-desc { display: none; }
    .hp-card-foot { margin-top: .15rem; }
    .hp-card-img { width: 40px; height: 40px; }
    .hp-categories { grid-template-columns: 1fr; gap: .45rem; }
    .hp-cat { padding: .65rem .8rem; }
    .hp-cat-icon { width: 36px; height: 36px; border-radius: 8px; }
    .hp-cat-arrow { display: none; }
    .hp-section { margin-top: 1.8rem; }
    .hp-section-head { margin-bottom: .7rem; }
    .hp-section-title { font-size: 1.1rem; }
    .hp-search-tags { gap: .3rem; }
    .hp-tag { font-size: .7rem; padding: .18rem .55rem; }
}

/* Project list (rows) */
.project-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.project-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: .85rem;
    row-gap: 0;
    padding: .85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    color: var(--text);
    text-decoration: none;
    position: relative;
}
.project-row:hover {
    border-color: rgba(27, 217, 106, .45);
    box-shadow: 0 2px 12px rgba(27, 217, 106, .08);
    text-decoration: none;
    transform: translateY(-1px);
}
.project-row:active {
    transform: translateY(0);
}

/* ── Server row card ────────────────────────────────── */
.server-row {
    border-left: 3px solid transparent;
    transition: border-color .2s, box-shadow .25s, transform .18s;
}

.server-row.server-highlight--sage {
    border-left-color: #7aa386;
    background: linear-gradient(100deg, rgba(122, 163, 134, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--ocean {
    border-left-color: #6f8fa9;
    background: linear-gradient(100deg, rgba(111, 143, 169, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--steel {
    border-left-color: #7f8a96;
    background: linear-gradient(100deg, rgba(127, 138, 150, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--sand {
    border-left-color: #b3966b;
    background: linear-gradient(100deg, rgba(179, 150, 107, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--moss {
    border-left-color: #7f9a67;
    background: linear-gradient(100deg, rgba(127, 154, 103, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--denim {
    border-left-color: #6e84a8;
    background: linear-gradient(100deg, rgba(110, 132, 168, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--rosewood {
    border-left-color: #9f7d7d;
    background: linear-gradient(100deg, rgba(159, 125, 125, .13) 0%, var(--bg-card) 50%);
}
.server-row.server-highlight--smoke {
    border-left-color: #8f9198;
    background: linear-gradient(100deg, rgba(143, 145, 152, .13) 0%, var(--bg-card) 50%);
}

.server-rank-tag {
    border: 1px solid rgba(255, 255, 255, .12);
    color: #ccd4df;
    background: rgba(255, 255, 255, .04);
}
.server-rank-tag--points {
    border-color: rgba(118, 172, 255, .45);
    color: #c6dbff;
    background: rgba(95, 141, 212, .2);
}

.project-row.server-row {
    grid-template-columns: 52px 1fr;
    grid-template-rows: auto;
    align-items: center;
    column-gap: .75rem;
    padding: .7rem .9rem;
    border-radius: 12px;
}

.project-row.server-row:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2), 0 0 0 1px rgba(27, 217, 106, .3);
}

.project-row.server-row .project-row-info {
    grid-column: 2;
    grid-row: 1;
    gap: .35rem;
}

/* Place badge */
.server-place {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .035);
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 1;
    position: relative;
    flex-shrink: 0;
}

.server-row:hover .server-place {
    border-color: rgba(27, 217, 106, .3);
    background: rgba(27, 217, 106, .06);
}

.server-place-number {
    font-size: .95rem;
    font-weight: 700;
    color: #cdd6e4;
    letter-spacing: -.01em;
}

.server-row:hover .server-place-number {
    color: var(--primary);
}

/* Head row: title + online badge */
.server-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
}

.server-head h3 {
    flex: 1;
    min-width: 0;
}

.server-title-link {
    color: var(--text);
    text-decoration: none;
    transition: color .15s;
}

.server-title-link:hover {
    color: var(--primary);
}

/* Online badge */
.server-online {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 600;
    color: #8a95a6;
    padding: .18rem .5rem .18rem .4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.3;
}

.server-online--live {
    color: #5ee682;
    background: rgba(27, 217, 106, .08);
    border-color: rgba(27, 217, 106, .2);
}

.server-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7589;
    flex-shrink: 0;
}

.server-online--live .server-online-dot {
    background: #34d058;
    box-shadow: 0 0 6px rgba(52, 208, 88, .5);
    animation: server-pulse 2s ease-in-out infinite;
}

@keyframes server-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(52, 208, 88, .5); }
    50% { opacity: .65; box-shadow: 0 0 3px rgba(52, 208, 88, .25); }
}

.server-online-sep {
    opacity: .45;
    font-weight: 400;
}

.server-online-count {
    font-variant-numeric: tabular-nums;
}

.server-online-max {
    font-weight: 400;
    opacity: .6;
    font-variant-numeric: tabular-nums;
}

/* Address line */
.server-address-line {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.server-address {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
    color: #b8c2d0;
    font-size: .74rem;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    line-height: 1.4;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .01em;
}

/* Copy button */
.server-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
    color: #8a95a6;
    border-radius: 6px;
    padding: .18rem .45rem;
    font-size: .7rem;
    line-height: 1.3;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.server-copy-icon {
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .18s;
}

.server-copy-btn:hover {
    border-color: rgba(27, 217, 106, .4);
    color: var(--primary);
    background: rgba(27, 217, 106, .06);
}

.server-copy-btn:hover .server-copy-icon {
    opacity: 1;
}

.server-copy-btn--done {
    border-color: rgba(27, 217, 106, .5);
    color: var(--primary);
    background: rgba(27, 217, 106, .1);
}

/* Meta row: version, votes, points */
.server-meta-row {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.server-stat {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .72rem;
    color: #8a95a6;
    line-height: 1.3;
    min-width: 0;
    padding: .12rem .4rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid rgba(255, 255, 255, .05);
    white-space: nowrap;
    transition: color .15s, background .15s;
}

.server-row:hover .server-stat {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .08);
}

.server-stat .icon {
    color: #6e7a8d;
    font-size: .65rem;
}

.server-stat--votes .icon {
    color: #c07070;
}

.server-stat--points .icon {
    color: #b0a050;
}

/* Icon */
.project-row-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    grid-row: 1 / 3;
    align-self: center;
    object-fit: cover;
    background: var(--bg-hover);
}

/* Info block */
.project-row-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.project-row-info h3 {
    font-size: .92rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-row-info p {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tags row */
.project-row-tags {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    gap: .3rem;
    margin-top: .4rem;
    flex-wrap: wrap;
    align-items: center;
}
.project-row-tags .tag {
    font-size: .68rem;
    padding: .1rem .4rem;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-muted);
    line-height: 1.5;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.project-row:hover .project-row-tags .tag {
    background: rgba(255, 255, 255, .07);
}

/* Meta column */
.project-row-meta {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: .2rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.project-row-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.project-row-meta svg {
    opacity: .5;
    flex-shrink: 0;
}
.project-row-meta .meta-downloads {
    color: var(--text);
    font-weight: 500;
    font-size: .75rem;
}

/* ── Project card responsive ─────────────────────── */
@media (max-width: 860px) {
    .project-row {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        padding: .75rem .85rem;
    }
    .project-row-icon {
        width: 40px;
        height: 40px;
        grid-row: 1 / 2;
    }
    .project-row-info {
        grid-column: 2;
        grid-row: 1;
    }
    .project-row-meta {
        grid-column: 2;
        grid-row: 3;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: .6rem;
        margin-top: .35rem;
    }
    .project-row-tags {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: .35rem;
    }

    .project-row.server-row {
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto;
        padding: .65rem .75rem;
    }

    .server-place {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .server-place-number {
        font-size: .88rem;
    }

    .server-head {
        flex-wrap: wrap;
        gap: .35rem;
    }

    .server-online {
        font-size: .68rem;
        padding: .14rem .4rem .14rem .35rem;
    }

    .server-meta-row {
        gap: .25rem;
    }

    .server-stat {
        font-size: .68rem;
        padding: .1rem .32rem;
    }
}

@media (max-width: 480px) {
    .project-list {
        gap: .45rem;
    }
    .project-row {
        column-gap: .65rem;
        padding: .65rem .7rem;
        border-radius: 8px;
    }
    .project-row-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .project-row-info h3 {
        font-size: .85rem;
    }
    .project-row-info p {
        font-size: .76rem;
        -webkit-line-clamp: 2;
    }
    .project-row-tags .tag {
        font-size: .64rem;
        padding: .05rem .3rem;
    }
    .project-row-meta span {
        font-size: .68rem;
    }

    .project-row.server-row {
        grid-template-columns: 42px 1fr;
        column-gap: .5rem;
        padding: .55rem .6rem;
        border-radius: 10px;
    }

    .server-place {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }

    .server-place-number {
        font-size: .8rem;
    }

    .server-head {
        gap: .3rem;
    }

    .server-online {
        font-size: .64rem;
        padding: .12rem .35rem .12rem .3rem;
        gap: .22rem;
    }

    .server-online-dot {
        width: 5px;
        height: 5px;
    }

    .server-address-line {
        gap: .3rem;
    }

    .server-address {
        font-size: .68rem;
        padding: .12rem .4rem;
    }

    .server-copy-btn {
        padding: .14rem .35rem;
        font-size: .66rem;
    }

    .server-copy-label {
        display: none;
    }

    .server-meta-row {
        gap: .2rem;
    }

    .server-stat {
        font-size: .66rem;
        padding: .08rem .28rem;
    }
}

/* Project detail (blog-post layout) */
.post {
    max-width: 820px;
    margin: 0 auto;
    padding-top: .5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.post-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.post-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .75rem;
}
.post-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    flex-shrink: 0;
    object-fit: cover;
}
.post-title-group { flex: 1; min-width: 0; }
.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}
.post-subtitle {
    font-size: .92rem;
    color: var(--text-muted);
    margin: .25rem 0 0;
    line-height: 1.4;
}
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
.post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    white-space: nowrap;
}
.post-meta-item svg { opacity: .65; flex-shrink: 0; }
.post-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.post-cats {
    display: inline-flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-left: .25rem;
}

/* Tabs (kept for other pages) */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: .6rem 1.25rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all .2s;
    font-size: .9rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab:hover, .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Project body + sidebar (legacy) */
.project-body { flex: 1; word-wrap: break-word; overflow-wrap: break-word; }
.project-sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.project-sidebar h3 { font-size: .9rem; margin-bottom: .5rem; color: var(--text-muted); }
.info-list { margin-bottom: 1rem; }
.info-list dt { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.info-list dd { font-size: .9rem; }

/* Prose (body content) */
.prose { line-height: 1.8; }
.prose h1,
.prose h2,
.prose h3 { margin: 1.5rem 0 .75rem; }
.prose p { margin-bottom: .75rem; }
.prose img { border-radius: var(--radius); max-width: 100%; height: auto; cursor: pointer; transition: filter .2s; }
.prose img:hover { filter: brightness(1.1); }
.prose code {
    background: var(--bg-hover);
    padding: .1rem .3rem;
    border-radius: 3px;
    font-size: .85em;
}
.prose pre {
    background: var(--bg-hover);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}
.prose .content-media {
    margin: 1rem 0 1.25rem;
    width: fit-content;
    max-width: 100%;
}
.prose .content-media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
}
.prose .content-media-image--small {
    max-width: 480px;
}
.prose .content-media-image--medium {
    max-width: 960px;
}
.prose .content-media-image--original {
    max-width: 1366px;
}
.prose .content-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .7rem;
    margin: 1rem 0 1.25rem;
}
.prose .content-gallery-item {
    margin: 0;
    padding: 0;
}
.prose .content-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
}
.prose .content-attachment {
    display: inline-flex;
    align-items: baseline;
    gap: .6rem;
    margin: .5rem 0;
    padding: .5rem .7rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    background: rgba(255,255,255,.03);
}
.prose .content-attachment:hover {
    border-color: rgba(27,217,106,.55);
    background: rgba(27,217,106,.06);
    text-decoration: none;
}
.prose .content-attachment-name {
    color: var(--text);
    font-weight: 600;
}
.prose .content-attachment-meta {
    color: var(--text-muted);
    font-size: .8rem;
}

/* Post body */
.post-body {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Post section titles */
.post-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.post-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--bg);
    font-size: .7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    line-height: 1;
}

/* Post Gallery */
.post-gallery {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.post-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .5rem;
}
.post-gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 10;
    background: var(--bg-card);
}
.post-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s, filter .25s;
}
.post-gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.post-gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 60%, rgba(0,0,0,.5));
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}
.post-gallery-item:hover::after { opacity: 1; }
.post-gallery-zoom {
    position: absolute;
    bottom: .5rem;
    right: .5rem;
    color: #fff;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
.post-gallery-item:hover .post-gallery-zoom { opacity: 1; }
.post-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .4rem .6rem;
    font-size: .72rem;
    color: #fff;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    z-index: 1;
}
.post-gallery-item:hover .post-gallery-caption { opacity: 1; }
/* Featured first image larger */
.post-gallery-grid.has-many .post-gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

/* Legacy gallery scroll (kept for compatibility) */
.gallery-scroll {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.gallery-scroll::-webkit-scrollbar { height: 6px; }
.gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.gallery-scroll-item {
    flex: 0 0 auto;
    width: min(380px, 80vw);
    scroll-snap-align: start;
}
.gallery-scroll-item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

/* ── Lightbox ──────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-img {
    max-width: min(90vw, 1200px);
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.4);
    transition: transform .3s;
    user-select: none;
    -webkit-user-select: none;
}
.lightbox-overlay.active .lightbox-img {
    animation: lightboxZoomIn .3s ease-out;
}
@keyframes lightboxZoomIn {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background .15s;
    z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    z-index: 1;
}
.lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-nav--prev { left: 1rem; }
.lightbox-nav--next { right: 1rem; }
.lightbox-nav[hidden] { display: none; }
.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    z-index: 1;
}
.lightbox-caption {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .85rem;
    color: rgba(255,255,255,.8);
    text-align: center;
    max-width: 80vw;
    z-index: 1;
}

/* Post Downloads */
.post-downloads {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.post-downloads-filter {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}
.post-filter-select {
    padding: .5rem .75rem;
    padding-right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .88rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    min-width: 120px;
}
.post-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,217,106,.1);
}
.post-filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    padding: 0;
}
.post-filter-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.post-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: .88rem;
}

/* Post version list */
.post-version-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.post-version {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .7rem .9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s;
}
.post-version:hover { border-color: var(--primary); }
.post-version-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.post-version-info {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex: 1;
    min-width: 0;
}
.post-version-name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-version-name:hover { color: var(--primary); }
.post-version-date {
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.post-version-tags {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}
.post-version-tag {
    display: inline-flex;
    align-items: center;
    padding: .15rem .45rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1.3;
}
.post-version-tag--loader {
    background: rgba(148,163,184,.12);
    color: #cbd5e1;
    border: 1px solid rgba(148,163,184,.28);
}
.post-version-tag--loader-fabric {
    background: rgba(125,223,100,.12);
    color: #7ddf64;
    border: 1px solid rgba(125,223,100,.3);
}
.post-version-tag--loader-forge {
    background: rgba(251,146,60,.12);
    color: #fb923c;
    border: 1px solid rgba(251,146,60,.32);
}
.post-version-tag--loader-neoforge {
    background: rgba(45,212,191,.12);
    color: #2dd4bf;
    border: 1px solid rgba(45,212,191,.3);
}
.post-version-tag--loader-quilt {
    background: rgba(96,165,250,.12);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,.3);
}
.post-version-tag--loader-paper {
    background: rgba(250,204,21,.12);
    color: #facc15;
    border: 1px solid rgba(250,204,21,.32);
}
.post-version-tag--loader-spigot {
    background: rgba(248,113,113,.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,.3);
}
.post-version-tag--loader-bukkit {
    background: rgba(167,139,250,.12);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,.3);
}
.post-version-tag--loader-vanilla {
    background: rgba(203,213,225,.12);
    color: #e2e8f0;
    border: 1px solid rgba(203,213,225,.28);
}
.post-version-tag--ver {
    background: rgba(27,217,106,.08);
    color: var(--primary);
    border: 1px solid rgba(27,217,106,.2);
}
.post-version-dl {
    display: flex;
    gap: .3rem;
    flex-shrink: 0;
}
.post-version-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin-top: .75rem;
}
.post-version-summary {
    margin: 0;
    font-size: .8rem;
    color: var(--text-muted);
}
.post-version-more {
    min-height: 34px;
}

/* Post comments */
.post-comments {
    padding-top: 0;
}

/* Versions (legacy) */
.version-list { display: flex; flex-direction: column; gap: .5rem; }
.version-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.version-info { flex: 1; }
.version-info h3 { font-size: 1rem; margin-bottom: .3rem; }
.version-meta { display: flex; gap: .75rem; font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; }
.version-files { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }

/* Version detail */
.version-detail-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; font-size: .9rem; }

/* File list (version detail page) */
.file-list { margin-bottom: 1.5rem; }
.file-row { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.file-size { color: var(--text-muted); font-size: .85rem; }
.file-hash { font-size: .7rem; color: var(--text-muted); }

/* Dependencies */
.dependency-list { margin-bottom: 1.5rem; }
.dependency-row { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.dependency-row:last-child { border-bottom: none; }
.dependency-link { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--primary); text-decoration: none; }
.dependency-link:hover { text-decoration: underline; }
.dependency-icon { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.dependency-pending { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.dependency-missing { color: var(--text-muted); }
.dependency-external { color: var(--text-muted); text-decoration: underline; }
.badge-warning { background: #f0ad4e; color: #fff; }

/* Gallery (legacy grid) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}
.gallery-item img {
    width: 100%;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform .2s;
}
.gallery-item img:hover { transform: scale(1.02); }
.gallery-caption { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; text-align: center; }

/* Comments Section */
.comments-section { margin-top: 2.5rem; }
.comments-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.comments-header h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.comments-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: var(--bg); font-size: .75rem;
    font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 11px; line-height: 1;
}

/* Main comment form */
.comment-form-main {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem; margin-bottom: 2rem;
    transition: border-color .2s;
}
.comment-form-main:focus-within { border-color: var(--primary); }
.comment-form-inner { display: flex; gap: .75rem; }
.comment-form-avatar { flex-shrink: 0; }
.comment-form-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.comment-form-avatar .avatar-placeholder { width: 36px; height: 36px; font-size: .85rem; }
.comment-form-body { flex: 1; min-width: 0; }
.comment-textarea {
    width: 100%; min-height: 72px; resize: vertical;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .75rem; color: var(--text);
    font-size: .9rem; line-height: 1.5; font-family: inherit;
    transition: border-color .2s;
}
.comment-textarea:focus { outline: none; border-color: var(--primary); }
.textarea-sm { min-height: 56px; padding: .6rem; font-size: .85rem; }
.comment-form-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: .5rem; gap: .5rem;
}
.comment-form-actions { display: flex; gap: .5rem; align-items: center; }
.comment-char-count { font-size: .75rem; color: var(--text-muted); }
.comment-char-count.near-limit { color: var(--warning, #f59e0b); }
.comment-char-count.at-limit { color: var(--danger); }

/* Login prompt */
.comment-login-prompt {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    margin-bottom: 2rem; color: var(--text-muted); font-size: .9rem;
}
.comment-login-prompt a { color: var(--primary); font-weight: 600; }
.comment-login-prompt a:hover { text-decoration: underline; }

/* Empty state */
.comments-empty {
    text-align: center; padding: 2.5rem 1rem; color: var(--text-muted);
    font-size: .9rem;
}

/* Comment list */
.comment-list { display: flex; flex-direction: column; gap: .5rem; position: relative; }

/* Individual comment */
.comment { position: relative; transition: opacity .3s, transform .3s; }
.comment.comment-removing { opacity: 0; transform: translateX(-20px); }
.comment-new-highlight .comment-inner { animation: commentFlash .8s ease; }
@keyframes commentFlash {
    0%, 100% { border-color: var(--border); }
    40% { border-color: var(--primary); box-shadow: 0 0 12px rgba(27, 217, 106, .15); }
}

.comment-inner {
    display: flex; gap: .75rem; padding: 1rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); transition: border-color .2s;
}
.comment-inner:hover { border-color: rgba(27, 217, 106, .2); }
.comment-pending .comment-inner { border-left: 3px solid var(--warning, #f59e0b); }
.comment-deleted-placeholder .comment-inner { opacity: .5; }

/* Depth indentation via CSS classes */
.comment-depth-1 { margin-left: 30px; }
.comment-depth-2 { margin-left: 60px; }
.comment-depth-3 { margin-left: 90px; }
.comment-depth-4 { margin-left: 120px; }
.comment-depth-5 { margin-left: 150px; }

/* Thread lines for nested comments */
.comment-depth-1::before,
.comment-depth-2::before,
.comment-depth-3::before,
.comment-depth-4::before,
.comment-depth-5::before {
    content: ""; position: absolute;
    left: -15px; top: 0; bottom: 0;
    width: 2px; background: var(--border);
    border-radius: 1px;
}

/* Avatar */
.comment-avatar { flex-shrink: 0; }
.comment-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-hover); display: flex; align-items: center;
    justify-content: center; font-weight: 700; color: var(--primary);
    text-transform: uppercase; font-size: .85rem;
}

/* Comment content */
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: .9rem; }
.comment-author.is-admin { color: var(--primary); }
.comment-date { font-size: .75rem; color: var(--text-muted); }
.comment-edited {
    font-size: .7rem; color: var(--text-muted); font-style: italic;
    cursor: help; display: inline-flex; align-items: center; gap: 3px;
}

.comment-body { font-size: .9rem; line-height: 1.55; color: var(--text); word-wrap: break-word; }

/* Badge */
.badge-pending { background: rgba(245, 158, 11, .15); color: #f59e0b; font-size: .7rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-admin { background: rgba(239, 68, 68, .12); color: var(--danger); font-size: .7rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-site { background: rgba(27, 217, 106, .14); color: #1bd96a; font-size: .7rem; padding: 2px 8px; border-radius: 10px; font-weight: 700; }

/* Comment actions */
.comment-actions { display: flex; gap: .25rem; margin-top: .5rem; flex-wrap: wrap; }
.comment-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 4px 8px;
    font-size: .78rem; color: var(--text-muted);
    cursor: pointer; font-weight: 500; border-radius: 4px;
    transition: background .15s, color .15s;
}
.comment-action-btn:hover { background: var(--bg-hover); color: var(--primary); }
.comment-action-btn.comment-action-danger:hover { color: var(--danger); }
.comment-approve-btn:hover { color: var(--primary); }

/* Inline forms (reply / edit) */
.comment-inline-form {
    margin-top: .75rem; padding: .75rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); animation: slideDown .2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Delete confirm overlay */
.comment-delete-confirm {
    position: absolute; inset: 0; z-index: 5;
    background: rgba(15, 15, 19, .92);
    border-radius: var(--radius); display: flex;
    align-items: center; justify-content: center; gap: .75rem;
    animation: fadeIn .15s ease;
}
.comment-delete-confirm span { font-size: .9rem; color: var(--text); }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 640px) {
    .comment-depth-1 { margin-left: 16px; }
    .comment-depth-2 { margin-left: 32px; }
    .comment-depth-3 { margin-left: 48px; }
    .comment-depth-4,
    .comment-depth-5 { margin-left: 56px; }
    .comment-inner { padding: .75rem; gap: .5rem; }
    .comment-avatar img, .avatar-placeholder { width: 30px; height: 30px; font-size: .75rem; }
    .comment-form-avatar img, .comment-form-avatar .avatar-placeholder { width: 30px; height: 30px; }
    .comments-header h2 { font-size: 1.1rem; }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0 0 1rem;
    font-size: .86rem;
    color: var(--text-muted);
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumbs a:hover {
    color: var(--primary);
}
.crumb-sep {
    color: var(--text-muted);
    opacity: .8;
}
.crumb-current {
    color: var(--text);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    gap: .3rem;
    justify-content: center;
    margin: 2rem 0;
}
.pagination-link {
    padding: .4rem .7rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: .85rem;
}
.pagination-link:hover {
    border-color: var(--primary);
    text-decoration: none;
}
.pagination-link.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}
.pagination-dots { padding: .4rem .3rem; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}
.input, .textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 217, 106, 0.1);
}
.textarea { resize: vertical; min-height: 100px; }
.textarea-sm { min-height: 60px; }
.textarea-code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: .85rem; }
.input-sm { padding: .4rem .6rem; font-size: .85rem; width: auto; }

/* Checkbox styling */
.checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    background-size: 12px 12px;
    background-repeat: no-repeat;
    background-position: center;
}
.checkbox:hover {
    border-color: var(--primary);
}
.checkbox:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="%23fff" d="M7 11l2 2 5-5" stroke="%23fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
}
.checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 217, 106, 0.2);
}

/* Auth page */
.auth-page {
    max-width: 480px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    animation: authFadeIn .4s ease;
}
@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(30, 30, 42, 0.95) 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.auth-header {
    text-align: center;
    padding: 2rem 2rem 0;
}
.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(27, 217, 106, 0.1);
    border: 1px solid rgba(27, 217, 106, 0.2);
    color: var(--primary);
    margin-bottom: 1rem;
}
.auth-header h1 {
    font-size: 1.5rem;
    margin: 0 0 .35rem;
    color: var(--text);
    font-weight: 700;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
    margin: 0;
}
.auth-form {
    padding: 1.75rem 2rem 2rem;
}
.auth-link {
    text-align: center;
    font-size: .9rem;
    color: var(--text-muted);
    margin: 0;
}
.auth-link a { color: var(--primary); font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }
.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-weight: 600;
}
.auth-back-link:hover { text-decoration: underline; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Input with icon */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: .85rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
    transition: color .2s;
}
.input-icon-wrap:focus-within .input-icon { color: var(--primary); }
.input-with-icon { padding-left: 2.6rem; }
.input-with-toggle { padding-right: 2.8rem; }

/* Password toggle */
.password-toggle {
    position: absolute;
    right: .65rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color .2s;
    z-index: 1;
}
.password-toggle:hover { color: var(--text); }

/* Form label row */
.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .6rem;
}
.form-label-row label { margin-bottom: 0; }
.form-label-link {
    font-size: .8rem;
    color: var(--primary);
    font-weight: 500;
}
.form-label-link:hover { text-decoration: underline; }

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 400;
    cursor: pointer;
    font-size: .9rem;
}

/* Auth button */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: 1rem;
    padding: .75rem 1.5rem;
    font-weight: 600;
}

/* Generate button */
.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .78rem;
    padding: .3rem .6rem;
}

/* Password requirements */
.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    margin-top: .75rem;
}
.pw-req {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--text-muted);
    transition: color .2s;
}
.pw-req.met { color: var(--primary); font-weight: 500; }
.pw-req-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    font-size: .65rem;
    transition: all .2s;
    flex-shrink: 0;
}
.pw-req.met .pw-req-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}
.pw-req-icon::after { content: ""; }
.pw-req.met .pw-req-icon::after { content: "\2713"; }

/* Generated password msg */
.generated-password-msg {
    display: none;
    margin-top: .75rem;
    padding: .6rem .85rem;
    background: rgba(27, 217, 106, 0.08);
    border: 1px solid rgba(27, 217, 106, 0.25);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: .85rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 540px) {
    .auth-page { margin: 1.5rem auto; }
    .auth-form { padding: 1.25rem 1.25rem 1.5rem; }
    .auth-header { padding: 1.5rem 1.25rem 0; }
    .auth-header h1 { font-size: 1.3rem; }
    .password-requirements { grid-template-columns: 1fr; }
}

/* Search form */
.search-form { display: block; margin-bottom: 1.5rem; }
.search-form-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: stretch; }
.search-form-input { flex: 1; min-width: 250px; }

/* Search input wrapper with icon */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.search-input-wrapper .search-input {
    padding-left: 2.4rem;
    padding-right: 2.2rem;
}
.search-input-wrapper-lg .search-input {
    padding-left: 2.8rem;
}
.search-icon {
    position: absolute;
    left: .7rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color .2s;
    flex-shrink: 0;
}
.search-input-wrapper-lg .search-icon {
    left: .85rem;
}
.search-input-wrapper:focus-within .search-icon {
    color: var(--primary);
}

/* Search select (type filter) */
.search-select {
    padding: .65rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    padding-right: 2rem;
    min-width: 130px;
}
.search-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 217, 106, 0.1);
}

/* Search button with icon */
.btn-search { gap: .4rem; white-space: nowrap; }
.btn-loading { opacity: .6; pointer-events: none; }

/* Live search dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .4);
    animation: searchDropdownIn .18s cubic-bezier(.4,0,.2,1);
    overscroll-behavior: contain;
}
@keyframes searchDropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .9rem;
    color: var(--text);
    text-decoration: none;
    transition: background .15s;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.search-dropdown-item:last-child { border-bottom: none; }
.search-dropdown-item:hover,
.search-dropdown-item.active {
    background: var(--bg-hover);
    text-decoration: none;
}
.search-dropdown-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg);
}
.search-dropdown-info { flex: 1; min-width: 0; }
.search-dropdown-title {
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.3;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-dropdown-desc {
    font-size: .78rem;
    color: var(--text-muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: .1rem;
}
.search-dropdown-badge {
    flex-shrink: 0;
}
.search-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem .9rem;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: background .15s;
}
.search-dropdown-footer:hover {
    background: var(--bg-hover);
    text-decoration: none;
}
.search-dropdown-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
.search-dropdown-loading {
    padding: 1.2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
.search-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
    margin-right: .4rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search page styles */
.search-page { max-width: 900px; margin: 0 auto; }
.search-page-header { margin-bottom: 1.5rem; }
.search-page-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.6rem;
    color: var(--text);
}
.search-page-title svg { color: var(--primary); flex-shrink: 0; }
.search-page-query { color: var(--primary); }

.search-results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: .5rem 0;
    font-size: .9rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.search-results-count strong {
    color: var(--primary);
}

.search-notice {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .9rem 1.1rem;
    background: rgba(214, 158, 46, .1);
    border: 1px solid rgba(214, 158, 46, .3);
    border-radius: var(--radius);
    color: var(--warning);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.search-results { margin-bottom: 2rem; }
.search-result-row {
    animation: searchResultIn .3s ease-out backwards;
}
@keyframes searchResultIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.download-count {
    display: flex;
    align-items: center;
    gap: .3rem;
    color: var(--text-muted);
}

/* Search empty state */
.search-empty {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 420px;
    margin: 0 auto;
}
.search-empty-icon {
    color: var(--text-muted);
    opacity: .4;
    margin-bottom: 1rem;
}
.search-empty h2 {
    font-size: 1.3rem;
    margin-bottom: .5rem;
    color: var(--text);
}
.search-empty p {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}
.search-empty-tips {
    list-style: none;
    text-align: left;
    display: inline-block;
    color: var(--text-muted);
    font-size: .88rem;
}
.search-empty-tips li {
    padding: .25rem 0;
    padding-left: 1.2rem;
    position: relative;
}
.search-empty-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.mt { margin-top: 1.5rem; }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: .6rem .75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .8rem;
}
.table-icon { width: 32px; height: 32px; border-radius: 4px; }

/* Toolbar */
.toolbar { margin-bottom: 1rem; }
.toolbar-filters { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ── Listing page layout ─────────────────────────── */
.listing-page { }
.listing-header { margin-bottom: 1.5rem; }
.listing-header h1 { margin-bottom: .5rem; }
.listing-header .lead { color: var(--text-muted); font-size: .95rem; margin-bottom: 1rem; }
.listing-filter-toggle-btn { margin-bottom: .75rem; }
.listing-active-filters { margin-bottom: .75rem; }

/* Listing results */
.listing-results { min-width: 0; }
.listing-results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.listing-results-count {
    font-size: .85rem;
    color: var(--text-muted);
}

/* Listing empty  */
.listing-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.listing-empty-icon {
    margin-bottom: 1rem;
    opacity: .5;
}
.listing-empty-text {
    margin-bottom: 1rem;
    font-size: .95rem;
}

/* ── Versions filter (project page) ──────────────── */
.versions-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
}
.versions-header h2 { margin-bottom: 0; }
.versions-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--bg);
    font-size: .7rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    line-height: 1;
}

.versions-filter {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.versions-filter-group {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1;
    min-width: 140px;
}
.versions-filter-label {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.versions-filter-label svg { color: var(--text-muted); }
.versions-filter-select {
    padding: .5rem .75rem;
    padding-right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    width: 100%;
}
.versions-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 217, 106, 0.1);
}
.versions-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .5rem .75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: .8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.versions-filter-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(229,62,62,.06);
}
.versions-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: .9rem;
    display: none;
}

@media (max-width: 540px) {
    .versions-filter { flex-direction: column; }
    .versions-filter-group { min-width: 0; }
}

/* Empty state */
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem; }

/* Error page */
.error-page {
    text-align: center;
    padding: 3rem 0 4rem;
    max-width: 560px;
    margin: 0 auto;
}

/* Illustration */
.error-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.error-svg {
    width: 160px;
    height: 160px;
    opacity: 0;
    animation: errorFadeIn .6s ease forwards;
}

/* Error code */
.error-code {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    margin-bottom: .5rem;
    letter-spacing: -2px;
    opacity: 0;
    animation: errorSlideUp .5s ease .15s forwards;
}
.error-code--danger {
    color: var(--danger);
}

/* Title & description */
.error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .75rem;
    color: var(--text);
    opacity: 0;
    animation: errorSlideUp .5s ease .25s forwards;
}
.error-description {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    opacity: 0;
    animation: errorSlideUp .5s ease .35s forwards;
}

/* Search (404) */
.error-search {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    opacity: 0;
    animation: errorSlideUp .5s ease .4s forwards;
}
.error-search-form .search-input-wrapper {
    position: relative;
}
.error-search-form .search-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.error-search-form .search-input {
    padding-left: 2.5rem;
    font-size: 1rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}

/* Action buttons */
.error-actions {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    opacity: 0;
    animation: errorSlideUp .5s ease .45s forwards;
}

/* Suggestions (404) */
.error-suggestions {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    opacity: 0;
    animation: errorSlideUp .5s ease .55s forwards;
}
.error-suggestions-title {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
.error-suggestions-links {
    display: flex;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Hint (500) */
.error-hint {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
    padding: .5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    opacity: 0;
    animation: errorSlideUp .5s ease .55s forwards;
}

/* Animations */
@keyframes errorFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes errorSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 480px) {
    .error-page { padding: 2rem 0 3rem; }
    .error-svg { width: 120px; height: 120px; }
    .error-code { font-size: 3.5rem; }
    .error-title { font-size: 1.25rem; }
    .error-description { font-size: .9rem; }
    .error-actions { flex-direction: column; align-items: center; }
    .error-actions .btn { width: 100%; max-width: 260px; }
}

/* Stats grid (admin dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.stat-card h3 { font-size: 2rem; color: var(--primary); margin-bottom: .3rem; }
.stat-card p { color: var(--text-muted); font-size: .85rem; }
.stat-warning h3 { color: var(--warning); }

/* Moderation actions */
.moderation-actions .action-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.moderation-actions .inline-form { flex: 1; }
.action-buttons { display: flex; gap: .5rem; }

/* Ban form */
.ban-form { display: flex; gap: .3rem; align-items: center; }

/* ─── Bookmarks ──────────────────────────────────────────── */

/* Bookmarks page */
.bookmarks-page { max-width: 1000px; margin: 0 auto; }
.bookmarks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
}
.bookmarks-header-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.bookmarks-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.5rem;
}
.bookmarks-title svg { color: var(--primary); flex-shrink: 0; }
.bookmarks-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 .5rem;
    background: rgba(27, 217, 106, .15);
    color: var(--primary);
    font-size: .85rem;
    font-weight: 700;
    border-radius: 20px;
}

.bookmarks-types {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: 1.25rem;
}

.bookmarks-type-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: .82rem;
    text-decoration: none;
    transition: all .16s ease;
}

.bookmarks-type-pill:hover {
    text-decoration: none;
    border-color: var(--primary);
    color: var(--primary);
}

.bookmarks-type-pill.active {
    border-color: rgba(27, 217, 106, .45);
    color: var(--primary);
    background: rgba(27, 217, 106, .08);
}

.bookmarks-type-pill-count {
    min-width: 22px;
    height: 22px;
    padding: 0 .45rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--text-muted);
}

.bookmarks-type-pill.active .bookmarks-type-pill-count {
    border-color: rgba(27, 217, 106, .35);
    color: var(--primary);
}

/* Bookmarks grid */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Bookmark card */
.bookmark-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .25s ease;
    animation: bookmarkCardIn .3s ease-out backwards;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
@keyframes bookmarkCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.bookmark-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.bookmark-card-removing {
    opacity: .5;
    pointer-events: none;
}
.bookmark-card-removed {
    animation: bookmarkCardOut .3s ease-in forwards;
}
@keyframes bookmarkCardOut {
    from { opacity: .5; transform: scale(1); max-height: 200px; margin-bottom: 0; }
    to { opacity: 0; transform: scale(.95); max-height: 0; margin-bottom: -1rem; }
}

.bookmark-card-link {
    display: block;
    padding: 1rem;
    color: var(--text);
    text-decoration: none;
    flex: 1;
}
.bookmark-card-link:hover { text-decoration: none; }

.bookmark-card-top {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .6rem;
}
.bookmark-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    flex-shrink: 0;
    object-fit: cover;
    background: var(--bg);
}
.bookmark-card-info { flex: 1; min-width: 0; }
.bookmark-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
}
.bookmark-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bookmark-card-meta {
    display: inline-flex;
    margin-top: .15rem;
    color: var(--text-muted);
    font-size: .75rem;
}
.bookmark-card-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bookmark-card-desc-empty {
    font-style: italic;
    opacity: .9;
}
.bookmark-type-badge {
    white-space: nowrap;
    flex-shrink: 0;
}
.bookmark-type-badge--skin {
    background: rgba(56, 189, 248, .18);
    color: #8edbff;
    border-color: rgba(56, 189, 248, .4);
}
.bookmark-type-badge--project {
    background: rgba(27, 217, 106, .15);
    color: var(--primary);
    border-color: rgba(27, 217, 106, .3);
}
.bookmark-card[data-content-type="skin"] .bookmark-card-icon {
    image-rendering: pixelated;
}

.bookmark-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    border-top: 1px solid var(--border);
    font-size: .78rem;
}
.bookmark-card-date {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-muted);
}
.bookmark-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.bookmark-remove-btn:hover {
    background: rgba(229, 62, 62, .15);
    color: var(--danger);
}

/* Bookmarks empty state */
.bookmarks-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    max-width: 420px;
    margin: 2rem auto;
}
.bookmarks-empty-icon {
    color: var(--text-muted);
    opacity: .3;
    margin-bottom: 1.2rem;
}
.bookmarks-empty h2 {
    font-size: 1.3rem;
    margin-bottom: .5rem;
    color: var(--text);
}
.bookmarks-empty p {
    color: var(--text-muted);
    margin-bottom: .6rem;
    font-size: .92rem;
}
.bookmarks-empty-hint {
    font-size: .85rem;
    color: var(--text-muted);
}
.bookmark-btn-demo {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .8rem;
    vertical-align: middle;
    color: var(--text);
}

/* Bookmark toggle button (project page) */
.bookmark-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.bookmark-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(27, 217, 106, .05);
}
.bookmark-toggle-btn .bookmark-icon-filled { display: none; }
.bookmark-toggle-btn .bookmark-icon-outline { display: inline-block; }

.bookmark-toggle-btn.bookmark-active {
    background: rgba(27, 217, 106, .12);
    border-color: var(--primary);
    color: var(--primary);
}
.bookmark-toggle-btn.bookmark-active .bookmark-icon-filled {
    display: inline-block;
    color: var(--primary);
}
.bookmark-toggle-btn.bookmark-active .bookmark-icon-outline { display: none; }

.bookmark-toggle-btn.bookmark-animating {
    animation: bookmarkPulse .4s ease;
}
@keyframes bookmarkPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.bookmark-toggle-btn:disabled {
    opacity: .6;
    pointer-events: none;
}

/* Nav bookmarks link */
.nav-bookmarks {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

/* Bookmark unverified visual hint */
.bookmark-unverified {
    opacity: .7;
}
.bookmark-unverified:hover {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(214, 158, 46, .06);
}
.bookmark-shake {
    animation: bookmarkShake .4s ease;
}
@keyframes bookmarkShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* ─── Toast notifications ────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    z-index: 9999;
    max-width: 420px;
    font-size: .88rem;
    color: var(--text);
    animation: toastIn .3s ease-out;
}
.toast-hiding {
    animation: toastOut .3s ease-in forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(8px) scale(.96); }
}

.toast-success { border-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info { border-color: var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.toast-message {
    flex: 1;
    line-height: 1.35;
}
.toast-link {
    flex-shrink: 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.toast-link:hover { text-decoration: underline; }
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all .15s;
    padding: 0;
    line-height: 1;
}
.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .search-kbd { display: none; }
    .search-form-row { flex-direction: column; }
    .search-form-input { min-width: 0; }
    .search-select { width: 100%; }
    .search-page-title { font-size: 1.2rem; }
    .project-header { flex-direction: column; align-items: center; text-align: center; }
    .project-layout { grid-template-columns: 1fr; }
    .project-main-column { order: 2; }
    .project-sidebar-static { order: 1; position: static; }
    .project-sidebar { float: none; width: 100%; margin-left: 0; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .version-row { flex-direction: column; }
    .version-files { align-items: flex-start; }
    .versions-filter { flex-direction: column; }
    .versions-filter-group { min-width: 0; }
    .hero-search { flex-direction: column; }
    .bookmarks-grid { grid-template-columns: 1fr; }
    .bookmarks-header { flex-direction: column; align-items: flex-start; }
    .bookmarks-type-pill { font-size: .78rem; }
    .toast { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}

/* Post: back button */
.post-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all .15s;
    flex-shrink: 0;
}
.post-back:hover {
    color: var(--primary);
    background: rgba(27, 217, 106, .08);
}
.post-subtitle a {
    color: var(--primary);
    text-decoration: none;
}
.post-subtitle a:hover { text-decoration: underline; }

/* Version detail: file list */
.ver-file-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ver-file {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.ver-file-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.ver-file-info {
    font-size: .85rem;
    color: var(--text-muted);
}
.ver-file-hash {
    font-size: .72rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: .15rem .4rem;
    border-radius: 3px;
    font-family: monospace;
}

/* Version detail: dependencies */
.dep-list {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}
.dep-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    border-radius: var(--radius);
    transition: background .1s;
}
.dep-row:hover { background: var(--bg-hover); }
.dep-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
}
.dep-link:hover { text-decoration: underline; }
.dep-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}
.dep-pending {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--text-muted);
}
.dep-missing { color: var(--text-muted); }
.dep-external {
    color: var(--text-muted);
    text-decoration: underline;
}

/* Post deps section */
.post-deps {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

/* Responsive: post & footer */
@media (max-width: 768px) {
    .post { padding-top: .25rem; }
    .post-title { font-size: 1.15rem; }
    .post-icon { width: 44px; height: 44px; }
    .post-meta { font-size: .75rem; }
    .post-version-top { flex-direction: column; align-items: flex-start; gap: .35rem; }
    .post-version-dl { width: 100%; }
    .post-version-dl .btn { flex: 1; justify-content: center; }
    .post-version-name { font-size: .82rem; }
    .post-version-tags { gap: .25rem; }
    .post-version-tag { font-size: .68rem; padding: .12rem .35rem; }
    .post-downloads-filter { flex-direction: column; gap: .4rem; }
    .post-filter-select { width: 100%; min-width: 0; font-size: .9rem; padding: .55rem .75rem; padding-right: 2rem; }
    .post-filter-reset { width: 100%; height: 36px; border-radius: var(--radius); }
    .post-version-controls { flex-direction: column; align-items: stretch; }
    .post-version-more { width: 100%; justify-content: center; }
    .gallery-scroll-item { width: min(300px, 85vw); }
    .post-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: .35rem; }
    .post-gallery-grid.has-many .post-gallery-item:first-child { grid-column: span 2; grid-row: span 1; }
    .post-gallery-item { aspect-ratio: 16 / 9; }
    .lightbox-nav { width: 36px; height: 36px; }
    .lightbox-nav--prev { left: .5rem; }
    .lightbox-nav--next { right: .5rem; }
    .lightbox-close { top: .5rem; right: .5rem; width: 34px; height: 34px; }
    .ver-file { flex-direction: column; align-items: flex-start; }
    .ver-file-btn { width: 100%; justify-content: center; }
    .ver-file-hash { word-break: break-all; }
    .post-back { width: 32px; height: 32px; }
    .post-section-title { font-size: 1rem; }
    .dep-row { padding: .45rem .5rem; gap: .5rem; font-size: .85rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-brand { margin-bottom: .5rem; }
}

/* ============================================================
   Profile page — modern layout
   ============================================================ */

/* Page layout: sidebar + content */
.profile-page {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    max-width: 1060px;
    margin: 2rem auto;
    padding: 0 1rem;
    animation: authFadeIn .4s ease;
}

/* ── Sidebar ── */
.profile-sidebar {
    position: sticky;
    top: 72px;
    align-self: start;
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(30, 30, 42, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.profile-sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.profile-sidebar-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.profile-sidebar-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
    line-height: 1.2;
}

.profile-sidebar-role {
    margin-top: 3px;
}

/* Avatar variants */
.avatar-placeholder--lg {
    width: 44px;
    height: 44px;
    font-size: .95rem;
    border: 2px solid var(--border);
}

.avatar-placeholder--xl {
    width: 88px;
    height: 88px;
    font-size: 1.6rem;
    border: 2px solid var(--border);
}

/* ── Profile nav ── */
.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
    width: 100%;
}

.profile-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.profile-nav-item.active {
    background: rgba(27, 217, 106, 0.08);
    color: var(--primary);
}

.profile-nav-item.active svg {
    color: var(--primary);
}

/* ── Content ── */
.profile-content {
    min-width: 0;
}

/* ── Tab panels ── */
.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
    animation: profileFadeIn .25s ease;
}

@keyframes profileFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Cards ── */
.profile-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(30, 30, 42, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    overflow: hidden;
}

.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.profile-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.profile-card-title svg {
    color: var(--primary);
    flex-shrink: 0;
}

.profile-card-body {
    padding: 1.25rem;
}

/* ── Form grid (2 columns on desktop) ── */
.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.profile-form-stack {
    display: flex;
    flex-direction: column;
}

/* ── Form hint ── */
.form-hint {
    display: block;
    margin-top: .5rem;
    font-size: .82rem;
    color: var(--text-muted);
}

.profile-email-pending {
    margin-top: .55rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.profile-email-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.profile-locked-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-inline-size: 0;
}

.profile-locked-fieldset[disabled] .input,
.profile-locked-fieldset[disabled] .textarea,
.profile-locked-fieldset[disabled] .checkbox {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
    opacity: 1;
    box-shadow: none;
    cursor: not-allowed;
}

.profile-locked-fieldset[disabled] .btn,
.profile-locked-fieldset[disabled] .profile-avatar-preview,
.profile-locked-fieldset[disabled] .profile-avatar-controls label {
    opacity: .65;
    cursor: not-allowed;
    pointer-events: none;
}

.profile-locked-fieldset[disabled] .profile-card {
    filter: grayscale(.08);
}

/* ── Disabled input ── */
.input-disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Monospace input ── */
.input-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: .85rem;
    letter-spacing: .03em;
}

/* ── Avatar section ── */
.profile-avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.profile-avatar-preview {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    transition: opacity .2s;
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
}

.profile-avatar-preview:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
    padding-top: .25rem;
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.profile-avatar-remove {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.profile-avatar-hint {
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── Profile links ── */
.profile-links-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: .75rem;
}

.profile-link-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: .5rem;
    align-items: start;
}

/* Icon-only button */
.btn-icon {
    padding: .5rem;
    min-width: 36px;
}

/* ── Profile actions ── */
.profile-actions {
    padding-top: .5rem;
}

.profile-actions--split {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ── Alert inside profile ── */
.profile-alert {
    margin-bottom: 1rem;
    border-radius: 14px;
}

.profile-alert-inner {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.profile-alert-inner svg {
    flex-shrink: 0;
}

.profile-alert-inner > div {
    min-width: 0;
}

.profile-alert .inline-form {
    display: block;
}

.profile-resend-btn {
    margin-top: .5rem;
    color: var(--text);
    border-color: rgba(214, 158, 46, .55);
    background: var(--bg-card);
}

.profile-resend-btn:hover {
    color: var(--text);
    border-color: rgba(214, 158, 46, .85);
    background: rgba(214, 158, 46, .12);
}

/* ── 2FA status ── */
.profile-2fa-status {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.profile-2fa-status--on {
    background: rgba(56, 161, 105, .1);
    border: 1px solid rgba(56, 161, 105, .25);
    color: var(--success);
}

.profile-2fa-status--on svg { color: var(--success); flex-shrink: 0; }

.profile-2fa-status--off {
    background: rgba(142, 142, 154, .08);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.profile-2fa-status--off svg { color: var(--text-muted); flex-shrink: 0; }

.profile-2fa-label {
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
}

.profile-2fa-meta {
    font-size: .85rem;
    margin-top: 2px;
}

/* ── 2FA sections ── */
.profile-2fa-section {
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.profile-2fa-section--danger {
    border-top-color: rgba(229, 62, 62, .2);
}

.profile-section-subtitle {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 1rem;
}

.profile-section-subtitle--danger {
    color: var(--danger);
}

/* ── 2FA QR ── */
.profile-2fa-qr {
    margin-bottom: 1.25rem;
}

.profile-2fa-qr-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.profile-2fa-qr-box img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Recovery codes grid ── */
.profile-recovery-alert {
    margin-bottom: 1.25rem;
}

.profile-recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}

.profile-recovery-code {
    display: block;
    padding: .4rem .6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: .82rem;
    text-align: center;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Sessions ── */
.profile-session-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.profile-sessions-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.profile-session-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    transition: border-color .15s;
}

.profile-session-item:hover {
    border-color: rgba(255, 255, 255, .1);
}

.profile-session-item--current {
    border-color: rgba(27, 217, 106, .25);
    background: rgba(27, 217, 106, .03);
}

.profile-session-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-session-item--current .profile-session-icon {
    background: rgba(27, 217, 106, .1);
    color: var(--primary);
}

.profile-session-details {
    flex: 1;
    min-width: 0;
}

.profile-session-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.profile-session-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
}

.profile-session-meta {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-session-ua {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 3px;
    word-break: break-word;
    opacity: .7;
}

.profile-session-revoke {
    flex-shrink: 0;
}

/* ── Empty state ── */
.profile-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Responsive: Tablet (≤ 900px) ── */
@media (max-width: 900px) {
    .profile-page {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 1rem auto;
        padding: 0 .75rem;
    }

    .profile-sidebar {
        position: static;
        border-radius: 14px 14px 0 0;
        padding: .75rem 1rem;
        margin-bottom: 0;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
        z-index: 2;
    }

    .profile-sidebar-user {
        display: none;
    }

    .profile-nav {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px;
        background: rgba(15, 15, 19, 0.4);
        border-radius: 10px;
    }

    .profile-nav::-webkit-scrollbar {
        display: none;
    }

    .profile-nav-item {
        white-space: nowrap;
        padding: .55rem 1rem;
        font-size: .85rem;
        border-radius: 8px;
        flex: 1;
        justify-content: center;
        text-align: center;
        min-height: 42px;
        transition: all .2s ease;
    }

    .profile-nav-item.active {
        background: rgba(27, 217, 106, 0.12);
        box-shadow: 0 1px 6px rgba(27, 217, 106, 0.15);
    }

    .profile-content {
        background: transparent;
    }

    .profile-card {
        border-radius: 14px;
        margin-bottom: .75rem;
    }

    .profile-card:first-child {
        border-radius: 0 0 14px 14px;
        margin-top: 0;
    }
}

/* ── Responsive: Mobile (≤ 600px) ── */
@media (max-width: 600px) {
    .profile-page {
        margin: 0 auto;
        padding: 0;
        gap: 0;
    }

    .profile-sidebar {
        padding: .55rem .75rem .65rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        position: sticky;
        top: 56px;
        z-index: 10;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        background: rgba(20, 20, 30, 0.9);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    .profile-nav {
        gap: 2px;
        padding: 2px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(255, 255, 255, 0.02);
    }

    .profile-nav-item {
        padding: .48rem .58rem;
        font-size: .78rem;
        gap: .3rem;
        border-radius: 8px;
        min-height: 38px;
        font-weight: 600;
    }

    .profile-nav-item span {
        line-height: 1.15;
    }

    .profile-nav-item.active {
        background: rgba(27, 217, 106, 0.14);
        box-shadow: none;
    }

    .profile-nav-item svg {
        width: 15px;
        height: 15px;
    }

    .profile-content {
        padding: .95rem .75rem .75rem;
    }

    .profile-card {
        border-radius: 12px;
        margin-bottom: .6rem;
        border-left: none;
        border-right: none;
    }

    .profile-card:first-child {
        border-radius: 12px;
        margin-top: 0;
    }

    .profile-card-header {
        padding: .75rem .85rem;
    }

    .profile-card-body {
        padding: .85rem;
    }

    .profile-card-title {
        font-size: .88rem;
    }

    .profile-card-title svg {
        width: 18px;
        height: 18px;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .profile-avatar-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .profile-avatar-preview {
        width: 80px;
        height: 80px;
    }

    .profile-avatar-controls {
        align-items: center;
    }

    .profile-avatar-controls .btn {
        min-width: 140px;
    }

    .profile-link-row {
        grid-template-columns: 1fr 1fr auto;
        gap: .4rem;
    }

    /* Session items */
    .profile-session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
        padding: .75rem .85rem;
    }

    .profile-session-icon {
        display: none;
    }

    .profile-session-header {
        width: 100%;
    }

    .profile-session-name {
        font-size: .85rem;
    }

    .profile-session-revoke {
        width: 100%;
    }

    .profile-session-revoke .btn {
        width: 100%;
        justify-content: center;
    }

    .profile-session-actions {
        width: 100%;
    }

    .profile-session-actions form {
        flex: 1;
    }

    .profile-session-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Buttons: full width stacking */
    .profile-actions {
        padding-top: .75rem;
    }

    .profile-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .profile-actions--split {
        flex-direction: column;
        gap: .5rem;
    }

    .profile-actions--split .btn {
        width: 100%;
        justify-content: center;
    }

    /* 2FA sections adjustments */
    .profile-2fa-status {
        padding: .75rem .85rem;
        border-radius: 8px;
    }

    .profile-2fa-status svg {
        width: 18px;
        height: 18px;
    }

    .profile-2fa-label {
        font-size: .88rem;
    }

    .profile-2fa-meta {
        font-size: .8rem;
    }

    .profile-2fa-section {
        padding-top: 1rem;
        margin-top: 1rem;
    }

    .profile-section-subtitle {
        font-size: .88rem;
    }

    .profile-2fa-qr-box {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }

    .profile-2fa-qr {
        text-align: center;
    }

    /* Recovery codes */
    .profile-recovery-grid {
        grid-template-columns: 1fr 1fr;
        gap: .4rem;
    }

    .profile-recovery-code {
        font-size: .75rem;
        padding: .35rem .4rem;
    }

    /* Alert */
    .profile-alert {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 0 -.6rem .6rem;
        padding: .75rem .85rem;
    }

    .profile-alert-inner {
        font-size: .85rem;
    }

    /* Form elements: bigger touch targets */
    .profile-card-body .input,
    .profile-card-body .textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
        min-height: 44px;
        padding: .6rem .75rem;
    }

    .profile-card-body .textarea {
        min-height: 80px;
    }

    /* Form labels */
    .profile-card-body label {
        font-size: .82rem;
    }

    .form-hint {
        font-size: .78rem;
    }

    .profile-email-pending {
        padding: .7rem .75rem;
    }

    .profile-email-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-email-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Textarea code block */
    .textarea-code {
        font-size: 13px;
    }
}

/* ── Responsive: Small mobile (≤ 420px) ── */
@media (max-width: 420px) {
    .profile-nav-item {
        padding: .42rem .42rem;
        font-size: .72rem;
        gap: .2rem;
        min-height: 36px;
    }

    .profile-nav-item svg {
        width: 13px;
        height: 13px;
    }

    .profile-link-row {
        grid-template-columns: 1fr auto;
    }

    .profile-link-row input[name="link_url[]"] {
        grid-column: 1 / -1;
    }

    .profile-card-body {
        padding: .7rem;
    }

    .profile-card-header {
        padding: .65rem .7rem;
    }

    .profile-avatar-preview {
        width: 72px;
        height: 72px;
    }

    .profile-recovery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-session-item {
        padding: .6rem .7rem;
    }

    .profile-session-meta {
        font-size: .75rem;
    }

    .profile-session-ua {
        font-size: .68rem;
    }
}

/* ── Skins module ───────────────────────────────────────── */
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.form-inline .input {
    width: auto;
    min-width: 180px;
}

/* ── Skin Listing (new) ───────────────────────────────── */
.sl {
    display: grid;
    gap: 1rem;
}

.sl-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: grid;
    gap: .65rem;
}

.sl-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sl-header-info h1 {
    font-size: 1.6rem;
    line-height: 1.25;
    margin: 0;
}

.sl-lead {
    color: var(--text-muted);
    font-size: .88rem;
    margin-top: .2rem;
    line-height: 1.5;
}

.sl-seo-text {
    color: var(--text-muted);
    font-size: .84rem;
    margin-top: .25rem;
    line-height: 1.55;
}

.sl-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sl-count {
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Active filter chips */
.sl-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.sl-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}

.sl-chip--active {
    background: rgba(27,217,106,.18);
    color: var(--primary);
    border: 1px solid rgba(27,217,106,.32);
}

.sl-chip--active:hover {
    background: rgba(229,62,62,.18);
    border-color: rgba(229,62,62,.4);
    color: var(--danger);
    text-decoration: none;
}

.sl-chip--reset {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.sl-chip--reset:hover {
    color: var(--text);
    border-color: var(--text-muted);
    text-decoration: none;
}

/* Body layout: sidebar + main */
.sl-body {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.sl-body--has-sidebar {
    grid-template-columns: 1fr;
}

/* Sidebar */
.sl-sidebar {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: var(--bg-card);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sl-sidebar.open {
    display: block;
    transform: translateX(0);
}

.sl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 899;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .25s;
}

.sl-overlay.open {
    display: block;
    opacity: 1;
}

.sl-sidebar-inner {
    padding: 1rem 1.1rem 2rem;
    display: grid;
    gap: .65rem;
}

.sl-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.sl-sidebar-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.sl-sidebar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: .3rem;
    border-radius: 50%;
    display: flex;
    transition: all .15s;
}

.sl-sidebar-close:hover {
    color: var(--text);
    background: var(--bg-hover);
}

/* Filter sections */
.sl-filter-section {
    display: grid;
    gap: .4rem;
}

.sl-filter-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    padding: .35rem 0;
    transition: color .15s;
}

.sl-filter-section-toggle:hover {
    color: var(--primary);
}

.sl-chevron {
    transition: transform .2s;
    flex-shrink: 0;
}

.sl-filter-section.collapsed .sl-chevron {
    transform: rotate(-90deg);
}

.sl-filter-section.collapsed .sl-filter-section-body {
    display: none;
}

.sl-filter-section.collapsed .sl-filter-show-all {
    display: none;
}

.sl-filter-section-body {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.sl-filter-section-body--collapsible {
    max-height: 320px;
    overflow: hidden;
    position: relative;
}

.sl-filter-section-body--collapsible::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(28,28,36,0) 0%, rgba(28,28,36,0.18) 30%, rgba(28,28,36,0.38) 60%, rgba(28,28,36,0.6) 85%, var(--bg-card) 100%);
    pointer-events: none;
    transition: opacity .2s;
}

.sl-filter-section-body--expanded {
    max-height: none;
}

.sl-filter-section-body--expanded::after {
    opacity: 0;
}

.sl-filter-show-all {
    margin-top: .5rem;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .25rem;
    padding: .4rem .5rem;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--radius);
    background: rgba(255,255,255,.04);
    color: var(--text-muted);
    font-size: .75rem;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}

.sl-filter-show-all:hover {
    color: var(--text);
    border-color: rgba(255,255,255,.2);
}

.sl-filter-show-all[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

/* Filter tags */
.sl-tag {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .18rem .5rem;
    font-size: .75rem;
    border-radius: 5px;
    background: var(--bg-hover);
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .15s;
    cursor: pointer;
    white-space: nowrap;
}

.sl-tag:hover {
    color: var(--text);
    background: rgba(255,255,255,.08);
    text-decoration: none;
}

.sl-tag--on {
    background: rgba(27,217,106,.18);
    color: var(--primary);
    border-color: rgba(27,217,106,.35);
}

.sl-tag--on:hover {
    background: rgba(27,217,106,.28);
    color: var(--primary);
}

.sl-tag--disabled {
    opacity: .38;
    cursor: not-allowed;
    border: 1px dashed rgba(255,255,255,.12);
}

/* Main content area */
.sl-main {
    display: grid;
    gap: 1.2rem;
}

/* Skin card grid */
.sl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: .65rem;
}

/* Skin card */
.sc {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all .2s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.sc:hover {
    border-color: rgba(27,217,106,.4);
    box-shadow: 0 4px 20px rgba(27,217,106,.1), 0 2px 8px rgba(0,0,0,.25);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
}

.sc-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 40% 25%, rgba(27,217,106,.14) 0%, rgba(20,20,28,.7) 70%);
    padding: .55rem .4rem;
    aspect-ratio: 7 / 10;
    overflow: hidden;
}

.sc-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    display: block;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.sc:hover .sc-img {
    transform: scale(1.04);
}

.sc-info {
    padding: .5rem .6rem .35rem;
    display: grid;
    gap: .2rem;
}

.sc-title {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-meta {
    display: flex;
    gap: .55rem;
    font-size: .7rem;
    color: var(--text-muted);
}

.sc-meta i {
    margin-right: .15rem;
    opacity: .65;
}

.sc-tags {
    padding: .15rem .6rem .5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .22rem;
}

.sc-tag {
    font-size: .62rem;
    padding: .08rem .32rem;
    border-radius: 3px;
    background: rgba(255,255,255,.06);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Empty state */
.sl-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

/* Footer links */
.sl-footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: .9rem;
    align-items: start;
}

.sl-link-block h2 {
    font-size: 1.05rem;
    margin-bottom: .55rem;
}

.sl-link-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

/* ── Desktop (≥ 1024px) ──────────────────────────────── */
@media (min-width: 1024px) {
    .sl-body--has-sidebar {
        grid-template-columns: 230px 1fr;
    }

    .sl-filter-toggle {
        display: none !important;
    }

    .sl-sidebar {
        display: block !important;
        position: static;
        transform: none;
        background: transparent;
        overflow: visible;
    }

    .sl-sidebar-inner {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: .85rem;
    }

    .sl-filter-section-body--collapsible {
        max-height: 320px;
        overflow: hidden;
        position: relative;
    }

    .sl-filter-section-body--collapsible::after {
        content: '';
        position: absolute;
        inset: auto 0 0 0;
        height: 60px;
        background: linear-gradient(180deg, rgba(28,28,36,0) 0%, rgba(28,28,36,0.25) 40%, rgba(28,28,36,0.5) 75%, rgba(28,28,36,0.78) 90%, var(--bg-card) 100%);
        pointer-events: none;
        transition: opacity .2s;
    }

    .sl-filter-section-body--expanded {
        max-height: none;
    }

    .sl-filter-section-body--expanded::after {
        opacity: 0;
    }

    .sl-filter-show-all {
        margin-top: .5rem;
        width: 100%;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: .25rem;
        padding: .4rem .5rem;
        border: 1px solid rgba(255,255,255,.08);
        border-radius: var(--radius);
        background: rgba(255,255,255,.04);
        color: var(--text-muted);
        font-size: .75rem;
        cursor: pointer;
        transition: border-color .2s, color .2s;
    }

    .sl-filter-show-all:hover {
        color: var(--text);
        border-color: rgba(255,255,255,.2);
    }

    .sl-sidebar-close {
        display: none;
    }

    .sl-sidebar-head {
        border: none;
        padding-bottom: .3rem;
    }

    .sl-overlay {
        display: none !important;
    }

    .sl-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

/* ── Large desktop ────────────────────────────────────── */
@media (min-width: 1280px) {
    .sl-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: .75rem;
    }
}

/* ── Tablet (640–1023px) ──────────────────────────────── */
@media (min-width: 640px) and (max-width: 1023px) {
    .sl-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: .6rem;
    }

    .sl-sidebar {
        width: 300px;
    }
}

/* ── Mobile (< 640px) ────────────────────────────────── */
@media (max-width: 639px) {
    .sl-header {
        padding: .85rem;
    }

    .sl-header-info h1 {
        font-size: 1.3rem;
    }

    .sl-header-top {
        flex-direction: column;
        gap: .5rem;
    }

    .sl-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .sl-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .5rem;
    }

    .sc-info {
        padding: .4rem .5rem .3rem;
    }

    .sc-title {
        font-size: .76rem;
    }

    .sc-meta {
        font-size: .66rem;
    }

    .sc-tags {
        padding: .1rem .5rem .4rem;
    }

    .sl-footer-links {
        grid-template-columns: 1fr;
    }

    .sl-sidebar {
        width: 85vw;
        max-width: 320px;
    }

    /* Server rows mobile */
    .project-row.server-row {
        grid-template-columns: 38px 1fr;
        column-gap: .45rem;
        padding: .5rem .55rem;
    }

    .server-place {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .server-place-number {
        font-size: .75rem;
    }

    .project-row.server-row .project-row-info {
        gap: .25rem;
    }

    .server-head h3 {
        font-size: .82rem;
    }

    .server-online {
        font-size: .62rem;
        padding: .1rem .3rem .1rem .25rem;
    }

    .server-address {
        font-size: .66rem;
        padding: .1rem .35rem;
        border-radius: 5px;
    }

    .server-copy-btn {
        padding: .12rem .3rem;
    }

    .server-copy-label {
        display: none;
    }

    .server-meta-row {
        gap: .18rem;
    }

    .server-stat {
        font-size: .62rem;
        padding: .06rem .24rem;
    }
}

/* ── Remaining skin page styles (collections, nicks listing) ── */
.skin-collections-page,
.skin-collection-page,
.skin-nicks-page {
    display: grid;
    gap: 1rem;
}

.skin-collections-page h1,
.skin-collection-page h1,
.skin-nicks-page h1 {
    font-size: 1.85rem;
    margin-bottom: .35rem;
}

.skin-page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    color: var(--text-muted);
    font-size: .85rem;
}

.skin-collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: .9rem;
}

.skin-collection-card {
    padding: 0;
    overflow: hidden;
    display: grid;
}

.skin-collection-cover {
    display: block;
    background: radial-gradient(circle at 30% 20%, rgba(27,217,106,.25), rgba(20,20,28,.6));
    padding: .7rem;
}

.skin-collection-cover img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
}

.skin-collection-body {
    padding: .8rem;
    display: grid;
    gap: .5rem;
}

.skin-collection-body h2 {
    font-size: 1.05rem;
    line-height: 1.3;
}

.skin-collection-body p {
    color: var(--text-muted);
    font-size: .85rem;
}

/* ── Skin Detail Page (sp-*) ── */
.sp {
    display: grid;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Top: viewer + info side by side */
.sp-top {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

/* ── 3D Viewer ── */
.sp-viewer {
    display: grid;
    gap: 1rem;
}

.sp-viewer-stage {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(170deg, rgba(27,217,106,.12) 0%, rgba(20,20,28,.95) 45%, rgba(14,14,22,1) 100%);
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
}

.sp-viewer-stage.sp-fs {
    position: fixed;
    inset: 0;
    z-index: 9999;
    border-radius: 0;
    border: none;
    min-height: 100vh;
    background: #0a0a12;
}

.sp-viewer-canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 520px;
    image-rendering: auto;
}

.sp-viewer-stage.sp-fs .sp-viewer-canvas {
    max-width: none;
}

/* ── Floating Toolbar ── */
.sp-toolbar {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 8px;
    background: rgba(14,14,22,.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    z-index: 10;
}

.sp-toolbar-group {
    display: flex;
    gap: 2px;
}

.sp-toolbar-sep {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.12);
    margin: 0 4px;
    flex-shrink: 0;
}

.sp-tb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: .75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    line-height: 1;
}

.sp-tb:hover {
    background: rgba(255,255,255,.08);
    color: var(--text);
}

.sp-tb.sp-tb--on {
    background: rgba(27,217,106,.15);
    color: var(--primary);
}

.sp-tb svg {
    flex-shrink: 0;
}

/* ── Slide-up panels (cameras & body poses) ── */
.sp-panel {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(14,14,22,.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    min-width: 180px;
    z-index: 20;
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.sp-panel--open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.sp-panel-title {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 0 4px 4px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sp-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.sp-panel-btn {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: .78rem;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: all .12s ease;
    white-space: nowrap;
}

.sp-panel-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--text);
}

.sp-panel-btn.sp-tb--on {
    background: rgba(27,217,106,.15);
    color: var(--primary);
}

/* Overlay for closing panels */
.sp-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: transparent;
}

.sp-panel-overlay--open {
    display: block;
}

/* ── Preview Strip ── */
.sp-previews {
    display: flex;
    gap: .65rem;
    padding: 0 2px;
}

.sp-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
}

.sp-preview-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    transition: border-color .15s;
}

.sp-preview-item img:hover {
    border-color: rgba(27,217,106,.35);
}

.sp-preview-item span {
    font-size: .7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Info Panel ── */
.sp-info {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.sp-info-card {
    display: grid;
    gap: .85rem;
    padding: 1.25rem;
}

.sp-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.sp-desc {
    color: var(--text-muted);
    font-size: .88rem;
    line-height: 1.5;
    margin: 0;
}

/* Stats row */
.sp-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    text-align: center;
    padding: .7rem 0;
    border-top: 1px solid rgba(255,255,255,.06);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sp-stat {
    display: grid;
    gap: .15rem;
}

.sp-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.sp-stat-label {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Download button */
.sp-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-weight: 600;
}

.sp-bookmark-btn,
.sp-bookmark-login {
    width: 100%;
    justify-content: center;
}

/* Meta row */
.sp-meta-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: var(--text-muted);
    font-size: .82rem;
}

/* Sections (tags, nicks) */
.sp-section {
    display: grid;
    gap: .55rem;
}

.sp-section-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
}

.sp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.sp-nicks {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.sp-nick {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 6px;
    font-size: .82rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text);
    text-decoration: none;
    transition: all .15s ease;
}

.sp-nick:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* Full-width section (similar skins) */
.sp-section-full {
    display: grid;
    gap: 1rem;
}

.sp-section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

/* Badge on similar cards */
.sc-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: .15rem .45rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 600;
    background: rgba(27,217,106,.18);
    color: var(--primary);
    backdrop-filter: blur(4px);
}

/* ══════════════════════════════════════════════
   Nick Page (sn-*)
   ══════════════════════════════════════════════ */
.sn {
    display: grid;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Top: viewer + nick info side-by-side */
.sn-top {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

/* Info panel */
.sn-info {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.sn-info-card {
    display: grid;
    gap: .85rem;
    padding: 1.25rem;
}

/* Header: avatar + name + copy */
.sn-header {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.sn-avatar {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: contain;
    image-rendering: pixelated;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sn-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.sn-name-wrap {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.sn-name {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Copy button */
.sn-copy {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    background: rgba(255,255,255,.04);
    color: var(--text-muted);
    font-size: .72rem;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s ease;
    width: max-content;
}

.sn-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(27,217,106,.06);
}

.sn-copy.sn-copy--done {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(27,217,106,.1);
}

.sn-copy-label {
    pointer-events: none;
}

/* Sections */
.sn-section {
    display: grid;
    gap: 1rem;
}

.sn-pagination {
    margin-top: .5rem;
}

/* Empty state */
.sn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.sn-empty p {
    margin: 0;
    font-size: .9rem;
}

/* ── Skin Detail & Nick Responsive ── */
@media (max-width: 900px) {
    .sp-top,
    .sn-top {
        grid-template-columns: 1fr;
    }

    .sp-viewer-stage {
        min-height: 300px;
    }

    /* ── Mobile toolbar: clean grouped layout ── */
    .sp-toolbar {
        bottom: 10px;
        left: 12px;
        right: 12px;
        transform: none;
        max-width: none;
        padding: 6px;
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 14px;
    }

    .sp-toolbar-sep {
        display: none;
    }

    .sp-toolbar-group {
        display: flex;
        gap: 2px;
        background: rgba(255,255,255,.05);
        border-radius: 9px;
        padding: 3px;
    }

    .sp-tb {
        padding: 9px 11px;
        border-radius: 7px;
        min-width: 40px;
        min-height: 40px;
        justify-content: center;
    }

    .sp-tb span {
        display: none;
    }

    /* ── Mobile panels: bottom sheet style ── */
    .sp-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: translateY(100%);
        border-radius: 18px 18px 0 0;
        min-width: auto;
        width: 100%;
        padding: 16px 16px 24px;
        z-index: 1010;
        box-shadow: 0 -8px 40px rgba(0,0,0,.5);
        transition: transform .25s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
    }

    .sp-panel--open {
        transform: translateY(0);
    }

    .sp-panel-title {
        font-size: .8rem;
        text-align: center;
        padding: 0 0 10px;
    }

    .sp-panel-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .sp-panel-btn {
        padding: 12px 8px;
        font-size: .85rem;
        border-radius: 10px;
        background: rgba(255,255,255,.05);
    }

    .sp-panel-overlay {
        background: rgba(0,0,0,.45);
        z-index: 1005;
    }

    .sp-info-card,
    .sn-info-card {
        padding: 1rem;
    }

    .sp-title {
        font-size: 1.2rem;
    }

    .sn-name {
        font-size: 1.15rem;
    }

    .sn-avatar {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .sp-viewer-stage {
        min-height: 280px;
        border-radius: 12px;
    }

    .sp-toolbar {
        left: 6px;
        right: 6px;
        bottom: 8px;
        padding: 4px;
        gap: 3px;
        border-radius: 12px;
    }

    .sp-toolbar-group {
        padding: 2px;
        gap: 1px;
        border-radius: 7px;
    }

    .sp-tb {
        padding: 7px 9px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 6px;
    }

    .sp-tb svg {
        width: 14px;
        height: 14px;
    }

    .sp-preview-item img {
        width: 64px;
        height: 64px;
    }

    .sp-stats {
        gap: .3rem;
    }

    .sp-stat-val {
        font-size: 1rem;
    }

    .sn-header {
        gap: .65rem;
    }

    .sn-copy-label {
        display: none;
    }
}

/* ── Nicks Index Page (nk-*) ── */
.nk {
    display: grid;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

/* Hero header with search */
.nk-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    padding: 2.5rem 2rem 2rem;
    border: 1px solid var(--border);
}

.nk-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(27,217,106,.14) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(27,217,106,.07) 0%, transparent 50%),
        var(--bg-card);
    z-index: 0;
}

.nk-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1rem;
    max-width: 640px;
}

.nk-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.nk-subtitle {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.5;
    margin-top: -.25rem;
}

/* Search bar */
.nk-search {
    margin-top: .25rem;
}

.nk-search-wrap {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .25rem .3rem .25rem .9rem;
    gap: .5rem;
    transition: border-color .2s, box-shadow .2s;
}

.nk-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27,217,106,.12);
}

.nk-search-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: .6;
}

.nk-search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: .95rem;
    padding: .55rem 0;
    outline: none;
    min-width: 0;
}

.nk-search-input::placeholder {
    color: var(--text-muted);
    opacity: .7;
}

.nk-search-clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all .15s;
}

.nk-search-clear:hover {
    background: var(--bg-hover);
    color: var(--text);
    text-decoration: none;
}

.nk-search-btn {
    flex-shrink: 0;
    padding: .55rem 1.2rem;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 9px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.nk-search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27,217,106,.25);
}

/* Search status & stats bar */
.nk-search-status,
.nk-stats-bar {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: .85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.nk-search-count {
    padding: .15rem .6rem;
    background: rgba(27,217,106,.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
}

/* Empty state */
.nk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.nk-empty p {
    font-size: 1.05rem;
    margin: 0;
}

/* Nicks grid */
.nk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: .65rem;
}

/* Nick card — vertical with skin preview */
.nk-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: all .2s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.nk-card:hover {
    border-color: rgba(27,217,106,.4);
    box-shadow: 0 4px 20px rgba(27,217,106,.1), 0 2px 8px rgba(0,0,0,.25);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
}

.nk-card:hover .nk-card-skin {
    transform: scale(1.04);
}

.nk-card:hover .nk-card-nick {
    color: var(--primary);
}

/* Visual preview area */
.nk-card-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 40% 25%, rgba(27,217,106,.14) 0%, rgba(20,20,28,.7) 70%);
    padding: .5rem .35rem;
    aspect-ratio: 7 / 10;
    overflow: hidden;
}

.nk-card-skin {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    display: block;
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.nk-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Model badge on the preview */
.nk-card-model {
    position: absolute;
    top: .4rem;
    right: .4rem;
    font-size: .62rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: 4px;
    letter-spacing: .03em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    z-index: 2;
}

.nk-card-model--steve {
    background: rgba(78,147,217,.2);
    color: #6aabec;
}

.nk-card-model--alex {
    background: rgba(217,147,78,.2);
    color: #e0a86a;
}

/* Info section */
.nk-card-info {
    padding: .45rem .55rem .4rem;
    display: grid;
    gap: .2rem;
}

.nk-card-header {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.nk-card-head {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.nk-card-nick {
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .15s;
}

.nk-card-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nk-card-stat {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.nk-card-stat svg {
    opacity: .6;
}

/* Pagination */
.nk-pagination {
    display: flex;
    justify-content: center;
    padding-top: .5rem;
}

/* ── Responsive: Tablet ── */
@media (max-width: 900px) {
    .nk-hero {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 12px;
    }

    .nk-title {
        font-size: 1.6rem;
    }

    .nk-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: .55rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .skin-pagination-inner {
        flex-wrap: wrap;
    }
}

/* ── Responsive: Mobile ── */
@media (max-width: 560px) {
    .nk {
        gap: 1rem;
    }

    .nk-hero {
        padding: 1.5rem 1rem 1.25rem;
        border-radius: 10px;
    }

    .nk-title {
        font-size: 1.35rem;
    }

    .nk-subtitle {
        font-size: .85rem;
    }

    .nk-search-wrap {
        padding: .2rem .25rem .2rem .75rem;
        border-radius: 10px;
    }

    .nk-search-input {
        font-size: .88rem;
        padding: .45rem 0;
    }

    .nk-search-btn {
        padding: .45rem .9rem;
        font-size: .85rem;
        border-radius: 8px;
    }

    .nk-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: .4rem;
    }

    .nk-card-nick {
        font-size: .78rem;
    }

    .nk-card-stat {
        font-size: .65rem;
    }

    .nk-card-info {
        padding: .35rem .45rem .35rem;
    }

    .nk-card-head {
        width: 16px;
        height: 16px;
    }

    .nk-empty {
        padding: 2.5rem 1rem;
    }
}

/* ── Legacy shared helpers (kept for backwards compat) ── */
.skin-nicks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .6rem;
}

.skin-nick-card {
    display: grid;
    gap: .2rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: var(--text);
    text-decoration: none;
    transition: all .15s ease;
}

.skin-nick-card:hover {
    border-color: var(--primary);
    color: var(--text);
    text-decoration: none;
}

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

    .skin-pagination-inner {
        flex-wrap: wrap;
    }
}

/* ============================================================
   Server Detail (sd-*)  —  /servers/{id}
   ============================================================ */
.sd {
    max-width: 960px;
    margin: 0 auto;
    padding-top: .25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Hero ──────────────────────────────────────────── */
.sd-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.sd-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.sd-hero-info { flex: 1; min-width: 0; }

.sd-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .2rem .55rem;
    border-radius: 20px;
    margin-bottom: .6rem;
}
.sd-status--on  { background: rgba(56,161,105,.15); color: var(--success); }
.sd-status--off { background: rgba(229,62,62,.15);  color: var(--danger); }
.sd-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sd-status--on .sd-status-dot  { background: var(--success); box-shadow: 0 0 6px rgba(56,161,105,.6); }
.sd-status--off .sd-status-dot { background: var(--danger); }

.sd-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 .5rem;
    word-break: break-word;
}

.sd-addr-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.sd-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-muted);
    font-size: .8rem;
}
.sd-copy-btn:hover {
    border-color: rgba(27,217,106,.45);
    color: var(--primary);
    background: rgba(27,217,106,.06);
}
.sd-copy-btn .icon { opacity: .6; transition: opacity .2s; }
.sd-copy-btn:hover .icon { opacity: 1; }
.sd-addr {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .82rem;
    color: var(--text);
    background: none;
    padding: 0;
}
.sd-badge {
    display: inline-block;
    padding: .15rem .5rem;
    font-size: .7rem;
    font-weight: 600;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sd-hero-action { flex-shrink: 0; }
.sd-vote-btn {
    padding: .6rem 1.5rem;
    font-size: .92rem;
    white-space: nowrap;
}

/* ── Stats row ─────────────────────────────────────── */
.sd-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
}
.sd-stat {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    overflow: hidden;
    transition: border-color .2s;
}
.sd-stat:hover { border-color: rgba(255,255,255,.12); }

.sd-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(27,217,106,.12);
    color: var(--primary);
}
.sd-stat-icon--votes { background: rgba(192,112,112,.15); color: #c07070; }
.sd-stat-icon--total { background: rgba(214,158,46,.12); color: var(--warning); }
.sd-stat-icon--uptime { background: rgba(56,161,105,.12); color: var(--success); }

.sd-stat-body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}
.sd-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.sd-stat-value small {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
}
.sd-stat-label {
    font-size: .72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Progress bar inside stat card */
.sd-stat-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.05);
}
.sd-stat-bar > span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 0 3px 0 0;
    transition: width .4s ease;
}

/* ── Two-column grid ───────────────────────────────── */
.sd-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}
.sd-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* ── Cards ─────────────────────────────────────────── */
.sd-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.sd-card-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .85rem;
    color: var(--text);
}
.sd-card-title .icon { color: var(--text-muted); }
.sd-card-body p {
    font-size: .88rem;
    line-height: 1.65;
    color: var(--text);
    margin: 0;
}

.sd-motd {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .82rem;
    line-height: 1.55;
    padding: .75rem 1rem;
    background: var(--bg-hover);
    border-radius: 6px;
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid rgba(255,255,255,.05);
}
.mc-motd .mc-segment { display: inline; }
.mc-motd .mc-bold { font-weight: 700; }
.mc-motd .mc-italic { font-style: italic; }
.mc-motd .mc-underlined { text-decoration: underline; }
.mc-motd .mc-strikethrough { text-decoration: line-through; }
.mc-motd .mc-obfuscated {
    filter: blur(.35px);
    text-shadow: 0 0 .55em currentColor;
}

.sd-services-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.sd-services-group {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.sd-services-subtitle {
    margin: 0;
    font-size: .86rem;
    color: var(--text-muted);
    font-weight: 600;
}
.sd-services-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.sd-service-item {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    padding: .65rem .8rem;
    background: rgba(255,255,255,.015);
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: center;
}
.sd-service-item--inactive {
    opacity: .72;
    background: rgba(0,0,0,.12);
    border-color: rgba(255,255,255,.045);
}
.sd-service-main {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
}
.sd-service-main strong {
    font-size: .88rem;
    color: var(--text);
}
.sd-service-main span {
    font-size: .82rem;
    color: var(--text-muted);
}
.sd-service-meta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    color: var(--text-muted);
    text-align: right;
}
.sd-service-color {
    width: .6rem;
    height: .6rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 0 0 2px rgba(0,0,0,.25);
    flex-shrink: 0;
}

/* ── Sidebar info card ─────────────────────────────── */
.sd-sidebar { min-width: 0; }
.sd-info-card { padding: 1rem 1.25rem; }
.sd-info-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sd-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    gap: .5rem;
}
.sd-info-row:last-child { border-bottom: none; }
.sd-info-row dt {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}
.sd-info-row dd {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    margin: 0;
    word-break: break-word;
}

/* ── Comments card ─────────────────────────────────── */
.sd-comments-card { padding: 1.5rem; }

/* ── Copy-to-clipboard feedback ────────────────────── */
.sd-copy-btn--done {
    border-color: rgba(27,217,106,.5);
    color: var(--primary);
    background: rgba(27,217,106,.1);
}

/* ── Responsive: Tablet (≤ 860px) ──────────────────── */
@media (max-width: 860px) {
    .sd-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .sd-grid {
        grid-template-columns: 1fr;
    }
    .sd-sidebar {
        order: -1;
    }
}

/* ── Responsive: Mobile (≤ 600px) ──────────────────── */
@media (max-width: 600px) {
    .sd { gap: .85rem; }
    .sd-hero { padding: 1rem; }
    .sd-hero-top {
        flex-direction: column;
        gap: .75rem;
    }
    .sd-hero-action { width: 100%; }
    .sd-vote-btn { width: 100%; text-align: center; justify-content: center; }
    .sd-title { font-size: 1.2rem; }
    .sd-stats {
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
    }
    .sd-stat {
        padding: .75rem;
        gap: .5rem;
    }
    .sd-stat-icon {
        width: 30px;
        height: 30px;
        border-radius: 6px;
    }
    .sd-stat-icon .icon { font-size: 13px; }
    .sd-stat-value { font-size: 1rem; }
    .sd-card { padding: 1rem; }
    .sd-comments-card { padding: 1rem; }
    .sd-info-card { padding: .85rem 1rem; }
    .sd-service-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .sd-service-meta {
        text-align: left;
    }
}

/* ── Responsive: Small mobile (≤ 400px) ────────────── */
@media (max-width: 400px) {
    .sd-stats {
        grid-template-columns: 1fr;
    }
    .sd-stat {
        flex-direction: row;
        align-items: center;
    }
    .sd-addr-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .35rem;
    }
}

/* ============================================================
   Server Vote (sv-*)  —  /servers/{id}/vote
   ============================================================ */
.sv-page {
    max-width: 480px;
    margin: 2rem auto;
    padding: 0 1rem;
    animation: svFadeIn .35s ease;
}
@keyframes svFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sv-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(30,30,42,.95) 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
    overflow: hidden;
}

/* ── Header ────────────────────────────────────────── */
.sv-header {
    text-align: center;
    padding: 2rem 2rem 0;
}
.sv-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(192,112,112,.12);
    border: 1px solid rgba(192,112,112,.22);
    color: #c07070;
    margin-bottom: .85rem;
}
.sv-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    color: var(--text);
}
.sv-subtitle {
    color: var(--text-muted);
    font-size: .88rem;
    margin: 0;
}

/* ── Body ──────────────────────────────────────────── */
.sv-body {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Server mini-card ──────────────────────────────── */
.sv-server {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--bg-hover);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
}
.sv-server-info {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}
.sv-server-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sv-server-addr {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .75rem;
    color: var(--text-muted);
    background: none;
    padding: 0;
}
.sv-server-stats {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-shrink: 0;
}
.sv-mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .05rem;
}
.sv-mini-stat-val {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.sv-mini-stat-lbl {
    font-size: .62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.sv-mini-stat-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,.08);
    flex-shrink: 0;
}

/* ── Cooldown block ────────────────────────────────── */
.sv-cooldown {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    background: rgba(214,158,46,.08);
    border: 1px solid rgba(214,158,46,.2);
    border-radius: 10px;
}
.sv-cooldown-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(214,158,46,.12);
    color: var(--warning);
}
.sv-cooldown-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: .82rem;
    line-height: 1.4;
}
.sv-cooldown-text strong {
    font-size: .85rem;
    color: var(--warning);
}
.sv-cooldown-text span {
    color: var(--text-muted);
}
.sv-cooldown-text b {
    color: var(--text);
    font-weight: 600;
}

/* ── Hint ──────────────────────────────────────────── */
.sv-hint {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}
.sv-hint .icon { opacity: .55; }

/* ── Form & Actions ────────────────────────────────── */
.sv-form { margin: 0; }
.sv-actions {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-top: .25rem;
}
.sv-submit-btn {
    width: 100%;
    justify-content: center;
    padding: .7rem 1.5rem;
    font-size: .95rem;
    font-weight: 600;
    gap: .4rem;
}
.sv-submit-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.sv-back-btn {
    width: 100%;
    justify-content: center;
    padding: .55rem 1rem;
    font-size: .85rem;
    gap: .3rem;
}

/* ── Responsive: tablet ────────────────────────────── */
@media (max-width: 540px) {
    .sv-page { margin: 1.25rem auto; }
    .sv-header { padding: 1.5rem 1.25rem 0; }
    .sv-body { padding: 1.25rem 1.25rem 1.5rem; }
    .sv-title { font-size: 1.25rem; }
    .sv-icon-wrap { width: 48px; height: 48px; border-radius: 12px; }
}

/* ── Responsive: small mobile ──────────────────────── */
@media (max-width: 400px) {
    .sv-server {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
    }
    .sv-server-stats {
        width: 100%;
        justify-content: flex-start;
    }
}
