html, body {
    font-family: Lexend, sans-serif;
    background-color: black;
    color: white;
}

.btn-accent,
.btn-primary {
    background: var(--accent);
    color: #0a0b0d;
    border-color: var(--accent);
    font-weight: 700;
    border-radius: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-accent:hover,
.btn-accent:focus,
.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #0a0b0d;
    box-shadow: 0 10px 34px -8px var(--accent-glow);
}

.btn-accent:active,
.btn-primary:active {
    transform: translateY(1px);
}

a, .btn-link {
    color: var(--accent);
}

a:hover, .btn-link:hover {
    color: var(--accent-2);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem black, 0 0 0 0.25rem var(--accent-glow);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Shared top-of-page heading, used across the dashboard and its sub-pages for visual coherence. */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.dashboard-card:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: #fff;
}

.dashboard-card .bi {
    font-size: 1.5rem;
    color: var(--accent);
}

.dashboard-card-title {
    font-weight: 600;
}

.dashboard-card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Dashboard news */
.dashboard-news {
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.dashboard-news-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.news-show-more {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

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

.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--accent);
}

.news-card-clickable {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.news-card-clickable:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.news-card-date {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.news-card-body {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-modal-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 320px;
    overflow: hidden;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-modal-image {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.news-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Inventory layout */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
}

.inventory-item {
    position: relative;
}

.inventory-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.4rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.4rem;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

    .inventory-card:hover {
        border-color: #0d6efd;
    }

    /* Square thumbnail slot that holds the centered spinner behind the image. */
    .inventory-card .inv-thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .inventory-card .inv-img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        background-color: #15171a;
        border-radius: 0.3rem;
        /* Hidden until the icon finishes downloading; revealing it (opaque bg) covers the spinner. */
        opacity: 0;
        transition: opacity 0.2s ease-in;
    }

        .inventory-card .inv-img.loaded {
            opacity: 1;
        }

    /* Loading spinner shown in the slot until the image loads. Centered via inset+margin (NOT transform,
       which Bootstrap's spinner-border animation already uses for the rotation). */
    .inv-spinner {
        position: absolute;
        inset: 0;
        margin: auto;
        color: #6c757d;
    }

    /* Once the sibling image has loaded, hide the spinner (the image is painted under the
       absolutely-positioned spinner, so opacity alone can't cover it). */
    .inv-img.loaded ~ .inv-spinner,
    .item-popup-icon.loaded ~ .inv-spinner,
    .detail-thumb img.loaded ~ .inv-spinner {
        display: none;
    }

    .inventory-card .inv-name {
        margin-top: 0.35rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .inventory-card .inv-sub {
        font-size: 0.7rem;
        color: #9aa0a6;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.inv-attachment-count {
    align-self: flex-start;
    margin-top: 0.3rem;
    padding: 0.08rem 0.3rem;
    color: #d7e7ff;
    background: #24364d;
    border: 1px solid #3f5f83;
    border-radius: 0.25rem;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Special-pattern tier badge overlaid on the inventory card (background color is set inline per entry). */
.inv-tier-badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    z-index: 2;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000;
    border-radius: 0.3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Contextual action (Case ROI / Catalog) overlaid on the inventory card, top-left. */
.inv-action {
    position: absolute;
    top: 0.3rem;
    left: 0.3rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background-color: rgba(13, 110, 253, 0.85);
    border-radius: 0.3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.inventory-item:hover .inv-action {
    opacity: 1;
}

    .inv-action:hover {
        background-color: #0d6efd;
        color: #fff;
    }

/* Inventory item hover popup */
.item-popup {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 1050;
    width: 20rem;
    margin-left: 0.5rem;
    padding: 0.75rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
    color: #fff;
}

.inventory-item:hover .item-popup {
    display: block;
}

/* Square slot holding the spinner behind the popup icon. */
.item-popup-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.item-popup-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

    .item-popup-icon.loaded {
        opacity: 1;
    }

.item-popup-attachments {
    max-height: 12rem;
    overflow-y: auto;
}

.item-popup-attachment {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.attachment-meta {
    font-size: 0.7rem;
}

.attachment-catalog-link {
    color: #8ab4f8;
    text-decoration: underline;
    text-decoration-color: rgba(138, 180, 248, 0.45);
    text-underline-offset: 0.12em;
}

.attachment-catalog-link:hover,
.attachment-catalog-link:focus {
    color: #b8d4ff;
    text-decoration-color: currentColor;
}

.attachment-tile {
    padding: 0.9rem;
    color: #fff;
    background: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
}

.attachment-thumb {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 4rem;
    height: 4rem;
    overflow: hidden;
    background: #111417;
    border: 1px solid #343a40;
    border-radius: 0.4rem;
}

.attachment-thumb-sm {
    width: 2rem;
    height: 2rem;
}

.attachment-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111417;
}

.attachment-fallback {
    color: #6c757d;
    font-weight: 700;
}

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

/* Detail-page hero image with a centered spinner behind it until the icon loads. */
.detail-thumb {
    position: relative;
}

    .detail-thumb img {
        opacity: 0;
        transition: opacity 0.2s ease-in;
    }

        .detail-thumb img.loaded {
            opacity: 1;
        }

/* ---- Trade-up calculator ---- */

/* Combobox dropdown under the skin search input. */
.tu-combo-list {
    position: absolute;
    z-index: 1060;
    width: 100%;
    max-height: 22rem;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
}

.tu-combo-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #fff;
}

    .tu-combo-item:hover {
        background-color: #2a2e33;
    }

.tu-combo-thumb {
    width: 32px;
    height: 24px;
    object-fit: contain;
}

.tu-row-thumb {
    width: 40px;
    height: 30px;
    object-fit: contain;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* Hover tooltip shared by skin names/thumbs across the calculator. */
.tu-tip-wrap {
    position: relative;
    cursor: default;
}

.tu-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 1070;
    width: 16rem;
    margin-bottom: 0.35rem;
    padding: 0.6rem 0.75rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.6);
    color: #fff;
    white-space: normal;
    text-align: left;
}

.tu-tip-wrap:hover .tu-tip {
    display: block;
        }

/* Invisible bridge over the gap so the pointer can move into the tooltip to click links. */
.tu-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.45rem;
}

.tu-tip-thumb {
    width: 100%;
    max-height: 5rem;
    object-fit: contain;
    margin-bottom: 0.4rem;
    background-color: #0d0f11;
    border-radius: 0.35rem;
}

.tu-tip-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: #6ea8fe;
    text-decoration: none;
}

    .tu-tip-link:hover {
        text-decoration: underline;
    }

/* Skin-name links in the input/outcome tables keep the table's text color but stay visibly underlined. */
.tu-skin-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(110, 168, 254, 0.7);
    text-underline-offset: 2px;
}

    .tu-skin-link:hover {
        text-decoration-color: currentColor;
    }

