#inventory-view {
    /* REMOVED height: 100%; */
    display: flex;
    flex-direction: column;
    /* Let #view-container handle height/scrolling */
}


#data-inventory-container {
    flex-grow: 1; /* Allow container to take space */
    /* REMOVED overflow-y: auto */
    padding: var(--spacing-m);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    min-height: 0; /* Allow shrinking */
}


.inventory-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}


.inventory-group-header {
    background-color: rgba(48, 48, 54, 0.8);
    color: var(--accent-active);
    font-weight: 700;
    padding: var(--spacing-s) var(--spacing-l);

    border-top: var(--border-width) solid var(--border-color);
    border-bottom: var(--border-width-thick) solid var(--accent-active);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.9em;
    box-shadow: var(--shadow-s);
    position: sticky;
    top: -1px; /* Adjust based on #view-container padding */
    z-index: 2;
}

#data-inventory-container > .inventory-group:first-of-type .inventory-group-header {
    border-top: none;
}



.inventory-card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-m);
}


.inventory-card {
    background-color: var(--glass-tint);

    border: var(--border-width) solid var(--glass-border);
    border-radius: var(--radius-m);
    padding: var(--spacing-m);
    display: flex;
    align-items: center;
    gap: var(--spacing-m);
    box-shadow: var(--shadow-s);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);

    flex-grow: 1;
    flex-basis: 180px;
    min-width: 150px;
}


.inventory-card:hover {
    border-color: var(--accent-interactive);
    box-shadow: var(--shadow-m), 0 0 5px var(--highlight-interactive);
}





.item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 28px;
    border-radius: 3px;
    position: relative;
    background-color: var(--item-color, var(--text-secondary));
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    overflow: hidden;
}

.item-icon::before,
.item-icon::after {
    content: '';
    position: absolute;
    background-color: rgba(255, 255, 255, 0.6);
    height: 3px;
    border-radius: 1px;
    left: 15%;
    width: 70%;
}

.item-icon::before {
    top: 6px;
}

.item-icon::after {
    bottom: 6px;

    box-shadow: 0 -5px 0 0 rgba(255, 255, 255, 0.4);
}


.item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}


.item-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}


.item-amount {
    font-family: var(--font-mono);
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    line-height: 1.1;
}


@media (max-width: 768px) {
    .inventory-card {
        flex-basis: 160px;
        padding: var(--spacing-s);
        gap: var(--spacing-s);
    }
     .item-icon { width: 20px; height: 24px; }
     .item-icon::before, .item-icon::after { height: 2px; left: 20%; width: 60%; }
     .item-icon::before { top: 5px; }
     .item-icon::after { bottom: 5px; box-shadow: 0 -4px 0 0 rgba(255, 255, 255, 0.4); }
     .item-name { font-size: 0.9em; }
     .item-amount { font-size: 1.0em; }
}


@media (max-width: 480px) {
    #data-inventory-container {
        padding: var(--spacing-s);
        gap: var(--spacing-l);
    }
    .inventory-group-header { font-size: 0.8em; }
    .inventory-card-grid {
        gap: var(--spacing-s);
    }
    .inventory-card {
        flex-basis: calc(50% - var(--spacing-s) / 2);
        flex-grow: 0;
        padding: var(--spacing-s);
        gap: var(--spacing-xs);
    }
    .item-icon { width: 18px; height: 22px; }
    .item-icon::before, .item-icon::after { height: 2px; left: 20%; width: 60%; }
     .item-icon::before { top: 4px; }
     .item-icon::after { bottom: 4px; box-shadow: 0 -3px 0 0 rgba(255, 255, 255, 0.4); }
    .item-name { font-size: 0.85em; }
    .item-amount { font-size: 0.95em; }
}
