:root {
    --background: #090b0e;
    --surface: #101318;
    --surface-2: #161a20;
    --surface-3: #1c2129;

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

    --text: #f4f5f7;
    --text-secondary: #9da5b4;
    --text-muted: #697281;

    --accent: #d9c899;
    --accent-soft: rgba(217, 200, 153, 0.10);

    --success: #67d391;

    --sidebar-width: 250px;

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


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    background:
        radial-gradient(
            circle at 70% -20%,
            rgba(217, 200, 153, 0.08),
            transparent 35%
        ),
        var(--background);

    color: var(--text);
}


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


.app-shell {
    min-height: 100vh;
}


.sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    padding: 24px 16px;

    background:
        rgba(12, 15, 19, 0.96);

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


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

    padding: 4px 8px 28px;
}


.brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border:
        1px solid rgba(217, 200, 153, 0.4);

    background:
        var(--accent-soft);

    color: var(--accent);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
}


.brand-name {
    font-size: 16px;
    font-weight: 700;
}


.brand-subtitle {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
    letter-spacing: 0.3px;
}


.nav {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.nav-item {
    display: flex;
    align-items: center;

    gap: 12px;

    min-height: 44px;

    padding: 0 13px;

    border-radius: 7px;

    color: var(--text-secondary);

    font-size: 13px;

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


.nav-item:hover {
    background:
        rgba(255, 255, 255, 0.04);

    color: var(--text);
}


.nav-item.active {
    background:
        var(--accent-soft);

    color: var(--accent);
}


.nav-item.disabled {
    opacity: 0.45;
    cursor: default;
}


.sidebar-footer {
    margin-top: auto;

    padding: 16px 8px 0;

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


.environment {
    display: flex;
    align-items: center;

    gap: 8px;

    font-size: 12px;
    color: var(--text-secondary);
}


.version {
    margin-top: 8px;

    color: var(--text-muted);

    font-size: 10px;
}


.status-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    border-radius: 999px;

    background: var(--success);

    box-shadow:
        0 0 10px rgba(103, 211, 145, 0.5);
}


.status-dot.offline {
    background: var(--text-muted);

    box-shadow: none;
}


.main-content {
    margin-left:
        var(--sidebar-width);

    padding:
        48px clamp(32px, 5vw, 72px);

    min-height: 100vh;
}


.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 32px;

    margin-bottom: 38px;
}


.eyebrow,
.panel-kicker {
    margin-bottom: 7px;

    color: var(--accent);

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

    letter-spacing: 1.8px;
}


.page-header h1 {
    margin: 0;

    font-size: 35px;
    line-height: 1.1;

    font-weight: 650;
    letter-spacing: -1px;
}


.page-header p {
    margin:
        10px 0 0;

    color: var(--text-secondary);

    font-size: 14px;
}


.system-status {
    display: flex;
    align-items: center;

    gap: 9px;

    padding:
        9px 13px;

    background:
        var(--surface);

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

    border-radius: 7px;

    color:
        var(--text-secondary);

    font-size: 11px;
}


.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 20px;
}


.stat-card {
    min-height: 145px;

    padding: 20px;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,0.025),
            transparent
        ),
        var(--surface);

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

    border-radius: 9px;
}


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

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

    letter-spacing: 1.5px;
}


.stat-value {
    margin-top: 17px;

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

    letter-spacing: -1px;
}


.stat-description {
    margin-top: 8px;

    color: var(--text-muted);

    font-size: 11px;
}


.panel {
    margin-top: 18px;

    background: var(--surface);

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

    border-radius: 10px;

    overflow: hidden;
}


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

    padding: 20px 22px;

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


.panel-header h2 {
    margin: 0;

    font-size: 16px;
    font-weight: 600;
}


.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 70px 30px;

    text-align: center;
}


.empty-icon {
    width: 54px;
    height: 54px;

    display: grid;
    place-items: center;

    margin-bottom: 18px;

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

    color: var(--accent);

    font-size: 25px;
}