/* Catalog */
.catalog-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.catalog-group-card {
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.catalog-group-card:hover {
    border-color: #0d6efd;
}

.catalog-group-card .inv-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.catalog-group-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 0.3rem;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), #15171a 72%);
    color: #6c757d;
    font-size: 2rem;
}

.catalog-group-placeholder.loaded {
    display: none;
}

.catalog-group-label {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-rarity-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.catalog-hero {
    background-color: #15171a;
    border: 1px solid #343a40;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-hero-img {
    max-width: 100%;
    max-height: 18rem;
    object-fit: contain;
}

.catalog-case-thumb img {
    width: 64px;
    height: 48px;
    object-fit: contain;
}

/* Catalog v2 */
.catalog-group-card .inv-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background-color: #15171a;
    border-radius: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s ease-in;
}
.catalog-group-card .inv-img.loaded { opacity: 1; }
.catalog-group-card .inv-img.failed { display: none; }
.catalog-group-card .inv-spinner { z-index: 2; }
.catalog-group-card .inv-img.failed ~ .inv-spinner { display: none; }

.catalog-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}
.catalog-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.4rem 0.5rem;
    background-color: #1a1d20;
    border: 1px solid #343a40;
    border-radius: 0.5rem;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.catalog-cat-tile:hover { border-color: #0d6efd; background-color: #20242a; }
.catalog-cat-tile .bi { font-size: 1.6rem; }

.catalog-result-card { border-left-width: 3px; border-left-style: solid; }

.catalog-search { position: relative; }
.catalog-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1080;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0 0 0.4rem 0.4rem;
    max-height: 22rem;
    overflow-y: auto;
}
.catalog-suggest-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #2a2e33;
}
.catalog-suggest-item:hover { background-color: #2a2e33; }
.catalog-suggest-item img { width: 36px; height: 28px; object-fit: contain; }
.catalog-suggest-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: 0 0 auto; }

