/* HTML hidden must beat flex/grid display rules on labels & panels */
[hidden] {
    display: none !important;
}

/* Partner shop: proud top-center logo — JS sizes 25–50vw, integer scale when possible */
.inv-store-hero {
    text-align: center;
    margin: 0.75rem auto 1.25rem;
}
.inv-store-hero-logo,
.inv-store-hero .trades-logo {
    display: inline-block;
    width: auto;
    height: auto;
    min-width: 25vw;
    max-width: 50vw;
    object-fit: contain;
    filter: drop-shadow(0 0 14px var(--trades-glow, rgba(94, 240, 255, 0.55)))
        drop-shadow(0 0 28px var(--trades-glow-soft, rgba(94, 240, 255, 0.28)));
}

/*
 * Partner shop full palette — beats Syber hardcoded navy/cyan on inv-* + trades chrome.
 * Vars set by inventory.js applyStoreBranding():
 *   --store-bg, --store-panel, --store-panel-hi, --store-panel-lo,
 *   --store-text, --store-text-muted, --trades-cyan*, --trades-border, --trades-glow*
 */
body.inv-partner-store {
    color: var(--store-text, #f2f7ff);
    --trades-navy: var(--store-panel, #0a1624);
    --trades-navy-panel: var(--store-panel, #0a1624);
    --trades-silver: var(--store-text, #f2f7ff);
    --trades-muted: var(--store-text-muted, #c8d8e8);
}

/* Page background must win over trades.css circuit-theme-cyan/green !important blues */
body.inv-partner-store,
body.inv-partner-store.circuit-on,
body.inv-partner-store.trades-circuit-on,
body.inv-partner-store.circuit-theme-cyan,
body.inv-partner-store.circuit-theme-green,
body.inv-partner-store.trades-circuit-on:not(.circuit-theme-green),
body.inv-partner-store.inv-store-solid-bg {
    background-color: var(--store-bg, #02080f) !important;
    background-image: none !important;
}

body.inv-partner-store #inv-topnav,
body.inv-partner-store [data-topnav] {
    display: none !important;
}
body.inv-partner-store.inv-store-solid-bg #circuit-bg,
body.inv-partner-store.inv-store-solid-bg #trades-circuit-bg,
body.inv-partner-store.inv-store-solid-bg .circuit-bg-canvas,
body.inv-store-solid-bg #circuit-bg,
body.inv-store-solid-bg #trades-circuit-bg,
body.inv-store-solid-bg .circuit-bg-canvas {
    display: none !important;
}

/* Buttons */
body.inv-partner-store .btm {
    color: var(--store-text, #f2f7ff) !important;
    background: linear-gradient(
        180deg,
        var(--store-panel-hi, #12324a) 0%,
        var(--store-panel, #061018) 100%
    ) !important;
    border-color: var(--trades-cyan, #5ef0ff) !important;
    box-shadow: 0 0 10px var(--trades-glow-soft, rgba(94, 240, 255, 0.28)) !important;
}
body.inv-partner-store .btm:hover,
body.inv-partner-store .btm:focus-visible {
    border-color: var(--trades-cyan-bright, #9cf7ff) !important;
    box-shadow: 0 0 14px var(--trades-glow, rgba(94, 240, 255, 0.55)) !important;
}
body.inv-partner-store .inv-primary-btn,
body.inv-partner-store .btm.inv-primary-btn {
    background: linear-gradient(
        180deg,
        var(--trades-cyan-bright, #9cf7ff) 0%,
        var(--trades-cyan, #5ef0ff) 100%
    ) !important;
    color: var(--store-panel-lo, #061018) !important;
    border-color: var(--trades-cyan-bright, #9cf7ff) !important;
}

/* Windows / panels / cards / dialogs */
body.inv-partner-store div.box,
body.inv-partner-store .box,
body.inv-partner-store .inv-owner-panel,
body.inv-partner-store .inv-auth-bar,
body.inv-partner-store .inv-filters,
body.inv-partner-store .inv-card,
body.inv-partner-store .inv-editor,
body.inv-partner-store .inv-checkout-dialog,
body.inv-partner-store .inv-image-viewer,
body.inv-partner-store .inv-cart-bar,
body.inv-partner-store .inv-add-lot,
body.inv-partner-store .inv-add-lot.box,
body.inv-partner-store .inv-bookkeeping,
body.inv-partner-store .inv-cash,
body.inv-partner-store .inv-sold-graded,
body.inv-partner-store .inv-pagination,
body.inv-partner-store .inv-status,
body.inv-partner-store .inv-editor-path-banner,
body.inv-partner-store .inv-graded-wrap,
body.inv-partner-store .inv-conditions-wrap,
body.inv-partner-store .inv-lots-wrap,
body.inv-partner-store .inv-ledger-wrap {
    background: linear-gradient(
        165deg,
        var(--store-panel-hi, rgba(10, 28, 44, 0.96)) 0%,
        var(--store-panel, rgba(6, 16, 28, 0.97)) 55%,
        var(--store-panel-lo, rgba(4, 10, 18, 0.98)) 100%
    ) !important;
    border-color: var(--trades-border, rgba(94, 240, 255, 0.75)) !important;
    color: var(--store-text, #f2f7ff) !important;
    box-shadow: 0 0 12px var(--trades-glow-soft, rgba(94, 240, 255, 0.12)) !important;
}
body.inv-partner-store div.box:hover,
body.inv-partner-store .box:hover {
    border-color: var(--trades-cyan, #5ef0ff) !important;
}

/* Headers & text */
body.inv-partner-store .cyber-header,
body.inv-partner-store h1,
body.inv-partner-store h2,
body.inv-partner-store h3,
body.inv-partner-store .inv-card-name,
body.inv-partner-store .inv-card-set,
body.inv-partner-store .inv-owner-head h2 {
    color: var(--store-text, #f2f7ff) !important;
    background: transparent !important;
}
body.inv-partner-store .inv-sub,
body.inv-partner-store .inv-field-hint,
body.inv-partner-store .inv-hint,
body.inv-partner-store .inv-image-note {
    color: var(--store-text-muted, #c8d8e8) !important;
}
body.inv-partner-store .inv-path-hint,
body.inv-partner-store .inv-empty {
    color: var(--store-text, #e0f4ff) !important;
    border-color: var(--trades-border, rgba(94, 240, 255, 0.45)) !important;
    background: linear-gradient(
        165deg,
        var(--store-panel-hi, rgba(8, 40, 60, 0.92)) 0%,
        var(--store-panel, rgba(4, 16, 28, 0.96)) 55%,
        var(--store-panel-lo, rgba(4, 12, 20, 0.98)) 100%
    ) !important;
    box-shadow: 0 0 12px var(--trades-glow-soft, rgba(94, 240, 255, 0.12)) !important;
}
body.inv-partner-store .cyber-container a:link:not(.btm),
body.inv-partner-store .cyber-container a:visited:not(.btm) {
    color: var(--trades-cyan, #5ef0ff) !important;
}

/* Inputs / selects / tables */
body.inv-partner-store .inv-input,
body.inv-partner-store input.inv-input,
body.inv-partner-store select.inv-input,
body.inv-partner-store textarea.inv-input,
body.inv-partner-store .inv-textarea,
body.inv-partner-store .inv-price-input,
body.inv-partner-store .inv-set-suggest,
body.inv-partner-store .inv-cond-table,
body.inv-partner-store .inv-cond-table th,
body.inv-partner-store .inv-cond-table td {
    background: var(--store-panel-lo, rgba(6, 22, 36, 0.92)) !important;
    color: var(--store-text, #f0f8ff) !important;
    border-color: var(--trades-border, #3a8aaa) !important;
}
body.inv-partner-store .inv-input:focus,
body.inv-partner-store input.inv-input:focus,
body.inv-partner-store select.inv-input:focus {
    outline-color: var(--trades-cyan, #5ef0ff) !important;
    border-color: var(--trades-cyan, #5ef0ff) !important;
    box-shadow: 0 0 10px var(--trades-glow-soft, rgba(94, 240, 255, 0.25)) !important;
}
body.inv-partner-store .inv-set-suggest,
body.inv-partner-store .inv-suggest-btn {
    background: var(--store-panel, #0a1624) !important;
    color: var(--store-text, #f0f8ff) !important;
}
body.inv-partner-store .inv-suggest-btn:hover {
    background: var(--store-panel-hi, #12324a) !important;
    color: var(--trades-cyan-bright, #9cf7ff) !important;
}

/* Stock / variant chips */
body.inv-partner-store .inv-stock-pill,
body.inv-partner-store .inv-variant-pill,
body.inv-partner-store .inv-path-chip,
body.inv-partner-store .inv-oos-badge {
    background: var(--store-panel-hi, rgba(10, 50, 80, 0.65)) !important;
    border-color: var(--trades-cyan, #4ab8d8) !important;
    color: var(--store-text, #d8f4ff) !important;
}

/* Cart / checkout / misc inv chrome */
body.inv-partner-store .inv-cart-summary,
body.inv-partner-store .inv-cart-general,
body.inv-partner-store .inv-editor-image,
body.inv-partner-store .inv-editor-noimg,
body.inv-partner-store .inv-editor-head,
body.inv-partner-store .inv-editor-foot,
body.inv-partner-store .inv-image-viewer-head,
body.inv-partner-store .inv-image-viewer-foot,
body.inv-partner-store .inv-type-option,
body.inv-partner-store .inv-lot-graded-fields {
    background: var(--store-panel, rgba(4, 14, 24, 0.9)) !important;
    color: var(--store-text, #e8f8ff) !important;
    border-color: var(--trades-border, rgba(94, 240, 255, 0.3)) !important;
}
body.inv-partner-store .inv-card--oos {
    opacity: 0.55;
}
body.inv-partner-store .inv-card-img {
    background: var(--store-panel-lo, rgba(4, 14, 24, 0.85)) !important;
    border-color: var(--trades-border, rgba(94, 240, 255, 0.2)) !important;
}
.inv-owner-only {
    display: none !important;
}
body.inv-is-owner .inv-owner-panel.inv-owner-only,
body.inv-is-owner .inv-auth-bar.inv-owner-only {
    display: flex !important;
}
body.inv-is-owner .inv-cond-table .inv-owner-only {
    display: table-cell !important;
}
.inv-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 2rem;
}
.inv-header {
    margin-bottom: 1rem;
}
.inv-sub {
    color: #e8f6ff;
    line-height: 1.5;
    margin: 0.65rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(94, 240, 255, 0.45);
    background: linear-gradient(165deg, rgba(8, 28, 44, 0.94) 0%, rgba(4, 14, 24, 0.96) 100%);
    box-shadow: 0 0 12px rgba(94, 240, 255, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.inv-sub a {
    color: #9cf7ff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.inv-owner-login {
    margin: 0.5rem 0 0;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: rgba(4, 14, 24, 0.85);
    display: inline-block;
}
.inv-login-subtle {
    font-size: 0.82rem;
}
.inv-auth-bar,
.inv-owner-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.inv-auth-bar #inv-logout-btn {
    margin-left: auto;
}
.inv-owner-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}
.inv-owner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.inv-variant-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.2rem 0 0.35rem;
}
.inv-variant-pill {
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    border: 1px solid #4ab8d8;
    color: #d8f4ff;
    background: rgba(10, 50, 80, 0.65);
    font-weight: 600;
}
.inv-variant-pill--1st {
    border-color: #8a6a2a;
    color: #ffd98a;
    background: rgba(70, 50, 0, 0.35);
}
.inv-variant-pill--graded {
    border-color: #6a4a9a;
    color: #d8b8ff;
    background: rgba(50, 20, 80, 0.35);
}
.inv-stock-pill--graded {
    border-color: #7a5aaa;
    color: #e8d4ff;
}
.inv-card--graded {
    border-color: #4a3a6a;
}
.inv-item-type-wrap {
    display: grid;
    gap: 0.35rem;
}
.inv-field-label {
    font-size: 0.88rem;
    color: #c8ecff;
    font-weight: 600;
}
.inv-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.inv-type-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
}
.inv-graded-wrap {
    margin-top: 0.75rem;
}
.inv-graded-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.55rem 0.75rem;
}
.inv-graded-fields label {
    display: grid;
    gap: 0.2rem;
    font-size: 0.84rem;
}
.inv-bookkeeping {
    width: 100%;
    font-size: 0.82rem;
    color: #b8e8d0;
    line-height: 1.5;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(4, 18, 30, 0.88);
    border: 1px solid rgba(94, 240, 255, 0.2);
}
.inv-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.inv-path-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.72rem;
    color: #9ec8e0;
    font-weight: 600;
}
.inv-path-label .inv-input {
    min-width: 7rem;
    font-size: 0.85rem;
}
.inv-path-hint {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--trades-border, rgba(94, 240, 255, 0.45));
    background: linear-gradient(
        165deg,
        var(--store-panel-hi, rgba(8, 40, 60, 0.9)) 0%,
        var(--store-panel, rgba(4, 18, 30, 0.94)) 100%
    );
    color: var(--store-text, #e0f4ff);
    box-shadow: 0 0 10px var(--trades-glow-soft, rgba(94, 240, 255, 0.12));
}
.inv-editor-path-banner {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(94, 240, 255, 0.45);
    background: rgba(8, 40, 60, 0.85);
    color: #e0f4ff;
    font-size: 0.88rem;
    font-weight: 600;
}
.inv-editor-path-banner strong {
    color: #9cf7ff;
}
.inv-input {
    font: inherit;
    padding: 0.45em 0.65em;
    border: 1px solid #3a8aaa;
    border-radius: 8px;
    background: rgba(6, 22, 36, 0.92);
    color: #f0f8ff;
    min-width: 0;
}
.inv-input:focus {
    outline: 2px solid #5ef0ff;
    border-color: #5ef0ff;
    box-shadow: 0 0 10px rgba(94, 240, 255, 0.25);
}
#inv-search {
    flex: 1 1 12rem;
}
#inv-set-filter {
    flex: 1 1 10rem;
}
.inv-textarea {
    width: 100%;
    resize: vertical;
}
.inv-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.inv-status {
    min-height: 1.2rem;
    color: #e8f8ff;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(94, 240, 255, 0.3);
    background: rgba(4, 16, 28, 0.9);
}
.inv-status:empty {
    border: none;
    background: transparent;
    padding: 0;
    min-height: 0;
}
.inv-grid {
    --inv-card-min: 160px;
    --inv-grid-gap: 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--inv-card-min), 1fr));
    gap: var(--inv-grid-gap);
}
/* Zoom levels (session): denser grid, images keep 3:4 aspect */
body.inv-zoom-0 .inv-grid {
    --inv-card-min: 160px;
    --inv-grid-gap: 0.85rem;
}
body.inv-zoom-1 .inv-grid {
    --inv-card-min: 118px;
    --inv-grid-gap: 0.55rem;
}
body.inv-zoom-2 .inv-grid {
    --inv-card-min: 92px;
    --inv-grid-gap: 0.4rem;
}
body.inv-zoom-1 .inv-card,
body.inv-zoom-2 .inv-card {
    border-width: 1.5px;
    border-radius: 10px;
}
body.inv-zoom-1 .inv-card-body {
    padding: 0.4rem 0.45rem 0.5rem;
}
body.inv-zoom-2 .inv-card-body {
    padding: 0.3rem 0.35rem 0.4rem;
}
body.inv-zoom-1 .inv-card-name {
    font-size: 0.82rem;
}
body.inv-zoom-2 .inv-card-name {
    font-size: 0.74rem;
}
body.inv-zoom-1 .inv-card-set {
    font-size: 0.7rem;
}
body.inv-zoom-2 .inv-card-set {
    font-size: 0.64rem;
}
body.inv-zoom-1 .inv-stock-pill,
body.inv-zoom-1 .inv-variant-pill {
    font-size: 0.62rem;
}
body.inv-zoom-2 .inv-stock-pill,
body.inv-zoom-2 .inv-variant-pill {
    font-size: 0.56rem;
}
body.inv-zoom-1 .inv-add-cart-btn,
body.inv-zoom-1 .inv-edit-link {
    font-size: 0.72rem !important;
    padding: 0.22rem 0.38rem !important;
}
body.inv-zoom-2 .inv-add-cart-btn,
body.inv-zoom-2 .inv-edit-link {
    font-size: 0.66rem !important;
    padding: 0.18rem 0.3rem !important;
}
.inv-card {
    border: 2px solid #2a6a88;
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(10, 28, 44, 0.96) 0%, rgba(6, 16, 28, 0.98) 100%);
    overflow: hidden;
    cursor: default;
    box-shadow: 0 0 10px rgba(94, 240, 255, 0.08);
}
.inv-card--editable {
    cursor: pointer;
}
.inv-card--editable:hover {
    border-color: #5ef0ff;
    box-shadow: 0 0 16px rgba(94, 240, 255, 0.35);
}
.inv-card-img {
    aspect-ratio: 3 / 4;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.inv-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.inv-card-img span {
    color: #6a9ab0;
    font-size: 0.75rem;
}
.inv-card-body {
    padding: 0.55rem 0.65rem 0.7rem;
}
.inv-card-name {
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.25;
    color: #f0f8ff;
}
.inv-card-set {
    font-size: 0.78rem;
    color: #9ec8e0;
    margin-top: 0.15rem;
}
.inv-stock-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.45rem;
}
.inv-stock-pill {
    font-size: 0.68rem;
    padding: 0.12em 0.45em;
    border-radius: 999px;
    border: 1px solid #3a9aba;
    color: #d8f4ff;
    background: rgba(10, 60, 90, 0.55);
    font-weight: 600;
}
/* Merged variant gallery + photo uploader */
.inv-variant-uploader {
    flex-direction: column;
    align-items: stretch;
}
.inv-variant-uploader > .inv-field-label {
    margin-bottom: 0.15rem;
}
.inv-variant-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.35rem 0 0.5rem;
}
.inv-variant-photo-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 5.25rem;
    padding: 0;
    border: 2px solid var(--trades-border, rgba(94, 240, 255, 0.4));
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
    overflow: hidden;
    color: inherit;
    font: inherit;
}
.inv-variant-photo-tile:hover {
    border-color: var(--trades-cyan, #5ef0ff);
}
.inv-variant-photo-tile.is-active {
    border-color: var(--trades-cyan-bright, #9cf7ff);
    box-shadow: 0 0 14px var(--trades-glow-soft, rgba(94, 240, 255, 0.45));
}
.inv-variant-photo-tile.is-placeholder.is-active {
    border-style: dashed;
}
.inv-variant-photo-tile img,
.inv-variant-photo-ph {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    background: rgba(0, 8, 16, 0.65);
}
.inv-variant-photo-ph {
    border-bottom: 1px solid rgba(94, 240, 255, 0.12);
}
/* Persistent: has stock/list but no photo */
.inv-variant-photo-ph--data {
    border: 2px dashed rgba(255, 160, 80, 0.55);
    box-sizing: border-box;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 160, 80, 0.06),
            rgba(255, 160, 80, 0.06) 4px,
            transparent 4px,
            transparent 8px
        ),
        rgba(0, 8, 16, 0.65);
}
/* Temporary: active empty finish (no data yet) — goes away if you leave without saving data */
.inv-variant-photo-ph--temp {
    border: 2px dashed rgba(94, 240, 255, 0.45);
    box-sizing: border-box;
    background: rgba(0, 12, 24, 0.5);
}
.inv-variant-photo-caption {
    width: 100%;
    padding: 0.32rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.15;
    color: var(--store-text, #e8f4ff);
    background: rgba(4, 14, 24, 0.92);
}
.inv-single-photo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.35rem 0;
}
.inv-noimg-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--store-text, #d8eefc);
}
.inv-variant-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5rem;
    font-size: 0.78rem;
    color: var(--store-text-muted, #8ab0c4);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.inv-empty {
    text-align: center;
    padding: 1.25rem 1rem;
    margin: 0.5rem 0;
    border-radius: 12px;
    border: 1px solid var(--trades-border, rgba(94, 240, 255, 0.45));
    background: linear-gradient(
        165deg,
        var(--store-panel-hi, rgba(8, 40, 60, 0.92)) 0%,
        var(--store-panel, rgba(4, 16, 28, 0.96)) 55%,
        var(--store-panel-lo, rgba(4, 12, 20, 0.98)) 100%
    );
    color: var(--store-text, #d8eef8);
    box-shadow: 0 0 12px var(--trades-glow-soft, rgba(94, 240, 255, 0.12));
}
/*
 * Native <dialog> is display:none until [open].
 * Any display:flex on .inv-editor without :not([open]) dumps closed modals into the page flow.
 */
dialog:not([open]) {
    display: none !important;
}
/* Centered modal: fixed Close/Save chrome, only the middle body scrolls */
.inv-editor {
    border: 2px solid #4488ff;
    border-radius: 14px;
    padding: 0;
    background: #0a1420;
    color: #e8f4ff;
    width: min(96vw, 720px);
    max-height: 92dvh;
    max-height: 92svh;
    overflow: hidden;
    margin: auto;
}
.inv-editor[open] {
    display: flex;
    flex-direction: column;
}
.inv-editor::backdrop {
    background: rgba(0, 0, 0, 0.72);
}
.inv-editor-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 92dvh;
    max-height: 92svh;
    flex: 1 1 auto;
    overflow: hidden;
}
.inv-editor-head,
.inv-editor-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1a3a55;
    flex: 0 0 auto;
    background: #0a1420;
    z-index: 2;
}
.inv-editor-foot {
    border-bottom: 0;
    border-top: 1px solid #1a3a55;
    justify-content: flex-end;
}
/* Middle pane scrolls; Close (top) + Save/Delete (bottom) stay on-screen */
.inv-editor-body {
    padding: 0.85rem 1rem 1rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}
.inv-remove-stock {
    border-color: rgba(255, 100, 100, 0.35);
}
.inv-pay-fieldset {
    border: 1px solid #1a3a55;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin: 0.75rem 0;
}
.inv-pay-fieldset legend {
    padding: 0 0.35rem;
    color: #9ec9e8;
    font-size: 0.9rem;
}
.inv-pay-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
}
.inv-pay-split {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid #1a3a55;
}
.inv-pay-split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.45rem 0.65rem;
}
.inv-pay-split-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}
.inv-pay-split-sum {
    margin: 0.4rem 0 0;
}
.inv-pay-split-sum.is-bad {
    color: #f88;
}
.inv-pay-split-sum.is-ok {
    color: #8f8;
}
.inv-cash-non-drawer {
    opacity: 0.92;
}
.inv-checkout-lines li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #132a40;
}
.inv-checkout-line-label {
    flex: 1 1 10rem;
}
.inv-checkout-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.inv-checkout-price-wrap input {
    width: 5.5rem;
}
.inv-editor-image {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.85rem;
    padding: 0.55rem;
    border: 2px dashed #2a5a7a;
    border-radius: 12px;
    outline: none;
}
.inv-editor-image:focus {
    border-color: #66aaff;
    box-shadow: 0 0 0 2px rgba(68, 136, 255, 0.25);
}
.inv-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.inv-image-note {
    margin: 0.35rem 0 0.5rem;
    font-size: 0.78rem;
    color: #b0daf0;
    line-height: 1.35;
}
.inv-primary-btn {
    margin-left: auto;
}
.inv-paste-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    color: #9ec8e0;
}
.inv-field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: #a8d0e8;
    line-height: 1.3;
}
#inv-editor-preview {
    width: 96px;
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #3a8aaa;
}
/* Main editor placeholder (overrides strip-sized default when no photo for active variant) */
.inv-editor-image .inv-editor-noimg {
    width: min(100%, 12rem);
    min-width: 7rem;
    min-height: 10rem;
    height: auto;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.78rem;
    line-height: 1.25;
    background: rgba(0, 8, 16, 0.55);
    border: 1px dashed rgba(94, 240, 255, 0.35);
    color: var(--store-text-muted, #9ec8e0);
}
.inv-file-btn {
    cursor: pointer;
}
.inv-editor-fields label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.85rem;
}
.inv-conditions-wrap h3,
.inv-ledger-wrap h3 {
    margin: 0.85rem 0 0.35rem;
    font-size: 1rem;
}
.inv-hint {
    font-size: 0.78rem;
    color: #b0daf0;
    margin: 0 0 0.5rem;
}
.inv-cond-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.inv-cond-table th,
.inv-cond-table td {
    border: 1px solid #1a3a55;
    padding: 0.35rem 0.3rem;
    text-align: center;
}
.inv-cond-table input {
    width: 3.2rem;
    font: inherit;
    padding: 0.2rem;
    border-radius: 6px;
    border: 1px solid #2a5a7a;
    background: rgba(0, 20, 40, 0.9);
    color: #e8f4ff;
    text-align: center;
}
.inv-cond-table input.inv-price-input {
    width: 4.2rem;
}
.inv-ledger-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.78rem;
    max-height: 10rem;
    overflow: auto;
}
.inv-ledger-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid #152535;
    color: #9ec8e8;
}
.inv-danger-btn {
    border-color: #aa4444;
    color: #ffaaaa;
}
.inv-danger-btn--shell {
    border-color: #cc2222;
    color: #ffcccc;
    background: linear-gradient(180deg, #4a1010 0%, #1a0505 100%) !important;
}
.inv-editor-foot {
    flex-wrap: wrap;
    gap: 0.45rem;
}
.inv-set-name-wrap {
    position: relative;
}
.inv-set-suggest {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin: 0.15rem 0 0;
    padding: 0.2rem 0;
    list-style: none;
    max-height: 11rem;
    overflow: auto;
    border: 1px solid #2a6a8a;
    border-radius: 8px;
    background: rgba(0, 18, 32, 0.98);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.inv-suggest-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #d8f0ff;
    font: inherit;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
}
.inv-suggest-btn:hover {
    background: rgba(40, 100, 140, 0.35);
}
.inv-suggest-code {
    color: #88ccff;
    font-size: 0.78rem;
}
.inv-cert-link {
    color: #b8e0ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.inv-cert-link:hover {
    color: #fff;
}
.inv-card-img {
    cursor: zoom-in;
}
.inv-page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.inv-page-size-input {
    width: 4.25rem;
    min-width: 4.25rem;
}
.inv-scan-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem 0.75rem;
    flex: 1 1 14rem;
}
.inv-scan-label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    flex: 1 1 12rem;
    min-width: 10rem;
}
.inv-barcode-scan {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.02em;
}
.inv-cond-barcode-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    min-width: 8rem;
}
.inv-cond-barcode-cell input {
    width: 7.5rem;
    min-width: 5rem;
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.inv-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #1a3a55;
    border-radius: 10px;
    background: rgba(0, 18, 28, 0.75);
}
.inv-page-summary {
    font-size: 0.84rem;
    color: #d0eaf8;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: rgba(4, 16, 28, 0.85);
}
.inv-page-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.inv-page-btn--active {
    border-color: #5ef0ff !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(94, 240, 255, 0.4) !important;
}
.inv-page-gap {
    color: #9ec8e0;
    padding: 0 0.15rem;
}
.inv-image-viewer {
    width: min(96vw, 720px);
    max-height: 92dvh;
    border: 2px solid #2a6a8a;
    border-radius: 12px;
    padding: 0;
    background: rgba(0, 12, 24, 0.98);
    color: #e8f4ff;
}
.inv-image-viewer::backdrop {
    background: rgba(0, 0, 0, 0.72);
}
.inv-image-viewer-head,
.inv-image-viewer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #1a3a55;
}
.inv-image-viewer-foot {
    border-bottom: 0;
    border-top: 1px solid #1a3a55;
}
.inv-image-viewer-body {
    padding: 0.65rem;
    overflow: auto;
    max-height: calc(92dvh - 7rem);
    text-align: center;
}
.inv-image-viewer-body img {
    max-width: 100%;
    max-height: 70dvh;
    object-fit: contain;
    border-radius: 8px;
}

/* Show cart + checkout */
.inv-cart-bar {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #1a3a55;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
}
.inv-cart-summary {
    font-size: 0.95rem;
}
.inv-cart-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.inv-cart-general {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.inv-general-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.inv-cart-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}
.inv-add-cart-btn,
.inv-edit-link,
.inv-general-btn {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 0.32rem 0.55rem !important;
}
/* Primary handled in trades.css — keep spacing only */
.inv-primary-btn {
    margin-left: auto;
}
.inv-checkout-lines {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.inv-checkout-lines li {
    padding: 0.35rem 0.45rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    font-size: 0.88rem;
}
.inv-checkout-total {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}
.inv-sales-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}
.inv-sales-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
}
.inv-sales-summary {
    margin: 0 0 0.75rem;
    font-weight: 600;
}
.inv-sales-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 55dvh;
    overflow-y: auto;
}
.inv-sale-card {
    border: 1px solid #1a3a55;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    background: rgba(0, 0, 0, 0.2);
}
.inv-sale-card header {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}
.inv-sale-card ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: #b8d4e8;
}
.inv-sales-dialog,
.inv-checkout-dialog {
    width: min(96vw, 520px);
}
.inv-sold-graded-dialog {
    width: min(96vw, 560px);
}
.inv-sold-graded-search-label {
    display: block;
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
}
.inv-sold-graded-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 55dvh;
    overflow-y: auto;
}
.inv-sold-graded-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.inv-sold-graded-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid #1a3a55;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    font-size: 0.7rem;
    color: #8ab;
}
.inv-sold-graded-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.inv-sold-graded-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    font-size: 0.85rem;
}
.inv-sold-graded-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}
.inv-card-name-wrap {
    position: relative;
}
.inv-qty-readonly {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    padding: 0.25rem 0.4rem;
}
.inv-add-lot {
    margin-top: 0.85rem;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.inv-add-lot h3 {
    margin: 0;
    font-size: 0.95rem;
}
.inv-add-lot-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: flex-end;
}
.inv-add-lot-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    min-width: 4.5rem;
}
.inv-add-lot-fields .inv-input {
    min-width: 4.5rem;
    width: 5.5rem;
}
.inv-add-lot-fields #f-lot-cond {
    width: 4.5rem;
}
.inv-lots-wrap {
    margin-top: 0.85rem;
}
.inv-lots-wrap h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}
.inv-lots-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.85rem;
    color: #c8e0f5;
}
.inv-lots-list li {
    margin: 0.25rem 0;
}
.inv-lots-list .inv-open-linked-graded {
    margin-left: 0.4rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
}
.inv-lot-grd {
    color: #d4c4ff;
}
.inv-cond-grd-row th {
    color: #c9b4ff;
}
.inv-lot-graded-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid #1a3a55;
}
/* Author display:flex overrides the HTML hidden attribute — force hide */
.inv-lot-graded-fields[hidden] {
    display: none !important;
}
.inv-lot-graded-fields label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    min-width: 5rem;
}
.inv-lot-graded-fields .inv-input {
    min-width: 5.5rem;
}

.inv-card--oos {
    opacity: 0.48;
    filter: grayscale(0.35);
}
.inv-card--oos .inv-card-img {
    opacity: 0.7;
}
.inv-card--catalog {
    border-style: dashed;
}
.inv-oos-badge {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #f0a0a0;
    border: 1px solid #804040;
    border-radius: 4px;
    padding: 0.05rem 0.3rem;
    vertical-align: middle;
}
.inv-catalog-badge {
    color: #9eefff;
    border-color: rgba(94, 240, 255, 0.55);
    background: rgba(94, 240, 255, 0.12);
}
.inv-hidden-badge {
    color: #ffc090;
    border-color: rgba(255, 160, 80, 0.55);
    background: rgba(255, 160, 80, 0.12);
}
.inv-oos-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #b8d4e8;
    white-space: nowrap;
}
.inv-cash-summary {
    margin-bottom: 0.85rem;
}
.inv-cash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.4rem 0.75rem;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}
.inv-cash-form h3 {
    margin: 0.5rem 0 0.4rem;
    font-size: 0.95rem;
}
.inv-cash-del {
    font-size: 0.72rem !important;
    padding: 0.15rem 0.35rem !important;
    margin-left: 0.5rem;
}