.empty-state h3 {
    margin: 0;

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


.empty-state p {
    max-width: 430px;

    margin:
        10px auto 18px;

    color:
        var(--text-secondary);

    font-size: 12px;

    line-height: 1.7;
}


.empty-badge {
    padding:
        6px 10px;

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

    border-radius: 999px;

    color:
        var(--text-muted);

    font-size: 10px;
}


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


.weapon-row {
    display: flex;
    align-items: center;

    gap: 14px;

    padding:
        13px 20px;

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


.weapon-row:last-child {
    border-bottom: 0;
}


.weapon-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: grid;
    place-items: center;

    background:
        var(--surface-3);

    overflow: hidden;
}


.weapon-icon img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}


.weapon-info {
    min-width: 0;
    flex: 1;
}


.weapon-name {
    font-size: 13px;
    font-weight: 600;
}


.weapon-meta {
    margin-top: 4px;

    color:
        var(--text-muted);

    font-size: 10px;
}


.weapon-status {
    padding:
        5px 8px;

    border:
        1px solid rgba(103, 211, 145, 0.18);

    background:
        rgba(103, 211, 145, 0.07);

    color:
        var(--success);

    font-size: 9px;

    border-radius: 4px;
}


.system-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-top: 18px;
}


.small-panel {
    display: flex;
    align-items: center;

    min-height: 72px;

    padding: 14px;

    gap: 12px;

    background:
        var(--surface);

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

    border-radius: 8px;
}


.small-panel-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: grid;
    place-items: center;

    background:
        var(--surface-3);

    color:
        var(--text-secondary);

    font-size: 9px;

    font-weight: 700;
}


.small-panel-title {
    color:
        var(--text-muted);

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: 0.8px;
}


.small-panel-value {
    margin-top: 3px;

    font-size: 12px;
}


.small-panel-value.muted {
    color:
        var(--text-secondary);
}


.small-panel .status-dot {
    margin-left: auto;
}


@media (max-width: 1000px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 760px) {

    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;

        padding:
            28px 18px;
    }

    .page-header {
        flex-direction: column;
    }

    .stats-grid,
    .system-grid {
        grid-template-columns: 1fr;
    }

}

.weapon-filters {
    display: grid;

    grid-template-columns:
        minmax(220px, 2fr)
        repeat(4, minmax(140px, 1fr))
        auto
        auto;

    gap: 10px;

    padding: 14px;

    margin-bottom: 18px;

    background: var(--surface);

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

    border-radius: 10px;
}


.weapon-filters input,
.weapon-filters select {
    width: 100%;
    min-height: 42px;

    padding: 0 12px;

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

    border-radius: 6px;

    outline: none;

    background:
        var(--surface-2);

    color:
        var(--text);

    font: inherit;

    font-size: 12px;
}


.weapon-filters input:focus,
.weapon-filters select:focus {
    border-color:
        rgba(217, 200, 153, 0.45);
}


.weapon-filters input::placeholder {
    color:
        var(--text-muted);
}


.button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 14px;

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

    border-radius: 6px;

    background:
        var(--surface-2);

    color:
        var(--text-secondary);

    font-size: 11px;

    cursor: pointer;
}


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

    color:
        var(--text);
}


.button-primary {
    border-color:
        rgba(217, 200, 153, 0.3);

    background:
        var(--accent-soft);

    color:
        var(--accent);
}


.results-header {
    display: flex;
    justify-content: space-between;

    margin:
        0 2px 13px;

    color:
        var(--text-muted);

    font-size: 11px;
}


.results-header strong {
    color:
        var(--text);
}


.weapons-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(235px, 1fr)
        );

    gap: 13px;
}


