/* Nexus Shops ------------------------------------------------------------- */
.nexus-shop-screen-window .window-content {
    padding: 0;
    overflow: hidden;
    background: #100b07;
}

.nexus-shop-screen-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    color: #ead8b9;
    background: radial-gradient(circle at 50% 0%, rgba(93, 60, 28, 0.32), transparent 45%), #120d09;
}

.nexus-shop-screen-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 78px;
    padding: 10px 18px;
    border-bottom: 2px solid #6e4824;
    background: linear-gradient(180deg, #4d321d, #24170f);
    box-shadow: inset 0 -1px rgba(245, 194, 93, 0.35);
}

.nexus-shop-screen-header h2 {
    margin: 0;
    color: #ffd15d;
    font-family: var(--font-h1, serif);
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nexus-shop-screen-header p {
    margin: 3px 0 0;
    color: #d0b68e;
    font-size: 13px;
}

.nexus-shop-screen-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: #f0c86e;
}

.nexus-shop-screen-summary span {
    color: #ae9a7d;
    font-size: 11px;
}

.nexus-shop-screen-header button,
.nexus-shop-screen-footer button {
    width: auto;
    margin: 0;
    border: 1px solid #b17628;
    background: linear-gradient(180deg, #543416, #26170d);
    color: #ffd66e;
}

.nexus-shop-screen-body {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px;
}

.nexus-shop-inventory-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    border: 2px solid #5b3a21;
    background: linear-gradient(180deg, rgba(46, 29, 18, 0.98), rgba(22, 15, 11, 0.98));
    box-shadow: inset 0 0 0 1px rgba(212, 155, 75, 0.24), 0 4px 12px rgba(0, 0, 0, 0.45);
}

.nexus-shop-inventory-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 4px 8px;
    color: #f0c25b;
}

.nexus-shop-inventory-panel h3 {
    margin: 0;
    font-family: var(--font-h2, serif);
    font-size: 19px;
    text-transform: uppercase;
}

.nexus-shop-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    grid-auto-rows: 86px;
    gap: 5px;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px;
}

.nexus-shop-empty-slot,
.nexus-shop-good-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(123, 87, 51, 0.72);
    border-radius: 3px;
    background: rgba(18, 13, 10, 0.76);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.62);
}

.nexus-shop-good-card {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto;
    width: 100%;
    height: 86px;
    margin: 0;
    padding: 3px;
    overflow: hidden;
    color: #f5d26e;
    cursor: pointer;
}

.nexus-shop-good-card:hover,
.nexus-shop-good-card:focus-visible {
    border-color: #ffc34f;
    background: rgba(75, 47, 23, 0.92);
    box-shadow: inset 0 0 9px rgba(255, 190, 66, 0.25), 0 0 6px rgba(255, 174, 43, 0.45);
}

.nexus-shop-good-card img {
    width: 100%;
    height: 50px;
    border: 0;
    object-fit: contain;
    pointer-events: none;
}

.nexus-shop-good-card strong {
    color: #ffd052;
    font-size: 11px;
    line-height: 1;
}

.nexus-shop-good-card small {
    overflow: hidden;
    color: #d9c7aa;
    font-size: 9px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-panel-note {
    flex: 0 0 auto;
    margin: 8px 4px 0;
    color: #9f8d73;
    font-size: 11px;
    line-height: 1.25;
}

.nexus-shop-screen-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    flex: 0 0 auto;
    min-height: 54px;
    padding: 8px 16px;
    border-top: 2px solid #5b3a21;
    background: linear-gradient(180deg, #2b1c12, #160f0b);
}

.nexus-shop-screen-footer small {
    color: #917f66;
    font-size: 10px;
}

.nexus-shop-screen-footer button {
    grid-column: 2;
    min-width: 180px;
}

.nexus-shop-screen-missing {
    display: grid;
    place-items: center;
    height: 100%;
}

@media (max-width: 850px) {
    .nexus-shop-screen-body { grid-template-columns: 1fr; overflow-y: auto; }
    .nexus-shop-inventory-panel { min-height: 390px; }
}

.nexus-shop-trader-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(130px, 0.8fr) minmax(150px, 0.8fr) auto;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    min-height: 72px;
    padding: 8px 16px;
    border-bottom: 1px solid #5b3a21;
    background: rgba(24, 16, 11, 0.96);
    transition: background 120ms ease, box-shadow 120ms ease;
}

.nexus-shop-trader-bar.is-dragover {
    background: rgba(77, 50, 25, 0.98);
    box-shadow: inset 0 0 0 2px #e7ad46;
}

.nexus-shop-trader-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nexus-shop-trader-identity img,
.nexus-shop-trader-placeholder {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border: 1px solid #9b682d;
    border-radius: 50%;
    object-fit: cover;
    background: #0e0a07;
}

.nexus-shop-trader-placeholder {
    display: grid;
    place-items: center;
    color: #bd8a43;
    font-size: 20px;
}

.nexus-shop-trader-identity div,
.nexus-shop-trader-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nexus-shop-trader-identity span,
.nexus-shop-trader-stat span {
    color: #9f8d73;
    font-size: 10px;
    text-transform: uppercase;
}

.nexus-shop-trader-identity strong,
.nexus-shop-trader-stat strong {
    overflow: hidden;
    color: #f1d39a;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-trader-identity small {
    color: #8c7961;
    font-size: 10px;
}

.nexus-shop-trader-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nexus-shop-trader-controls select {
    min-width: 150px;
    height: 30px;
    border: 1px solid #75502a;
    background: #1b120c;
    color: #ead8b9;
}

.nexus-shop-trader-controls button,
.nexus-shop-inventory-panel > header button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-height: 28px;
    margin: 0;
    border: 1px solid #8d5e29;
    background: #2c1c10;
    color: #eec776;
    font-size: 11px;
}

.nexus-shop-inventory-panel > header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nexus-shop-good-slot {
    position: relative;
    min-width: 0;
    min-height: 0;
}

.nexus-shop-good-slot .nexus-shop-good-card {
    position: relative;
}

.nexus-shop-good-info {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(232, 190, 105, 0.72);
    border-radius: 50%;
    background: rgba(24, 15, 9, 0.92);
    color: #f3cc79;
    font-size: 10px;
}

.nexus-shop-card-action {
    position: absolute;
    top: 5px;
    left: 5px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(18, 12, 8, 0.88);
    color: #ffd269;
    font-size: 9px;
    pointer-events: none;
}

.nexus-shop-good-card.is-cart-item {
    border-color: rgba(213, 160, 71, 0.9);
    background: rgba(57, 37, 20, 0.9);
}

.nexus-shop-screen-footer {
    grid-template-columns: minmax(150px, 1fr) minmax(340px, 1.4fr) auto;
    gap: 16px;
    min-height: 76px;
}

.nexus-shop-checkout {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nexus-shop-checkout > span {
    color: #efc66b;
    font-size: 12px;
    font-weight: 700;
}

.nexus-shop-checkout > button {
    grid-column: auto;
    min-width: 290px;
    min-height: 34px;
    font-weight: 700;
}

.nexus-shop-checkout > small {
    max-width: 460px;
    color: #a9977d;
    text-align: center;
}

.nexus-shop-screen-footer > button[data-action="closeTradeScreen"] {
    grid-column: 3;
    min-width: 130px;
}

.nexus-shop-screen-shell button:disabled {
    cursor: not-allowed;
    filter: saturate(0.3);
    opacity: 0.55;
}

@media (max-width: 900px) {
    .nexus-shop-trader-bar {
        grid-template-columns: minmax(240px, 1fr) auto;
    }

    .nexus-shop-trader-stat { display: none; }

    .nexus-shop-screen-footer {
        grid-template-columns: 1fr auto;
    }

    .nexus-shop-screen-footer > small { display: none; }
    .nexus-shop-checkout { grid-column: 1; }
    .nexus-shop-screen-footer > button[data-action="closeTradeScreen"] { grid-column: 2; }
}

.nexus-shop-screen-shell .nexus-shop-screen-header {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 68px;
    padding: 8px 14px;
    overflow: visible;
    transition: background 120ms ease, box-shadow 120ms ease;
}

.nexus-shop-screen-shell .nexus-shop-screen-header.is-dragover {
    background: linear-gradient(180deg, #694522, #352116);
    box-shadow: inset 0 0 0 2px #efb84e;
}

.nexus-shop-header-trader {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nexus-shop-trader-picker {
    position: relative;
    flex: 0 0 auto;
}

.nexus-shop-trader-picker > summary {
    position: relative;
    display: block;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #d09a43;
    border-radius: 50%;
    background: #100b08;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    list-style: none;
}

.nexus-shop-trader-picker > summary::-webkit-details-marker {
    display: none;
}

.nexus-shop-trader-picker > summary > img,
.nexus-shop-trader-picker > summary > span {
    display: grid;
    place-items: center;
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    object-fit: cover;
}

.nexus-shop-trader-picker > summary > span {
    color: #ddb264;
    font-size: 17px;
}

.nexus-shop-trader-picker > summary > i {
    position: absolute;
    right: -3px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border: 1px solid #a87530;
    border-radius: 50%;
    background: #20140c;
    color: #f4cd78;
    font-size: 9px;
}

.nexus-shop-trader-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 310px;
    max-height: 360px;
    padding: 10px;
    border: 1px solid #9c682d;
    border-radius: 4px;
    background: rgba(24, 16, 11, 0.99);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72);
}

.nexus-shop-trader-menu > strong {
    color: #efc56e;
    font-family: var(--font-h2, serif);
    font-size: 13px;
    text-transform: uppercase;
}

.nexus-shop-trader-menu > p,
.nexus-shop-trader-menu > small {
    margin: 0;
    color: #9e8a6e;
    font-size: 10px;
}

.nexus-shop-trader-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nexus-shop-trader-options > button,
.nexus-shop-trader-menu > button {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 2px 7px;
    border: 1px solid #604224;
    background: #21160e;
    color: #dec6a1;
    text-align: left;
}

.nexus-shop-trader-menu > button {
    grid-template-columns: 20px minmax(0, 1fr);
}

.nexus-shop-trader-options > button:hover,
.nexus-shop-trader-options > button.is-selected,
.nexus-shop-trader-menu > button:hover {
    border-color: #c58b38;
    background: #3a2514;
    color: #ffd57a;
}

.nexus-shop-trader-options img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    object-fit: cover;
}

.nexus-shop-header-identity,
.nexus-shop-header-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nexus-shop-header-identity {
    min-width: 145px;
}

.nexus-shop-header-stat {
    padding-left: 12px;
    border-left: 1px solid rgba(205, 158, 83, 0.28);
}

.nexus-shop-header-identity span,
.nexus-shop-header-stat span {
    color: #aa9270;
    font-size: 9px;
    line-height: 1.1;
    text-transform: uppercase;
}

.nexus-shop-header-identity strong,
.nexus-shop-header-stat strong {
    overflow: hidden;
    color: #f2d49b;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-header-identity small {
    color: #907b60;
    font-size: 9px;
}

@media (max-width: 860px) {
    .nexus-shop-header-stat { display: none; }
    .nexus-shop-header-identity { min-width: 0; }
}

.nexus-shop-participants {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nexus-shop-participant {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 3px;
    border-radius: 5px;
    transition: background 120ms ease, box-shadow 120ms ease;
}

.nexus-shop-participant.is-dragover {
    background: rgba(117, 75, 31, 0.72);
    box-shadow: inset 0 0 0 2px #efb84e;
}

.nexus-shop-recipient {
    flex: 1 1 auto;
}

.nexus-shop-delivery-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid #765027;
    border-radius: 4px;
    background: rgba(28, 18, 11, 0.82);
    color: #d9bd8d;
    font-size: 10px;
    cursor: pointer;
}