/* StatTrak / Souvenir variant coloring (CS in-game name colors) */
.text-stattrak { color: #cf6a32 !important; }
.text-souvenir { color: #ffd700 !important; }
.badge-stattrak { background-color: #cf6a32; color: #000; }
.badge-souvenir { background-color: #ffd700; color: #000; }

/* Catalog v3 */
.catalog-cat-tile { text-decoration: none; }
.catalog-result-card { position: relative; overflow: visible; }
.catalog-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1075;
    width: 15rem;
    margin-bottom: 0.35rem;
    padding: 0.5rem 0.7rem;
    background-color: #1a1d20;
    border: 1px solid #495057;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.6);
    color: #fff;
    white-space: normal;
    text-align: left;
    pointer-events: none;
}
.catalog-result-card:hover .catalog-tip { display: block; }

/* ========================================================================== */
/* VAULT WORKSPACE — shared full-width dashboard redesign                     */
/* ========================================================================== */

.vault-app-content > .container,
.vault-app-content > .container-fluid {
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 0 3rem !important;
}

.vault-app-content {
    color: var(--text);
    font-family: var(--font-body);
}

.vault-app-content .text-muted {
    color: var(--text-muted) !important;
}

.vault-page {
    width: 100%;
    min-width: 0;
    padding-bottom: 3rem;
}

.vault-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.25rem;
    padding: 0.2rem 0 1.3rem;
    border-bottom: 1px solid var(--line);
}

.vault-page-header h1 {
    margin: 0.35rem 0 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4.2vw, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.88;
    text-transform: uppercase;
}

.vault-page-header h1 em {
    color: var(--accent);
    font-style: normal;
}

.vault-page-header p {
    max-width: 66ch;
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.vault-eyebrow,
.vault-card-label {
    display: block;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1.3;
    text-transform: uppercase;
}

.vault-card-label {
    color: var(--text-dim);
    letter-spacing: 0.14em;
}

.vault-status-pill,
.vault-result-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.vault-status-pill i {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--pos);
    box-shadow: 0 0 0 0.22rem rgba(61, 220, 132, 0.09);
}

.vault-panel,
.vault-app-content .card,
.vault-app-content .border.border-secondary,
.vault-app-content .rounded.border,
.vault-app-content .border-secondary.rounded {
    border: 1px solid var(--line-strong) !important;
    border-radius: 14px !important;
    background: var(--surface) !important;
    box-shadow: 0 22px 55px -42px rgba(0, 0, 0, 0.9);
}

.vault-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.vault-section-heading h2 {
    margin: 0.25rem 0 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.vault-section-heading > p {
    max-width: 40ch;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: right;
}

.vault-text-link {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.vault-text-link:hover {
    color: var(--accent-2);
}

.vault-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.vault-metric-card {
    position: relative;
    min-width: 0;
    padding: 1rem 1.1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.vault-metric-card::after {
    content: "";
    position: absolute;
    inset: auto -2.5rem -4rem auto;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: var(--accent-soft);
    filter: blur(0.3rem);
    opacity: 0.35;
}

.vault-metric-card.is-accent {
    border-color: color-mix(in srgb, var(--accent) 34%, transparent);
}

.vault-metric-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 0.4rem;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.7vw, 1.55rem);
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-metric-card.is-accent strong {
    color: var(--accent);
}

.vault-metric-card small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-dim);
    font-size: 0.68rem;
}

.vault-pro-banner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    margin: 0.8rem 0 1rem;
    padding: 1.15rem 1.25rem;
    overflow: hidden;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background:
        radial-gradient(circle at 8% 50%, var(--accent-soft), transparent 24rem),
        linear-gradient(110deg, var(--surface-2), var(--surface));
    box-shadow: 0 24px 70px -52px var(--accent-glow);
}

.vault-pro-banner-compact {
    margin-bottom: 1.25rem;
}

.vault-pro-mark {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 800;
}

.vault-pro-copy h2 {
    margin: 0.18rem 0 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.55rem);
    font-weight: 700;
}