.weapon-card {
    min-width: 0;

    background:
        var(--surface);

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

    border-radius: 9px;

    overflow: hidden;

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


.weapon-card:hover {
    transform:
        translateY(-2px);

    border-color:
        var(--border-strong);

    background:
        var(--surface-2);
}


.weapon-card-image {
    position: relative;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background:
        var(--surface-3);
}


.weapon-card-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.weapon-placeholder {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;

    color:
        var(--accent);

    font-size: 40px;
}


.weapon-card-body {
    padding: 15px;
}


.weapon-card-top {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 7px;
}


.weapon-rarity {
    color:
        var(--accent);

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

    text-transform: uppercase;
    letter-spacing: 1.2px;
}


.weapon-hash {
    overflow: hidden;

    color:
        var(--text-muted);

    font-size: 8px;

    text-overflow: ellipsis;
}


.weapon-card h2 {
    margin: 0;

    overflow: hidden;

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

    white-space: nowrap;
    text-overflow: ellipsis;
}


.weapon-type {
    margin-top: 5px;

    color:
        var(--text-secondary);

    font-size: 10px;
}


.weapon-tags {
    display: flex;
    flex-wrap: wrap;

    gap: 5px;

    margin-top: 13px;
}


.weapon-tags span {
    padding:
        4px 6px;

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

    border-radius: 4px;

    background:
        var(--surface-2);

    color:
        var(--text-muted);

    font-size: 8px;
}


.pagination {
    display: grid;

    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    gap: 16px;

    margin-top: 24px;
}


.pagination > div:last-child {
    text-align: right;
}


.pagination-status {
    color:
        var(--text-muted);

    font-size: 10px;
}


@media (max-width: 1200px) {

    .weapon-filters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 650px) {

    .weapon-filters {
        grid-template-columns:
            1fr;
    }

    .weapons-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


@media (max-width: 430px) {

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

}
/* ---------- Weapon detail / God Roll editor ---------- */

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.back-link {
    color: var(--text-secondary);
    font-size: 11px;
}

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

.save-notice {
    padding: 8px 11px;
    border: 1px solid rgba(103, 211, 145, 0.22);
    border-radius: 6px;
    background: rgba(103, 211, 145, 0.08);
    color: var(--success);
    font-size: 10px;
}

.weapon-hero {
    display: grid;
    grid-template-columns: minmax(190px, 280px) 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
    margin-bottom: 34px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.weapon-hero-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-3);
}

.weapon-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.weapon-hero-content h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.02;
    letter-spacing: -1.5px;
}

.weapon-detail-type {
    margin-top: 9px;
    color: var(--text-secondary);
    font-size: 13px;
}

.weapon-detail-tags {
    margin-top: 18px;
}

.weapon-description {
    max-width: 760px;
    margin: 20px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.75;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: 22px;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}

.socket-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.socket-panel,
.notes-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.socket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.socket-title {
    font-size: 14px;
    font-weight: 650;
}

.socket-meta,
.socket-count {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
}

.perk-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    padding: 12px;
}

.perk-option {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.perk-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.perk-option-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 72px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.perk-option:hover .perk-option-card {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.perk-option input:checked + .perk-option-card {
    border-color: rgba(217, 200, 153, 0.55);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(217, 200, 153, 0.08);
}

.perk-icon,
.perk-empty-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--accent);
}

.perk-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perk-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perk-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.perk-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notes-panel {
    margin-top: 14px;
    padding: 18px;
}