.nexus-shop-delivery-toggle input {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #c78a34;
}

.nexus-shop-delivery-arrow {
    flex: 0 0 auto;
    color: #b7833c;
    font-size: 12px;
}

.nexus-shop-trader-options > h4 {
    margin: 5px 2px 1px;
    color: #aa8b5d;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nexus-shop-recipient-menu {
    right: 0;
    left: auto;
}

.nexus-shop-delivery-warning {
    color: #efb85c !important;
}

@media (max-width: 1060px) {
    .nexus-shop-participant .nexus-shop-header-stat:last-child {
        display: none;
    }
}

@media (max-width: 900px) {
    .nexus-shop-screen-shell .nexus-shop-screen-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .nexus-shop-screen-header > button[data-action="restockShop"] {
        display: none;
    }

    .nexus-shop-delivery-toggle span {
        max-width: 58px;
        line-height: 1.1;
    }
}

.nexus-shop-header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nexus-shop-header-controls > button {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .nexus-shop-header-controls > button[data-action="restockShop"] {
        display: none;
    }
}

/* Nexus Shops v2: bilateral trade and configuration --------------------- */
.nexus-shop-trade-header {
    grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 0.9fr) minmax(180px, 0.8fr) auto !important;
    gap: 12px !important;
}

.nexus-shop-participant,
.nexus-shop-wallet-participant {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    transition: background 120ms ease, box-shadow 120ms ease;
}

.nexus-shop-participant.is-dragover,
.nexus-shop-wallet-participant.is-dragover {
    border-radius: 5px;
    background: rgba(112, 72, 30, 0.55);
    box-shadow: 0 0 0 2px #e6ad48;
}