.vault-pro-copy p {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.vault-ad-slot {
    display: flex;
    flex-direction: column;
    min-height: 12rem;
    padding: 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.018), transparent),
        var(--surface-2);
}

.vault-ad-slot-tall {
    min-height: 17.5rem;
}

.vault-ad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.vault-ad-badge {
    padding: 0.15rem 0.38rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
}

.vault-ad-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
}

.vault-ad-body .bi {
    width: auto;
    margin: 0;
    color: var(--accent);
    font-size: 1.4rem;
    text-align: left;
}

.vault-ad-body strong {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.vault-ad-body p,
.vault-ad-slot > small {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.5;
}

.vault-ad-slot > small {
    color: var(--text-dim);
    font-size: 0.58rem;
}

/* Dashboard */
.dashboard-hero {
    align-items: center;
}

.dashboard-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.7rem;
}

.dashboard-pulse {
    margin-bottom: 0.8rem;
}

.dashboard-return-breakdown {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.35rem;
}

.dashboard-return-breakdown b {
    font-weight: 800;
}

.dashboard-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15.5rem, 0.27fr);
    gap: 0.8rem;
    align-items: stretch;
}

.dashboard-news-panel {
    padding: 1.15rem;
}

.dashboard-context-rail {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 0.8rem;
}