.notes-panel label {
    display: block;
    margin-bottom: 9px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.notes-panel textarea {
    width: 100%;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    line-height: 1.6;
}

.notes-panel textarea:focus {
    border-color: rgba(217, 200, 153, 0.45);
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 13px 0;
    color: var(--text-muted);
    font-size: 9px;
}

.compact-empty {
    margin-top: 0;
    padding: 38px 24px;
}

.weapon-card {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 760px) {
    .weapon-hero {
        grid-template-columns: 1fr;
    }

    .weapon-hero-image {
        max-width: 320px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .save-button {
        width: 100%;
    }

    .perk-options {
        grid-template-columns: 1fr;
    }
}

/* ---------- v0.5 God Roll profiles / alternatives / Discord preview ---------- */

.weapon-profile-status {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.profile-badge {
    min-width: 42px;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.4px;
}

.profile-badge.configured {
    border-color: rgba(217, 200, 153, 0.22);
    background: var(--accent-soft);
    color: var(--accent);
}

.profile-badge.published {
    border-color: rgba(103, 211, 145, 0.24);
    background: rgba(103, 211, 145, 0.08);
    color: var(--success);
}

.profile-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 24px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 130px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
}

.profile-tab.active {
    border-color: rgba(217, 200, 153, 0.28);
    background: var(--accent-soft);
    color: var(--accent);
}

.profile-state {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-state.published {
    color: var(--success);
}

.profile-state.empty {
    opacity: 0.6;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 20px;
    align-items: start;
}

.editor-main {
    min-width: 0;
}

.preview-sticky {
    position: sticky;
    top: 24px;
}

.editor-preview h3 {
    margin: 0;
    font-size: 17px;
}

.preview-help {
    margin: 6px 0 14px;
    color: var(--text-muted);
    font-size: 10px;
}

.priority-selectors {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.priority-field {
    min-width: 0;
}

.priority-field > span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.priority-field select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 10px;
}

.priority-field select:focus {
    border-color: rgba(217, 200, 153, 0.45);
}

.perk-library {
    margin: 0 14px 14px;
    border-top: 1px solid var(--border);
}

.perk-library summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 2px 2px;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    list-style: none;
}

.perk-library summary::-webkit-details-marker {
    display: none;
}

.perk-library summary::before {
    content: "+";
    color: var(--accent);
    font-size: 13px;
}

.perk-library[open] summary::before {
    content: "−";
}

.perk-library summary span {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 8px;
}

.perk-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 8px;
    padding-top: 10px;
}

.perk-library-card {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
}

.perk-library-top {
    display: flex;
    gap: 9px;
    align-items: center;
}

.perk-library-card .perk-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

.perk-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.perk-actions button {
    min-width: 34px;
    min-height: 27px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
}

.perk-actions button:hover,
.perk-actions button.active {
    border-color: rgba(217, 200, 153, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.publish-panel {
    margin-top: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.publish-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.publish-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-control {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-3);
    transition: background 120ms ease, border-color 120ms ease;
}

.toggle-control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 120ms ease, background 120ms ease;
}

.publish-toggle input:checked + .toggle-control {
    border-color: rgba(103, 211, 145, 0.35);
    background: rgba(103, 211, 145, 0.12);
}

.publish-toggle input:checked + .toggle-control::after {
    transform: translateX(16px);
    background: var(--success);
}

.publish-toggle strong {
    display: block;
    font-size: 11px;
}

.publish-toggle small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
}

.discord-preview {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #2b2d31;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.discord-accent {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--accent);
}

.discord-content {
    padding: 14px 14px 14px 18px;
}

.discord-title {
    color: #f2f3f5;
    font-size: 14px;
    font-weight: 700;
}

.discord-subtitle {
    margin-top: 3px;
    color: #b5bac1;
    font-size: 9px;
}

.discord-weapon-image {
    width: 100%;
    margin-top: 12px;
    border-radius: 4px;
    display: block;
}

.discord-roll-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-top: 14px;
}

.discord-field {
    min-width: 0;
}

.discord-field-title {
    color: #f2f3f5;
    font-size: 9px;
    font-weight: 700;
}

.discord-field-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 3px;
    color: #dbdee1;
    font-size: 9px;
    line-height: 1.35;
}

.discord-field-value strong {
    font-weight: 500;
}

.discord-field-value span {
    color: #949ba4;
    font-size: 8px;
}

.discord-empty {
    grid-column: 1 / -1;
    color: #949ba4;
    font-size: 9px;
}

.discord-notes {
    margin-top: 13px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #b5bac1;
    font-size: 8px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.discord-footer {
    margin-top: 12px;
    color: #80848e;
    font-size: 8px;
}

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

    .preview-sticky {
        position: static;
    }

    .editor-preview {
        max-width: 620px;
    }
}