.nexus-shop-header-identity,
.nexus-shop-screen-summary {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nexus-shop-header-identity span,
.nexus-shop-screen-summary small {
    color: #ad9270;
    font-size: 10px;
    text-transform: uppercase;
}

.nexus-shop-header-identity strong,
.nexus-shop-screen-summary strong {
    overflow: hidden;
    color: #f1d49a;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-header-identity small {
    overflow: hidden;
    color: #a18a6e;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-header-controls,
.nexus-shop-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.nexus-shop-header-controls button,
.nexus-shop-footer-actions button {
    width: auto;
    min-width: 34px;
    margin: 0;
}

.nexus-shop-bilateral-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nexus-shop-inventory-panel > header > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.nexus-shop-inventory-panel > header small {
    color: #9f8d73;
    font-size: 10px;
    font-weight: 400;
    text-transform: none;
}

.nexus-shop-product-grid {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    grid-auto-rows: 116px;
}

.nexus-shop-product-grid .nexus-shop-good-card {
    position: relative;
    display: grid;
    grid-template-rows: 62px auto auto;
    height: 116px;
    padding: 4px 4px 28px;
    overflow: hidden;
}

.nexus-shop-product-grid .nexus-shop-good-card > img,
.nexus-shop-product-inspect,
.nexus-shop-product-inspect img {
    width: 100%;
    height: 62px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: contain;
    background: transparent;
}

.nexus-shop-product-inspect {
    display: block;
}

.nexus-shop-product-grid .nexus-shop-good-card.is-selected {
    border-color: #f0ba4e;
    box-shadow: inset 0 0 10px rgba(238, 176, 66, 0.28), 0 0 5px rgba(238, 176, 66, 0.3);
}

.nexus-shop-product-grid .nexus-shop-good-card.is-disabled {
    filter: saturate(0.25);
    opacity: 0.56;
}

.nexus-shop-stock-badge,
.nexus-shop-state-badge,
.nexus-shop-selected-badge {
    position: absolute;
    z-index: 2;
    border-radius: 3px;
    background: rgba(17, 11, 7, 0.9);
    color: #f1cf83;
    font-size: 9px;
    line-height: 16px;
}

.nexus-shop-stock-badge { top: 4px; right: 4px; padding: 0 4px; }
.nexus-shop-state-badge { top: 4px; left: 4px; padding: 0 4px; }
.nexus-shop-selected-badge { right: 4px; bottom: 28px; padding: 0 4px; color: #ffd45d; }

.nexus-shop-card-controls {
    position: absolute;
    right: 4px;
    bottom: 3px;
    left: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.nexus-shop-card-controls button {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 23px;
    margin: 0;
    padding: 0;
    border: 1px solid #765027;
    background: #2b1b10;
    color: #eec777;
}

.nexus-shop-empty-message {
    grid-column: 1 / -1;
    margin: 20px;
    color: #9f8d73;
    text-align: center;
}

.nexus-shop-trade-footer {
    grid-template-columns: minmax(120px, 0.8fr) minmax(330px, 1.2fr) minmax(340px, 1.4fr) auto;
    min-height: 88px;
}

.nexus-shop-ledger {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 2px 16px;
    color: #a99579;
    font-size: 11px;
}

.nexus-shop-ledger span { display: flex; justify-content: space-between; gap: 8px; }
.nexus-shop-ledger strong { color: #eac46f; }
.nexus-shop-ledger .nexus-shop-net { grid-column: 1 / -1; padding-top: 3px; border-top: 1px solid #6a4826; color: #e7c98c; }
.nexus-shop-trade-footer .nexus-shop-checkout { grid-column: 3; }
.nexus-shop-trade-footer .nexus-shop-footer-actions { grid-column: 4; }

.nexus-shop-config-window .window-content {
    padding: 0;
    overflow: hidden;
    background: #120d09;
}

.nexus-shop-config-shell {
    height: 100%;
    padding: 12px;
    overflow-y: auto;
    color: #ead8b9;
    background: radial-gradient(circle at 50% 0%, rgba(93, 60, 28, 0.28), transparent 45%), #120d09;
}

.nexus-shop-config-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.nexus-shop-config-card {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #674421;
    border-radius: 4px;
    background: rgba(37, 24, 15, 0.96);
}

.nexus-shop-config-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.nexus-shop-config-card h2 { margin: 0; color: #efc667; font-size: 17px; }
.nexus-shop-config-card button { width: auto; margin: 0; border: 1px solid #8d5e29; background: #2c1c10; color: #eec776; }
.nexus-shop-config-card label { display: flex; flex-direction: column; gap: 3px; color: #bba78a; font-size: 11px; }
.nexus-shop-config-card input,
.nexus-shop-config-card select { height: 30px; border: 1px solid #76502a; background: #17100b; color: #ecdab9; }

.nexus-shop-config-grid,
.nexus-shop-catalog-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.nexus-shop-catalog-controls { grid-template-columns: repeat(5, minmax(110px, 1fr)); }
.nexus-shop-config-check { flex-direction: row !important; align-items: center; align-self: end; min-height: 30px; }
.nexus-shop-config-check input { width: auto; height: auto; }

.nexus-shop-pack-picker { margin: 9px 0; padding: 7px; border: 1px solid #54391f; }
.nexus-shop-pack-picker > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: 120px; overflow-y: auto; }
.nexus-shop-pack-picker label { flex-direction: row; align-items: center; }
.nexus-shop-pack-picker input { width: auto; height: auto; }

.nexus-shop-config-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    max-height: 260px;
    overflow-y: auto;
}

.nexus-shop-config-product-grid article {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 4px;
    border: 1px solid #54391f;
    background: #18100b;
}

.nexus-shop-config-product-grid img { width: 42px; height: 42px; border: 0; object-fit: contain; }
.nexus-shop-config-product-grid article > div { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-config-product-grid strong,
.nexus-shop-config-product-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-shop-config-product-grid strong { color: #ebcd91; font-size: 12px; }
.nexus-shop-config-product-grid small { color: #9f8d73; font-size: 9px; }
.nexus-shop-config-product-grid button { min-width: 27px; min-height: 27px; padding: 0; }
.nexus-shop-config-product-grid .is-pinned { color: #ffcb53; }

@media (max-width: 900px) {
    .nexus-shop-trade-header { grid-template-columns: 1fr 1fr !important; }
    .nexus-shop-product-grid { grid-template-columns: repeat(4, minmax(70px, 1fr)); }
    .nexus-shop-trade-footer { grid-template-columns: 1fr auto; }
    .nexus-shop-ledger { grid-column: 1; }
    .nexus-shop-trade-footer .nexus-shop-checkout { grid-column: 1; }
    .nexus-shop-trade-footer .nexus-shop-footer-actions { grid-column: 2; grid-row: 1 / 3; }
    .nexus-shop-config-columns { grid-template-columns: 1fr; }
    .nexus-shop-catalog-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.nexus-shop-stock-card .nexus-shop-config-product-grid article { grid-template-columns: 42px minmax(0, 1fr) repeat(3, auto); }
.nexus-shop-stock-edit { display: grid; grid-template-columns: 70px minmax(90px, 1fr); gap: 5px; margin-top: 3px; }
.nexus-shop-stock-edit label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px; font-size: 8px; }
.nexus-shop-stock-edit input { width: 100%; height: 22px; min-width: 0; font-size: 10px; }

/* Nexus Shops v4: restrained bilateral counter ------------------------- */
.nexus-shop-screen-window {
    --shop-charcoal: #090d0f;
    --shop-surface: #0d1316;
    --shop-surface-raised: #13191b;
    --shop-ivory: #e7dfcf;
    --shop-muted: #968e81;
    --shop-brass: var(--nexus-accent-primary, #bf913f);
    --shop-brass-bright: var(--nexus-accent-bright, #e0b75f);
    --shop-blue: #8eacbe;
    --shop-green: #86ad5b;
    --shop-burgundy: #6d3037;
}

.nexus-shop-screen-window .window-header {
    border: 1px solid #66512d;
    border-bottom: 0;
    background: #090c0d;
    color: var(--shop-ivory);
}

.nexus-shop-screen-window .window-content {
    border: 1px solid #66512d;
    border-top: 1px solid color-mix(in srgb, var(--shop-brass) 45%, transparent);
    background: var(--shop-charcoal);
}

.nexus-shop-screen-shell {
    color: var(--shop-ivory);
    background: linear-gradient(180deg, #0b1012, #070a0b 62%);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, .42);
}

.nexus-shop-screen-shell .nexus-shop-streamlined-header {
    grid-template-columns: minmax(290px, 1.2fr) minmax(190px, .78fr) minmax(270px, 1fr) auto !important;
    gap: 0 !important;
    min-height: 86px;
    padding: 8px 12px;
    border-bottom: 1px solid #54482f;
    background: linear-gradient(180deg, #111719, #0a0f11);
    box-shadow: inset 0 -1px color-mix(in srgb, var(--shop-brass-bright) 12%, transparent);
}

.nexus-shop-screen-shell .nexus-shop-primary-trader,
.nexus-shop-screen-shell .nexus-shop-wallet-control {
    align-self: stretch;
    padding: 7px 18px 7px 8px;
    border-right: 1px solid color-mix(in srgb, var(--shop-brass) 38%, transparent);
    border-radius: 0;
}

.nexus-shop-screen-shell .nexus-shop-wallet-control {
    gap: 11px;
    padding-left: 20px;
}

.nexus-shop-screen-shell .nexus-shop-screen-summary {
    align-items: flex-end;
    padding: 5px 18px;
    color: var(--shop-ivory);
    text-align: right;
}

.nexus-shop-screen-shell .nexus-shop-screen-summary strong {
    color: var(--shop-ivory);
    font-family: var(--font-h2, serif);
    font-size: 18px;
    line-height: 1.15;
}

.nexus-shop-screen-shell .nexus-shop-screen-summary span {
    color: #b8ad9c;
    font-size: 11px;
}

.nexus-shop-screen-shell .nexus-shop-screen-summary small {
    margin-top: 5px;
    color: #77756f;
    font-size: 9px;
    letter-spacing: .06em;
}

.nexus-shop-screen-shell .nexus-shop-header-identity span,
.nexus-shop-screen-shell .nexus-shop-wallet-label span {
    color: #9b9387;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.nexus-shop-screen-shell .nexus-shop-header-identity strong,
.nexus-shop-screen-shell .nexus-shop-wallet-label strong {
    color: var(--shop-ivory);
    font-family: var(--font-h2, serif);
    font-size: 18px;
    line-height: 1.15;
}

.nexus-shop-screen-shell .nexus-shop-header-identity small,
.nexus-shop-screen-shell .nexus-shop-wallet-label small {
    color: #9b958b;
    font-size: 10px;
}

.nexus-shop-screen-shell .nexus-shop-trader-picker > summary {
    width: 52px;
    height: 52px;
    border: 1px solid var(--shop-brass);
    background: #090d0f;
    box-shadow: inset 0 0 0 2px #151b1d;
}

.nexus-shop-screen-shell .nexus-shop-trader-picker > summary > img,
.nexus-shop-screen-shell .nexus-shop-trader-picker > summary > span {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
}

.nexus-shop-screen-shell .nexus-shop-wallet-control:not(.is-separate) .nexus-shop-wallet-picker > summary {
    width: 52px;
    height: 52px;
    border-style: solid;
    opacity: 1;
}

.nexus-shop-screen-shell .nexus-shop-wallet-control:not(.is-separate) .nexus-shop-wallet-picker > summary > span {
    width: 48px !important;
    height: 48px !important;
    color: var(--shop-ivory);
    font-size: 19px;
}

.nexus-shop-screen-shell .nexus-shop-header-controls {
    gap: 8px;
    padding-left: 6px;
}

.nexus-shop-screen-shell .nexus-shop-header-controls > button {
    width: 38px;
    min-width: 38px;
    height: 34px;
    padding: 0;
    border: 1px solid #806329;
    border-radius: 3px;
    background: #151719;
    color: var(--shop-brass-bright);
    box-shadow: none;
}

.nexus-shop-screen-shell .nexus-shop-header-controls > button:hover,
.nexus-shop-screen-shell .nexus-shop-header-controls > button:focus-visible {
    border-color: var(--shop-brass-bright);
    background: #202224;
    outline: none;
}

.nexus-shop-screen-shell .nexus-shop-counter {
    gap: 8px;
    padding: 10px;
    background: #080c0e;
}

.nexus-shop-screen-shell .nexus-shop-inventory-panel {
    padding: 10px;
    border: 1px solid #4a5050;
    border-radius: 0;
    background: linear-gradient(145deg, rgba(18, 28, 33, .98), rgba(9, 14, 16, .98));
    box-shadow: inset 0 0 22px rgba(0, 0, 0, .34);
}

.nexus-shop-screen-shell .nexus-shop-market-inventory {
    border-color: #66532e;
    background: linear-gradient(145deg, rgba(24, 25, 22, .98), rgba(11, 14, 14, .98));
}

.nexus-shop-screen-shell .nexus-shop-inventory-panel > header {
    min-height: 47px;
    padding: 0 8px 8px 11px;
    border-left: 3px solid var(--shop-blue);
    color: var(--shop-blue);
}

.nexus-shop-screen-shell .nexus-shop-market-inventory > header {
    border-left-color: var(--shop-brass-bright);
    color: var(--shop-brass-bright);
}

.nexus-shop-screen-shell .nexus-shop-inventory-panel h3 {
    color: inherit;
    font-family: var(--font-h2, serif);
    font-size: 21px;
    letter-spacing: .035em;
}

.nexus-shop-screen-shell .nexus-shop-inventory-panel > header small {
    color: #9d978c;
    font-size: 10px;
}

.nexus-shop-screen-shell .nexus-shop-inventory-panel > header > span {
    align-self: flex-start;
    padding-top: 4px;
    color: inherit;
    font-family: var(--font-h2, serif);
    font-size: 13px;
    font-weight: 700;
}

.nexus-shop-screen-shell .nexus-shop-compact-grid {
    grid-template-columns: repeat(auto-fill, 92px);
    grid-auto-rows: 100px;
    gap: 7px;
    padding: 7px 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .012), transparent 38%);
}

.nexus-shop-screen-shell .nexus-shop-item-card {
    width: 92px;
    height: 100px;
    min-width: 92px;
    min-height: 100px;
    border: 1px solid #4e5352;
    border-radius: 4px;
    background: #090d0f;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, .7);
    color: var(--shop-ivory);
}

.nexus-shop-screen-shell .nexus-shop-market-inventory .nexus-shop-item-card {
    border-color: #725926;
}

.nexus-shop-screen-shell .nexus-shop-item-card:hover,
.nexus-shop-screen-shell .nexus-shop-item-card:focus-visible {
    border-color: var(--shop-brass-bright);
    box-shadow: inset 0 0 10px color-mix(in srgb, var(--shop-brass-bright) 12%, transparent), 0 0 0 1px color-mix(in srgb, var(--shop-brass-bright) 32%, transparent);
}

.nexus-shop-screen-shell .nexus-shop-card-price {
    bottom: 19px;
    padding: 1px 4px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(5, 8, 9, .94);
    font-size: 9px;
}

.nexus-shop-screen-shell .nexus-shop-card-quantity {
    top: 4px;
    right: 4px;
    background: rgba(5, 8, 9, .92);
    color: var(--shop-ivory);
}

.nexus-shop-screen-shell .nexus-shop-card-name {
    padding: 8px 4px 3px;
    background: linear-gradient(transparent, rgba(5, 8, 9, .98) 44%);
    color: var(--shop-ivory);
    font-family: var(--font-h2, serif);
    font-size: 9px;
    text-align: center;
}

.nexus-shop-screen-shell .nexus-shop-item-card.is-incoming-purchase {
    border-color: var(--shop-green);
    background: #111a10;
    box-shadow: inset 0 0 13px rgba(134, 173, 91, .22), 0 0 0 1px rgba(134, 173, 91, .34);
}

.nexus-shop-screen-shell .nexus-shop-item-card.is-incoming-sale {
    border-color: #9a5159;
    background: #211113;
    box-shadow: inset 0 0 13px rgba(109, 48, 55, .3), 0 0 0 1px rgba(154, 81, 89, .34);
}

.nexus-shop-screen-shell .nexus-shop-item-card.is-incoming-purchase .nexus-shop-card-flow { color: #acd47d; }
.nexus-shop-screen-shell .nexus-shop-item-card.is-incoming-sale .nexus-shop-card-flow { color: #e09aa1; }

.nexus-shop-screen-shell .nexus-shop-item-card.is-disabled {
    filter: grayscale(.9) brightness(.62);
    opacity: .68;
}

.nexus-shop-screen-shell .nexus-shop-item-card.is-disabled .nexus-shop-card-price {
    top: 43px;
    right: -9px;
    bottom: auto;
    left: -9px;
    border: 1px solid #77736b;
    border-radius: 0;
    background: rgba(37, 39, 39, .94);
    color: #dedbd3;
    line-height: 15px;
    text-align: center;
    transform: rotate(-9deg);
}

.nexus-shop-screen-shell .nexus-shop-empty-message {
    color: #737774;
    font-style: italic;
}

.nexus-shop-screen-shell .nexus-shop-receipt-footer {
    grid-template-columns: minmax(155px, .72fr) minmax(280px, 1.12fr) minmax(330px, 1.32fr) minmax(140px, auto);
    gap: 0;
    min-height: 104px;
    padding: 0;
    border-top: 1px solid #5c4b2c;
    background: #0b1012;
}

.nexus-shop-screen-shell .nexus-shop-receipt-footer > small,
.nexus-shop-screen-shell .nexus-shop-ledger,
.nexus-shop-screen-shell .nexus-shop-checkout,
.nexus-shop-screen-shell .nexus-shop-footer-actions {
    align-self: stretch;
    padding: 14px 18px;
    border-right: 1px solid #454641;
}

.nexus-shop-screen-shell .nexus-shop-receipt-footer > small {
    display: flex;
    align-items: center;
    border-left: 3px solid var(--shop-green);
    color: #b9b3a8;
    font-size: 10px;
    line-height: 1.35;
}

.nexus-shop-screen-shell .nexus-shop-ledger {
    align-content: center;
    gap: 6px 20px;
    color: #aaa397;
    font-size: 11px;
}

.nexus-shop-screen-shell .nexus-shop-ledger strong { color: var(--shop-ivory); }

.nexus-shop-screen-shell .nexus-shop-ledger .nexus-shop-net {
    padding-top: 7px;
    border-top: 1px solid #59503d;
    color: var(--shop-green);
}

.nexus-shop-screen-shell .nexus-shop-checkout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 7px;
}

.nexus-shop-screen-shell .nexus-shop-checkout > button {
    min-height: 44px;
    border: 1px solid #789e52;
    border-radius: 3px;
    background: linear-gradient(180deg, #35552d, #223b20);
    color: #e8efd9;
    font-family: var(--font-h2, serif);
    font-size: 17px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.nexus-shop-screen-shell .nexus-shop-checkout > button:disabled {
    border-color: #68353a;
    background: linear-gradient(180deg, #442326, #2c181b);
    color: #8f7b78;
    opacity: 1;
}

.nexus-shop-screen-shell .nexus-shop-checkout > small {
    color: #9d978d;
    line-height: 1.3;
    text-align: center;
}

.nexus-shop-screen-shell .nexus-shop-footer-actions {
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    border-right: 0;
}

.nexus-shop-screen-shell .nexus-shop-footer-actions > button {
    width: 100%;
    min-width: 112px;
    min-height: 40px;
    border: 1px solid var(--shop-brass);
    border-radius: 3px;
    background: #141719;
    color: var(--shop-brass-bright);
    font-family: var(--font-h2, serif);
    font-size: 14px;
    box-shadow: none;
}

.nexus-shop-screen-shell .nexus-shop-footer-actions > button:hover,
.nexus-shop-screen-shell .nexus-shop-footer-actions > button:focus-visible {
    border-color: var(--shop-brass-bright);
    background: #202326;
    outline: none;
}

@media (max-width: 1000px) {
    .nexus-shop-screen-shell .nexus-shop-streamlined-header {
        grid-template-columns: minmax(250px, 1fr) minmax(170px, .75fr) auto !important;
    }

    .nexus-shop-screen-shell .nexus-shop-screen-summary { display: none; }
    .nexus-shop-screen-shell .nexus-shop-compact-grid { grid-template-columns: repeat(auto-fill, 82px); grid-auto-rows: 92px; }
    .nexus-shop-screen-shell .nexus-shop-item-card { width: 82px; height: 92px; min-width: 82px; min-height: 92px; }
    .nexus-shop-screen-shell .nexus-shop-receipt-footer { grid-template-columns: minmax(250px, 1fr) minmax(300px, 1.25fr) 130px; }
    .nexus-shop-screen-shell .nexus-shop-receipt-footer > small { display: none; }
    .nexus-shop-screen-shell .nexus-shop-receipt-footer .nexus-shop-ledger { grid-column: 1; }
    .nexus-shop-screen-shell .nexus-shop-receipt-footer .nexus-shop-checkout { grid-column: 2; }
    .nexus-shop-screen-shell .nexus-shop-receipt-footer .nexus-shop-footer-actions { grid-column: 3; grid-row: 1; }
}

/* Nexus Shops v3: direct manipulation counter --------------------------- */
.nexus-shop-streamlined-header {
    grid-template-columns: minmax(300px, 1.35fr) minmax(56px, auto) minmax(210px, 0.85fr) auto !important;
}

.nexus-shop-primary-trader { min-width: 0; }

.nexus-shop-wallet-control {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 48px;
}

.nexus-shop-wallet-control:not(.is-separate) .nexus-shop-wallet-picker > summary {
    width: 36px;
    height: 36px;
    border-style: dashed;
    opacity: 0.78;
}

.nexus-shop-wallet-control:not(.is-separate) .nexus-shop-wallet-picker > summary > span {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px;
}

.nexus-shop-wallet-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nexus-shop-wallet-label span { color: #a88f70; font-size: 9px; text-transform: uppercase; }
.nexus-shop-wallet-label strong { overflow: hidden; color: #f0d096; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.nexus-shop-wallet-label small { color: #b69c77; font-size: 9px; }

.nexus-shop-counter {
    gap: 10px;
    padding: 10px;
}

.nexus-shop-compact-grid {
    grid-template-columns: repeat(auto-fill, 84px);
    grid-auto-rows: 84px;
    gap: 6px;
    justify-content: start;
    padding: 5px;
}

.nexus-shop-item-card {
    position: relative;
    display: block;
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #76502a;
    border-radius: 4px;
    background: #100b08;
    box-shadow: inset 0 0 9px rgba(0, 0, 0, 0.72);
    color: #f3d28c;
    cursor: pointer;
    transition: border-color 100ms ease, box-shadow 100ms ease, transform 100ms ease, filter 100ms ease;
}

.nexus-shop-item-card:hover,
.nexus-shop-item-card:focus-visible {
    z-index: 2;
    border-color: #f0b64a;
    outline: none;
    box-shadow: inset 0 0 9px rgba(245, 183, 69, 0.18), 0 0 7px rgba(240, 176, 64, 0.62);
    transform: translateY(-1px);
}

.nexus-shop-item-card > img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    object-fit: contain;
    pointer-events: none;
}

.nexus-shop-card-price,
.nexus-shop-card-quantity,
.nexus-shop-card-name,
.nexus-shop-card-flow,
.nexus-shop-card-state {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.nexus-shop-card-price {
    left: 3px;
    bottom: 16px;
    padding: 1px 3px;
    border-radius: 2px;
    background: rgba(12, 8, 5, 0.9);
    color: #ffd15b;
    font-size: 9px;
    font-weight: 800;
    line-height: 13px;
}

.nexus-shop-card-price.is-price-favorable {
    color: #8ee58e;
}

.nexus-shop-card-price.is-price-unfavorable {
    color: #f08b82;
}

.nexus-shop-card-price.is-price-standard {
    color: #f4efe5;
}

.nexus-shop-card-price.is-price-rejected {
    color: #969696;
}

.nexus-shop-card-quantity {
    top: 3px;
    right: 3px;
    min-width: 18px;
    padding: 1px 3px;
    border-radius: 8px;
    background: rgba(12, 8, 5, 0.92);
    color: #ffe5a4;
    font-size: 9px;
    font-weight: 800;
    line-height: 13px;
    text-align: center;
}

.nexus-shop-card-name {
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    padding: 7px 3px 2px;
    background: linear-gradient(transparent, rgba(8, 5, 3, 0.96) 48%);
    color: #ead8ba;
    font-size: 8px;
    font-weight: 600;
    line-height: 11px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nexus-shop-card-flow {
    top: 3px;
    left: 3px;
    padding: 1px 3px;
    border-radius: 2px;
    background: rgba(16, 10, 6, 0.92);
    font-size: 8px;
    font-weight: 800;
    line-height: 13px;
    text-transform: uppercase;
}

.nexus-shop-card-state {
    top: 3px;
    left: 3px;
    padding: 3px;
    border-radius: 50%;
    background: rgba(16, 10, 6, 0.92);
    color: #9ec5e8;
    font-size: 9px;
}

.nexus-shop-item-card.is-incoming-purchase {
    border: 2px solid #ffc24e;
    background: rgba(72, 46, 17, 0.92);
    box-shadow: inset 0 0 12px rgba(255, 189, 65, 0.28), 0 0 7px rgba(255, 187, 56, 0.62);
}

.nexus-shop-item-card.is-incoming-purchase .nexus-shop-card-flow { color: #ffd369; }

.nexus-shop-item-card.is-incoming-sale {
    border: 2px solid #51c8cf;
    background: rgba(14, 57, 61, 0.9);
    box-shadow: inset 0 0 12px rgba(72, 204, 211, 0.25), 0 0 7px rgba(66, 197, 205, 0.56);
}

.nexus-shop-item-card.is-incoming-sale .nexus-shop-card-flow { color: #7fe0e5; }

.nexus-shop-item-card.is-temporary::after {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    content: "";
    pointer-events: none;
}

.nexus-shop-item-card.is-disabled {
    cursor: not-allowed;
    filter: grayscale(0.78) brightness(0.58);
    opacity: 0.72;
}

.nexus-shop-item-card.is-disabled:hover { transform: none; }

.nexus-shop-receipt-footer {
    grid-template-columns: minmax(130px, 0.7fr) minmax(250px, 1fr) minmax(340px, 1.35fr) auto;
}

.nexus-shop-receipt-footer .nexus-shop-checkout { grid-column: 3; }
.nexus-shop-receipt-footer .nexus-shop-footer-actions { grid-column: 4; }

.nexus-shop-rich-tooltip {
    width: 300px;
    max-width: 340px;
    padding: 0 !important;
    border: 1px solid #8b714b !important;
    color: #292016 !important;
    background: #e6d5b8 !important;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.62) !important;
}

.nexus-shop-tooltip-card {
    padding: 12px;
    background:
        linear-gradient(rgba(255,255,255,0.12), rgba(255,255,255,0.02)),
        repeating-linear-gradient(0deg, rgba(92,66,38,0.035) 0, rgba(92,66,38,0.035) 1px, transparent 1px, transparent 4px),
        #e6d5b8;
}

.nexus-shop-tooltip-card header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(91, 66, 38, 0.42);
}

.nexus-shop-tooltip-card header img {
    width: 52px;
    height: 52px;
    border: 1px solid #675139;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(32, 23, 15, 0.9);
}

.nexus-shop-tooltip-card header div { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-tooltip-card header strong { color: #2c2117; font-family: var(--font-h2, serif); font-size: 17px; }
.nexus-shop-tooltip-card header span { color: #695a49; font-size: 11px; }
.nexus-shop-tooltip-meta { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; color: #6c512c; font-size: 11px; }
.nexus-shop-tooltip-card p { margin: 4px 0 8px; color: #382d22; font-size: 12px; line-height: 1.35; }
.nexus-shop-tooltip-card > small { display: block; padding-top: 6px; border-top: 1px solid rgba(91,66,38,0.28); color: #796b5a; font-size: 9px; text-align: center; }

@media (max-width: 900px) {
    .nexus-shop-streamlined-header { grid-template-columns: minmax(250px, 1fr) auto auto !important; }
    .nexus-shop-streamlined-header .nexus-shop-screen-summary { display: none; }
    .nexus-shop-compact-grid { grid-template-columns: repeat(auto-fill, 80px); grid-auto-rows: 80px; }
    .nexus-shop-item-card { width: 80px; height: 80px; min-width: 80px; min-height: 80px; }
    .nexus-shop-receipt-footer { grid-template-columns: 1fr auto; }
    .nexus-shop-receipt-footer .nexus-shop-ledger,
    .nexus-shop-receipt-footer .nexus-shop-checkout { grid-column: 1; }
    .nexus-shop-receipt-footer .nexus-shop-footer-actions { grid-column: 2; grid-row: 1 / 3; }
}

/* Nexus Shops: streamlined GM configuration ----------------------------- */
.nexus-shop-config-streamlined {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nexus-shop-config-streamlined .nexus-shop-config-card { margin: 0; }

.nexus-shop-config-streamlined .nexus-shop-config-card > header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nexus-shop-config-streamlined .nexus-shop-config-card > header small {
    color: #9e8a70;
    font-size: 10px;
}

.nexus-shop-name-field {
    display: grid !important;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 8px !important;
    margin-bottom: 9px;
}

.nexus-shop-commerce-row {
    display: grid;
    grid-template-columns: minmax(145px, 1fr) minmax(145px, 1fr) minmax(170px, 1.2fr) auto;
    align-items: end;
    gap: 9px;
}

.nexus-shop-commerce-row > label:not(.nexus-shop-inline-check) {
    display: grid;
    grid-template-columns: auto minmax(60px, 1fr) auto;
    align-items: center;
    gap: 5px;
}

.nexus-shop-commerce-row > label:not(.nexus-shop-inline-check) > input { min-width: 0; }
.nexus-shop-commerce-row > label > span { color: #d4b26e; }

.nexus-shop-inline-check,
.nexus-shop-commerce-toggles label {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 5px !important;
    min-height: 30px;
}

.nexus-shop-inline-check input,
.nexus-shop-commerce-toggles input { width: auto; height: auto; margin: 0; }

.nexus-shop-commerce-toggles {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(118, 80, 42, 0.52);
}

.nexus-shop-profile-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 5px !important;
}

.nexus-shop-profile-actions .is-danger {
    border-color: #7c3e31;
    color: #dca18d;
    background: #321914;
}

.nexus-shop-profile-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) minmax(130px, 0.85fr) minmax(150px, 0.9fr) minmax(150px, 0.9fr);
    align-items: end;
    gap: 9px;
}

.nexus-shop-suffixed-input,
.nexus-shop-range-input {
    display: grid;
    align-items: center;
    gap: 5px;
}

.nexus-shop-suffixed-input { grid-template-columns: minmax(0, 1fr) auto; }
.nexus-shop-range-input { grid-template-columns: minmax(45px, 1fr) auto minmax(45px, 1fr); }
.nexus-shop-suffixed-input span,
.nexus-shop-range-input span { color: #c5a66b; font-size: 10px; text-align: center; }

.nexus-shop-profile-summary {
    margin: 9px 0 0;
    padding: 7px 9px;
    border-left: 3px solid #93622c;
    background: rgba(20, 13, 9, 0.55);
    color: #bba88b;
    font-size: 11px;
}

.nexus-shop-profile-summary i { margin-right: 5px; color: #dfb45f; }

.nexus-shop-advanced-sources {
    margin: 8px 0 0;
    padding: 6px 8px;
    border: 1px solid #50361e;
    border-radius: 3px;
    background: rgba(18, 12, 8, 0.46);
}

.nexus-shop-advanced-sources > summary {
    color: #c7aa73;
    cursor: pointer;
    font-size: 11px;
}

.nexus-shop-advanced-sources > summary small { margin-left: 8px; color: #887863; }
.nexus-shop-advanced-sources > div { margin-top: 7px; }

.nexus-shop-stock-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 300px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.nexus-shop-stock-card.is-dragover {
    border-color: #efbb50;
    background: rgba(69, 45, 21, 0.98);
    box-shadow: inset 0 0 0 2px rgba(239, 187, 80, 0.6), 0 0 12px rgba(239, 173, 64, 0.35);
}

.nexus-shop-stock-drop-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    margin-bottom: 9px;
    padding: 7px 12px;
    border: 1px dashed #876033;
    border-radius: 4px;
    color: #c4a979;
    background: rgba(17, 11, 7, 0.58);
    pointer-events: none;
}

.nexus-shop-stock-drop-hint > i { color: #e5b758; font-size: 20px; }
.nexus-shop-stock-drop-hint > div { display: flex; flex-direction: column; }
.nexus-shop-stock-drop-hint strong { color: #e3c58c; font-size: 12px; }
.nexus-shop-stock-drop-hint span { color: #95826a; font-size: 10px; }
.nexus-shop-stock-card.is-dragover .nexus-shop-stock-drop-hint { border-color: #f1c45d; color: #f0d49a; background: rgba(90, 58, 24, 0.68); }

.nexus-shop-current-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    flex: 1 1 auto;
}

.nexus-shop-current-stock-grid article {
    grid-template-columns: 46px minmax(0, 1fr) repeat(3, auto) !important;
}

.nexus-shop-current-stock-grid article > img { width: 46px; height: 46px; }
.nexus-shop-stock-details { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-stock-drop-unavailable,
.nexus-shop-empty-stock { color: #99856b; font-size: 11px; text-align: center; }
.nexus-shop-empty-stock { grid-column: 1 / -1; padding: 28px; }

@media (max-width: 760px) {
    .nexus-shop-commerce-row { grid-template-columns: 1fr 1fr; }
    .nexus-shop-profile-row { grid-template-columns: 1fr 1fr; }
    .nexus-shop-current-stock-grid { grid-template-columns: 1fr; }
}

/* Nexus Shops: embedded Restock Pool ------------------------------------ */
.nexus-shop-config-top-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: stretch; gap: 10px; }
.nexus-shop-config-top-grid > .nexus-shop-config-card { min-width: 0; }
.nexus-shop-config-top-grid .nexus-shop-commerce-row { grid-template-columns: 1fr 1fr; }
.nexus-shop-config-top-grid .nexus-shop-treasury-field { grid-column: 1; }
.nexus-shop-config-top-grid .nexus-shop-inline-check { grid-column: 2; }
.nexus-shop-config-top-grid .nexus-shop-commerce-toggles { justify-content: space-between; gap: 8px; }
.nexus-shop-list-card > label { display: flex; flex-direction: column; gap: 3px; }
.nexus-shop-list-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px; border: 1px solid #57391f; border-radius: 3px; background: #1c120d; }
.nexus-shop-list-summary.has-missing { border-color: #935344; }
.nexus-shop-list-summary > span { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-list-summary strong { color: #dec184; }
.nexus-shop-list-summary small { color: #9a876b; font-size: 9px; }
.nexus-shop-list-summary button { width: auto; white-space: nowrap; }
.nexus-shop-list-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.nexus-shop-list-actions { display: flex; justify-content: flex-end; gap: 5px; margin-top: 8px; }
.nexus-shop-list-actions button { width: auto; }
.nexus-shop-list-actions .is-danger { border-color: #7c3e31; color: #dca18d; background: #321914; }
.nexus-shop-stock-card > header { min-height: 34px; }
.nexus-shop-stock-card > header .nexus-shop-stock-drop-hint { min-height: 27px; margin: 0; padding: 3px 9px; border-style: dashed; pointer-events: none; }
.nexus-shop-stock-card > header .nexus-shop-stock-drop-hint > i { font-size: 12px; }
.nexus-shop-stock-card > header .nexus-shop-stock-drop-hint strong { font-size: 10px; }
.nexus-shop-current-stock-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nexus-shop-current-stock-grid article { grid-template-columns: 40px minmax(0, 1fr) auto !important; gap: 6px; min-width: 0; }
.nexus-shop-current-stock-grid article > img { width: 40px; height: 40px; }
.nexus-shop-stock-details > strong, .nexus-shop-stock-details > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-shop-stock-edit { gap: 5px; }
.nexus-shop-stock-edit label { min-width: 0; }
.nexus-shop-stock-edit label:first-child { flex: 0 0 62px; }
.nexus-shop-stock-edit label:last-child { flex: 1 1 auto; }
.nexus-shop-stock-edit em { color: #a98c5b; font-size: 9px; font-style: normal; }
.nexus-shop-stock-actions { display: flex; flex-direction: column; gap: 3px; }
.nexus-shop-stock-actions button { width: 25px; min-width: 25px; height: 22px; padding: 0; }

.nexus-shop-stock-list-builder-window .window-content { padding: 0; overflow: hidden; }
.nexus-stock-list-builder { display: flex; flex-direction: column; height: 100%; min-height: 0; color: #d9c39c; background: #140e0b; }
.nexus-stock-list-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid #70481f; background: #29180f; }
.nexus-stock-list-header > div { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(240px, 1.35fr); gap: 8px; }
.nexus-stock-list-header label, .nexus-stock-list-filter-row > label { display: flex; flex-direction: column; gap: 3px; color: #c8aa73; font-size: 9px; }
.nexus-stock-list-header nav, .nexus-stock-list-column header nav { display: flex; gap: 5px; }
.nexus-stock-list-header button, .nexus-stock-list-column header button { width: auto; min-height: 28px; padding: 3px 8px; font-size: 9px; white-space: nowrap; }
.nexus-stock-list-discovery { flex: 0 0 auto; padding: 9px 12px; border-bottom: 1px solid #5e3d20; background: #21140e; }
.nexus-stock-list-filter-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(125px, .65fr) minmax(130px, .65fr) auto minmax(180px, .9fr); align-items: end; gap: 8px; }
.nexus-stock-priced-only { flex-direction: row !important; align-items: center; min-height: 30px; white-space: nowrap; }
.nexus-stock-priced-only input { width: auto; height: auto; }
.nexus-stock-list-search { display: flex !important; flex-direction: row !important; align-items: center; padding: 0 7px; border: 1px solid #593b21; border-radius: 3px; }
.nexus-stock-list-search input { min-width: 0; border: 0; background: transparent; }
.nexus-stock-list-discovery > p { margin: 6px 0; color: #9d896b; font-size: 9px; }
.nexus-stock-list-discovery > p i { color: #dfb45f; }
.nexus-stock-list-categories { display: flex; flex-wrap: wrap; gap: 5px; }
.nexus-stock-list-categories label { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid #50351d; border-radius: 3px; color: #b79c70; font-size: 9px; background: #1a110c; }
.nexus-stock-list-categories input { width: auto; height: auto; }
.nexus-stock-list-sources { margin-top: 7px; border: 1px solid #50351d; border-radius: 3px; background: #170f0b; }
.nexus-stock-list-sources > summary { padding: 6px 8px; color: #d2af6c; cursor: pointer; font-size: 10px; }
.nexus-stock-list-sources > summary small { margin-left: 5px; color: #8e7c64; }
.nexus-stock-list-source-toolbar { display: flex; justify-content: flex-end; gap: 5px; padding: 0 7px 5px; }
.nexus-stock-list-source-toolbar button { width: auto; min-height: 24px; padding: 2px 7px; font-size: 8px; }
.nexus-stock-list-source-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-height: 190px; overflow: auto; padding: 0 7px 7px; }
.nexus-stock-list-source-groups h3 { margin: 0 0 4px; color: #aa9168; font-size: 8px; text-transform: uppercase; }
.nexus-stock-list-source-groups section > label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px; margin-bottom: 4px; padding: 5px; border: 1px solid #412b19; border-radius: 3px; background: #21150e; cursor: pointer; }
.nexus-stock-list-source-groups section > label:has(input:checked) { border-color: #9d692a; background: #342014; }
.nexus-stock-list-source-groups input { width: auto; height: auto; }
.nexus-stock-list-source-groups label > span { display: flex; flex-direction: column; min-width: 0; }
.nexus-stock-list-source-groups strong, .nexus-stock-list-source-groups small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-stock-list-source-groups strong { color: #d5ba88; font-size: 9px; }
.nexus-stock-list-source-groups strong em { color: #e5b85e; font-size: 7px; font-style: normal; }
.nexus-stock-list-source-groups small { color: #806f5c; font-size: 7px; }

.nexus-stock-list-columns { display: grid; grid-template-columns: 1fr 1fr; flex: 1 1 auto; min-height: 0; }
.nexus-stock-list-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px; }
.nexus-stock-list-column + .nexus-stock-list-column { border-left: 1px solid #6a4321; }
.nexus-stock-list-column > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; margin-bottom: 7px; }
.nexus-stock-list-column h2 { margin: 0; color: #e1b95f; font-family: var(--nexus-font-heading, serif); font-size: 17px; }
.nexus-stock-list-column header small { color: #947f64; font-size: 8px; }
.nexus-stock-list-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 5px; flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 4px; }
.nexus-stock-list-items article { display: grid; grid-template-columns: auto 38px minmax(0, 1fr) auto auto; align-items: center; gap: 5px; min-width: 0; min-height: 47px; padding: 4px; border: 1px solid #49301c; border-radius: 3px; background: #21150e; }
.nexus-stock-list-column.selected article { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.nexus-stock-list-items article.already-added { opacity: .55; }
.nexus-stock-list-items article.missing { border-color: #87473c; background: #2a1512; }
.nexus-stock-list-items input { width: auto; height: auto; }
.nexus-stock-list-items img { width: 38px; height: 38px; border: 1px solid #5b3f25; object-fit: cover; }
.nexus-stock-list-items article > span { display: flex; flex-direction: column; min-width: 0; }
.nexus-stock-list-items strong, .nexus-stock-list-items small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-stock-list-items strong { color: #d9bd88; font-size: 9px; }
.nexus-stock-list-items small { color: #806f5b; font-size: 7px; }
.nexus-stock-list-items article > b { color: #d9ad55; font-size: 8px; white-space: nowrap; }
.nexus-stock-list-items article > button { width: 24px; min-width: 24px; height: 24px; padding: 0; }
.nexus-stock-list-empty { grid-column: 1 / -1; margin: auto; color: #907d64; font-size: 10px; text-align: center; }
.nexus-stock-list-builder > footer { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: 34px; padding: 5px 12px; border-top: 1px solid #70481f; color: #b6a17f; background: #29180f; font-size: 10px; }
.nexus-stock-list-builder > footer span b { color: #dfb45f; }
.nexus-stock-list-builder > footer strong { color: #d5ad5e; font-size: 10px; }

@media (max-width: 920px) {
    .nexus-shop-config-top-grid { grid-template-columns: 1fr; }
    .nexus-shop-current-stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nexus-stock-list-filter-row { grid-template-columns: 1fr 1fr 1fr; }
    .nexus-stock-list-source-groups { grid-template-columns: 1fr 1fr; }
    .nexus-stock-list-items { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .nexus-shop-current-stock-grid { grid-template-columns: 1fr; }
    .nexus-stock-list-columns { grid-template-columns: 1fr; overflow: auto; }
    .nexus-stock-list-column { min-height: 350px; }
    .nexus-stock-list-column + .nexus-stock-list-column { border-left: 0; border-top: 1px solid #6a4321; }
}


/* Restock Pool editor refinements --------------------------------------- */
.nexus-stock-list-unsaved {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 3px;
    color: #dda94f;
    font-size: 8px;
    white-space: nowrap;
}
.nexus-stock-list-unsaved[hidden] { display: none; }
.nexus-stock-list-unsaved i { font-size: 6px; }
.nexus-stock-list-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    max-height: 190px;
    overflow: auto;
    padding: 0 7px 7px;
}
.nexus-stock-list-source-grid > label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid #412b19;
    border-radius: 3px;
    background: #21150e;
    cursor: pointer;
}
.nexus-stock-list-source-grid > label:has(input:checked) {
    border-color: #9d692a;
    background: #342014;
    box-shadow: inset 2px 0 #d59a3c;
}
.nexus-stock-list-source-grid input { width: auto; height: auto; }
.nexus-stock-list-source-grid label > span { display: flex; flex-direction: column; min-width: 0; }
.nexus-stock-list-source-grid strong,
.nexus-stock-list-source-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-stock-list-source-grid strong { color: #d5ba88; font-size: 9px; }
.nexus-stock-list-source-grid small { color: #806f5c; font-size: 7px; }
.nexus-stock-list-source-grid > p { grid-column: 1 / -1; color: #8f7c62; font-size: 9px; text-align: center; }

@media (max-width: 820px) {
    .nexus-stock-list-source-grid { grid-template-columns: 1fr; }
    .nexus-stock-list-unsaved { display: none; }
}


.nexus-stock-list-source-grid > label.no-matches { opacity: .55; }
.nexus-stock-list-source-grid > label.no-matches strong { color: #9b8b75; }

.nexus-stock-list-items article[hidden] { display: none; }

/* Restock Pool visible preset filters ----------------------------------- */
.nexus-stock-list-subtypes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(112, 72, 31, .45);
}
.nexus-stock-list-subtypes > span {
    margin-left: 5px;
    color: #8f7c62;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
}
.nexus-stock-list-subtypes > span:first-child { margin-left: 0; }
.nexus-stock-list-subtypes label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border: 1px solid #50351d;
    border-radius: 3px;
    color: #b79c70;
    font-size: 8px;
    background: #1a110c;
}
.nexus-stock-list-subtypes input { width: auto; height: auto; }


.nexus-stock-list-subtypes > small { flex: 0 0 100%; color: #806f5c; font-size: 7px; }

/* Restock Pool Browser */
.nexus-shop-stock-list-builder-window .window-content { padding: 0; overflow: hidden; }
.nexus-stock-list-workspace {
    display: grid;
    grid-template-columns: 252px minmax(340px, 1fr) minmax(340px, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.nexus-stock-filter-rail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    border-right: 1px solid #6a4321;
    background: #171616;
}
.nexus-stock-filter-rail .nexus-stock-list-search {
    flex: 0 0 auto;
    min-height: 32px;
    margin-bottom: 8px;
    background: #25272d;
}
.nexus-stock-preset { display: flex; flex-direction: column; gap: 3px; color: #c8aa73; font-size: 9px; }
.nexus-stock-filter-help { margin: 5px 0 8px; color: #817667; font-size: 8px; line-height: 1.25; }
.nexus-stock-filter-scroll { min-height: 0; overflow: auto; padding-right: 4px; }
.nexus-stock-filter-rail fieldset { min-width: 0; margin: 0 0 9px; padding: 0; border: 0; }
.nexus-stock-filter-rail legend {
    width: 100%;
    margin-bottom: 4px;
    border-bottom: 1px dotted #665640;
    color: #a99a85;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
}
.nexus-stock-filter-types { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 7px; flex: 0 0 auto; }
.nexus-stock-filter-types legend { grid-column: 1 / -1; }
.nexus-stock-filter-types label,
.nexus-stock-price-filter > label { display: flex; align-items: center; gap: 4px; color: #c4b69f; font-size: 9px; }
.nexus-stock-filter-types input,
.nexus-stock-price-filter input[type="checkbox"],
.nexus-stock-catalog-packs input { width: auto; height: auto; margin: 0; }
.nexus-stock-price-filter > div { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 4px; margin-bottom: 5px; }
.nexus-stock-price-filter input[type="number"] { min-width: 0; height: 26px; }
.nexus-stock-price-filter b { color: #a98a55; font-size: 8px; }
.nexus-stock-tristate-group { display: flex; flex-direction: column; gap: 2px; }
.nexus-stock-tristate-group button {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 23px;
    padding: 2px 5px;
    border: 1px solid transparent;
    color: #c3b6a2;
    background: transparent;
    box-shadow: none;
    font-size: 9px;
    text-align: left;
}
.nexus-stock-tristate-group button:hover { border-color: #5c4a35; background: #24201c; }
.nexus-stock-tristate-group button i { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid #76644d; border-radius: 2px; color: transparent; font-size: 9px; }
.nexus-stock-tristate-group button.state-1 { color: #bce0b0; background: #162719; }
.nexus-stock-tristate-group button.state-1 i { border-color: #64a95b; color: #8bdd7e; background: #244c27; }
.nexus-stock-tristate-group button.state--1 { color: #e2aaa5; background: #2a1717; }
.nexus-stock-tristate-group button.state--1 i { border-color: #b1544c; color: #f08076; background: #57231f; }
.nexus-stock-rules-sources { margin-top: 4px !important; }
.nexus-stock-clear-filters { width: 100%; min-height: 25px; margin: 0 0 8px; font-size: 8px; }
.nexus-stock-catalog-packs { border-top: 1px solid #4e4234; color: #aa9a83; font-size: 8px; }
.nexus-stock-catalog-packs summary { padding: 7px 2px; color: #c3a66f; cursor: pointer; font-size: 9px; }
.nexus-stock-catalog-packs summary small { margin-left: 3px; color: #756b5d; }
.nexus-stock-catalog-packs > p { margin: 0 0 5px; color: #796f62; line-height: 1.25; }
.nexus-stock-catalog-packs > label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px; margin-bottom: 3px; padding: 4px; border: 1px solid #38332c; border-radius: 2px; }
.nexus-stock-catalog-packs > label:has(input:checked) { border-color: #745323; background: #2b2116; }
.nexus-stock-catalog-packs label span { display: flex; flex-direction: column; min-width: 0; }
.nexus-stock-catalog-packs strong,
.nexus-stock-catalog-packs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-stock-catalog-packs strong { color: #bcae99; font-size: 8px; }
.nexus-stock-catalog-packs small { color: #756c60; font-size: 7px; }
.nexus-stock-list-workspace > .nexus-stock-list-column { padding: 10px; }
.nexus-stock-list-workspace > .nexus-stock-list-column + .nexus-stock-list-column { border-left: 1px solid #6a4321; }
.nexus-stock-list-workspace .nexus-stock-list-items { display: flex; flex-direction: column; gap: 3px; }
.nexus-stock-list-workspace .nexus-stock-list-items article {
    display: grid;
    grid-template-columns: auto 38px minmax(0, 1fr) auto auto;
    min-height: 47px;
    padding: 3px 4px;
    background: #25282f;
    border-color: #444850;
}
.nexus-stock-list-workspace .nexus-stock-list-column.selected article { grid-template-columns: 38px minmax(0, 1fr) auto auto; }
.nexus-stock-list-workspace .nexus-stock-list-items article > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 6px; }
.nexus-stock-list-workspace .nexus-stock-list-items article strong { grid-column: 1; color: #dedde0; font-size: 10px; }
.nexus-stock-list-workspace .nexus-stock-list-items article small { grid-column: 1; color: #999ba1; font-size: 8px; }
.nexus-stock-list-workspace .nexus-stock-list-items article em { grid-column: 2; grid-row: 1 / span 2; max-width: 105px; overflow: hidden; color: #b8bbc2; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.nexus-stock-list-workspace .nexus-stock-list-items article > b { min-width: 52px; color: #e5b958; text-align: right; }
.nexus-stock-load-more { flex: 0 0 auto; width: 100%; min-height: 28px; margin-top: 4px; font-size: 9px; }

@media (max-width: 1050px) {
    .nexus-stock-list-workspace { grid-template-columns: 220px minmax(300px, 1fr) minmax(300px, 1fr); overflow: auto; }
}


/* Collapsible Restock Pool Filters */
.nexus-stock-filter-rail .nexus-stock-preset { flex: 0 0 auto; }
.nexus-stock-filter-rail .nexus-stock-list-search { margin-top: 8px; }
.nexus-stock-filter-details {
    margin: 0 0 5px;
    border: 0;
    color: #a99a85;
}
.nexus-stock-filter-details > summary {
    padding: 4px 3px;
    border-bottom: 1px dotted #665640;
    color: #a99a85;
    cursor: pointer;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.nexus-stock-filter-details[open] > summary { margin-bottom: 3px; }
.nexus-stock-filter-details.has-active-filters > summary {
    border-bottom-color: #4f8f49;
    color: #9ad68e;
    background: #162719;
}
.nexus-stock-filter-details.has-active-filters > summary::marker { color: #79c86d; }
.nexus-stock-filter-details > .nexus-stock-tristate-group { padding: 0 2px 3px; }
.nexus-stock-list-builder > footer .nexus-stock-footer-tools {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.nexus-stock-list-builder > footer .nexus-stock-clear-filters {
    width: auto;
    min-height: 24px;
    margin: 0;
    padding: 2px 8px;
    flex: 0 0 auto;
    font-size: 9px;
}
.nexus-stock-list-builder > footer .nexus-stock-footer-tools span { white-space: nowrap; }
/* Shop configuration workbench ----------------------------------------- */
.nexus-shop-config-workbench {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.nexus-shop-config-workspace {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.nexus-shop-config-rail {
    min-width: 0;
    padding: 10px;
    overflow-y: auto;
    border-right: 1px solid #70481f;
    background: rgba(27, 18, 12, 0.97);
}

.nexus-shop-config-panel {
    padding: 0 0 12px;
    margin: 0 0 12px;
    border-bottom: 1px solid #54391f;
}

.nexus-shop-config-panel:last-child { margin-bottom: 0; border-bottom: 0; }
.nexus-shop-config-panel > header { margin-bottom: 8px; }
.nexus-shop-config-panel h2,
.nexus-shop-config-inventory h2 { margin: 0; color: #efc667; font-size: 17px; }
.nexus-shop-config-panel header small,
.nexus-shop-config-inventory-header small { color: #9e8a70; font-size: 9px; }
.nexus-shop-config-panel label { display: flex; flex-direction: column; gap: 3px; color: #bba78a; font-size: 10px; }
.nexus-shop-config-panel input,
.nexus-shop-config-panel select,
.nexus-shop-config-stock-search input,
.nexus-shop-config-stock-row input {
    height: 28px;
    min-width: 0;
    border: 1px solid #76502a;
    background: #17100b;
    color: #ecdab9;
}

.nexus-shop-config-percentages,
.nexus-shop-config-treasury,
.nexus-shop-config-ranges { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 7px; }
.nexus-shop-config-percentages label > span,
.nexus-shop-config-treasury label > span,
.nexus-shop-config-ranges label > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.nexus-shop-config-ranges label > span { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.nexus-shop-config-panel em { color: #c8a965; font-size: 9px; font-style: normal; }
.nexus-shop-config-treasury .nexus-shop-config-check { flex-direction: row !important; align-items: center; align-self: end; min-height: 28px; }
.nexus-shop-config-treasury .nexus-shop-config-check input { width: auto; height: auto; }

.nexus-shop-config-toggle-list { display: grid; gap: 5px; margin-top: 9px; }
.nexus-shop-config-toggle-list label { flex-direction: row; align-items: center; }
.nexus-shop-config-toggle-list input { width: auto; height: auto; margin: 0; }

.nexus-shop-config-list-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 7px;
    padding: 7px;
    border: 1px solid #57391f;
    background: #1c120d;
}
.nexus-shop-config-list-summary.has-missing { border-color: #935344; }
.nexus-shop-config-list-summary > div { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-config-list-summary strong { overflow: hidden; color: #dec184; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.nexus-shop-config-list-summary small { color: #9a876b; font-size: 8px; }
.nexus-shop-config-list-summary button,
.nexus-shop-config-generation-actions button,
.nexus-shop-config-footer button { width: auto; margin: 0; border: 1px solid #8d5e29; background: #2c1c10; color: #eec776; }
.nexus-shop-config-list-summary button { flex: 0 0 auto; min-height: 27px; padding: 2px 7px; font-size: 9px; }
.nexus-shop-config-generation-actions { display: grid; gap: 5px; margin-top: 9px; }
.nexus-shop-config-generation-actions button { min-height: 28px; }
.nexus-shop-config-generation-actions .is-danger { border-color: #7c3e31; color: #dca18d; background: #321914; }

.nexus-shop-config-inventory {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: rgba(17, 12, 8, 0.92);
    transition: background 120ms ease, box-shadow 120ms ease;
}
.nexus-shop-config-inventory.is-dragover {
    background: rgba(61, 40, 20, 0.98);
    box-shadow: inset 0 0 0 2px rgba(239, 187, 80, 0.7);
}
.nexus-shop-config-inventory-header {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(190px, 280px) auto;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 58px;
    padding: 8px 12px;
    border-bottom: 1px solid #54391f;
    background: #21150e;
}
.nexus-shop-config-inventory-header > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-config-stock-search { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; }
.nexus-shop-config-stock-search i { color: #cfa95e; }
.nexus-shop-config-stock-search input { width: 100%; }
.nexus-shop-config-drop-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px dashed #8a612e;
    color: #d7b66e;
    font-size: 9px;
    pointer-events: none;
}

.nexus-shop-config-stock-filters {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 6px 12px;
    border-bottom: 1px solid #54391f;
    background: #18100b;
}
.nexus-shop-config-stock-filters button {
    width: auto;
    min-height: 25px;
    margin: 0;
    padding: 2px 8px;
    border: 1px solid #5b4229;
    color: #ad9a7d;
    background: #1e1712;
    font-size: 9px;
}
.nexus-shop-config-stock-filters button span { margin-left: 3px; color: #806f58; }
.nexus-shop-config-stock-filters button.is-selected { border-color: #b78337; color: #f0cb76; background: #3b2918; }
.nexus-shop-config-stock-filters button.is-selected span { color: #d3a956; }

.nexus-shop-config-stock-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
}
.nexus-shop-config-stock-row {
    display: grid;
    grid-template-columns: 44px minmax(150px, 1fr) auto 76px 64px minmax(108px, 138px) 54px;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 54px;
    padding: 4px 6px;
    border: 1px solid #49341f;
    background: #1b130e;
}
.nexus-shop-config-stock-row[hidden] { display: none !important; }
.nexus-shop-config-stock-row > img { width: 44px; height: 44px; border: 0; object-fit: contain; }
.nexus-shop-config-stock-identity { display: flex; flex-direction: column; min-width: 0; }
.nexus-shop-config-stock-identity strong,
.nexus-shop-config-stock-identity small,
.nexus-shop-config-stock-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nexus-shop-config-stock-identity strong { color: #e7c77f; font-size: 11px; }
.nexus-shop-config-stock-identity small { color: #b09d80; font-size: 9px; }
.nexus-shop-config-stock-identity span { color: #7f7464; font-size: 8px; }
.nexus-shop-config-origin { padding: 2px 5px; border: 1px solid #5c4731; color: #aa987d; background: #241b14; font-size: 8px; text-align: center; }
.nexus-shop-config-origin.is-generated { border-color: #675b2c; color: #d4bd66; }
.nexus-shop-config-origin.is-acquired { border-color: #4e6740; color: #9bc286; }
.nexus-shop-config-effective-price { color: #e5bb54; font-size: 10px; text-align: right; }
.nexus-shop-config-quantity,
.nexus-shop-config-override { display: grid; align-items: center; gap: 3px; color: #9e8c72; font-size: 8px; }
.nexus-shop-config-quantity { grid-template-columns: auto minmax(0, 1fr); }
.nexus-shop-config-override { grid-template-columns: auto minmax(0, 1fr) auto; }
.nexus-shop-config-quantity input,
.nexus-shop-config-override input { width: 100%; height: 25px; font-size: 9px; }
.nexus-shop-config-override em { color: #a98c5b; font-size: 8px; font-style: normal; }
.nexus-shop-config-stock-actions { display: flex; gap: 3px; justify-content: flex-end; }
.nexus-shop-config-stock-actions button { width: 25px; min-width: 25px; height: 25px; margin: 0; padding: 0; border: 1px solid #72502c; color: #cfad72; background: #25170f; }
.nexus-shop-config-stock-actions .is-pinned { color: #ffcb53; }
.nexus-shop-config-empty-stock { margin: auto; padding: 24px; color: #99856b; font-size: 10px; text-align: center; }
.nexus-shop-config-empty-stock[hidden] { display: none; }

.nexus-shop-config-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 5px 10px;
    border-top: 1px solid #70481f;
    color: #a99575;
    background: #29180f;
    font-size: 9px;
}
.nexus-shop-config-footer > span:first-child { margin-right: auto; }
.nexus-shop-config-unsaved { color: #e2b957; }
.nexus-shop-config-unsaved[hidden] { display: none; }
.nexus-shop-config-unsaved i { font-size: 6px; }
.nexus-shop-config-footer button { min-width: 112px; min-height: 28px; }
.nexus-shop-config-footer button:disabled { opacity: .45; }

@media (max-width: 920px) {
    .nexus-shop-config-workspace { grid-template-columns: 275px minmax(0, 1fr); }
    .nexus-shop-config-inventory-header { grid-template-columns: 1fr minmax(150px, 220px); }
    .nexus-shop-config-drop-hint { display: none; }
    .nexus-shop-config-stock-row { grid-template-columns: 40px minmax(130px, 1fr) 68px 58px minmax(96px, 120px) 54px; }
    .nexus-shop-config-stock-row > img { width: 40px; height: 40px; }
    .nexus-shop-config-origin { display: none; }
}

/* Location creation and Shop dossiers share the established dense dossier shell. */
.location-dossier .npc-dossier-connections { position: relative; }
.location-dossier-new-button {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid rgba(225, 180, 103, .58);
    border-radius: 16px;
    color: #f6e6c8;
    background: linear-gradient(180deg, rgba(120, 76, 30, .96), rgba(69, 40, 18, .98));
    box-shadow: 0 5px 14px rgba(0, 0, 0, .35);
}
.location-dossier-new-button:hover {
    border-color: #f0c36f;
    background: linear-gradient(180deg, rgba(148, 94, 35, .98), rgba(84, 48, 19, .98));
}
.shop-dossier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(219, 173, 92, .22);
}
.shop-dossier-header h2,
.shop-dossier-header p { margin: 0; }
.shop-dossier-header p { color: rgba(241, 229, 204, .68); }
.shop-dossier-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid rgba(218, 164, 77, .45);
    border-radius: 50%;
    color: #efbd68;
    background: rgba(111, 68, 26, .45);
    font-size: 20px;
}
.shop-dossier-portrait {
    border-color: rgba(218, 164, 77, .72);
    color: #efbd68;
    background: linear-gradient(145deg, rgba(112, 69, 31, .94), rgba(61, 40, 25, .96));
    box-shadow: 0 0 16px rgba(218, 164, 77, .2);
    font-size: 28px;
}
.shop-dossier-profile-header {
    --npc-accent: #d18a42;
}
.shop-dossier-trade-footer {
    margin-top: auto;
}
.shop-dossier-trade-footer .npc-dossier-primary {
    width: 100%;
}
.shop-dossier-stock-surface {
    min-height: 0;
    flex: 1 1 auto;
    margin-top: 12px;
    padding-right: 3px;
    overflow-y: auto;
}
.shop-dossier-stock-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}
.shop-dossier-stock-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid rgba(218, 164, 77, .52);
    border-radius: 5px;
    background: rgba(16, 11, 8, .92);
    box-shadow: inset 0 0 9px rgba(0, 0, 0, .72);
}
.shop-dossier-stock-card > img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    object-fit: contain;
}
.shop-dossier-stock-price,
.shop-dossier-stock-quantity {
    position: absolute;
    z-index: 2;
    padding: 1px 3px;
    background: rgba(12, 8, 5, .92);
    font-size: 8px;
    font-weight: 800;
    line-height: 13px;
    pointer-events: none;
}
.shop-dossier-stock-price {
    right: 3px;
    bottom: 3px;
    left: 3px;
    overflow: hidden;
    border-radius: 2px;
    color: #ffd15b;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shop-dossier-stock-quantity {
    top: 3px;
    right: 3px;
    min-width: 18px;
    border-radius: 8px;
    color: #ffe5a4;
    text-align: center;
}
.shop-dossier-stock-grid:empty {
    display: none;
}
.shop-pill-emblem {
    display: grid;
    place-items: center;
    color: #efbd68;
    background: linear-gradient(145deg, #70451f, #3d2819);
}
.shop-create-dialog .window-content { padding: 0; overflow: hidden; }
.nexus-shop-creator-shell {
    --shop-charcoal: #090d0f;
    --shop-ivory: #e7dfcf;
    --shop-muted: #968e81;
    --shop-brass: var(--nexus-accent-primary, #bf913f);
    --shop-brass-bright: var(--nexus-accent-bright, #e0b75f);
    --shop-green: #86ad5b;
}
.nexus-shop-creator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 88px;
    padding: 12px 18px;
    border-bottom: 1px solid #54482f;
    background: linear-gradient(180deg, #111719, #0a0f11);
}
.nexus-shop-creator-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nexus-shop-creator-icon {
    display: grid;
    place-items: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border: 1px solid var(--shop-brass);
    border-radius: 50%;
    color: var(--shop-brass-bright);
    background: #090d0f;
    box-shadow: inset 0 0 0 3px #151b1d;
    font-size: 22px;
}
.nexus-shop-creator-title small,
.nexus-shop-creator-location span { color: #9b9387; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.nexus-shop-creator-title h2 { margin: 0; color: var(--shop-ivory); font-family: var(--font-h2, serif); font-size: 24px; }
.nexus-shop-creator-title p { margin: 2px 0 0; color: #9d978c; font-size: 11px; }
.nexus-shop-creator-location { display: flex; flex-direction: column; align-items: flex-end; padding-left: 18px; }
.nexus-shop-creator-location strong { color: var(--shop-brass-bright); font-family: var(--font-h2, serif); }
.nexus-shop-editor-type-control { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; padding-left: 18px; }
.nexus-shop-editor-type-control > span { color: #9b9387; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nexus-shop-editor-type-control > span em { margin-left: 5px; padding: 2px 5px; border: 1px solid #81602c; border-radius: 2px; color: var(--shop-brass-bright); background: rgba(129, 96, 44, .18); font-size: 8px; font-style: normal; letter-spacing: .03em; }
.nexus-shop-editor-type-control > div { display: flex; gap: 5px; }
.nexus-shop-editor-type-control select { width: 176px; height: 30px; margin: 0; border: 1px solid #755229; color: #f1dfbd; background: #181516; }
.nexus-shop-editor-type-control button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; min-width: 70px; height: 30px; margin: 0; padding: 0 10px; border: 1px solid var(--shop-brass); color: var(--shop-brass-bright); background: linear-gradient(180deg, #342718, #18130f); }
.nexus-shop-creator-body {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px;
    background: #080c0e;
}
.nexus-shop-creator-controls {
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
    padding: 14px;
    border: 1px solid #4a5050;
    background: linear-gradient(145deg, rgba(18, 28, 33, .98), rgba(9, 14, 16, .98));
}
.nexus-shop-creator-controls > label { display: flex; flex-direction: column; gap: 4px; color: var(--shop-ivory); }
.nexus-shop-creator-controls > label > span { color: #b8ad9c; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.nexus-shop-creator-controls input,
.nexus-shop-creator-controls select {
    min-height: 32px;
    border: 1px solid #5c574e;
    border-radius: 2px;
    color: var(--shop-ivory);
    background: #101719;
}
.nexus-shop-creator-controls small { color: #7f817d; font-size: 9px; line-height: 1.25; }
.nexus-shop-creator-controls .nexus-shop-creator-checkbox { flex-direction: row; align-items: center; gap: 7px; }
.nexus-shop-creator-checkbox input { width: auto; min-height: auto; }
.nexus-shop-creator-help { display: flex; gap: 8px; margin-top: auto; padding: 9px; border-left: 3px solid var(--shop-green); color: #aeb0a8; background: rgba(134, 173, 91, .07); }
.nexus-shop-creator-help i { padding-top: 2px; color: var(--shop-green); }
.nexus-shop-creator-help p { margin: 0; font-size: 10px; line-height: 1.35; }
.nexus-shop-creator-preview { padding: 10px; }
.nexus-shop-creator-preview .nexus-shop-grid { padding-bottom: 12px; }
.nexus-shop-creator-card { overflow: visible; cursor: default; }
.nexus-shop-creator-card.is-kept { border-color: var(--shop-green) !important; box-shadow: inset 0 0 10px rgba(134, 173, 91, .2), 0 0 0 1px rgba(134, 173, 91, .28) !important; }
.nexus-shop-creator-card:hover { transform: none; }
.nexus-shop-creator-card-tools {
    position: absolute;
    z-index: 4;
    right: -1px;
    bottom: 0;
    left: -1px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    height: 28px;
    border: 1px solid #725926;
    background: #111719;
}
.nexus-shop-creator-card:hover .nexus-shop-creator-card-tools,
.nexus-shop-creator-card:focus-within .nexus-shop-creator-card-tools { display: grid; }
.nexus-shop-creator-card:hover .nexus-shop-card-name,
.nexus-shop-creator-card:focus-within .nexus-shop-card-name { display: none; }
.nexus-shop-creator-card-tools button { min-width: 0; height: 26px; margin: 0; padding: 0; border: 0; border-right: 1px solid #454641; border-radius: 0; color: var(--shop-brass-bright); background: transparent; font-size: 9px; }
.nexus-shop-creator-card-tools button:last-child { border-right: 0; color: #db8585; }
.nexus-shop-creator-card-tools button:hover { background: #252a2b; }
.nexus-shop-creator-preview-actions { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 8px 4px 0; border-top: 1px solid #454641; }
.nexus-shop-creator-preview-actions button { width: auto; margin: 0; border: 1px solid var(--shop-brass); color: var(--shop-brass-bright); background: #141719; }
.nexus-shop-creator-preview-actions small { color: #777b78; font-size: 9px; }
.nexus-shop-creator-blank { display: grid; place-items: center; align-content: center; flex: 1 1 auto; min-height: 0; color: #737774; }
.nexus-shop-creator-blank i { margin-bottom: 10px; color: var(--shop-brass); font-size: 42px; }
.nexus-shop-creator-blank strong { color: var(--shop-ivory); font-family: var(--font-h2, serif); font-size: 19px; }
.nexus-shop-creator-blank p { margin: 3px; font-size: 10px; }
.nexus-shop-creator-footer { display: flex; justify-content: flex-end; gap: 8px; flex: 0 0 auto; min-height: 58px; padding: 10px 14px; border-top: 1px solid #5c4b2c; background: #0b1012; }
.nexus-shop-creator-footer button { width: auto; min-width: 120px; margin: 0; border: 1px solid var(--shop-brass); color: var(--shop-brass-bright); background: #141719; }
.nexus-shop-creator-footer button.bright { min-width: 160px; border-color: #789e52; color: #e8efd9; background: linear-gradient(180deg, #35552d, #223b20); font-family: var(--font-h2, serif); font-size: 15px; }
@media (max-width: 760px) {
    .nexus-shop-creator-body { grid-template-columns: 1fr; overflow-y: auto; }
    .nexus-shop-creator-controls { min-height: 330px; }
    .nexus-shop-creator-preview { min-height: 440px; }
}

/* Unified Shop Editor */
.nexus-shop-editor-window .window-content { padding: 0; overflow: hidden; }
.nexus-shop-editor-shell {
    --shop-charcoal: #090d0f;
    --shop-ivory: #e7dfcf;
    --shop-muted: #968e81;
    --shop-brass: var(--nexus-accent-primary, #bf913f);
    --shop-brass-bright: var(--nexus-accent-bright, #e0b75f);
    --shop-green: #86ad5b;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    color: var(--shop-ivory);
    background: #080c0e;
    font-size: 10px;
}
.nexus-shop-editor-tabs { display: grid; grid-template-columns: repeat(2, 1fr); flex: 0 0 auto; border-bottom: 1px solid #594727; background: #0d1315; }
.nexus-shop-editor-tabs button { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-items: center; min-height: 54px; margin: 0; padding: 7px 16px; border: 0; border-right: 1px solid #303839; border-radius: 0; color: #a7a39b; background: transparent; text-align: left; }
.nexus-shop-editor-tabs button i { grid-row: 1 / span 2; color: #807761; font-size: 16px; }
.nexus-shop-editor-tabs button span { color: #d2c7b4; font-family: var(--font-h2, serif); font-size: 15px; }
.nexus-shop-editor-tabs button small { color: #777d7b; font-size: 9px; }
.nexus-shop-editor-tabs button.active { box-shadow: inset 0 -3px var(--shop-brass); background: linear-gradient(180deg, color-mix(in srgb, var(--shop-brass) 12%, transparent), transparent); }
.nexus-shop-editor-tabs button.active i, .nexus-shop-editor-tabs button.active span { color: var(--shop-brass-bright); }
.nexus-shop-editor-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.nexus-shop-editor-current-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px; border: 1px solid #4a5050; background: linear-gradient(145deg, rgba(14, 20, 22, .98), rgba(8, 12, 14, .98)); }
.nexus-shop-editor-current-panel > header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 285px); align-items: center; gap: 10px; flex: 0 0 auto; padding: 2px 3px 8px; border-bottom: 1px solid #454641; }
.nexus-shop-editor-current-panel > header h3 { margin: 0; color: var(--shop-brass-bright); }
.nexus-shop-editor-current-panel > header small { color: #888c88; }
.nexus-shop-editor-current-panel.is-dragover { box-shadow: inset 0 0 0 2px var(--shop-green); }
.nexus-shop-editor-current-panel .nexus-shop-config-stock-filters { padding: 6px 2px; background: transparent; }
.nexus-shop-editor-drop-hint { flex: 0 0 auto; justify-content: center; min-height: 27px; margin: 0 2px 5px; }
.nexus-shop-editor-stock-grid { grid-template-columns: repeat(auto-fill, 92px) !important; grid-auto-rows: 100px !important; justify-content: start; align-content: start; gap: 7px !important; flex: 1 1 auto; min-height: 0; padding: 8px 2px !important; overflow-y: auto; }
.nexus-shop-editor-stock-grid .nexus-shop-creator-blank { grid-column: 1 / -1; width: 100%; min-height: 300px; }
.nexus-shop-editor-card-tools { grid-template-columns: repeat(5, 1fr); }
.nexus-shop-editor-pool-tab { display: flex; flex: 1 1 auto; flex-direction: column; width: 100%; min-height: 0; overflow: hidden; background: #140e0b; }
.nexus-shop-editor-pool-workspace { flex: 1 1 auto; width: 100%; min-height: 0; }
.nexus-shop-editor-pool-workspace.nexus-stock-list-workspace { grid-template-columns: 252px minmax(330px, .8fr) minmax(480px, 1.2fr); }
.nexus-shop-editor-pool-items article { grid-template-columns: 38px minmax(120px, 1fr) minmax(250px, auto) 26px !important; }
.nexus-shop-editor-entry-controls { display: flex; align-items: center; gap: 5px; }
.nexus-shop-editor-entry-controls label { display: inline-flex; align-items: center; gap: 3px; color: #aaa69e; white-space: nowrap; }
.nexus-shop-editor-entry-controls input[type="number"] { width: 43px; height: 22px; padding: 1px 3px; font-size: 9px; }
.nexus-shop-editor-entry-controls input[name="poolPriceGp"] { width: 54px; }
.nexus-shop-editor-pool-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; flex: 0 0 auto; width: 100%; min-height: 38px; padding: 4px 10px; border-top: 1px solid #70481f; color: #b6a17f; background: #29180f; }
.nexus-shop-editor-pool-footer > div { display: flex; align-items: center; gap: 8px; }
.nexus-shop-editor-pool-footer > strong { color: #d5ad5e; }
.nexus-shop-editor-pool-footer nav { display: flex; gap: 6px; }
.nexus-shop-editor-pool-footer button { width: auto; margin: 0; }
.nexus-shop-editor-store-workbench { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 10px; flex: 1 1 auto; width: 100%; min-height: 0; padding: 10px; overflow: hidden; background: radial-gradient(circle at 30% 0, rgba(104, 72, 31, .1), transparent 42%), #080c0e; }
.nexus-shop-editor-settings-rail { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }
.nexus-shop-editor-settings-card { padding: 13px; border: 1px solid #4a5050; background: linear-gradient(145deg, rgba(18, 28, 33, .98), rgba(9, 14, 16, .98)); box-shadow: inset 0 0 18px rgba(0, 0, 0, .22); }
.nexus-shop-editor-settings-card > header { display: flex; align-items: center; gap: 9px; margin: -2px -2px 11px; padding-bottom: 8px; border-bottom: 1px solid #454641; }
.nexus-shop-editor-settings-card > header > i { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #6a5632; border-radius: 50%; color: var(--shop-brass-bright); background: #0b1012; }
.nexus-shop-editor-settings-card h2 { margin: 0; color: var(--shop-brass-bright); font-family: var(--font-h2, serif); font-size: 18px; }
.nexus-shop-editor-settings-card header small { color: #858985; font-size: 9px; }
.nexus-shop-editor-settings-card label { display: flex; flex-direction: column; gap: 3px; color: #bba78a; font-size: 10px; }
.nexus-shop-editor-settings-card input, .nexus-shop-editor-settings-card select { min-width: 0; height: 29px; border: 1px solid #76502a; color: #ecdab9; background: #101719; }
.nexus-shop-editor-settings-card input[type="checkbox"] { width: auto; height: auto; }
.nexus-shop-editor-settings-card p { margin: 10px 0 0; padding: 8px; border-left: 3px solid var(--shop-green); color: #929a92; background: rgba(134, 173, 91, .06); font-size: 9px; }
.nexus-shop-editor-commerce-card .nexus-shop-config-percentages, .nexus-shop-editor-commerce-card .nexus-shop-config-treasury { grid-template-columns: 1fr 1fr; }
.nexus-shop-editor-commerce-card .nexus-shop-config-toggle-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding-top: 9px; border-top: 1px solid #343b3c; }
.nexus-shop-editor-commerce-card .nexus-shop-config-toggle-list label { flex-direction: row; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.nexus-shop-editor-restock-actions { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.nexus-shop-editor-restock-actions button { min-height: 30px; margin: 0; }
.nexus-shop-editor-restock-actions .is-danger { border-color: #7c3e31; color: #dca18d; background: #321914; }
.nexus-shop-editor-footer { align-items: center; }
.nexus-shop-editor-footer > span { margin-right: auto; color: var(--shop-brass-bright); }
@media (max-width: 960px) {
    .nexus-shop-editor-store-workbench { grid-template-columns: 285px minmax(0, 1fr); }
    .nexus-shop-editor-pool-items article { grid-template-columns: 38px minmax(120px, 1fr) 26px !important; }
    .nexus-shop-editor-entry-controls { grid-column: 2; flex-wrap: wrap; }
}

.nexus-shop-creator-icon-button {
    position: relative;
    min-width: 54px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}
.nexus-shop-creator-icon-button > img {
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
}
.nexus-shop-creator-icon-button > span {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #14100b;
    background: var(--shop-brass-bright);
    font-size: 9px;
}
.shop-pill-emblem img,
.shop-dossier-portrait img {
    object-fit: contain;
}
.nexus-browser-pill-shell .shop-pill-emblem {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.nexus-browser-pill-shell .shop-pill-emblem img {
    width: 34px;
    height: 34px;
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}
:where(.augur-nexus, .augur-nexus-tool) .shop-icon-picker .npc-portrait-visual img {
    padding: 5px;
    object-fit: contain;
}
.nexus-shop-screen-shell .nexus-shop-screen-summary:has(.nexus-shop-trade-identity) {
    flex-direction: row;
    align-items: center;
    gap: 9px;
}
.nexus-shop-screen-shell .nexus-shop-screen-summary > div {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}
.nexus-shop-trade-identity {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
}