.vault-news-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vault-news-row {
    display: grid;
    grid-template-columns: 0.22rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: inherit;
    text-align: left;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.vault-news-row:hover {
    transform: translateX(2px);
    border-color: color-mix(in srgb, var(--accent) 38%, transparent);
    background: color-mix(in srgb, var(--surface-2) 90%, var(--accent));
}

.vault-news-accent {
    align-self: stretch;
    border-radius: 999px;
    background: var(--accent);
}

.vault-news-copy {
    min-width: 0;
}

.vault-news-title {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-news-summary {
    display: block;
    margin-top: 0.2rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.69rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-news-row time,
.vault-news-date {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    white-space: nowrap;
}

.vault-news-arrow {
    color: var(--accent);
}

.vault-empty {
    margin: 0;
    padding: 2.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    color: var(--text-muted);
    text-align: center;
}

.vault-field-note {
    padding: 1rem;
}

.vault-field-note h3 {
    margin: 0.45rem 0 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1rem;
}

.vault-field-note p {
    margin: 0.45rem 0 0.8rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.dashboard-features {
    margin-top: 1.35rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0;
}

.dashboard-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    min-height: 6.2rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: transform .18s var(--ease), border-color .18s ease, background-color .18s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 44%, transparent);
    background: var(--surface-2);
    color: var(--text);
}

.dashboard-card-icon {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
}

.dashboard-card-icon .bi {
    width: auto;
    margin: 0;
    color: inherit;
    font-size: 1.05rem;
}

.dashboard-card-copy {
    min-width: 0;
}

.dashboard-card-title {
    display: block;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.94rem;
    font-weight: 700;
}

.dashboard-card-desc {
    display: -webkit-box;
    margin-top: 0.25rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dashboard-card-arrow {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.vault-modal-backdrop {
    z-index: 1100;
    background: rgba(5, 4, 3, 0.82);
    backdrop-filter: blur(10px);
}

.vault-modal {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2rem 6rem rgba(0,0,0,.6);
}

.vault-modal .modal-header {
    border-bottom-color: var(--line);
    background: var(--surface-2);
}

.vault-modal-message {
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

/* News */
.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.28fr);
    gap: 0.8rem;
    align-items: start;
}

.news-feed {
    min-width: 0;
}

.news-rail {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: sticky;
    top: 1rem;
}

.news-editorial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.news-editorial-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
}

.news-editorial-image {
    width: 100%;
    height: 10rem;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.news-editorial-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-editorial-copy {
    padding: 1rem;
}

.news-editorial-copy time {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.news-editorial-copy h3 {
    margin: 0.45rem 0 0;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.news-editorial-copy p {
    display: -webkit-box;
    margin: 0.55rem 0 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.6;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
}

/* Generic dashboard sub-pages: full-width, matching headings, surfaces and controls. */
.vault-app-content > .container > .row,
.vault-app-content > .container-fluid > .row {
    width: 100%;
    margin-inline: 0;
}

.vault-app-content .page-title,
.vault-app-content > .container h1:not(.display-4),
.vault-app-content > .container-fluid h1:not(.display-4) {
    margin: 0 0 0.4rem;
    color: var(--text);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
}

.vault-app-content .form-control,
.vault-app-content .form-select,
.vault-app-content .input-group-text {
    min-height: 2.55rem;
    border-color: var(--line-strong) !important;
    border-radius: 8px;
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

.vault-app-content .form-control:focus,
.vault-app-content .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

.vault-app-content .form-label {
    color: var(--text-dim) !important;
    font-family: var(--font-mono);
    font-size: 0.65rem !important;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.vault-app-content .table-responsive,
.vault-app-content table.table {
    border-radius: 10px;
}

.vault-app-content table.table {
    --bs-table-bg: var(--surface);
    --bs-table-striped-bg: var(--surface-2);
    --bs-table-hover-bg: color-mix(in srgb, var(--surface-2) 88%, var(--accent));
    --bs-table-border-color: var(--line);
    margin-bottom: 0;
    color: var(--text);
    font-size: 0.78rem;
}

.vault-app-content table.table thead th {
    padding-block: 0.75rem;
    background: var(--surface-2);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.vault-app-content table.table td,
.vault-app-content table.table th {
    padding: 0.68rem 0.75rem;
    border-color: var(--line);
    vertical-align: middle;
}

.vault-app-content .alert {
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-muted);
}

.vault-app-content .alert-danger {
    border-color: color-mix(in srgb, var(--neg) 38%, transparent);
    background: color-mix(in srgb, var(--surface-2) 90%, var(--neg));
    color: #ffc3c3;
}

.vault-app-content .alert-success {
    border-color: color-mix(in srgb, var(--pos) 35%, transparent);
    background: color-mix(in srgb, var(--surface-2) 92%, var(--pos));
    color: #baf5d2;
}

.vault-app-content .btn-outline-secondary,
.vault-app-content .btn-secondary {
    border-color: var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
}

.vault-app-content .btn-outline-secondary:hover,
.vault-app-content .btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* Retheme the older catalog/inventory tiles without changing their behavior. */
.inventory-card,
.catalog-group-card,
.catalog-cat-tile {
    border-color: var(--line) !important;
    border-radius: 11px !important;
    background: var(--surface) !important;
    box-shadow: 0 16px 35px -30px rgba(0,0,0,.9);
}

.inventory-card:hover,
.catalog-group-card:hover,
.catalog-cat-tile:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 48%, transparent) !important;
    background: var(--surface-2) !important;
}

.inventory-card .inv-img,
.catalog-group-card .inv-img,
.catalog-hero {
    background: var(--surface-2) !important;
}

.catalog-cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 0.75rem;
}

.catalog-cat-tile {
    min-height: 8rem;
    color: var(--text);
}

.catalog-cat-tile .bi {
    width: auto;
    margin: 0;
    color: var(--accent);
    font-size: 1.5rem;
}

@media (max-width: 1280px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .vault-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-primary-grid,
    .news-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-context-rail {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .news-rail {
        display: grid;
        grid-template-columns: 1fr 1fr;
        position: static;
    }

    .vault-ad-slot-tall {
        min-height: 13rem;
    }
}

@media (max-width: 760px) {
    .vault-page-header,
    .vault-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-actions {
        align-items: flex-start;
    }

    .vault-section-heading > p {
        text-align: left;
    }

    .vault-pro-banner {
        grid-template-columns: auto 1fr;
    }

    .vault-pro-banner > .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

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

@media (max-width: 520px) {
    .vault-metric-grid,
    .dashboard-grid,
    .dashboard-context-rail,
    .news-editorial-grid,
    .news-rail {
        grid-template-columns: 1fr;
    }

    .vault-news-row {
        grid-template-columns: 0.2rem minmax(0, 1fr) auto;
    }

    .vault-news-row time {
        display: none;
    }
}