@media (max-width: 760px) {
    .profile-tabs {
        display: flex;
        width: 100%;
    }

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

    .priority-selectors {
        grid-template-columns: 1fr;
    }

    .discord-roll-fields {
        grid-template-columns: 1fr;
    }
}

/* Discord administration -------------------------------------------------- */
.discord-stats-grid {
    margin-bottom: 18px;
}

.stat-card-warning {
    border-color: rgba(217, 164, 91, 0.28);
}

.discord-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.discord-admin-panel {
    margin-top: 0;
}

.discord-forum-list {
    display: flex;
    flex-direction: column;
}

.discord-forum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.discord-forum-row:last-child {
    border-bottom: 0;
}

.discord-forum-name {
    font-size: 12px;
    font-weight: 600;
}

.discord-forum-id {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.discord-help-copy {
    padding: 18px 20px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.65;
}

.discord-help-copy p {
    margin: 0 0 13px;
}

.discord-help-copy p:last-child {
    margin-bottom: 0;
}

.discord-policy-tags {
    margin: 0 0 14px;
}

.muted-copy {
    color: var(--text-muted);
}

.panel-counter {
    color: var(--text-muted);
    font-size: 10px;
}

.publication-table-wrap {
    overflow-x: auto;
}

.publication-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.publication-table th,
.publication-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.publication-table th {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.publication-table tbody tr:last-child td {
    border-bottom: 0;
}

.publication-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.018);
}

.publication-weapon {
    color: var(--text);
    font-weight: 600;
}

.publication-weapon:hover,
.publication-action a:hover {
    color: var(--accent);
}

.mono-cell {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 9px;
}

.publication-action {
    text-align: right !important;
}

.publication-action a {
    color: var(--text-secondary);
}

.discord-command-panel {
    margin-top: 18px;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
}

.command-card {
    min-height: 104px;
    padding: 18px;
    background: var(--surface);
}

.command-card code {
    display: block;
    color: var(--accent);
    font-size: 11px;
}

.command-card span {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

@media (max-width: 1000px) {
    .discord-admin-grid {
        grid-template-columns: 1fr;
    }

    .command-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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


/* Authentication --------------------------------------------------------- */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 50% -10%, rgba(217, 200, 153, 0.12), transparent 38%),
        var(--background);
}

.auth-shell {
    width: min(100%, 460px);
}

.auth-card {
    padding: 38px;
    background: rgba(16, 19, 24, 0.97);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.auth-brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 26px;
    border: 1px solid rgba(217, 200, 153, 0.42);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
}

.auth-card h1 {
    margin: 0;
    font-size: 31px;
    letter-spacing: -0.8px;
}

