/* Smartphones: four cards per row. */
.wrap{
    padding:12px 8px 16px;
}

.top-bar{
    position:static;
    flex-direction:column;
    gap:10px;
    padding:10px 0;
}

.top-bar h1{
    font-size:24px;
}

.top-buttons{
    flex-wrap:wrap;
    justify-content:center;
    gap:6px;
}

.top-save button,
.buylist-btn{
    padding:8px 12px;
    font-size:12px;
}

.section{
    scroll-margin-top:12px;
}

.section-title{
    padding:8px;
    font-size:16px;
}

.rarity-buttons{
    width:100%;
}

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

.card{
    padding:3px;
    border-radius:6px;
}

.name,
.price-row{
    font-size:10px;
}

.price-row{
    flex-wrap:wrap;
    gap:2px;
}

.buylist-area{
    flex-wrap:wrap;
    gap:2px;
}

.buylist-area input{
    width:14px;
    height:14px;
    margin:2px 0;
}

.form-box input{
    min-width:0;
    padding:4px 1px;
    font-size:10px;
}

/* Shared layout prerequisites from DM, scoped to mobile by the link media. */
.section-title{
    flex-wrap:wrap;
    gap:8px;
}
.rarity-buttons{
    flex-wrap:wrap;
    min-width:0;
}
.grid{
    width:100%;
}
.card{
    min-width:0;
    overflow-wrap:anywhere;
}
.top-bar,
.top-bar h1{
    max-width:100%;
    overflow-wrap:anywhere;
}
/* Four-column cards also need compact stock controls. */
.stock-control{
    grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr);
}
.stock-minus,
.stock-plus{
    width:100%;
    min-width:0;
    max-width:36px;
}
.stock-control .stock-input{
    width:100%;
    min-width:0;
}