.auth-lead {
    margin: 12px 0 24px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.discord-login-button {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0 18px;
    border: 1px solid rgba(88, 101, 242, 0.55);
    border-radius: 7px;
    background: #5865f2;
    color: white;
    font-size: 12px;
    font-weight: 650;
    transition: transform 120ms ease, filter 120ms ease;
}

.discord-login-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.discord-login-icon {
    font-size: 18px;
}

.secondary-login-button {
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
}

.auth-alert {
    margin-bottom: 16px;
    padding: 11px 12px;
    border: 1px solid rgba(217, 102, 102, 0.25);
    border-radius: 6px;
    background: rgba(217, 102, 102, 0.08);
    color: #e5a2a2;
    font-size: 10px;
    line-height: 1.55;
}

.auth-alert-warning {
    border-color: rgba(217, 164, 91, 0.3);
    background: rgba(217, 164, 91, 0.08);
    color: #d9b783;
}

.auth-security {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.5;
}

.auth-redirect {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 8px;
    line-height: 1.6;
    word-break: break-all;
}

.auth-redirect code {
    color: var(--text-secondary);
}

.sidebar-user {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 9px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-copy {
    min-width: 0;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-copy strong {
    color: var(--text);
    font-size: 10px;
    font-weight: 650;
}

.sidebar-user-copy span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.logout-form button:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* Manifest / maintenance ------------------------------------------------- */
.manifest-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.manifest-info-panel {
    min-width: 0;
}

.manifest-detail-list,
.backup-list,
.manifest-command-list {
    display: flex;
    flex-direction: column;
}

.manifest-detail-row,
.backup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 48px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
}

.manifest-detail-row:last-child,
.backup-row:last-child {
    border-bottom: 0;
}

.manifest-detail-row span,
.backup-row span {
    color: var(--text-muted);
    font-size: 9px;
}

.manifest-detail-row strong,
.manifest-detail-row code,
.backup-row code {
    color: var(--text-secondary);
    font-size: 10px;
}

.manifest-detail-row code {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manifest-policy-copy {
    padding: 16px 20px;
}

.manifest-policy-copy p {
    margin: 0 0 11px;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

.manifest-policy-copy p:last-child {
    margin-bottom: 0;
}

.manifest-policy-copy strong {
    color: var(--accent);
}

.manifest-error-panel,
.manifest-review-warning {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(217, 102, 102, 0.26);
    border-radius: 8px;
    background: rgba(217, 102, 102, 0.08);
    color: #e5a2a2;
    font-size: 10px;
    line-height: 1.6;
}

.manifest-error-panel strong,
.manifest-error-panel code {
    display: block;
}

.manifest-error-panel code {
    margin-top: 7px;
    color: #d8b1b1;
    white-space: pre-wrap;
    word-break: break-word;
}

.manifest-changes-panel,
.manifest-runs-panel {
    margin-top: 18px;
}

.manifest-change-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manifest-change-group {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid var(--border);
}

.manifest-change-group:last-child {
    border-right: 0;
}

.manifest-change-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.manifest-change-heading strong {
    color: var(--text);
    font-size: 16px;
    letter-spacing: -0.4px;
}

.manifest-change-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.manifest-change-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 9px;
}

.manifest-change-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.manifest-change-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manifest-change-item code {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 7px;
}

.manifest-change-more,
.manifest-change-empty {
    padding: 7px;
    color: var(--text-muted);
    font-size: 9px;
}

.manifest-review-warning {
    margin: 0 18px 18px;
    border-color: rgba(217, 164, 91, 0.28);
    background: rgba(217, 164, 91, 0.08);
    color: #d9b783;
}

.manifest-run-status {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 0 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manifest-run-status.status-success {
    border-color: rgba(103, 211, 145, 0.22);
    background: rgba(103, 211, 145, 0.07);
    color: var(--success);
}

.manifest-run-status.status-failed {
    border-color: rgba(217, 102, 102, 0.25);
    background: rgba(217, 102, 102, 0.08);
    color: #e5a2a2;
}

.manifest-run-status.status-skipped {
    color: var(--text-muted);
}

.manifest-version-cell {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-row > div {
    min-width: 0;
}

.backup-row strong,
.backup-row span {
    display: block;
}

.backup-row strong {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-row span {
    margin-top: 3px;
    font-size: 8px;
}

.manifest-backup-empty {
    padding: 24px 20px;
}

.manifest-command-list > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
}

.manifest-command-list > div:last-child {
    border-bottom: 0;
}

.manifest-command-list code {
    color: var(--accent);
    font-size: 9px;
}

.manifest-command-list span {
    color: var(--text-muted);
    font-size: 8px;
}

@media (max-width: 1100px) {
    .manifest-change-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manifest-change-group:nth-child(2) {
        border-right: 0;
    }

    .manifest-change-group:nth-child(-n+2) {
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 760px) {
    .manifest-overview-grid,
    .manifest-change-grid {
        grid-template-columns: 1fr;
    }

    .manifest-change-group {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .manifest-change-group:last-child {
        border-bottom: 0;
    }
}
